Abstract:Abstract: Biodiesel (fatty acid methyl or ethyl esters) is made from vegetable oil or animal fat (triglycerides) reacting with methanol or ethanol using a catalyst (lye). It is safe, biodegradable, and produces less air pollutants than petroleum-based diesel or recycled restaurant greases. With the increasing demand of green energy source and the decreasing of fossil fuel, biodiesel has gained increasing attention as one of the alternative fuels. 100% biodiesel (B100) was used in this study. Experimental samples with water content of 0, 2.50%, 5.00%, 7.50% and 10.0% were set. There were 35 samples for every treatment with different water contents, and total 175 samples. 116 samples were selected for calibration set, and 58 samples for prediction set based with Kennard-Stone (K-S) method. Visible and near infrared spectra (Vis-NIR) technique which was a nondestructive and rapid method, was used to measure the water content in biodiesel. Samples were scanned using the ADS Handheld FieldSpec spectrometer and spectra of samples were acquired. Principal component analysis (PCA) was used to compress spectral data and observe the cluster's situation of biodiesel with different water contents. The scores plot showed a good cluster distribution and the total accumulated variance of PC-1 and PC-2 was up to 99.3%. Random Frog algorithm was applied to extract spectral feature. Then, 8 sensitive wavelengths (563, 560, 642, 565, 562, 493, 559 and 779 nm) were selected respectively. Spectral feature and different water contents were set as input values of partial least squares regression (PLSR) and least squares-support vector machine (LS-SVM) models. It was showed that LS-SVM and PLSR with full spectra had good results, while the variables were too much (116×591) compared with the regression models (116×8). Results of the Random Frog-LS-SVM were better than the Random Frog-PLSR. R of the non-linear LS-SVM models with spectral feature extracted by Random Frog was higher than 0.965, RMSEC of 0.722, RMSEP of 0.520. Sensitive wavelengths extracted were good for eliminating the interfering spectral and improving the accuracy of the model. Results indicated that the Random Frog-LS-SVM as a satisfactory model can measure the water content in biodiesel accurately, which could provide a reference for practical application.