--- license: agpl-3.0 datasets: - iloncka/mosquito-species-detection-dataset metrics: - mean_iou base_model: - Ultralytics/YOLO11 --- # Model Card for iloncka/culico-net-det-v1 This model is a fine-tuned version of YOLOv11n, an object detection algorithm, specifically adapted for the detection of four different mosquito species. ## Model Details ### Model Description `culico-net-det-v1` is a deep learning model for object detection, which has been fine-tuned to identify and classify four species of mosquitoes: *Aedes aegypti*, *Aedes albopictus*, *Culiseta*, and *Aedes japonicus/koreicus*. The model is based on the YOLOv11n architecture, known for its efficiency and real-time object detection capabilities. - **Developed by:** iloncka - **Shared by:** iloncka - **Model type:** Object Detection - **License:** agpl-3.0 - **Finetuned from model:** `yolo11n.pt` ### Model Sources - **Repository:** https://huggingface.co/iloncka/culico-net-det-v1 - **W&B Training Run:** https://wandb.ai/mosquitoscan/experiments-set-1-detection/runs/a5fq691z ## Uses ### Direct Use This model is intended for direct use in detecting and classifying the four specified mosquito species from images. It can be a valuable tool for researchers, public health officials, and citizen scientists involved in mosquito surveillance and control, enabling rapid identification in the field. ### Downstream Use The model can be further fine-tuned on more specific datasets of mosquito species or integrated into larger applications for automated mosquito monitoring systems, such as smart traps. ### Out-of-Scope Use This model is specifically trained on four mosquito classes and is not intended for the detection of other insects or for use in any medical diagnostic applications. The performance of the model on images that differ significantly from the training data (e.g., in terms of lighting conditions, backgrounds, or mosquito life stages) is not guaranteed. ## Bias, Risks, and Limitations The dataset used for fine-tuning contains images of four specific mosquito species/groups. Therefore, the model's performance is optimized for these classes and it will not detect or classify other species. Model accuracy can be affected by image quality, including lighting, resolution, background clutter, and the orientation of the mosquito. ### Recommendations Users should validate the model's performance on their own data before deployment in critical applications. For definitive species identification, especially for public health purposes, the model's predictions should be verified by a human expert (entomologist). ## How to Get Started with the Model To get started with this model, you can use the Ultralytics Python package. ```python # Install necessary packages !pip install -q ultralytics from ultralytics import YOLO # Load the model from the Hugging Face Hub model = YOLO('hub:iloncka/culico-net-det-v1') # Perform inference on an image image_path = 'path/to/your/mosquito_image.jpg' results = model.predict(image_path) # Display the results results[0].show() ``` ## Training Details ### Training Data The model was fine-tuned on version 2 of the `mosquito-detection-esjag` dataset, sourced from Roboflow. The dataset is licensed under `CC BY 4.0`. - **Dataset:** `mosquitoscan/mosquito-detection-esjag` - **Dataset URL:** https://universe.roboflow.com/mosquitoscan/mosquito-detection-esjag/dataset/2 - **Classes:** `aegypti`, `albopictus`, `culiseta`, `japonicus-koreicus` ### Training Procedure The model was trained for 100 epochs with an early stopping patience of 10 epochs. The training stopped after 55 epochs as no improvement was observed. The run was logged using W&B. #### Preprocessing The following `albumentations` were used for data augmentation during training: * Blur (p=0.01) * MedianBlur (p=0.01) * ToGray (p=0.01) * CLAHE (p=0.01) #### Training Hyperparameters - **Training regime:** Automatic Mixed Precision (AMP) - **Epochs:** 100 (stopped at 55 due to early stopping) - **Patience:** 10 - **Batch Size:** 16 - **Image Size:** 640 - **Optimizer:** AdamW - **Learning Rate:** 0.00125 - **Momentum:** 0.9 - **Mosaic Augmentation:** 0 (disabled) #### Speeds, Sizes, Times - **Training Time:** 55 epochs completed in 1.122 hours. - **Model Size:** 5.4 MB (stripped) ## Evaluation The model was validated on the validation split of the Roboflow dataset. The final results are from the best performing checkpoint at epoch 45. ### Testing Data, Factors & Metrics #### Testing Data The evaluation was performed on the validation set of the `mosquito-detection-esjag` dataset, which contains 315 images with 315 instances. #### Metrics The following standard object detection metrics were used during validation: - **Precision:** The accuracy of positive predictions. - **Recall:** The ability of the model to find all relevant instances. - **mAP50:** Mean Average Precision at an IoU threshold of 0.5. - **mAP50-95:** Mean Average Precision averaged over IoU thresholds from 0.5 to 0.95 (in steps of 0.05). Test metric - mean IOU. ### Results Mean IOU: - 0.85 | Class | Images | Instances | Precision | Recall | mAP50 | mAP50-95 | | :------- | :----- | :-------- | :-------- | :----- | :---- | :------- | | all | 315 | 315 | 0.961 | 0.981 | 0.989 | 0.778 | | mosquito | 315 | 315 | 0.961 | 0.981 | 0.989 | 0.778 | *Note: The results are reported for the single class mosquito as the `single_cls=True` flag was used during training, which collapses all classes into one for this specific evaluation run.* ## Environmental Impact - **Hardware Type:** 1 x Tesla P100-PCIE-16GB - **Hours used:** 1.122 hours - **Cloud Provider:** Kaggle - **Carbon Emitted:** Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute). ## Technical Specifications ### Model Architecture and Objective The model uses the `YOLOv11n` architecture. It is a single-stage object detector composed of: 1. A backbone for feature extraction. 2. A neck (C2PSA, SPPF) to aggregate features from different scales. 3. A detection head to predict bounding boxes and class probabilities. - **Layers:** 319 - **Parameters:** 2,590,620 - **GFLOPs:** 6.4 ### Compute Infrastructure #### Hardware - **GPU:** Tesla P100-PCIE-16GB - **CPU:** 4 CPUs - **RAM:** 31.4 GB #### Software - **Python:** 3.10.13 - **PyTorch:** 2.1.2 - **Ultralytics:** 8.3.10 - **Wandb:** 0.16.6 - **Roboflow:** 1.1.47 ## More Information Further details on the training process, including loss curves and validation results per epoch, can be found in the associated [W&B run](https://wandb.ai/mosquitoscan/experiments-set-1-detection/runs/a5fq691z). **The CulicidaeLab Project:** The `culico-net-det-v1` model is a component of the larger CulicidaeLab project. This project aims to provide a comprehensive suite of tools for mosquito monitoring and research. Other parts of the project include: - **Related Models:** - [iloncka/culico-net-cls-v1](https://huggingface.co/iloncka/culico-net-cls-v1) - Classification model - [iloncka/culico-net-segm-v1-nano](https://huggingface.co/iloncka/culico-net-segm-v1-nano) - Segmentation model - **Datasets:** - [iloncka/mosquito-species-detection-dataset](https://huggingface.co/datasets/iloncka/mosquito-species-detection-dataset) - [iloncka/mosquito-species-segmentation-dataset](https://huggingface.co/datasets/iloncka/mosquito-species-segmentation-dataset) - [iloncka/mosquito-species-classification-dataset](https://huggingface.co/datasets/iloncka/mosquito-species-classification-dataset) - **Python Library:** [https://github.com/iloncka-ds/culicidaelab](https://github.com/iloncka-ds/culicidaelab) - **Mobile Applications:** - [https://gitlab.com/mosquitoscan/mosquitoscan-app](https://gitlab.com/mosquitoscan/mosquitoscan-app) - [https://github.com/iloncka-ds/culicidaelab-mobile](https://github.com/iloncka-ds/culicidaelab-mobile) - **Web Application:** [https://github.com/iloncka-ds/culicidaelab-server](https://github.com/iloncka-ds/culicidaelab-server) **Practical Applications:** The `culico-net-det-v1` model and the broader `CulicidaeLab` project have several practical applications: - **Precise Morphological Analysis:** Enables detailed examination of mosquito anatomical features for species identification and research. - **Automated Specimen Measurement:** Can be used to automatically measure wing dimensions, body size, and other morphological characteristics. - **Training Data Generation:** Creates high-quality segmentation masks for training other computer vision models. - **Embedded Systems (Edge AI):** The efficient architecture allows deployment on edge devices for real-time mosquito monitoring in field conditions. - **Expert Systems Integration:** Provides precise segmentation capabilities that can assist entomologists in detailed specimen analysis. **Acknowledgments:** The development of `CulicidaeLab` is supported by a grant from the [Foundation for Assistance to Small Innovative Enterprises (FASIE)](https://fasie.ru/).