Skip to content

ZeynepRuveyda/DeepLearning_ObjectDetection-FasterRCNN_and_Segmentation-MaskRCNN_Mosquito_Egg_Counter

Repository files navigation

Counting Mosquito Eggs using Computer Vision Internship Project

image

Description of the project

Female mosquitoes lay their eggs near or in water, and after hatching mosquito larvae spend a week in this aquatic environment before they fly away as adults. The microbial and chemical composition of the water in which they spend their childhood affects the health of the larvae and the adult mosquitoes they will turn into. Previous research has shown that specific microbes or nutrients in the larval environment make for very healthy adult mosquitoes, whereas larval exposure to other compounds and bacterial strains decreases e.g the life-span of adult mosquitoes. It is unknown how female mosquitoes evaluate a body of water before she lays her precious eggs.

To characterize the environmental cues that influence the oviposition choices of mosquitoes, laboratory experiments in which mosquitoes can choose between several potential egg laying sites are often performed. In these experiments mosquitoes deposit eggs on an 'egg paper' that is partly submerged in the water of the egg laying site. It is common practice that the number of eggs deposited on the paper is counted by hand. This method is very labor intensive and prevents large-scale egg laying experiments. In our project, we aim to develop a computer vision pipeline that takes a photograph of an egg paper as input, and accurately determines the number of eggs deposited on the paper. One challenge is that eggs are often deposited in clusters and individual eggs may overlap, providing an interesting computer vision challenge.

Our expectations

We expect that applying a variety of deep learning models to this problem will result in an accurate algorithm to determine the number of eggs present on the image.

Main challenges that we have faced

The main challenge in the project is that our datasets is very small. We have many overlapping and clustered eggs, and usually due to the ambient conditions (light reflection or uneven illumination) when photographing the eggs, some of the eggs are not clearly visible, making it difficult for our model to learn the position of the eggs, and separate overlapping/clustered eggs.

Project Roadmap

We tried the Mask-RCNN and Resunet models for segmentation, and the Faster-RCNN and Retinanet models for object detection within a period of 4 months. By updating the stages of our project, We aimed to improve our egg counting project only with object detection models, not by segmentation. And related to this, We tried the following methods to improve our model. For the datasets part(I spent most of our effort to improve our datasets),

*Mask-RCNN model; cropping image method and masking these images , Resunet model; use big image size and their masks images before loading datasets( I had just 13 images for train and validation datasets :) )

*Faster-RCNN and Retinanet model;

-Divided each image into 6 part

-I got 1728x1728 image size

-Resized images to 1024x1024 size

-Finished 303 images with bounding box annotation

-inverted all train and test images

-Splitted the dataset %80 train, %20validation

Augmentation Part

-We used horizontally and vertically flip, changing gray scale image, brigtness and rotates methods

Transfer Learning

-Used the COCO Datasets weights

-For the Faster-RCNN , We used 10 different weights with backbone resnet50 and resnet101

Configurations

*MaskRCNN

-MaxGTInstances: the maximum number of instances that can be detected in one image ( 100 -> 200)

-DetectionMinConfidence: the confidence level threshold ( 0,7-> 0,5)

-ImageMinDim and ImageMaxDim:

Changed -ImageMinDim:512, ImageMaxDim:1024

The ideal approach would be to train all the initial models on smaller image sizes for faster updation of weights and use higher sizes during final stage to fine tune the final model parameters.

-LOSS_WEIGHTS: Mrcnnmaskloss: This corresponds to masks created on the identified objects, If identification at pixel level is of importance, this weight is to be increased

*Faster-RCNN

-Changed batchsize from 2 to 8

-Play with learning rate

-Changing backbone (resnet50,resnet101)

-Play with iteration and epochs

FASTER-RCNN MODEL RESULTS

file:///home/criuser/Downloads/detectron_resnet50/faster_rcnn_R_50_DC5_1x.yaml/epoch40(97).pngimage image image image

RESUNET MODEL RESULT

image

MASK-RCNN MODEL RESULT

image

The Digital Sciences methods

The Digital Sciences methods that I have used are :

-Programming

-Deep Learning

-Machine Learning

-Project Management

The technical environment

I have used a lot of libraries when I am writing my codes. Pycharm, Google Colab Pro, Streamlit

List of hard/soft skills developed

Deep Learning, OpenCV, Streamlit, Segmentation and object detection models, Python skills

(For Project Management) Notion(https://www.notion.so/Project-management-26c800e772294358a464b1abc9236d03)

Projet video for last user

Download the video

bandicam.2021-06-25.05-07-40-440_Trim.mp4

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published