Spectroscopy and Spectral Analysis, Volume. 45, Issue 1, 117(2025)
Research on a Mixed Gas Detection Method Based on KNN-SVM
In the current research on mixed gas detection, various mathematical algorithms for classifying and predicting data of multiple gas components have emerged. Rapid and accurate gas composition and concentration detection has gradually become a hot topic. However, in some studies, the features of gas data are difficult to capture and judge, and the classification and prediction of gas data exhibit poor accuracy and efficiency due to data bias and unbounded generalization errors. In response to challenges like data bias and unbounded generalization errors, this paper proposes a KNN-SVM algorithm. This algorithm performs secondary classification on ambiguous gas data that is challenging to classify. It combines K-nearest neighbors and Support Vector Machine algorithms to make more comprehensive data feature assessments. The algorithm determines the weights of each algorithm based on experiments, thereby improving the accuracy of discriminating gas categories. The integration of the two algorithms also enhances the efficiency of the overall algorithm, providing stable adaptability to different types of gases. The experimental gas composition consists of cylinders containing C2H2, NO2,and SF6 at concentrations of 12 mg·L-1, NO2, SF6 at 10 mg·L-1, and C2H2 at 5 mg·L-1(all diluted with N2 as a background gas), as well as two bottles of pure N2. The experiment involves mixing these gases and adjusting their ratios to set the required gas concentrations for detection. By detecting individual gases,60 sets of training data are obtained for each of the three gases. Linear fitting of these 60 data sets yields fitted lines for each gas, establishing the relationship between gas concentration and absorption peak. The accuracy of gas detection is confirmed through the adjusted R-squared values for the fitted lines: 0.991 for C2H2, 0.981 for NO2, and 0.987 for SF6. Subsequently, 40 sets of training data are obtained by detecting mixed gases. The KNN-SVM algorithm is then applied to classify and predict mixed gases, and the concentrations of each gas in the mixed gas are inferred from the fitted lines. Comparisons with traditional SVM algorithms using various classification metrics demonstrate the effectiveness and superiority of the proposed algorithm. Experimental results indicate that the KNN-SVM algorithm exhibits outstanding performance in gas classification and prediction, achieving an accuracy of 99.167% and an Area Under the Curve index of 99.375%. This algorithm enhances the accuracy of gas detection and improves generalization capabilities to adapt to diverse gas compositions, providing robust support for real-time gas detection systems.
Get Citation
Copy Citation Text
SUN Chao, HU Run-ze, WU Zhong-xu, LIU Nian-song, DING Jian-jun. Research on a Mixed Gas Detection Method Based on KNN-SVM[J]. Spectroscopy and Spectral Analysis, 2025, 45(1): 117
Received: Oct. 16, 2023
Accepted: Feb. 28, 2025
Published Online: Feb. 28, 2025
The Author Email: Jian-jun DING (10107093@jhun.edu.cn)