Abstract:Abstract: Volatile Fatty Acids (VFA), serving as important intermediate products in Anaerobic Digestion (AD), have been considered as the key variables in most AD monitoring strategies, as they respond to incoming imbalances, indicating the buffer capacity of digesters to process disturbance and imminent digester failure that caused by sudden operational changes. In order to ensure efficient operation of AD while improve the utilization rate of raw materials, it is necessary to accurately monitor and evaluate the operation state of biogas engineering, via detecting the concentrations of VFA in the process of biogas production with corn stover and animal manure as feedstocks. Previously, the rapid detection models of Acetic Acid (AA), Propionic Acid (PA) and Total Acid (TA) in biogas slurry have been constructed, using the Near Infrared Spectroscopy (NIRS) technique combined with the Partial Least Squares (PLS), aiming to overcome the time consuming and high-cost in the traditional chemical analysis method. However, a prediction model can trigger the high complexity and low accuracy, due to the spectroscopic data generally includes quantities of invalid redundant information. In this study, an integrated algorithm was presented, based on the Competitive Adaptive Reweighted Sampling (CARS) and genetic simulated annealing algorithm (GSA), to optimize the characteristic wavelength variables of AA, PA, and TA, and thereby to improve the efficiency and precision of NIRS detection models. An AD experiment was carried out with corn stover, pig manure and cow manure as feedstocks, where 155 samples of biogas slurry were collected. The NIRS data of biogas slurry was acquired in a transmittance mode using the AntarisTM II FT-NIR spectrophotometer equipped with a quartz cuvette. A Gas Chromatography (GC) system was used to measure the VFA of biogas slurry, where 81 valid data of AA, 78 valid data of PA, and 87 valid data of TA were obtained to establish the regression model. One segment of the spectrum with 95 wavelength points was removed from 4 933.02 to 5 295.57 cm-1, and 1462 wavelength variables remained, mainly due to the saturation of spectrum can be caused by the strong combination band of -OH from water. The spectral preprocessing methods were selected, according to the mean relative error of calibration set. Correspondingly, the samples were divided into the calibration set and validation set, using Sample Set Portioning based on Joint X-Y Distances (SPXY) algorithm. The number of characteristic wavelength variables for AA, PA, and TA were 135, 101, and 245, respectively. The PLS regression models were established with the characteristic wavelengths of AA, PA, and TA, where the results were the coefficients of multiple determination for prediction is 0.988, root mean squared error of prediction (RMSEP) of 0.111, and the residual predictive deviation (RPD) of 9.685 for AA, coefficients of multiple determination for prediction is 0.922, RMSEP of 0.120, and RPD of 3.685 for PA, coefficients of multiple determination for prediction is 0.886, RMSEP of 0.727, and RPD of 3.484 for TA. Meanwhile, compared with the whole spectrum model, the RMSEP in the CARS-GSA model decreased by 17.78%, 15.49%, and 1.22%, respectively, showing that the number of wavelengths significantly decreased after the optimization, whereas, the performance of regressive model was obviously higher than that of the whole wavelengths. The results demonstrate that the CARS-GSA model can fulfil the requirement of rapid detection for AA and PA concentrations in biogas slurry during anaerobic fermentation with agricultural waste as feedstocks, while basically meet the detection requirement of TA concentration. The CARS-GSA model also can be used to enhance the forecasting capability of the model, while reduce its complexity. The findings can provide a new way to improve the accuracy and robustness of prediction model, base on optimizing sensitive wavelengths for AA, PA, and TA, further for rapid and accurate measurement of VFA concentrations in biogas slurry.