> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edgeimpulse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Capsule

> A labeled image dataset of pharmaceutical capsules for training visual anomaly detection models to identify defects.

**Task:** Visual Anomaly Detection

**License:** [BSD 3-Clause Clear](https://spdx.org/licenses/BSD-3-Clause-Clear.html)

> [card] [Open dataset in Edge Impulse Studio](https://studio.edgeimpulse.com/public/497433/latest)
>
> Clone this ready-to-use dataset into your Edge Impulse account and start experimenting immediately.

![Public dataset preview for capsule images labeled anomaly and no anomaly](https://mintcdn.com/edgeimpulse/VpF_Einsy6qHCvhZ/.assets/images/dataset-screenshot/497433.png?fit=max\&auto=format\&n=VpF_Einsy6qHCvhZ\&q=85\&s=ac69725aa536d6f5794e4b4946b9bf4e)

Dataset Screenshot

## Description

This dataset has been collected by Edge Impulse teams and contains a single red-white capsule, centered in the frame, with a similar size and a uniform background.

The training dataset only contains "nominal" (no anomaly) images whereas the testing dataset contains both nominal and anomalous images.

### Compatible Blocks

* **Feature extraction**: [Image](https://docs.edgeimpulse.com/studio/projects/processing-blocks/blocks/image.md)
* **Learning block**: [Visual Anomaly Detection (FOMO-AD)](https://docs.edgeimpulse.com/studio/projects/learning-blocks/blocks/visual-anomaly-detection-fomo-ad.md)

*Not sure what to choose? Try out this dataset with the [EON Tuner](https://docs.edgeimpulse.com/studio/projects/eon-tuner.md).*

### Dataset Details

* **Total Data Items:** 149

* **Labeling Method:** single label

* **Train/Test Split:** 64.43% / 35.57%

| | **Training Set** | **Testing Set** |
| - | - | - |
| **Total Data Items** | 96 | 53 |
| **Labels** | no anomaly | anomaly, no anomaly |

## Usage

The dataset can be added to a project in two ways: cloning the dataset public project or downloading the dataset and importing it into another project.

* **Clone the [public project](https://studio.edgeimpulse.com/public/497433/latest)**

  To clone and use this project, visit the [Edge Impulse Studio link](https://studio.edgeimpulse.com/public/497433/latest), click on the **Clone** button on the top-right corner and follow the cloning instructions.

* **Download and import**

  * [Download link](https://cdn.edgeimpulse.com/datasets/Visual+Anomaly+Detection+-+Capsule.zip)

  This dataset uses the Edge Impulse Exporter Format (`info.labels`). See [Edge Impulse labels](https://docs.edgeimpulse.com/tools/specifications/data-annotation/ei-labels.md) for more info.

  Edge Impulse also supports different [data acquisition formats](https://docs.edgeimpulse.com/tools/specifications/data-acquisition/json-cbor.md) and [dataset annotation formats](https://docs.edgeimpulse.com/tools/specifications/data-annotation/ei-labels.md) that you can import into your project to build your edge AI models:

  * [Studio uploader](https://docs.edgeimpulse.com/studio/projects/data-acquisition/dataset/uploader.md)
  * [CLI uploader](https://docs.edgeimpulse.com/tools/clis/edge-impulse-cli/uploader.md)
  * [CSV Wizard](https://docs.edgeimpulse.com/studio/projects/data-acquisition/csv-wizard.md)
  * [Python SDK](https://docs.edgeimpulse.com/tutorials/tools/sdks/studio/python/upload-download-data.md)
  * [Ingestion API](https://docs.edgeimpulse.com/apis/ingestion.md)
  * [Import from S3 buckets](https://docs.edgeimpulse.com/studio/projects/data-acquisition/data-sources.md)
  * [Upload portals](https://docs.edgeimpulse.com/studio/organizations/upload-portals.md)

## Citation

If you use this dataset in your research paper, please cite it using the following BibTeX:

```
@misc{edgeimpulse_dataset_497433,
    title = {Visual Anomaly Detection - Capsule},
    author = {Edge Impulse},
    year = {2024},
    url = {https://studio.edgeimpulse.com/public/497433/latest},
    note = {BSD 3-Clause Clear}
}
```
