ultralytics 8.3.55 New Medical-pills dataset (#18389)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Muhammad Rizwan Munawar 2024-12-26 18:24:53 +05:00 committed by GitHub
parent edf8ba0f17
commit cf9ab17426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 157 additions and 1 deletions

View file

@ -89,6 +89,7 @@ Here is a list of the supported datasets and a brief description for each:
- [Brain-tumor](brain-tumor.md): A dataset for detecting brain tumors includes MRI or CT scan images with details on tumor presence, location, and characteristics.
- [African-wildlife](african-wildlife.md): A dataset featuring images of African wildlife, including buffalo, elephant, rhino, and zebras.
- [Signature](signature.md): A dataset featuring images of various documents with annotated signatures, supporting document verification and fraud detection research.
- [Medical-pills](medical-pills.md): A dataset featuring images of medical-pills, annotated for applications such as pharmaceutical quality assurance, pill sorting, and regulatory compliance.
### Adding your own dataset

View file

@ -0,0 +1,132 @@
---
comments: true
description: Explore the medical-pills detection dataset with labeled images. Essential for training AI models for pharmaceutical identification and automation.
keywords: medical-pills dataset, pill detection, pharmaceutical imaging, AI in healthcare, computer vision, object detection, medical automation, dataset for training
---
# Medical Pills Dataset
The medical-pills detection dataset is a proof-of-concept (POC) dataset, carefully curated to demonstrate the potential of AI in pharmaceutical applications. It contains labeled images specifically designed to train [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) [models](https://docs.ultralytics.com/models/) for identifying medical-pills. This dataset serves as a foundational resource for automating essential [tasks](https://docs.ultralytics.com/tasks/) such as quality control, packaging automation, and efficient sorting in pharmaceutical workflows. By integrating this dataset into projects, researchers and developers can explore innovative [solutions](https://docs.ultralytics.com/solutions/) that enhance [accuracy](https://www.ultralytics.com/glossary/accuracy), streamline operations, and ultimately contribute to improved healthcare outcomes.
## Dataset Structure
The medical-pills dataset is divided into two subsets:
- **Training set**: Consisting of 92 images, each annotated with the class `pill`.
- **Validation set**: Comprising 23 images with corresponding annotations.
## Applications
Using computer vision for medical-pills detection enables automation in the pharmaceutical industry, supporting tasks like:
- **Pharmaceutical Sorting**: Automating the sorting of pills based on size, shape, or color to enhance production efficiency.
- **AI Research and Development**: Serving as a benchmark for developing and testing computer vision algorithms in pharmaceutical use cases.
- **Digital Inventory Systems**: Powering smart inventory solutions by integrating automated pill recognition for real-time stock monitoring and replenishment planning.
## Dataset YAML
A YAML configuration file is provided to define the dataset's structure, including paths and classes. For the medical-pills dataset, the `medical-pills.yaml` file can be accessed at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/medical-pills.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/medical-pills.yaml).
!!! example "ultralytics/cfg/datasets/medical-pills.yaml"
```yaml
--8<-- "ultralytics/cfg/datasets/medical-pills.yaml"
```
## Usage
To train a YOLO11n model on the medical-pills dataset for 100 [epochs](https://www.ultralytics.com/glossary/epoch) with an image size of 640, use the following examples. For detailed arguments, refer to the model's [Training](../../modes/train.md) page.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="medical-pills.yaml", epochs=100, imgsz=640)
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model
yolo detect train data=medical-pills.yaml model=yolo11n.pt epochs=100 imgsz=640
```
!!! example "Inference Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("path/to/best.pt") # load a fine-tuned model
# Inference using the model
results = model.predict("https://ultralytics.com/assets/medical-pills-sample.jpg")
```
=== "CLI"
```bash
# Start prediction with a fine-tuned *.pt model
yolo detect predict model='path/to/best.pt' imgsz=640 source="https://ultralytics.com/assets/medical-pills-sample.jpg"
```
## Sample Images and Annotations
The medical-pills dataset features labeled images showcasing the diversity of pills. Below is an example of a labeled image from the dataset:
![Medical-pills dataset sample image](https://github.com/ultralytics/docs/releases/download/0/medical-pills-dataset-sample-image.avif)
- **Mosaiced Image**: Displayed is a training batch comprising mosaiced dataset images. Mosaicing enhances training diversity by consolidating multiple images into one, improving model generalization.
## Citations and Acknowledgments
The dataset is available under the [AGPL-3.0 License](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
If you use the Medical-pills dataset in your research or development work, please cite it using the mentioned details:
!!! quote ""
=== "BibTeX"
```bibtex
@dataset{Jocher_Ultralytics_Datasets_2024,
author = {Jocher, Glenn and Rizwan, Muhammad},
license = {AGPL-3.0},
month = {Dec},
title = {Ultralytics Datasets: Medical-pills Detection Dataset},
url = {https://docs.ultralytics.com/datasets/detect/medical-pills/},
version = {1.0.0},
year = {2024}
}
```
## FAQ
### What is the structure of the medical-pills dataset?
The dataset includes 92 images for training and 23 images for validation. Each image is annotated with the class `pill`, enabling effective training and evaluation of models.
### How can I train a YOLO11 model on the medical-pills dataset?
You can train a YOLO11 model for 100 epochs with an image size of 640px using the Python or CLI methods provided. Refer to the [Training Example](#usage) section for detailed instructions.
### What are the benefits of using the medical-pills dataset in AI projects?
The dataset enables automation in pill detection, contributing to counterfeit prevention, quality assurance, and pharmaceutical process optimization.
### How do I perform inference on the medical-pills dataset?
Inference can be done using Python or CLI methods with a fine-tuned YOLO11 model. Refer to the [Inference Example](#usage) section for code snippets.
### Where can I find the YAML configuration file for the medical-pills dataset?
The YAML file is available at [medical-pills.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/medical-pills.yaml), containing dataset paths, classes, and additional configuration details.

View file

@ -54,6 +54,7 @@ Create [embeddings](https://www.ultralytics.com/glossary/embeddings) for your da
- [Brain-tumor](detect/brain-tumor.md): A dataset for detecting brain tumors includes MRI or CT scan images with details on tumor presence, location, and characteristics.
- [African-wildlife](detect/african-wildlife.md): A dataset featuring images of African wildlife, including buffalo, elephant, rhino, and zebras.
- [Signature](detect/signature.md): A dataset featuring images of various documents with annotated signatures, supporting document verification and fraud detection research.
- [Medical-pills](detect/medical-pills.md): A dataset containing labeled images of medical-pills, designed to aid in tasks like pharmaceutical quality control, sorting, and ensuring compliance with industry standards.
## [Instance Segmentation](segment/index.md)

View file

@ -280,6 +280,7 @@ nav:
- Brain-tumor: datasets/detect/brain-tumor.md
- African-wildlife: datasets/detect/african-wildlife.md
- Signature: datasets/detect/signature.md
- Medical-pills: datasets/detect/medical-pills.md
- Segmentation:
- datasets/segment/index.md
- COCO: datasets/segment/coco.md

View file

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.3.54"
__version__ = "8.3.55"
import os

View file

@ -0,0 +1,21 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
# Medical-pills dataset by Ultralytics
# Documentation: https://docs.ultralytics.com/datasets/detect/medical-pills/
# Example usage: yolo train data=medical-pills.yaml
# parent
# ├── ultralytics
# └── datasets
# └── medical-pills ← downloads here (8.19 MB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ../datasets/medical-pills # dataset root dir
train: train/images # train images (relative to 'path') 92 images
val: valid/images # val images (relative to 'path') 23 images
test: # test images (relative to 'path')
# Classes
names:
0: pill
# Download script/URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/medical-pills.zip