







































SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 
12-21 

12 

 

 

 

Article 

Classification of vanilla by quality using MOS gas 

sensors: assessing the effectiveness of wavelet 

time-frequency analyzer 
Sherlyn Cheryl May Xin Wee, Hui En Lee, Hong Siang Chua* 

 Swinburne University of Technology Sarawak Campus, Kuching, Sarawak, Malaysia 

A R T I C L E   I N F O 
 

Article history: 
Received 21 April 2024  
Received in revised form 
15 June 2024 
Accepted 03 July 2024 
 
Keywords:  
Classification, Electronic nose, Gas sensors, 
Machine learning, Metal oxide semiconductor 
(MOS), Principal component analysis (PCA) 
 
*Corresponding author 
Email address: 
hschua@swinburne.edu.my  
 
 
DOI: 10.55670/fpll.futech.3.4.2 
 

A B S T R A C T 
 

This paper presents an overview of the global vanilla industry, emphasizing 
vanilla’s status as the second most costly spice and the most extensively used 
flavoring worldwide. To satisfy global demand, there is an increasing reliance 
on synthetic methods for flavor extraction, raising concerns about quality and 
health risks due to widespread adulteration with cheaper synthetic vanillin, 
often misrepresented as "pure." To tackle adulteration effectively and 
economically, this study proposes employing a single-stage classification model 
trained using the transient response of an electronic nose (e-nose) equipped 
with four metal oxide semiconductor (MOS) gas sensors with Principal 
Component Analysis (PCA) and machine learning classification models to 
sample vanilla from various countries (Indonesia & Madagascar) and grades 
(Grade A & B). 33 classifiers were trained and compared based on classification 
and validation accuracy. Through trial and error, it was determined that the 
sensor response times at the 20s, 60s, and 90s marks, using Weighted KNN, 
contributed to 100% classification accuracy and 80% validation accuracy. A 
second analysis method was attempted where the sensor transient response 
was processed using the Wavelet Time-Frequency Analyzer. When training 
classification models using the processed data, the bilayer neural network 
yielded the highest classification accuracy of 100% and validation accuracy of 
70%. 

 

 

1. Introduction 

Due Vanilla, the second-costliest spice globally and the 
most widely used flavoring agent in the food industry, is 
sourced from orchids within the Vanilla genus, primarily 
native to Mexico. The primary contributor to global supply, 
Vanilla Planifolia, dominates production at 80%, mainly 
cultivated in Madagascar and nearby islands [1]. Despite its 
value in various sectors, the vanilla market faces substantial 
supply challenges, exacerbated by the 2018 "vanilla crisis," 
leading to price surges and criminal activities in producing 
regions [2, 3]. Synthetic means are increasingly used due to 
the limited availability and high production costs of natural 
vanilla [4]. Adulteration with cheaper synthetic vanillin poses 
health risks and quality concerns [5]. To address these 
challenges, this study aims to distinguish between natural and 
synthetic vanilla and enhance the authenticity and 
traceability of vanilla planifolia. Vanilla samples from 
Indonesia and Madagascar, categorized into different grades 
(A and B), have been prepared for this purpose.  

 
In the current phase of the research, a single-stage 

classification model was created to distinguish between 
vanilla samples originating from Indonesia and Madagascar, 
each with varying grades. The training and prediction 
processes of the classification model were iterated to 
ascertain precise sample categorizations. Consequently, 
various methods were employed subsequently to assess the 
accuracy of these classifications. Additionally, wavelet 
analysis will be employed to assess its effectiveness in 
conjunction with the single-stage method. The Continuous 
Wavelet Transform (CWT) is among the various iterations of 
the Wavelet Transform frequently utilized to detect patterns 
or frequencies within a signal, with the specific pattern or 
frequency corresponding to the chosen wavelet. Continuous 
analysis often offers easier interpretation due to its 
redundancy, reinforcing signal traits and enhancing the 
visibility of all information, particularly subtle details [6]. 

 

 

Future Technology 

Open Access Journal 

