mosquito-guard / README.md
Neylton's picture
first commit
4d4c8a6

A newer version of the Streamlit SDK is available: 1.57.0

Upgrade
metadata
title: MosquitoGuard - Species Detection
emoji: 🦟
colorFrom: green
colorTo: blue
sdk: streamlit
sdk_version: 1.31.0
app_file: app.py
pinned: false
license: mit

🦟 MosquitoGuard - Mosquito Species Detection

AI-powered mosquito species detection using ConvNeXt transfer learning from fire detection models.

🎯 Features

  • πŸ“· Camera Input: Take live photos of mosquitoes using your device camera
  • πŸ“ File Upload: Upload existing mosquito images for analysis
  • 🎯 Species Identification: Detect Aedes aegypti, Anopheles, and Culex species
  • πŸ”₯ Transfer Learning: Powered by ZeroFire ConvNeXt Large (197M parameters)
  • πŸ’‘ Confidence Filtering: 65% minimum confidence threshold for reliable predictions
  • 🎨 Beautiful UI: Gradient color scheme with responsive design

🦟 Detectable Species

πŸ”΄ High Risk Species

  • Aedes aegypti (Yellow Fever Mosquito)

    • Diseases: Dengue Fever, Zika Virus, Chikungunya, Yellow Fever
    • Primary urban vector for dengue and Zika
  • Anopheles (Malaria Mosquito)

    • Diseases: Malaria, Lymphatic Filariasis
    • Most active during nighttime hours

🟑 Medium Risk Species

  • Culex (House Mosquito)
    • Diseases: West Nile Virus, Eastern Equine Encephalitis
    • Common urban mosquito, breeds in stagnant water

πŸš€ How to Use

  1. Choose Input Method: Select camera capture or file upload
  2. Provide Image: Take a photo or upload an existing mosquito image
  3. Get Results: Receive instant species identification with confidence scores
  4. View Details: See disease risks and prevention recommendations

πŸ”¬ Model Details

  • Architecture: ConvNeXt Large with 197M parameters
  • Transfer Learning: Adapted from ZeroFire fire detection model
  • Training: Professional mosquito datasets from iNaturalist
  • Accuracy: 95%+ validation accuracy on mosquito species
  • Confidence Threshold: 65% minimum for predictions
  • Processing: CPU-optimized for cloud deployment

🌍 Health Impact

MosquitoGuard helps identify disease vectors responsible for:

  • Dengue Fever: 390 million infections annually worldwide
  • Malaria: 247 million cases in 2021, primarily in Africa
  • Zika Virus: Causes birth defects and neurological complications
  • West Nile Virus: Leading mosquito-borne disease in North America

Early identification enables targeted prevention and control measures.

πŸ“Έ Usage Tips

  • Use clear, well-lit photos for best results
  • Focus on the mosquito - close-up shots work best
  • Ensure the mosquito is clearly visible in the image
  • JPG, JPEG, PNG formats supported
  • Good lighting improves detection accuracy

πŸ›‘οΈ Prevention Measures

General Prevention:

  • Remove standing water from containers
  • Use air conditioning or window screens
  • Wear long-sleeved shirts and pants
  • Apply EPA-registered insect repellents

Species-Specific:

  • Aedes aegypti: Focus on small water containers, urban areas
  • Anopheles: Use bed nets, evening protection in endemic areas
  • Culex: Maintain clean gutters, treat permanent water features

πŸ”§ Technical Implementation

  • Frontend: Streamlit with custom CSS styling
  • Backend: PyTorch with CPU inference
  • Model: ConvNeXt Large architecture
  • Preprocessing: Standard ImageNet normalization
  • Deployment: Hugging Face Spaces with automatic scaling

πŸ“Š Performance Metrics

  • Validation Accuracy: 95%+
  • Real-world Testing: 100% confidence on clear mosquito images
  • Processing Time: < 3 seconds per image
  • Model Size: ~790MB (ConvNeXt Large)
  • Memory Usage: < 2GB RAM

🎨 UI Features

  • Gradient Backgrounds: Beautiful green-to-blue color scheme
  • Responsive Design: Works on desktop and mobile devices
  • Real-time Processing: Automatic analysis on image upload/capture
  • Progress Indicators: Visual feedback during processing
  • Detailed Results: Confidence scores and species information

πŸ” Model Architecture

ConvNeXt Large Configuration:
- Input Channels: 3 (RGB)
- Output Classes: 3 (mosquito species)
- Depths: [3, 3, 27, 3]
- Dimensions: [192, 384, 768, 1536]
- Parameters: ~197M
- Transfer Learning: From fire detection

🌟 Future Enhancements

  • Additional mosquito species detection
  • Breeding site identification
  • Geographic risk mapping
  • Mobile app development
  • Real-time video analysis

πŸ“± Try It Now!

Upload a mosquito image or use your camera to get instant species identification and health risk assessment.


Disclaimer: This tool is for educational and research purposes. For medical concerns or disease outbreaks, consult healthcare professionals and local health authorities. # mosquito