--- license: mit tags: - computer-vision - object-detection - medical-imaging - malaria-detection - yolov8 - clinical-ai datasets: - electricsheepafrica/malaria-parasite-detection-yolo metrics: - precision - recall - mAP model-index: - name: Lara - Malaria Parasite Detection Model results: - task: type: object-detection name: Object Detection dataset: name: Malaria Parasite Detection Dataset type: electricsheepafrica/malaria-parasite-detection-yolo metrics: - type: mAP50 value: 0.9914 name: Mean Average Precision (IoU=0.5) - type: mAP50-95 value: 0.9913 name: Mean Average Precision (IoU=0.5:0.95) - type: precision value: 0.9718 name: Precision - type: recall value: 0.9639 name: Recall --- # Lara - Clinical-Grade Malaria Parasite Detection Model **Lara** is a state-of-the-art YOLOv8-based object detection model specifically trained for malaria parasite detection in blood smear microscopy images. This model achieves world-class performance with **99.14% mAP50** and is designed for clinical deployment. ## Model Description - **Model Type**: YOLOv8 Object Detection - **Task**: Malaria parasite detection and localization - **Training Dataset**: 27,558 annotated blood smear images - **Performance**: Clinical-grade accuracy exceeding published benchmarks - **License**: MIT ## Performance Metrics | Metric | Value | |--------|-------| | mAP50 | **99.14%** | | mAP50-95 | **99.13%** | | Precision | **97.18%** | | Recall | **96.39%** | ## Model Formats This repository includes multiple model formats for different deployment scenarios: - `best_model.pt` - PyTorch format (6.2MB) - For training and research - `best_model.onnx` - ONNX format (12.3MB) - For cross-platform inference - `best_model.torchscript` - TorchScript format (12.5MB) - For production deployment ## Usage ### PyTorch Inference ```python from ultralytics import YOLO import cv2 # Load model model = YOLO('best_model.pt') # Run inference image = cv2.imread('blood_smear.jpg') results = model(image) # Process results for result in results: boxes = result.boxes for box in boxes: confidence = box.conf[0] if confidence > 0.5: # Confidence threshold print(f"Malaria parasite detected with {confidence:.2%} confidence") ``` ### ONNX Inference ```python import onnxruntime as ort import numpy as np from PIL import Image # Load ONNX model session = ort.InferenceSession('best_model.onnx') # Preprocess image image = Image.open('blood_smear.jpg').resize((640, 640)) image_array = np.array(image).transpose(2, 0, 1).astype(np.float32) / 255.0 image_array = np.expand_dims(image_array, axis=0) # Run inference outputs = session.run(None, {'images': image_array}) ``` ## Training Details - **Architecture**: YOLOv8n (nano) optimized for medical imaging - **Training Data**: 19,290 training images, 5,512 validation images - **Epochs**: 100 with early stopping - **Augmentations**: Mosaic, mixup, rotation, scaling, color jittering - **Hardware**: NVIDIA A100-SXM4-40GB - **Training Time**: ~2 hours ## Clinical Validation This model has been validated on a held-out test set of 2,756 images and demonstrates: - **High Sensitivity**: 96.39% recall ensures minimal false negatives - **High Specificity**: 97.18% precision minimizes false positives - **Robust Performance**: Consistent across different microscope types and magnifications - **Fast Inference**: <50ms per image on standard hardware ## Ethical Considerations - **Medical Use**: This model is intended for research and clinical AI development - **Regulatory Approval**: Clinical validation and regulatory approval required for diagnostic use - **Data Privacy**: Training data contains no patient identifiers - **Bias Mitigation**: Model trained on diverse global dataset ## Citation If you use this model in your research, please cite: ```bibtex @misc{lara_malaria_2024, title={Lara: Clinical-Grade Malaria Parasite Detection using YOLOv8}, author={Electric Sheep Africa}, year={2024}, publisher={HuggingFace Hub}, url={https://huggingface.co/electricsheepafrica/Lara} } ``` ## Dataset This model was trained on the [Malaria Parasite Detection Dataset](https://huggingface.co/datasets/electricsheepafrica/malaria-parasite-detection-yolo), which contains 27,558 annotated images in YOLO format. ## Repository Training code and deployment scripts are available at: [GitHub Repository](https://github.com/kossisoroyce/malaria-detection) ## Contact For questions about this model or collaboration opportunities, please contact Electric Sheep Africa. --- **Disclaimer**: This model is for research and development purposes. Clinical validation and regulatory approval are required before use in diagnostic applications.