https://doi.org/10.55670/fpll.futech.3.4.2 

 

 

 

 

 

 

 

November 2024| Volume 03 | Issue 04 | Pages 12-21 

Journal homepage: https://fupubco.com/futech 

 

ISSN 2832-0379 

mailto:hschua@swinburne.edu.my
https://doi.org/10.55670/fpll.futech.3.4.2
https://fupubco.com/futech


SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

13 

 

2. Methodology 

2.1 Preparation, storage, and sampling of vanilla 
samples 
A total of 68 training samples were gathered as follows: 

• 20 Madagascar Grade A (MGA) samples 
• 20 Madagascar Grade B (MGB) samples 
• 16 Indonesia Grade A (IGA) samples 
• 12 Indonesia Grade B (IGB) samples 

These samples were utilized to form the training datasets 
used in training the classification models examined in this 
investigation. To validate the trained classification models, a 
total of 20 vanilla samples were prepared as follows and 
predicted by the trained classification models: 
• 5 Madagascar Grade A (MGA) samples 
• 5 Madagascar Grade B (MGB) samples 
• 5 Indonesia Grade A (IGA) samples 
• 5 Indonesia Grade B (IGB) samples 

The vanilla samples in this study were stored in 
individual zip-lock plastic bags, as shown in Figure 1. 

 
Figure 1. Indonesia grade A vanilla sample- each sample was stored 
in a zip-lock plastic bag 

 
Vanilla sampling was conducted by inserting a 2 cm 

sample into a sensing chamber with four MOS gas sensor 
models: TGS2600, TGS2602, TGS2611, and TGS2620 for 
headspace sampling. Table 1 shows the specifications of each 
MOS gas sensor model. Each sample was inserted into a 
sample holder before placing it within the sensing chamber. 
Given the utilization of two distinct grades of vanilla samples, 
two separate sample holders shown in Figure 2 were 
employed. 

Table 1. MOS gas sensors specifications 

Sensor Model Target Gases 

TGS2600 

Hydrogen, ethanol, smoke, general smoke 

contaminants 

TGS2602 
VOCs, ammonia, H2S 

TGS2611 
Methane, natural gas 

TGS2620 
Alcohol, organic solvent vapors 

 

 
 

 
Figure 2. Vanilla sample holder 

This division is essential to prevent the cross-
contamination of vanilla caviar from the two different grades. 
Upon the conclusion of the sampling procedure, the solenoid 
valves were unsealed to enable the introduction of the carrier 
gas. This study utilized the MOS gas sensors module, sampling 
process, and feature extraction method practiced by Lee et al. 
in their studies [7-10]. Sensor response is defined as the 
change in sensor output voltage (voltage across an external 
load resistor) due to the change in resistance of the sensing 
material in the sensor. The change in sensor output voltage is 
calculated as a percentage change by comparing it with the 
sensor output voltage baseline, which was set to 1.0 V in this 
study. The complete e-nose circuit configuration is shown in 
Figure 3. The sensors were preheated before commencing the 
vanilla sample collection. This was done by adjusting the 
sensor heater to 5 V and samples with strong aroma, for 
example, coffee beans, were introduced into the sensing 
chamber for a duration of 15 minutes.  After the 15-minute 
interval, the coffee beans were removed, and purging was 
employed until the sensor readings returned to the baseline 
values, after which the sampling procedure was initiated. 

 

 
Figure 3. Complete e-nose circuit configuration 

The sampling process started with a 10-second baseline 
period, followed by static headspace sampling of vanilla for 
120 seconds, a maximum purging duration of 30 seconds, and 
a maximum recovery interval of 250 seconds. This sums up to 
a total duration of 410 seconds. For the vanilla sampling 
process, temperature modulation was employed setting three 
different levels of heater voltage at different time intervals to 
produce three different temperatures. The three different 
sensor temperatures contributed to three distinct sensor 
sensitivity and selectivity. Table 2 lists the heater voltage 
corresponding to each sensitivity level in this study. Figure 4 
shows the flowchart of the warmup procedure, whereas 
Figure 5 shows the flowchart of the sampling procedure. 

 
 
 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

