Related Experiment Video
Updated: Aug 5, 2026

Exploring Life History Choices: Using Temperature and Substrate Type as Interacting Factors for Blowfly Larval and Female Preferences
Published on: November 17, 2023
Machine learning models for predicting crude protein and fat content in black soldier fly larvae: Comparative study
Xinrui Lv1, Qing Wang1, Lei Feng2
1Key Laboratory of Smart Breeding (Co-construction by Ministry and Province) of Ministry of Agriculture and Rural Affairs, Tianjin Agricultural University, Tianjin 300392, China; College of Engineering and Technology, Tianjin Agricultural University, Tianjin 300392, China.
None:
Black soldier fly larvae (BSFL) are rich in crude protein (CP) and crude fat (EE), offering substantial potential for animal feed and biodiesel production. However, their nutritional composition is dynamically influenced by multiple factors. Traditional chemical detection methods are inefficient to meet the practical demands of modern farming. Therefore, this study developed a machine learning-based prediction method for the major nutritional components of BSFL. By collecting larval growth data under different feeding substrates and environmental conditions, six regression models were evaluated. Results demonstrated that Light Gradient Boosting Machine (LightGBM), achieved optimal performance in predicting CP content (determination coefficient (R2) = 0.711, mean absolute error (MAE) = 3.515, root mean square error (RMSE) = 4.913), while K-Nearest Neighbors outperformed the other five models in predicting EE content (R2 = 0.702, MAE = 4.508, RMSE = 5.975). Validation on five practical substrates produced mean absolute errors of 3.14 percentage points for CP and 3.42 percentage points for EE, indicating promising predictive potential under tested conditions. SHapley Additive exPlanations analysis identified larval instar stage and initial weight as the most important predictive factors for CP, and feeding substrate as the most influential factor for EE prediction. This study provided a data-driven tool to rapidly evaluate BSFL nutritional components, supporting optimization of farming strategies, although validation under broader conditions is still required.

