Optimizing Electronic Nose Performance for Detecting Coconut Sap Preservatives: A Comparative Analysis of Feature Extraction and Machine Learning Techniques

Open

Yahya Efendi, Agus Naba, Arinto Yudi Ponco Wardoyo

2026 Trends in Sciences Vol. 23 Issue 2 Article Cited by 0

Abstract

Coconut sap, the raw material for coconut sugar, is highly susceptible to rapid fermentation, prompting farmers to use natural or chemical preservatives. Detecting these preservatives is challenging, as conventional techniques like Gas Chromatography-Mass Spectrometry (GC-MS) are costly and impractical for field applications. This study evaluated 3 feature extraction methods—maximum, difference, and integral—using an Electronic Nose (e-nose) to classify sap samples: Without preservatives (S-O (Original Sap)), with natural preservatives (S-NP (Sap with Natural Preservative)), and with chemical preservatives (S-CP (Sap with Chemical Preservative)). Data from ten Metal-Oxide Semiconductor sensors were analyzed using Principal Component Analysis (PCA) and 4 machine learning models: Random Forest (RF), Gradient Boosting (GB), Quadratic Discriminant Analysis, and k-Nearest Neighbor (k-NN). A stratified 5-fold cross-validation protocol was employed to ensure model robustness. The results demonstrated that the integral feature consistently outperformed the other methods, yielding superior PCA cluster separation and classification accuracy. The k-NN model with raw integral features achieved the highest test accuracy of 93.33% and a mean validation accuracy of 86.11%. Although GB with 2PC input also performed well (91.11% test accuracy, 87.78% validation), the k-NN model’s misclassification pattern was safer for food safety, as it avoided labeling S-CP samples as S-O—a high-risk error. Sensors sensitive to organic solvent vapors and alcohols were the most significant contributors to detection accuracy. These findings confirm that integral feature extraction provides a reliable, rapid, and non-destructive method for preservative detection in coconut sap, offering a cost-effective alternative to GC-MS for quality control. © 2026, Walailak University. All rights reserved.

Affiliations

Department of Physics, Faculty of Mathematics and Natural Sciences, Universitas Brawijaya, Malang, Indonesia