14 

 

 
Table 2. The heater voltage corresponding to each sensitivity level 

 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 

Figure 4. Sensor warmup procedure 

Figure 5. Vanilla sampling procedure 

2.2 Sample Data Analysis 
Sample data analysis was conducted using the MATLAB 
software. Data obtained from both the training and validation 
sets was processed using Principal Component Analysis 
(PCA) for data visualization and interpretation. This process 
will reveal distinct PCA scatter clusters corresponding to each 
grade and country. However, to augment sample 
classification, the processed data was then used to train and 
validate 33 classification models from broad categories of 
decision tree, discriminant analysis, logistic regression 
classifier, naïve bayes classifier, SVM, k-nearest neighbour 
(KNN), ensemble classifier and neural network, from which 
the most accurate models were shortlisted to evaluate the 
accuracy of sample classification. 

2.3 Wavelet Time-Frequency Analyzer 
A second data analysis method was developed where the 
sensor transient response (output voltage against time) was 
analysed using the Wavelet Time-Frequency Analyzer in 
MATLAB. This analysis aimed to ascertain whether the 
wavelet technique could improve result accuracy compared 
to the method in section 2.2. Figure 6 outlines the steps for 
using the Wavelet Time-Frequency Analyzer. 

2.4 Vanilla Classification Methods 
In this study, multiple techniques (Method A, B, C, D, E and F) 
were employed to classify the vanilla samples as follows: 
a. Method A: Single-stage multi-class machine learning, 

focusing on distinctions between grades and countries. 
b. Method B: Multi-stage two-class machine learning, 

examining relationships between grades and countries – 
Madagascar Grade A (MGA), Madagascar Grade B (MGB), 
Indonesia Grade A (IGA) and Indonesia Grade B (IGB) – as 
illustrated in Figure 7. 

c. Method C: Similar to Method B, specifically comparing the 
classification and validation accuracy between the two 
classification approaches in the second stage – (1) MGA vs 
non-MGA; (2) IGA vs non-IGA. 

d. Method D: Similar to Method B, concentrating on the 
classification of IGA vs non-IGA in stage 2. 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 

Sensitivity Heater Voltage 

1 
4.6 V 

2 
4.8 V 

3 
5.0 V 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

15 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

Figure 6. Procedure for using the Wavelet Time-Frequency Analyzer in MATLAB 

Figure 7. Method B of vanilla classification 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

16 

 

e. Method E: Single-stage machine learning that classifies the 
vanilla samples into two classes only – Madagascar or 
Indonesia. 

f. Method F: Similar to method E, except that wavelet time-
frequency analysis was used to process the sensor 
transient response. The processed data was then used to 
train the classification models. 

3. Results and discussion 

In this study, sensor data was extracted from three 
response times – 20 s, 60 s, and 90 s – where each response 
time corresponded to a unique sensor sensitivity and 
selectivity. This contributed to greater data dimensionality, 
which led to better interclass separation of vanilla samples. 

3.1 Method A 
Table 3 discerns that the top three most effective 

classification models belong to the ensemble classifiers 
category. These models demonstrated perfect accuracy of 
100% with the training dataset. However, in terms of 
validation accuracy, the performance ranged between 50% 
and 60%, falling short of satisfactory levels. Consequently, the 
subsequent section will introduce an approach aimed at 
enhancing the outcomes. 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

3.2 Method B 
In this section, a multi-stage, two-class machine learning 

