We have designed computer vision techniques to determine stages in the gonotrophic cycle (unfed, fully fed, semi-gravid and gravid)) of female mosquitoes (Aedes aegypti, Anopheles stephensi, and Culex quinquefasciatus) from images captured by smartphones.
The paper has been accepted to Scientific Reports this 13th December, 2023.
- Python 3.10.12
- Tensorflow 2.12
- Keras 2.12
| Folder | Description |
|---|---|
codes/ |
Provides the source code. |
data/ |
Contains the dataset - training (with augmentation), validation, test. |
models/ |
Saves training models according to the model architecture. |
git clone https://github.com/FarhatBuet14/Classifying-stages-in-the-gonotrophic-cycle-of-mosquitoes.git
cd Classifying-stages-in-the-gonotrophic-cycle-of-mosquitoes/codes
pip install -r requirements.txt
Download the dataset from here and place the data folder in the current directory. It has a data.npz file containing all the images - training (with augmentation), validation and the test dataset. The size of this file is 1.88GB.
For Training run the train.py and provide a model name i.e. EfficientNetB0.
python train.py --name EfficientNetB0
Other parameters can be passed as arguments.
python train.py --name EfficientNetB0 --ep 500 --batch 16
Get all the pretrained models from here. Place the models folder in the current directory. It has subfolders with the four AI architectures names (ConvNeXtTiny, EfficientNetB0, MobileNetV2, ResNet50) which have been used to train the dataset. Each subfolder contains a .h5 file, storing the model architecture with the weights and parameters. Loading these pretrained models, all the test results and Grad-CAMs can be re-genrated.
Run the test_model.py and provide a model name i.e. EfficientNetB0, model directory.
python test_model.py --name EfficientNetB0 --model ../models/EfficientNetB0/model00000533.h5
To generate a TSNE plot with a trained model, put the model directory link to the model variable in tsne.py file and then run tsne.py file.
python tsne.py --name EfficientNetB0 --model ../models/EfficientNetB0/model00000533.h5
It will generate the TSNE plot which will be saved to the current folder with the name tsne.png
To test a trained model with an image, run test_image.py file with and provide a model name i.e. EfficientNetB0, model directory and the directory of the test image
python test_image.py --name EfficientNetB0 --model ../models/EfficientNetB0/model00000533.h5 --test test_image.jpg
It will print the prediction with the confidence and generate the Grad-CAM which will be saved to the current folder with the name gradCam_test_image.jpg.
We are also hosting this classification test process in the website where you can upload an image and check the results with the Grad-CAM within less than a minute. The model in this website is the EfficientNetB0.


