Abstract:Objective Electronic nasal breath testing is a highly promising noninvasive cancer detection technique. However, most of the existing studies on detection modeling has are centered on the differentiation of a certain type of disease from healthy individuals. In order to realize the differentiation of multiple cancers through breath testing with an electronic nose, this paper constructs a three-classification cancer detection model based on KNN. Methods Firstly, breath signal samples were first collected from 210 volunteers through an electronic nose, of which 160 patients with lung or liver cancer were diagnosed patients in the hospital and 50 healthy controls were hospital staff or students. The breath samples were preprocessed to obtain a dataset of size 210 × 180. Then, the initial screening of data features is completed by chi-square test and the training feature set is obtained by using LDA optimization method. Then, the optimal KNN triple classification cancer detection model is trained and obtained by using the K- value to select the learning curves. Finally, the model is evaluated in multiple dimensions. Results The optimally designed KNN triple classification cancer detection model can effectively differentiate between healthy people, lung cancer patients and liver cancer patients, with better performance than other models, and the accuracy can reach about 92.5%. It can be seen that machine learning algorithms can help promote the application of electronic nasal breath testing in cancer detection.