technique was employed. This method involved a simpler 
classification process where samples are divided into two 
classes rather than four simultaneously. During data training, 
several classification models attained a perfect classification 
(training) accuracy of 100%, including Support Vector 
Machine (SVM), K-Nearest Neighbor (KNN) Classifiers, 
Ensemble Classifiers, and Neural Network. Tables 4-6 show 
the best performing classification models in terms of 
validation results at each stage of Method B. For the validation 
dataset, Linear Discriminant, Bagged Trees, Trilayer Neural 
Network, SVM Kernel, and Logistic Regression Kernel 
demonstrated robust performance in the initial stage, 
achieving validation accuracies ranging from 80% to 95%. 
However, in the second stage, none of the models effectively 
differentiated between samples of Indonesia Grade B and 
Non-Indonesia Grade B, with the exception of Fine KNN and 
RUS Boosted Trees, which achieved an accuracy of 73.33%. 
Progressing to the final stage, three models—Fine Gaussian 
SVM, Subspace KNN, and Trilayer Neural Network—
displayed enhanced proficiency in distinguishing between 
samples of Madagascar Grade A and Indonesia Grade A. 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Table 3. Best performing classification models in method A 

Classification 
Model 

Training Training 
Accuracy 

Validation Validation 
Accuracy IGA IGB MGA MGB IGA IGB MGA MGB 

Bagged Trees 16/16 12/12 20/20 20/20 100% 3/5 1/5 1/5 5/5 50% 

Subspace KNN 16/16 12/12 20/20 20/20 100% 2/5 1/5 3/5 4/5 50% 

RUS Boosted 
Trees 

16/16 12/12 20/20 20/20 100% 4/5 2/5 1/5 5/5 60% 

 

Table 4. Best performing classification models in method B, stage 1 (MGB vs Non-MGB) 

Validation 

Classification Model 
Stage 1 

Accuracy 
MGB Non-MGB 

Linear Discriminant 5/5 12/15 85% 

Bagged Trees 5/5 14/15 95% 

Trilayer Neural Network 5/5 11/15 80% 

SVM Kernel 5/5 11/15 80% 

Logistic Regression Kernel 5/5 11/15 80% 

 

Table 5. Best performing classification models in method B, stage 2 (IGB vs Non-IGB) 

Validation 

Classification Model 
Stage 2 

Accuracy 
IGB Non-IGB 

Fine KNN 1/5 10/10 73.33% 

RUS Boosted Trees 1/5 10/10 73.33% 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

17 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

3.3 Method C 
This section redirects its focus to testing and analyzing 

samples from Madagascar and Indonesia Grade A, aiming to 
ascertain which origin offers greater separability from the 
other classes during classification in the second stage. Table 7 
lists the models with the highest validation accuracy for both 
Madagascar and Indonesia Grade A. Three models showed 
outstanding performance on the validation dataset for 
Indonesia Grade A, while none stood out for Madagascar 
Grade A.  

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Therefore, the decision has been made to differentiate 
between Indonesia and non-Indonesia Grade A samples in 
Stage 2 – this was employed in method D. 

3.4 Method D 
Tables 8-10 show the best performing classification 

models in terms of validation results at each stage of Method 
D. Validation in stage 1 achieved accuracy ranging from 75% 
to 95%. Following this, the KNN, RUS Boosted Trees, and 
Neural Network models produced satisfactory results in stage 

Table 6. Best performing classification models in method B, stage 3 (IGA vs MGA) 

Validation 

Classification Model 
Stage 3 

Accuracy 
IGA MGA 

Fine Gaussian SVM 3/5 2/5 50% 

Subspace KNN 4/5 4/5 80% 

Trilayer Neural Network 3/5 3/5 60% 

 

Table 7. Best performing classification models in method C 

Validation  

Classification Model 
Stage 2 

MGA Non-MGA IGA Non-IGA 

Cubic KNN 0/5 10/10 4/5 6/10 

RUS Boosted Trees 1/5 10/10 3/5 6/10 

Medium Neural Network 1/5 5/10 4/5 5/10 

 

Table 8. Best performing classification models in method D, stage 1 (MGB vs Non-MGB) 

Validation 

Classification Model 
Stage 1 

Accuracy 
MGB Non-MGB 

Linear Discriminant 5/5 12/15 85% 

Weighted KNN 4/5 13/15 85% 

Bagged Trees 5/5 14/15 95% 

Medium Neural Network 4/5 12/15 80% 

