Beverage Stain Classification Using Hyperspectral Imaging with an L-BFGS-B-Optimized Autoencoder and a Channel-Attention 1D CNN
Abstract
1. Introduction
2. Related Work
3. Methodology
3.1. Hyperspectral Setup
3.2. Dataset Description
3.3. Reflectance Calibration
3.4. Data Preprocessing
3.5. Model Development
3.5.1. Latent Dimension Selection
- A total of 32 dimensions—provides strong compression, capturing coarse but robust spectral structure.
- A total of 64 dimensions—achieves a balanced trade-off between compression and discriminative fidelity.
- A total of 128 dimensions—retains the richest spectral detail and achieves the highest standalone accuracy.
3.5.2. Feature Compression via AE
3.5.3. CA Framework
3.5.4. Ensemble Learning Framework
3.6. Computational Environment
4. Results and Discussion
4.1. Temporal Spectral Analysis
4.2. Empirical Study on Latent Dimension
4.3. Performance of Individual AE-CA Models
4.4. Performance of the Ensemble Classifier
4.5. Ablation Study
4.6. Training and Validation Analysis
4.7. Training and Inference Time Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A






References
- Cui, R.; Yu, H.; Xu, T.; Xing, X.; Cao, X.; Yan, K.; Chen, J. Deep Learning in Medical Hyperspectral Images: A Review. Sensors 2022, 22, 9790. [Google Scholar] [CrossRef]
- Xu, Y.; Du, B.; Zhang, L. Robust Self-Ensembling Network for Hyperspectral Image Classification. IEEE Trans. Neural Networks Learn. Syst. 2024, 35, 3780–3793. [Google Scholar] [CrossRef]
- Yang, C.; Guo, Z.; Fernandes Barbin, D.; Dai, Z.; Watson, N.; Povey, M.; Zou, X. Hyperspectral Imaging and Deep Learning for Quality and Safety Inspection of Fruits and Vegetables: A Review. J. Agric. Food Chem. 2025, 73, 10019–10035. [Google Scholar] [CrossRef] [PubMed]
- Wang, K.; Yong, B.; Gu, X.; Xiao, P.; Zhang, X. Spectral Similarity Measure Using Frequency Spectrum for Hyperspectral Image Classification. IEEE Geosci. Remote Sens. Lett. 2015, 12, 130–134. [Google Scholar] [CrossRef]
- Pallocci, M.; Treglia, M.; Passalacqua, P.; Luca, L.D.; Zanovello, C.; Mazzuca, D.; Guarna, F.; Gratteri, S.; Marsella, L.T. Forensic applications of hyperspectral imaging technique: A narrative review. Med.-Leg. J. 2022, 90, 216–220. [Google Scholar] [CrossRef] [PubMed]
- Sharma, S.; Chophi, R.; Jossan, J.K.; Singh, R. Detection of bloodstains using attenuated total reflectance-Fourier transform infrared spectroscopy supported with PCA and PCA–LDA. Med. Sci. Law 2021, 61, 292–301. [Google Scholar] [CrossRef] [PubMed]
- Mistek-Morabito, E.; Lednev, I. Discrimination between human and animal blood by attenuated total reflection Fourier transform-infrared spectroscopy. Commun. Chem. 2020, 3, 178. [Google Scholar] [CrossRef]
- Bioucas-Dias, J.M.; Plaza, A.; Camps-Valls, G.; Scheunders, P.; Nasrabadi, N.M.; Chanussot, J. Hyperspectral remote sensing data analysis and future challenges. IEEE Geosci. Remote Sens. Mag. 2013, 1, 6–36. [Google Scholar] [CrossRef]
- Ghamisi, P.; Yokoya, N.; Li, J.; Liao, W.; Liu, S.; Plaza, J.; Rasti, B.; Plaza, A. Advances in Hyperspectral Image and Signal Processing: A Comprehensive Overview of the State of the Art. IEEE Geosci. Remote Sens. Mag. 2017, 5, 37–78. [Google Scholar] [CrossRef]
- Jaiswal, G.; Sharma, A.; Kumar Yadav, S. DFD-SS: Document Forgery Detection using Spectral – Spatial Features for Hyperspectral Images. J. Vis. Commun. Image Represent. 2022, 89, 103690. [Google Scholar] [CrossRef]
- Plaza, A.; Benediktsson, J.A.; Boardman, J.W.; Brazile, J.; Bruzzone, L.; Camps-Valls, G.; Chanussot, J.; Fauvel, M.; Gamba, P.; Gualtieri, A.; et al. Recent advances in techniques for hyperspectral image processing. Remote Sens. Environ. 2009, 113, S110–S122. [Google Scholar] [CrossRef]
- Zhong, Z.; Li, J.; Luo, Z.; Chapman, M. Spectral–spatial residual network for hyperspectral image classification: A 3-D deep learning framework. IEEE Trans. Geosci. Remote Sens. 2018, 56, 847–858. [Google Scholar] [CrossRef]
- Roy, S.K.; Krishna, G.; Dubey, S.R.; Chaudhuri, B.B. HybridSN: Exploring 3-D–2-D CNN Feature Hierarchy for Hyperspectral Image Classification. IEEE Geosci. Remote Sens. Lett. 2020, 17, 277–281. [Google Scholar] [CrossRef]
- Li, Y.; Zhang, H.; Shen, Q. Spectral–Spatial Classification of Hyperspectral Imagery with 3D Convolutional Neural Network. Remote Sens. 2017, 9, 67. [Google Scholar] [CrossRef]
- Chen, Y.; Lin, Z.; Zhao, X.; Wang, G.; Gu, Y. Deep Learning-Based Classification of Hyperspectral Data. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2014, 7, 2094–2107. [Google Scholar] [CrossRef]
- Zhu, M.; Jiao, L.; Liu, F.; Yang, S.; Wang, J. Residual Spectral–Spatial Attention Network for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2021, 59, 449–462. [Google Scholar] [CrossRef]
- Huang, W.; Zhao, Z.; Sun, L.; Ju, M. Dual-Branch Attention-Assisted CNN for Hyperspectral Image Classification. Remote Sens. 2022, 14, 6158. [Google Scholar] [CrossRef]
- Xu, L.; Lu, C.; Zhou, T.; Wu, J.; Feng, H. A 3D-2DCNN-CA approach for enhanced classification of hickory tree species using UAV-based hyperspectral imaging. Microchem. J. 2024, 199, 109981. [Google Scholar] [CrossRef]
- Tuia, D.; Persello, C.; Bruzzone, L. Domain Adaptation for the Classification of Remote Sensing Data: An Overview of Recent Advances. IEEE Geosci. Remote Sens. Mag. 2016, 4, 41–57. [Google Scholar] [CrossRef]
- Liu, B.; Zuo, X.; Yu, A.; Sun, Y.; Wang, R. Semi-supervised classification of hyperspectral images based on multi-view consistency. Remote Sens. Lett. 2023, 14, 479–490. [Google Scholar] [CrossRef]
- Wang, Y.; Yao, Q.; Kwok, J.T.; Ni, L.M. Generalizing from a Few Examples: A Survey on Few-shot Learning. ACM Comput. Surv. 2020, 53, 63. [Google Scholar] [CrossRef]
- Keshava, N.; Mustard, J. Spectral unmixing. IEEE Signal Process. Mag. 2002, 19, 44–57. [Google Scholar] [CrossRef]
- Bioucas-Dias, J.M.; Plaza, A.; Dobigeon, N.; Parente, M.; Du, Q.; Gader, P.; Chanussot, J. Hyperspectral Unmixing Overview: Geometrical, Statistical, and Sparse Regression-Based Approaches. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2012, 5, 354–379. [Google Scholar] [CrossRef]
- Zhang, H.; He, W.; Zhang, L.; Shen, H.; Yuan, Q. Hyperspectral Image Restoration Using Low-Rank Matrix Recovery. IEEE Trans. Geosci. Remote Sens. 2014, 52, 4729–4743. [Google Scholar] [CrossRef]
- He, W.; Zhang, H.; Zhang, L.; Shen, H. Total-Variation-Regularized Low-Rank Matrix Factorization for Hyperspectral Image Restoration. IEEE Trans. Geosci. Remote Sens. 2016, 54, 178–188. [Google Scholar] [CrossRef]
- Fan, A.; Xu, T.; Li, J.; Teng, G.; Wang, X.; Zhang, Y.; Xu, C. Compressive full-Stokes polarization and flexible hyperspectral imaging with efficient reconstruction. Opt. Lasers Eng. 2023, 160, 107256. [Google Scholar] [CrossRef]
- Fan, A.; Xu, T.; Teng, G.; Wang, X.; Zhang, Y.; Pan, C. Hyperspectral polarization-compressed imaging and reconstruction with sparse basis optimized by particle swarm optimization. Chemom. Intell. Lab. Syst. 2020, 206, 104163. [Google Scholar] [CrossRef]
- Devassy, B.M.; George, S. Forensic analysis of beverage stains using hyperspectral imaging. Sci. Rep. 2021, 11, 6512. [Google Scholar] [CrossRef]














