Non-destructive and rapid prediction of protein and fat content in black soldier fly larvae using hyperspectral imaging and machine learning

Date
2025
Authors
Babirye, Immaculate
Journal Title
Journal ISSN
Volume Title
Publisher
Makerere University
Abstract
The accurate determination of protein and fat content in Black Soldier Fly Larvae (BSFL) is essential for their utilization in sustainable animal feed production. Traditional methods such as Kjeldahl and Solvent extraction for assessing these nutritional parameters are time-consuming, destructive, and require extensive chemical analysis. This study presents a non-destructive, rapid, and reliable machine learning model for predicting BSFL protein and fat content using Hyperspectral Imaging (HSI). Hyperspectral camera was used to capture a broad range of spectral information from BSFL enabling detailed analysis of chemical composition without physical sample destruction. A dataset of 200 hyperspectral images of BSFL samples was collected using XIMEA IMEC camera and preprocessed to extract spectral features. These features were then used to train and validate machine learning models such as the Partial Least Squares Regression (PLSR) and the Support Vector Machine Regression (SVMR). The models’ performance was then evaluated using metrics like the coefficient of determination (R²) and Root Mean Square Error (RMSE). Results demonstrated that the developed models accurately predicted BSFL protein and fat content, with the SVMR yielding the best prediction, characterized by R² values closer to 1 compared to the PLSR. This approach provides a rapid, non-destructive alternative to traditional chemical analyses, making it suitable for real-time monitoring and quality control in BSFL production. The study emphasizes the potential of integrating hyperspectral imaging and machine learning for advancing precision nutrition analysis in the insect protein industry.
Description
A dissertation submitted in partial fulfilment of the requirements for the award of the Degree of Bachelor of Science in Electrical Engineering of Makerere University
Keywords
Black Soldier Fly, Hyperspectral imaging, Machine Learning
Citation
Babirye, I. (2025). Non-destructive and rapid prediction of protein and fat content in black soldier fly larvae using hyperspectral imaging and machine learning; Unpublished dissertation, Makerere University, Kampala