Wide Neural Network 4/5 11/15 75% 

Bilayer Neural Network 
4/5 11/15 75% 

Trilayer Neural Network 
5/5 11/15 80% 

SVM Kernel 
5/5 11/15 80% 

Logistic Regression Kernel 5/5 11/15 80% 

 

 

 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

18 

 

2. However, stage 3 yielded notably less favorable results, 
with these models encountering challenges in differentiating 
between Indonesia Grade B and Madagascar Grade A. In this 
context, only one model achieved a validation accuracy of 
60%. Conversely, the training dataset showcased strong 
performance across various classification models.  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In conclusion, the most effective models stem from the 
Neural Network category, achieving a classification accuracy 
of 100% for the training dataset. Moreover, the Medium 
Neural Network achieved an 80% validation accuracy in Stage 
1 and a 60% validation accuracy in Stage 2, while the Wide 
Neural Network attained a 75% validation accuracy in Stage 
1 and a 53.3% validation accuracy in Stage 2. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 9. Best performing classification models in method D, stage 2 (IGA vs Non-IGA) 

Validation 

Classification Model 
Stage 2 

Accuracy 
IGA Non-IGA 

Cubic KNN 4/5 6/10 60% 

RUS Boosted Trees 3/5 6/10 60% 

Medium Neural Network 4/5 5/10 60% 

Wide Neural Network 3/5 5/10 53.33% 

 

Table 10. Best performing classification models in method D, stage 3 (IGB vs MGA) 

Validation 

Classification Model 
Stage 3 

Accuracy 
IGB MGA 

RUS Boosted Trees 1/5 5/5 60% 

 

Table 11. Best performing classification models in method E – training accuracy 

Classification Model 
Training 

Training Accuracy 
Indonesia Madagascar 

Cubic SVM 28/28 40/40 100% 

Medium Gaussian SVM 28/28 40/40 100% 

Coarse Gaussian SVM 28/28 40/40 100% 

Fine KNN 28/28 40/40 100% 

Weighted KNN 28/28 40/40 100% 

Bagged Trees 28/28 40/40 100% 

Subspace KNN 28/28 40/40 100% 

RUS Boosted Trees 28/28 40/40 100% 

Narrow Neural Network 28/28 40/40 100% 

Medium Neural Network 28/28 40/40 100% 

Wide Neural Network 28/28 40/40 100% 

Bilayer Neural Network 28/28 40/40 100% 

Trilayer Neural Network 28/28 40/40 100% 

SVM Kernel 28/28 40/40 100% 

Logistic Regression Kernel 28/28 40/40 100% 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

19 

 

3.5 Method E 
In this section, samples are segregated based on their 

respective countries, regardless of their grades. It is evident 
that several classification models exhibited exceptional 
performance on the training dataset, achieving an accuracy of 
100% as shown in Table 11. However, Table 12 shows that 
only two models, Cosine KNN and Weighted KNN achieved 
satisfactory validation accuracy of 80%. By summarising the 
results from Table 11 and 12, Weighted KNN emerged as the 
most effective model in distinguishing samples based on their 
countries, displaying a training dataset accuracy of 100% and 
a validation accuracy of 80%. 

3.6 Method F 
In this stage, both the training and validation datasets 

underwent a transition from transient response to time-
frequency analysis. Specifically, data from the TGS2602 
sensor is selected for this analytical process. The sample rate 
is fixed at 1 Hz, considering that the entire sampling process 
lasts approximately 130 seconds with a 1-second interval. 
The "bump" wavelet is opted for this analysis. Subsequently, 
a magnitude scalogram is generated as shown in Figure 8, 
aiding in the precise identification of data at designated 
timestamps. In this scenario, the data are isolated at 20, 60, 
90, and 100-second intervals to extract the RGB frequencies. 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The data extracted from the magnitude scalogram was used 
to train and validate classification models. Table 13 presents 
the training accuracy, whereas Table 14 presents the 
validation accuracy. Noteworthy is the attainment of 100% 
accuracy by several classification models, while five models 
achieve validation accuracy ranging between 65% and 70%. 

