Identify five alcohol vapours from a compact QCM sensor signature
This electronic-nose example classifies a sample as 1-isobutanol, 1-octanol, 1-propanol, 2-butanol or 2-propanol from five frequency-shift measurements. It shows how a compact softmax model can turn a quartz-crystal microbalance response into an interpretable laboratory decision.
Electronic noses can support rapid screening when conventional analytical methods are too slow or costly for every measurement. In this controlled benchmark, the model compares the response pattern across five gas-mixture levels and selects one of five known alcohols. The result is useful as a compact pattern-recognition demonstration, but it is not evidence of field performance on unknown vapours or changing environmental conditions.
1. Industrial challenge
This is a multiclass classification problem. Five QCM frequency shifts describe one sample, and the network returns a mutually exclusive probability distribution over five alcohol identities.
Potential users include sensor R&D teams, analytical laboratories, chemical-process engineers, quality-control groups and industrial monitoring specialists.
2. Data set
The source Alcohol QCM Sensor Dataset contains five files for five QCM sensor configurations. This example uses the QCM12 subset and retains one frequency-shift column at each of five mixture ratios. The updated semicolon-delimited CSV contains 25 observations, five numerical inputs and the categorical target class, with no missing values.
| CSV variable | Measurement | Air / gas ratio | Unit | Observed range |
|---|---|---|---|---|
frequency_1 | Frequency shift at mixture 1 | 0.799 / 0.201 | Hz | -86.34 to -9.40 |
frequency_2 | Frequency shift at mixture 2 | 0.700 / 0.300 | Hz | -129.71 to -21.44 |
frequency_3 | Frequency shift at mixture 3 | 0.600 / 0.400 | Hz | -183.94 to -34.39 |
frequency_4 | Frequency shift at mixture 4 | 0.501 / 0.499 | Hz | -231.08 to -48.61 |
frequency_5 | Frequency shift at mixture 5 | 0.400 / 0.600 | Hz | -296.68 to -63.62 |
Class balance
| Alcohol class | Samples | Share |
|---|---|---|
| 1-Isobutanol | 5 | 20% |
| 1-Octanol | 5 | 20% |
| 1-Propanol | 5 | 20% |
| 2-Butanol | 5 | 20% |
| 2-Propanol | 5 | 20% |

Configured split
| Subset | Rows | Share | Classes represented |
|---|---|---|---|
| Training | 12 | 48% | 5 of 5 |
| Selection | 3 | 12% | 2 of 5 |
| Testing | 10 | 40% | 5 of 5 |
3. Neural network
The exported model standardizes the five frequency inputs and feeds them directly to five softmax neurons. The probabilities sum to one, and the class with the largest probability becomes the prediction. This compact 5–5 architecture contains 30 trainable parameters.

class. Internally, the exported model evaluates five logits—one per alcohol—and applies a stable softmax to produce the probability distribution.4. Training strategy
The network minimizes multiclass cross-entropy with no regularization using the quasi-Newton method. Training reached the configured loss goal after 19 epochs. The final recorded training loss is approximately 0.0007, while the selection loss is approximately 0.0023.

The low objective values show that this compact model separates the configured rows. Because only three observations are available for selection and three classes are absent from that subset, the selection curve should not be interpreted as evidence of reliable hyperparameter tuning.
5. Validation design and decision rule
No architecture sweep is reported for this project; the 5–5 softmax network is used as a deliberately small baseline. The decision rule is argmax: select the class with the largest output probability.
For a production-oriented study, keep the five-class objective but replace the single random split with repeated stratified validation. A stronger generalization test would reserve complete sensor configurations or measurement sessions, then evaluate probability calibration and an explicit “unknown or low-confidence” rejection rule.
6. Testing analysis
The exported model was recalculated on the ten rows marked as testing in the Neural Designer project. All ten were assigned to the correct class. The majority-class baseline for this particular testing split is 30%.
Confusion matrix
| Actual / predicted | 1-Isobutanol | 1-Octanol | 1-Propanol | 2-Butanol | 2-Propanol | Total |
|---|---|---|---|---|---|---|
| 1-Isobutanol | 2 | 0 | 0 | 0 | 0 | 2 |
| 1-Octanol | 0 | 3 | 0 | 0 | 0 | 3 |
| 1-Propanol | 0 | 0 | 1 | 0 | 0 | 1 |
| 2-Butanol | 0 | 0 | 0 | 1 | 0 | 1 |
| 2-Propanol | 0 | 0 | 0 | 0 | 3 | 3 |
| Total | 2 | 3 | 1 | 1 | 3 | 10 |
Per-class results
| Class | Testing support | Precision | Recall | F1 |
|---|---|---|---|---|
| 1-Isobutanol | 2 | 100% | 100% | 100% |
| 1-Octanol | 3 | 100% | 100% | 100% |
| 1-Propanol | 1 | 100% | 100% | 100% |
| 2-Butanol | 1 | 100% | 100% | 100% |
| 2-Propanol | 3 | 100% | 100% | 100% |
7. Model deployment
A professional e-nose workflow should validate the experiment before classification: stabilize the sensor, control temperature and humidity, confirm a clean baseline, collect the five frequency shifts, evaluate the softmax probabilities and route uncertain samples to confirmatory analysis.
Real testing example: 1-isobutanol
Testing row 22 contains the frequency signature below. The model assigns the largest probability to the recorded 1-isobutanol class.
| Input | Frequency shift |
|---|---|
frequency_1 | -56.14 Hz |
frequency_2 | -90.74 Hz |
frequency_3 | -132.16 Hz |
frequency_4 | -178.79 Hz |
frequency_5 | -239.06 Hz |
| Class | Model probability |
|---|---|
| 1-Isobutanol | 99.99998% |
| 1-Octanol | <0.00001% |
| 1-Propanol | <0.00001% |
| 2-Butanol | <0.00001% |
| 2-Propanol | 0.00002% |
Recommended interpretation: report 1-isobutanol as the model suggestion only if experimental controls and sensor-quality checks pass. A high softmax probability is not proof that an unrepresented vapour is absent.
Try the alcohol classifier
Enter five QCM frequency shifts or load a testing example. The browser uses the scaling, weights and stable softmax from the exported Python model.
Closed-set demonstration — not a certified gas detector, safety alarm or concentration estimator.
Download and reproduce
8. Scope and limitations
- This example uses 25 observations from the QCM12 subset; the full UCI collection contains 125 observations across five QCM sensor configurations.
- The model recognizes only the five alcohols represented during training. It has no “unknown”, mixture or contaminated-sample class.
- The five inputs are measurements at specified mixture ratios; this model is not a concentration estimator.
- The random, non-stratified split does not demonstrate transfer to another sensor, coating, measurement session or laboratory.
- Temperature, humidity, baseline drift, sensor ageing, response and recovery dynamics are not modelled as inputs.
- Individual input ranges do not guarantee that an arbitrary combination of five values is physically represented.
- Production use requires repeated measurements, calibration monitoring, an uncertainty or rejection policy and confirmation against an appropriate analytical method.
- The classifier supports controlled screening; it must not replace certified gas detection, occupational exposure monitoring or safety alarms.
References
- UCI Machine Learning Repository. Alcohol QCM Sensor Dataset, DOI: 10.24432/C5KC7M.
- E. Özmen et al. An electronic nose dataset for identification of five different alcohols, Data in Brief.
- Neural Designer testing analysis: confusion matrices and classification metrics.
- Neural Designer model deployment: output calculation and Python export.