| Latent Dimension | Test Accuracy (%) |
|---|---|
| 32 | 96.54 |
| 64 | 97.19 |
| 128 | 97.86 |
| Method | Technique | Accuracy (%) |
|---|---|---|
| Devassy and George (2021) [28] | CAE + SVM | 94.40 |
| Proposed Method | AE-CA Ensemble | 98.28 |
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Papaya | 0.9905 | 0.9905 | 0.9905 |
| Coffee | 0.9688 | 0.9773 | 0.9732 |
| Pomegranate | 0.9959 | 0.9926 | 0.9943 |
| Orange | 0.9803 | 0.9878 | 0.9841 |
| Tea | 0.9869 | 0.9722 | 0.9795 |
| Wine | 0.9914 | 0.9941 | 0.9928 |
| Whisky | 0.9725 | 0.9783 | 0.9754 |
| Rum | 0.9605 | 0.9726 | 0.9665 |
| Brandy | 0.9841 | 0.9646 | 0.9742 |
| Model Variant | CA | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
|---|---|---|---|---|---|
| AE32–CNN (without CA) | No | 95.43 | 95.51 | 95.38 | 95.44 |
| AE32–CA | Yes | 96.54 | 96.61 | 96.49 | 96.55 |
| AE64–CNN (without CA) | No | 96.21 | 96.28 | 96.15 | 96.21 |
| AE64–CA | Yes | 97.19 | 97.23 | 97.14 | 97.18 |
| AE128–CNN (without CA) | No | 96.98 | 97.04 | 96.91 | 96.97 |
| AE128–CA | Yes | 97.86 | 97.90 | 97.82 | 97.86 |
| Ensemble Configuration | CA | Fusion | Accuracy (%) | Precision (%) | Recall (%) |
|---|---|---|---|---|---|
| AE-CNN Ensemble (without CA) | No | Equal- weight | 96.78 | 96.83 | 96.72 |
| AE-CA Ensemble | Yes | Equal- weight | 97.92 | 97.96 | 97.88 |
| AE-CNN Ensemble (without CA) | No | L-BFGS-B | 97.21 | 97.26 | 97.17 |
| AE-CA Ensemble (Proposed) | Yes | L-BFGS-B | 98.28 | 98.31 | 98.24 |
| Model | AE Train (s) | Encoder Infer (s) | Classifier Train (s) | Classifier Test (s) | Test (ms/Sample) |
|---|---|---|---|---|---|
| AE32–CA | 332.58 | 3.88 | 1095.74 | 2.31 | 0.099 |
| AE64–CA | 359.58 | 4.80 | 1029.85 | 2.17 | 0.092 |
| AE128-CA | 366.47 | 3.89 | 715.23 | 2.37 | 0.101 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Shit, J.; Dar, M.A.; V M, M.; Roy, P.P. Beverage Stain Classification Using Hyperspectral Imaging with an L-BFGS-B-Optimized Autoencoder and a Channel-Attention 1D CNN. Informatics 2026, 13, 68. https://doi.org/10.3390/informatics13050068
Shit J, Dar MA, V M M, Roy PP. Beverage Stain Classification Using Hyperspectral Imaging with an L-BFGS-B-Optimized Autoencoder and a Channel-Attention 1D CNN. Informatics. 2026; 13(5):68. https://doi.org/10.3390/informatics13050068
Chicago/Turabian StyleShit, Jitendra, Muzaffar Ahmad Dar, Manikandan V M, and Partha Pratim Roy. 2026. "Beverage Stain Classification Using Hyperspectral Imaging with an L-BFGS-B-Optimized Autoencoder and a Channel-Attention 1D CNN" Informatics 13, no. 5: 68. https://doi.org/10.3390/informatics13050068
APA StyleShit, J., Dar, M. A., V M, M., & Roy, P. P. (2026). Beverage Stain Classification Using Hyperspectral Imaging with an L-BFGS-B-Optimized Autoencoder and a Channel-Attention 1D CNN. Informatics, 13(5), 68. https://doi.org/10.3390/informatics13050068

