| --- |
| license: mit |
| language: |
| - en |
| base_model: |
| - Ultralytics/YOLO11 |
| pipeline_tag: object-detection |
| --- |
| |
| # YOLO11 Pill Detection Model |
|
|
| ## Model Description |
|
|
| This model is a custom-trained **YOLO11 object detection model** developed for detecting **full pills** in images. |
| It was trained using a labeled dataset prepared in **Roboflow** and exported in **YOLO format**. |
|
|
| The model identifies pills by predicting: |
|
|
| * Bounding boxes |
| * Confidence scores |
| * Object class labels |
|
|
| Currently, the model supports **three detection classes**: |
|
|
| * `pill` |
| * `capsule` |
| * `tablet` |
|
|
| This project is designed for pharmaceutical object detection research and computer vision experimentation. |
|
|
| --- |
|
|
| ## Model Details |
|
|
| ### Model Type |
|
|
| * **Architecture:** YOLO11 |
| * **Task:** Object Detection |
| * **Framework:** Ultralytics YOLO |
|
|
| ### Classes |
|
|
| ```yaml id="5m4e5l" |
| names: |
| 0: pill |
| 1: capsule |
| 2: tablet |
| ``` |
|
|
| --- |
|
|
| ## Intended Uses |
|
|
| ### Primary Use Cases |
|
|
| This model is intended for: |
|
|
| * Pill detection in images |
| * Pharmaceutical automation experiments |
| * Computer vision prototyping |
| * Medication localization in images/video |
|
|
| ### Out-of-Scope Use |
|
|
| This model is **not intended for**: |
|
|
| * Medical diagnosis |
| * Drug verification in clinical workflows |
| * Safety-critical pharmaceutical decisions |
|
|
| Predictions may be inaccurate under challenging imaging conditions. |
|
|
| --- |
|
|
| ## Training Data |
|
|
| The model was trained on a **custom Roboflow dataset** containing images of [**Labeled_full_pill Computer Vision Model**](https://universe.roboflow.com/cocotoyolo-rg00w/labeled_full_pill/model/2) annotated with bounding boxes. |
|
|
| ### Dataset Characteristics |
|
|
| * Annotated in Roboflow |
| * Exported in YOLO8 format |
| * Single object class: `pill` |
|
|
| ### Dataset Split |
|
|
| Example: |
|
|
| * **Train:** 70% |
| * **Validation:** 20% |
| * **Test:** 10% |
|
|
| --- |
|
|
| ## Training Procedure |
|
|
| The model was trained using **Ultralytics YOLO11** with pretrained weights. |
|
|
| ### Training Hyperparameters |
|
|
| ```yaml id="swf4hk" |
| model: yolo11x.pt |
| epochs: 100 |
| imgsz: 640 |
| batch: 16 |
| optimizer: auto |
| device: 6 |
| ``` |
|
|
| ### Training Command |
|
|
| ```bash id="x0n8cd" |
| yolo train device=3 \ |
| model=ul://ultralytics/yolo11/yolo11x \ |
| data=ul://wijai-thongsom/datasets/labeled-full-pillv2iyolov8 \ |
| roject=wijai-thongsom/jolly-husky \ |
| name=yolo11x |
| epochs=100 \ |
| imgsz=640 \ |
| batch=-1 |
| ``` |
|
|
| --- |
|
|
| ## Evaluation Results |
|
|
| Model performance was evaluated on the validation set using standard object detection metrics. |
|
|
| ### Metrics |
|
|
| | Metric | Value | |
| | --------- | ----: | |
| | Precision | 0.953978 | |
| | Recall | 0.932336 | |
| | mAP50 | 0.965024 | |
| | mAP50-95 | 0.728589 | |
|
|
| > Replace these values with the actual metrics from your training results. |
|
|
| --- |
|
|
| ## Inference |
|
|
| ### CLI Example |
|
|
| ```bash id="7yqz1e" |
| yolo detect predict \ |
| model=yolo11x.pt \ |
| source=image.jpg |
| ``` |
|
|
| ### Python Example |
|
|
| ```python id="x61czj" |
| from ultralytics import YOLO |
| |
| model = YOLO("yolo11x.pt") |
| results = model("image.jpg") |
| |
| for result in results: |
| print(result.boxes) |
| ``` |
|
|
| --- |
|
|
| ## Limitations |
|
|
| The model performance may degrade in cases such as: |
|
|
| * Poor lighting |
| * Motion blur |
| * Partial occlusion |
| * Overlapping pills |
| * Pill appearances not represented in the training dataset |
|
|
| Performance is dependent on image quality and dataset diversity. |
|
|
| --- |
|
|
| ## Bias and Risks |
|
|
| Because this model was trained on a custom dataset, its predictions may be biased toward: |
|
|
| * Specific pill colors |
| * Particular lighting conditions |
| * Limited pill shapes and sizes |
| * Background styles present in training data |
|
|
| Use caution when applying the model to images outside the training distribution. |
|
|
| --- |
|
|
| ## Environmental Impact |
|
|
| Training object detection models requires computational resources that consume energy. |
|
|
| Training setup example: |
|
|
| * **Hardware:** GPU |
| * **Framework:** Ultralytics YOLO11 |
| * **Epochs:** 100 |
|
|
| For reproducibility, document: |
|
|
| * GPU type |
| * Training duration |
| * Energy consumption estimate |
|
|
| --- |
|
|
| ## Model Files |
|
|
| Typical files included in this repository: |
|
|
| ```bash id="5nucyy" |
| . |
| βββ README.md |
| βββ yolo11n.onnx |
| βββ yolo11m.onnx |
| βββ yolo11x.onnx |
| βββ data.yaml |
| βββ results.png |
| ``` |
|
|
| --- |
|
|
| ## Citation |
|
|
| If you use this model, please cite: |
|
|
| ```bibtex id="54bb7l" |
| @misc{yolo11-pill-detection, |
| title={YOLO11 Pill Detection Model}, |
| author={Wijai Thongsom}, |
| year={2026}, |
| publisher={Hugging Face} |
| } |
| ``` |
|
|
| --- |
|
|
| ## License |
|
|
| This model is released under the **MIT License**. |
|
|
| --- |
|
|
| ## Acknowledgments |
|
|
| * **Ultralytics** for YOLO11 |
| * **Roboflow** for dataset annotation/export |
| * **Hugging Face Hub** for model hosting |