Conformal Prediction Based on K-Nearest Neighbors for Discrimination of Ginsengs by a Home-Made Electronic Nose

Zhan Wang, Xiyang Sun, Jiacheng Miao, You Wang, Zhiyuan Luo, Guang Li2017

TL;DR

This paper introduces conformal prediction, a novel framework for electronic noses (e-noses) that provides reliable and valid predictions for classifying ginsengs. By integrating k-nearest neighbors (KNN) as a nonconformity measure, the approach not only achieves competitive classification accuracy but also quantifies the confidence and credibility of each prediction, addressing a key limitation of traditional e-nose methods.

What Problem Does This Paper Address?

Electronic noses (e-noses) are powerful tools for identifying and classifying volatile organic compounds (VOCs) based on sensor array responses. However, a significant challenge in e-nose applications is the lack of reliable measures for the confidence in individual predictions. Traditional machine learning models, while capable of classification, often fail to provide a clear indication of how trustworthy a specific prediction is. Furthermore, the overall accuracy of these models is not always guaranteed, especially in real-world scenarios where sensor drift, aging, and environmental variations can impact performance. This paper aims to bridge this gap by introducing conformal prediction, a method that offers both accurate predictions and a quantifiable measure of their reliability, ensuring validity even under challenging conditions.

Methods

The core of this work is the application of conformal prediction (CP) to e-nose data. Conformal prediction is a machine learning framework that provides a rigorous mathematical guarantee of validity. Instead of outputting a single prediction, it generates a prediction region. The key idea is to measure how "conformal" a new data point is with existing data.

The paper implements CP using k-nearest neighbors (KNN) as the underlying "nonconformity measure." This means that for a new sample, the algorithm assesses its similarity to known samples. Specifically, they define two variants:

  • CP-1NN: Uses the 1-nearest neighbor to determine nonconformity.
  • CP-3NN: Uses the 3-nearest neighbors.

The paper distinguishes between two modes of operation:

  • Offline Mode: Predictions are made based on a fixed training set. Here, CP can provide a "forced prediction" (a single label) along with confidence and credibility scores, indicating how likely the prediction is correct and how well the sample conforms to known data.
  • Online Mode: Samples are processed sequentially. This mode guarantees validity, meaning the error rate of predictions will not exceed a user-defined significance level (ε). This mode also naturally produces multiple or empty predictions, which can help identify borderline cases and outliers.

Datasets

The study utilizes a dataset of nine different categories of ginsengs.

  • Sample Preparation: 35 pieces of ginseng per category were pulverized, and 10g of powder from each was placed in glass bottles. Head-space gas was extracted for measurement.
  • E-Nose Measurement: A homemade e-nose with 16 metal-oxide semi-conductive sensors (Figaro TGS type) was used. Sensor responses were recorded for 340 seconds per sample, with a sampling frequency of 10 Hz.
  • Data Preprocessing: Sensor voltage signals were converted to resistance signals and calibrated. Five features were extracted from each sensor's response: maximal absolute response, area under the response curve, and three variations of exponentially moving averages of the derivative. This resulted in a total of 80 features per sample.
  • Total Samples: 315 samples were measured in total.

Key Insights and Ideas

  • Reliability Beyond Accuracy: The most significant insight is that e-nose predictions can be made more trustworthy by quantifying their reliability. Conformal prediction offers this by providing confidence and credibility scores, which are crucial for real-world decision-making.
  • Validity Guarantee: The online mode of conformal prediction offers a strong theoretical guarantee: the error rate will not exceed the chosen significance level. This is a powerful feature for applications where errors have serious consequences.
  • Identifying Ambiguity and Outliers: Multiple and empty predictions in the online mode are not just artifacts but valuable indicators. Multiple predictions can highlight borderline samples that are difficult to classify, while empty predictions can signal potential outliers that don't fit any known category.
  • KNN as a Versatile Nonconformity Measure: The paper demonstrates that a simple yet effective algorithm like KNN can be successfully adapted as a nonconformity measure within the conformal prediction framework, achieving good results.

Key Results

  • Offline Mode Performance:
    • CP-1NN achieved a classification rate of 84.44%.
  • CP-3NN achieved a classification rate of 80.63%.
  • These rates are comparable to, and slightly better than, simple 1NN and 3NN predictors, indicating that reliability doesn't come at a significant cost to accuracy.
  • Online Mode Validity: The study experimentally verified the validity of online conformal prediction, showing that the cumulative error (Err) was consistently less than ε * n (where n is the number of samples and ε is the confidence level) across different confidence levels (80%, 85%, 90%).
  • Efficiency Comparison: CP-1NN generally showed better efficiency (fewer multiple and excess predictions) compared to CP-3NN across various confidence levels, suggesting it's a more parsimonious predictor.

Limitations and Future Work

  • Limitations:
    • The paper notes that in offline mode, "forced prediction" (outputting a single label) sacrifices the strict validity guarantee that holds in online mode.
  • While CP-1NN and CP-3NN are effective, the paper suggests that the choice of nonconformity measure is crucial for improving efficiency.
  • Future Work:
    • The authors propose focusing on designing new methods for computing nonconformity measures to further enhance the validity and efficiency of conformal prediction for e-nose data.
  • Exploring more sophisticated nonconformity measures beyond KNN could lead to even better performance.

Summary updated

BibTeX
@misc{wang2017conformal,
  author = {Zhan Wang and Xiyang Sun and Jiacheng Miao and You Wang and Zhiyuan Luo and Guang Li},
  title = {{Conformal Prediction Based on K-Nearest Neighbors for Discrimination of Ginsengs by a Home-Made Electronic Nose}},
  year = {2017},
  doi = {10.3390/s17081869},
}
Figure