Object Detection and Regression Based Visible Spectrophotometric Analysis: A Demonstration Using Methylene Blue Solution - Aytaç, Ersin (ADCAIJ: Advances in Distributed Computing and Artificial Intelligence Journal, 2023)
This study investigates the estimation of the concentration of methylene blue solutions to understand if visible spectrophotometry could be performed using a smartphone and machine learning. The presented procedure consists of taking photos, detecting test tubes and sampling region of interest (ROI) with YOLOv5, finding the hue, saturation, value (HSV) code of the dominant color in the ROI, and regression. 257 photos were taken for the procedure. The YOLOv5 object detection architecture was trained on 928 images and the highest mAP@05 values were detected as 0.915 in 300 epochs. For automatic ROI sampling, the YOLOv5 detect.py file was edited. The trained YOLOv5 detected 254 out of 257 test tubes and extracted ROIs. The HSV code of the dominant color in the exported ROI images was determined and stored in a csv file together with the concentration values. Subsequently, 25 different regression algorithms were applied to the generated data set. The extra trees regressor was the most generalizing model with 99.5% training and 99.4% validation R2 values. A hyperparameter tuning process was performed on the extra trees regressor and a mixed model was created using the best 3 regression algorithms to improve the R2 value. Finally, all three models were tested on unseen data and the lowest MSE value was found in the untuned extra trees regressor and blended model with values of 0.10564 and 0.16586, respectively. These results prove that visible spectrophotometric analysis can be performed using the presented procedure and that a mobile application can be developed for this purpose.