An object detection model for identifying and counting mosquito larvae and eggs
Machine Learning
Transfer learning
Object Detection
YOLOv8
Optimal Sailor
2023-12-15
GUI application for sailboat navigation using weather data
Python
Pygame
Pygrib
MatPlotLib
Cartopy
grib
CarbonZero
2022-09-29
A sustainability application to gamify Earth-friendly habits
Meteor
React Bootstrap
MongoDB
Google Maps API
JavaScript
Warrior Ride Buddies
2022-05-12
A web application to connect UH students with similar commutes.
Meteor
React
Semantic UI
MongoDB
Testcafe
Google Maps API
JavaScript
Database Program
2021-10-21
A simple database program with read/write capabilities and a console UI
Software
C language
Database
Mosquito Larvae Detection
2024-05-11
Purpose:
Counting mosquito larvae in an aliquot is a tedious task faced by PhD students researching mosquito population control. This paper presents a machine learning approach to this problem, leveraging a minimal dataset of only 96 images. The goal is to develop a model that can accurately detect and count mosquito larvae in images taken in a laboratory environment.
Dataset:
The model's inputs are images of mosquito larvae and mosquito eggs in an aliquot, and the output is the location, dimensions, and classifications of the objects detected within these two classes. Initially, the model was trained to detect live larvae only, as this is the targeted class to be identified. This resulted in the eggs occasionally being misclassified as larvae, so the model is now trained to distinguish between live larvae and eggs to reduce this error. Due to the limited nature of the dataset, a transfer learning method is implemented using the generic object detection model YOLOv8.
The dataset consists of 96 images of size 2592 by 1944 pixels. The images have a uniform background and lighting and contain three classes of objects: live larvae, dead larvae, and eggs. Because there are very few samples of dead larvae in the dataset, this class is excluded from the training process. Each object within the images is labeled by class with bounding boxes tightly surrounding them. The data is randomly permuted and split as follows:
Training set: 67 images (70%)
Validation set: 19 images (20%)
Test set: 10 images (10%)
The model is trained on the training set and the validation set was used for hyperparameter selection and early stopping. The test set is used to evaluate the final model.
Preprocessing & Tuning:
Preprocessing includes auto-orienting the images to ensure the bounding boxes match the image orientation. The images are not resized due to the small nature of the dataset, as well as to avoid requiring preprocessing during the usage of the trained model. The bounding boxes
are encoded using the YOLO format, which consists of its class number and four values between 0 and 1 describing its center coordinate and height and width relative to the dimensions.
Hyperparameter tuning for this model was conducted using the YOLO model tune method to optimize the model's performance. YOLO tune method uses the mutation algorithm which searches the hyperparameter space by applying small random changes to existing hyperparameters. Tuning was conducted with AdamW optimization for 93 iterations for 30 epochs each. The hyperparameters which were included in the tuning process and their final values are as follows:
Hyperparameter
Value
lr0
0.00838
lrf
0.01346
momentum
0.86808
weight_decay
0.00041
warmup_epochs
3.37112
warmup_momentum
0.88987
box
9.86137
cls
0.44448
dfl
1.59169
hsv_h
0.01633
hsv_s
0.54486
hsv_v
0.55232
degrees
0
translate
0.08194
scale
0.45391
shear
0
perspective
0
flipud
0
fliplr
0.53219
bgr
0
mosaic
0.94871
mixup
0
copy_paste
0
Training & Evaluation
The base model used is "yolov8n" and is trained using the best hyperparameters from the tuning process. Training was set to be conducted for 500 epochs with early stopping and a patience of 100. Training ended after epoch 376 and the best results were observed at 276. Figure 1 shows the labels manually added by humans alongside the model's predictions and their corresponding confidence levels. These predictions were generated by the final model on the test data that was not included in the training or validation processes.
Figure 1: Human-added labels (left) vs model predictions (right)
The performance of this model is evaluated using the following metrics:
Precision-Recall: A plot of the trade-off between:
Precision: the ratio of true positive predictions to the total number of positive predictions.
Recall: the ratio of true positive predictions to the total number of actual positive instances in the data.
Precision-Confidence: A plot of precision at different confidence thresholds.
Recall-Confidence: A plot of recall at different confidence thresholds.
F1-Confidence: A plot of the F1 score at different confidence thresholds. The F1 score is the harmonic mean of precision and recall.
The F1 score for this model has a peak value of 0.94 at a confidence threshold of 0.32.
Distribution Shift:
While this model has been highly evaluated for its performance, its ability to generalize is not thoroughly proven due to the minuscule size of the test set. Since all training was conducted using images from the same source and in the same setting, it is likely that the model will not generalize well to photos taken under different conditions, such as those with a different background or lighting. Any variation in these factors could significantly impact the model's ability to accurately detect and classify mosquito larvae.
Developed the graphical user interface using python
Implemented the path finding algorithm
Incorporated speed profile data and directional limitations of the sailboat
Integrated local wind forecast data from NOAA
Optimized the land detection algorithm for imported maps
Takeaways
This was my first project in which I developed software for a client. My role incorporated communication, project management, and software development. The minimum viable project agreed upon at the start was completed early and our team continued the project by implementing additional features at the requests of our client.
Source: The source code for this project not available to the public
CarbonZero
2022-09-29
The purpose of this application is to provide users with a fun way to improve the sustainability of their lifestyle. CarbonZero helps to foster an environmentally-conscious community by allowing users to share sustainability-related challenges and organize volunteer opportunities which can be completed in order to gain individual points as well as to improve their neighborhood's sustainability score. Accumulating points enables users to level-up their profile as well as purchase digital badges as well as sponsor-provided incentives.
Contributions
My primary contribution was in creating the forum through which users can create and comment on posts. Aside from this I contributed by creating the scoring system, the experience and leveling system, and assisting in making components on other pages functional such as the leaderboard.
Takeaways
This project was the second web application I've contributed to. There wasn't a lot to learn since the tech-stack was mostly the same as with the previous one. One of the key differences in this experience was that most of the development took place within a span of a few days rather than weeks. Working with a tech stack I was familiar with enabled me to be more productive as well as focus on implementing good coding practices rather than being primarily concerned with getting the app to work.
The purpose of this application is to make it easy for students attending the University of Hawaii at Manoa to organize carpools. The way it works is users create a profile including their name, photo, address, commuting schedule, and other optional fields. Then on the main page, they can view the approximate locations of the other users on a map, and filter these users based on day, commute times, and whether they are a driver. When a potential car-pooler or "buddy" is found, the user can send them a message for coordination purposes. Users can also create group messages to organize a larger pool.
Contributions
Created the direct messaging feature which supports group messaging
Integrated Google Maps and populated the map with users' markers
Created the filtering capability for the map markers
Implemented the report function for misuse that gets reviewed by site admins
Designed and created the pages for viewing messages and reports
Created the form for making new user profiles
Takeaways
Through the creation of this project, I learned almost everything I know now about web development. Going through tutorials doesn't quite have the same educational value as tackling problems on your own (with the help of stackoverflow). Prior to working on this project, I had only a vague understanding of all the tools and concepts which were introduced to me in the course for which this project was made, however, I now have a much richer understanding of these tools as well as confidence in applying them.
This is an individual project I completed in ICS 212, Fall 2021. Doing this project helped me learn how to compile a C application with multiple source files, how to use a Makefile, and how to implement a simple linked list data structure using principles of object-oriented programming.
The user interface was designed to be robust using error handling for all cases of user input.
It accepts user input, stores it in an object on a linked list, and then writes the data to a file upon program termination, which is then read and stored onto the linked list at the next startup.
Another feature of this project is the implementation of a debug mode which can be run by passing a specific command line argument when starting the application.