Siamese networks for few-shot coffee bean defect detection

Defective coffee beans compromise flavor profiles and product quality, necessitating the real-time identification of defects throughout the supply chain. While convolutional neural networks have advanced agricultural image recognition, they remain limited in few-shot classification of fine-grained defects due to dependence on large annotated datasets. This study presents a Siamese neural network approach for few-shot coffee bean defect detection through similarity-based learning. The architecture employs dual ResNet18-based branches (adapted for single-channel 224×224 input, outputting 512-dimensional features) with shared weights, utilizing Euclidean distance for feature matching. A dataset of 3,220 images encompassing sound beans and six defect categories was constructed from samples in Yunnan Province. The model achieved 94.95% accuracy, substantially outperforming traditional CNN (74.35%) and support vector machine (64.28%) approaches. The processing speed of 34 milliseconds per image enables real-time industrial deployment. This approach demonstrates robust generalization under limited sample conditions, offering practical value for resource-constrained production environments in coffee supply chains while reducing reliance on extensive labelled datasets. • Developed a Siamese neural network for efficient coffee bean defect detection. • Achieved over 92% accuracy and F1-score on a custom coffee bean dataset. • Introduced L1 norm feature matching for detecting subtle defect variations. • Outperformed traditional CNN and SVM models in defect classification tasks. • Demonstrated robust generalization under few-shot learning conditions.

Authors

Institutions

Publication Details

Journal
LWT
Published
2025-10-17
DOI
https://doi.org/10.1016/j.lwt.2025.118631
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Siamese networks for few-shot coffee bean defect detection

Xiao Hu, Sunyan Hong, Xinyu Guo, Jun He et al.
LWT
Smart Agriculture and AI
article

Siamese networks for few-shot coffee bean defect detection

Xiao Hu, Sunyan Hong, Xinyu Guo, Jun He, Jing Yu
article en

Abstract

Defective coffee beans compromise flavor profiles and product quality, necessitating the real-time identification of defects throughout the supply chain. While convolutional neural networks have advanced agricultural image recognition, they remain limited in few-shot classification of fine-grained defects due to dependence on large annotated datasets. This study presents a Siamese neural network approach for few-shot coffee bean defect detection through similarity-based learning. The architecture employs dual ResNet18-based branches (adapted for single-channel 224×224 input, outputting 512-dimensional features) with shared weights, utilizing Euclidean distance for feature matching. A dataset of 3,220 images encompassing sound beans and six defect categories was constructed from samples in Yunnan Province. The model achieved 94.95% accuracy, substantially outperforming traditional CNN (74.35%) and support vector machine (64.28%) approaches. The processing speed of 34 milliseconds per image enables real-time industrial deployment. This approach demonstrates robust generalization under limited sample conditions, offering practical value for resource-constrained production environments in coffee supply chains while reducing reliance on extensive labelled datasets. • Developed a Siamese neural network for efficient coffee bean defect detection. • Achieved over 92% accuracy and F1-score on a custom coffee bean dataset. • Introduced L1 norm feature matching for detecting subtle defect variations. • Outperformed traditional CNN and SVM models in defect classification tasks. • Demonstrated robust generalization under few-shot learning conditions.

LWTVol. 235
Kunming University (CN), Yunnan University (CN)
Openalex Percentile: Top 78%
Smart Agriculture and AI
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.

Siamese networks for few-shot coffee bean defect detection — Xiao Hu, Sunyan Hong, et al. · LWT (2025) | TGRS Research Map | TGRS