3.7 Comparison between Method E and F 
Tables 12 and 14 were used to compare the validation 

accuracy between methods E and F using their best-
performing classification models. It is apparent that method 
E surpassed the performance of method F, attaining a 
superior validation accuracy of 80% in contrast to the latter's 
maximum accuracy of 70%. However, there is a noticeable 
discrepancy in data distribution between methods E and F. 
For instance, in method E, the Linear SVM model correctly 
identified only 1 out of 10 samples from Indonesia and 9 out 
of 10 from Madagascar.  

Conversely, when utilizing the wavelet time-frequency 
analyzer (method F), 6 out of 10 samples from Indonesia and 
4 out of 10 samples from Madagascar were predicted 
correctly at validation stage. This observation suggested that 
employing different signal processing methods resulted in 
classification of samples from different perspectives. 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Table 12. Best performing classification models in method E – validation accuracy 

Classification Model 
Validation 

Validation Accuracy 
Indonesia Madagascar 

Cosine KNN 7/10 9/10 80% 

Weighted KNN 7/10 9/10 80% 

 

 

 

Figure 8. Magnitude scalogram 

 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

20 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

4. Conclusion 

Based on the aforementioned discoveries, it is apparent 
that Method A, which employs single-stage multi-class 
machine learning to differentiate between grades and 
countries, achieves a training dataset accuracy of 100% and a 
validation dataset accuracy of 60%. Meanwhile, Method B, 
utilizing multi-stage two-class machine learning, 
demonstrates a training dataset accuracy of 100%, with 
validation accuracies of 95%, 73.33%, and 80% for Stages 1, 
2, and 3, respectively. Furthermore, Method D, which also 
employs multi-stage two-class machine learning but focuses 
on Indonesia Grade A as Stage 2, indicates that the Medium 
Neural Network yields the optimal classification model, 
achieving validation accuracies of 80% and 60% for Stages 1 
and 2, respectively, albeit Stage 3 yielding unsatisfactory 
results. Additionally, Method E, similar to Method A but aimed  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

at distinguishing samples between countries, yields 
satisfactory outcomes, particularly with the Weighted KNN 
model achieving 100% for training and 80% for validation. 
Lastly, Method F, utilizing the wavelet time-frequency 
analyzer, demonstrates a training accuracy of 100% and a 
validation accuracy of 70% for the bilayer neural network. In 
summary, it is evident that Method E produces the most 
favorable results for the samples. 

Ethical issue 
The authors are aware of and comply with best practices in 
publication ethics, specifically with regard to authorship 
(avoidance of guest authorship), dual submission, 
manipulation of figures, competing interests, and compliance 
with policies on research ethics. The authors adhere to 

Table 13. Best performing classification models in method F – training accuracy 

Classification Model 
Training 

Training Accuracy 
Indonesia Madagascar 

Cubic SVM 20/20 20/20 100% 

Coarse Gaussian SVM 20/20 20/20 100% 

Fine KNN 20/20 20/20 100% 

Weighted KNN 20/20 20/20 100% 

Bagged Trees 20/20 20/20 100% 

Subspace KNN 20/20 20/20 100% 

Narrow Neural Network 20/20 20/20 100% 

Medium Neural Network 20/20 20/20 100% 

Wide Neural Network 20/20 20/20 100% 

Bilayer Neural Network 20/20 20/20 100% 

Trilayer Neural Network 20/20 20/20 100% 

SVM Kernel 20/20 20/20 100% 

Logistic Regression Kernel 20/20 20/20 100% 

 

Table 14. Best performing classification models in method F – validation accuracy 

Classification Model 
Validation 

Validation Accuracy 
Indonesia Madagascar 

Wide Neural Network 7/10 6/10 65% 

Bilayer Neural Network 7/10 7/10 70% 

Trilayer Neural Network 6/10 7/10 65% 

SVM Kernel 6/10 7/10 65% 

