Pesticide residue detection on pakchoi using a one-dimensional convolutional neural network enhanced by data augmentation and spectral attention

Rapid and non-destructive detection of pesticide residues on vegetable surfaces is crucial for ensuring food safety. This study proposes a one-dimensional convolutional neural network (1D-CNN) model based on visible-near infrared (Vis/NIR) spectroscopy for pesticide residue detection on pakchoi. Traditional machine learning models (partial least squares discriminant analysis, K-nearest neighbor, and support vector machine) were constructed for comparison. To enhance the 1D-CNN's performance, we introduced the spectral attention module (SAM) to strengthen its learning of key features, and employed a Wasserstein generative adversarial network integrated with a variational autoencoder (VAE-WGAN) for data augmentation to improve generalization and robustness. Results show that the baseline 1D-CNN outperformed traditional machine learning models without complex feature engineering. Furthermore, the 1D-SACNN, which integrates a baseline 1D-CNN and a SAM, achieved the best performance on the pakchoi dataset after data augmentation, with an accuracy of 97.92 ± 0.95%, recall of 97.92 ± 0.95%, precision of 98.07 ± 0.86%, and F1-score of 97.93 ± 0.96%. The findings demonstrate the potential of the data-augmented and attention-optimized 1D-SACNN model for detecting pesticide residues on pakchoi surfaces, providing a valuable, convenient, and efficient technical reference solution for food safety monitoring. • First application of Vis/NIR combined with DL for detecting pesticide residues in pakchoi • Compare the performance of 1D-SACNN with that of traditional machine learning • Adding the Spectral Attention Module enhances the feature extraction capability of 1D-CNN • Data augmented by VAE-WGAN enhances model generalization and robustness

Authors

Institutions

Publication Details

Journal
Journal of Food Composition and Analysis
Published
2026-04-21
DOI
https://doi.org/10.1016/j.jfca.2026.109182
Primary Topic
Spectroscopy and Chemometric Analyses
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Pesticide residue detection on pakchoi using a one-dimensional convolutional neural network enhanced by data augmentation and spectral attention

J Zhang, Wendou Wu, Rui Hu, Xiaoyi Bai et al.
Journal of Food Composition and Analysis
Spectroscopy and Chemometric Analyses
article

Pesticide residue detection on pakchoi using a one-dimensional convolutional neural network enhanced by data augmentation and spectral attention

J Zhang, Wendou Wu, Rui Hu, Xiaoyi Bai, Bing Zhou
article en

Abstract

Rapid and non-destructive detection of pesticide residues on vegetable surfaces is crucial for ensuring food safety. This study proposes a one-dimensional convolutional neural network (1D-CNN) model based on visible-near infrared (Vis/NIR) spectroscopy for pesticide residue detection on pakchoi. Traditional machine learning models (partial least squares discriminant analysis, K-nearest neighbor, and support vector machine) were constructed for comparison. To enhance the 1D-CNN's performance, we introduced the spectral attention module (SAM) to strengthen its learning of key features, and employed a Wasserstein generative adversarial network integrated with a variational autoencoder (VAE-WGAN) for data augmentation to improve generalization and robustness. Results show that the baseline 1D-CNN outperformed traditional machine learning models without complex feature engineering. Furthermore, the 1D-SACNN, which integrates a baseline 1D-CNN and a SAM, achieved the best performance on the pakchoi dataset after data augmentation, with an accuracy of 97.92 ± 0.95%, recall of 97.92 ± 0.95%, precision of 98.07 ± 0.86%, and F1-score of 97.93 ± 0.96%. The findings demonstrate the potential of the data-augmented and attention-optimized 1D-SACNN model for detecting pesticide residues on pakchoi surfaces, providing a valuable, convenient, and efficient technical reference solution for food safety monitoring. • First application of Vis/NIR combined with DL for detecting pesticide residues in pakchoi • Compare the performance of 1D-SACNN with that of traditional machine learning • Adding the Spectral Attention Module enhances the feature extraction capability of 1D-CNN • Data augmented by VAE-WGAN enhances model generalization and robustness

Journal of Food Composition and AnalysisVol. 154
Yunnan Agricultural University (CN)
Major Science and Technology Projects in Yunnan Province
Openalex Percentile: Top 8%
Spectroscopy and Chemometric Analyses
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.