Logistic Regression Kernel 6/10 7/10 65% 

 

 

 

 



SCMX Wee et al. /Future Technology                                                                                   November 2024| Volume 03 | Issue 04 | Pages 12-21 

21 

 

publication requirements that the submitted work is original 
and has not been published elsewhere. 

Data availability statement 
The datasets analyzed during the current study are available 
and can be given upon reasonable request from the 
corresponding author. 

Conflict of interest 

The authors declare no potential conflict of interest. 

References 

[1] Quick Facts: Vanilla Beans [Online] Available: 

https://podillas.com/?p=250 

[2] R. T. des Oliveira, J. P. da Silva Oliveira, and A. F. 

Macedo, "Vanilla beyond Vanilla planifolia and Vanilla 

x tahitensis: Taxonomy and Historical Notes, 

Reproductive Biology, and Metabolites," Plants (Basel), 

vol. 11, no. 23, Nov 30 2022, doi: 

10.3390/plants11233311. 

[3] J. P. da Silva Oliveira, R. Garrett, M. G. Bello Koblitz, and 

A. Furtado Macedo, "Vanilla flavor: Species from the 

Atlantic forest as natural alternatives," Food Chem, vol. 

375, p. 131891, May 1 2022, doi: 

10.1016/j.foodchem.2021.131891. 

[4] M. M. Bombgardner. The problem with vanilla [Online] 

Available: 

https://cen.acs.org/articles/94/i36/problem-

vanilla.html 

[5] C. M. Moreno-Ley, D. M. Hernandez-Martinez, G. 

Osorio-Revilla, A. P. Tapia-Ochoategui, G. Davila-Ortiz, 

and T. Gallardo-Velazquez, "Prediction of coumarin 

and ethyl vanillin in pure vanilla extracts using MID-

FTIR spectroscopy and chemometrics," Talanta, vol. 

197, pp. 264-269, May 15 2019, doi: 

10.1016/j.talanta.2019.01.033. 

[6] Continuous and Discrete Wavelet Analysis of 

Frequency Break [Online] Available: 

https://www.mathworks.com/help/wavelet/ug/conti

nuous-and-discrete-wavelet-analysis.html 

[7] H. E. Lee, Z. J. A. Mercer, S. M. Ng, M. Shafiei, and H. S. 

Chua, "Geo-tracing of black pepper using metal oxide 

semiconductor (MOS) gas sensors array," IEEE Sensors 

Journal, vol. 20, no. 14, pp. 8039-8045, 2020, doi: 

10.1109/JSEN.2020.2981602.  

[8] H. E. Lee, H. S. Chua, Z. J. A. Mercer, S. M. Ng, and M. 

Shafiei, "Fraud detection of black pepper using metal 

oxide semiconductor gas sensors," in 2021 IEEE 

Sensors, 31 Oct.-3 Nov. 2021, pp. 1-4, doi: 

10.1109/SENSORS47087.2021.9639658.  

[9] H. E. Lee, Z. J. A. Mercer, S. M. Ng, M. Shafiei, and H. S. 

Chua, "Metal Oxide Semiconductor Gas Sensors-based 

E-nose and Two-stage Classification: Authentication of 

Malaysia and Vietnam Black Pepper Samples," in 2022 

IEEE International Symposium on Olfaction and 

Electronic Nose (ISOEN), 29 May-1 June 2022, pp. 1-4, 

doi: 10.1109/ISOEN54820.2022.9789618. 

[10] H. E. Lee, "Geo-tracing of Black Pepper using Metal 

Oxide Semiconductor Gas Sensors," PhD, Faculty of 

Engineering, Computing and Science, Swinburne 

University of Technology, Sarawak, Malaysia, 2022. 

[Online]. Available: 

http://hdl.handle.net/1959.3/468270 

 

 
This article is an open-access article distributed under the 

terms and conditions of the Creative Commons Attribution 

(CC BY) license 

(https://creativecommons.org/licenses/by/4.0/). 

https://creativecommons.org/licenses/by/4.0/

