Attention Guided Convolutional Neural Networks for Accurate Egg Defect Detection in Food Quality Assessment

Egg defect detection is essential for ensuring food safety and quality in the egg production industry. This study introduces a novel approach for egg defect detection by integrating a multi-head self-attention (MHSA) mechanism into the AlexNet convolutional neural network (CNN) to overcome the limitations of traditional CNNs in capturing long-range dependencies and global context. A machine vision system equipped with a constant-speed rotating mechanism was developed to capture multi-view images of each egg’s surface. Each egg was imaged from six angles, generating a dataset of 2400 images categorized into four classes: bloodstained, cracked, dirty, and intact. The collected images were pre-processed through segmentation and cropping before being fed into the MHSA-AlexNet architecture. The extracted feature maps were flattened and passed through an MHSA layer with eight attention heads, followed by a fully connected layer and Softmax classifier. The proposed MHSA-AlexNet model achieved an average accuracy of 0.9847, outperforming the baseline AlexNet and surpassing other state-of-the-art CNNs. The model also surpassed conventional machine learning models, including Naïve Bayes, Random Forest, and Support Vector Machine, by 36.35–66.81%. Comparison with prior studies demonstrated that MHSA-AlexNet achieved superior accuracy, emphasizing the effectiveness of integrating self-attention mechanisms for egg defect detection.

Authors

Institutions

Publication Details

Journal
Food and Bioprocess Technology
Published
2026-03-04
DOI
https://doi.org/10.1007/s11947-026-04282-5
Primary Topic
Spectroscopy and Chemometric Analyses
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Attention Guided Convolutional Neural Networks for Accurate Egg Defect Detection in Food Quality Assessment

Sia Chee Kiong, Pauline Ong, Cheng Kit Cheong
Food and Bioprocess Technology
Spectroscopy and Chemometric Analyses
article

Attention Guided Convolutional Neural Networks for Accurate Egg Defect Detection in Food Quality Assessment

Sia Chee Kiong, Pauline Ong, Cheng Kit Cheong
article en

Abstract

Egg defect detection is essential for ensuring food safety and quality in the egg production industry. This study introduces a novel approach for egg defect detection by integrating a multi-head self-attention (MHSA) mechanism into the AlexNet convolutional neural network (CNN) to overcome the limitations of traditional CNNs in capturing long-range dependencies and global context. A machine vision system equipped with a constant-speed rotating mechanism was developed to capture multi-view images of each egg’s surface. Each egg was imaged from six angles, generating a dataset of 2400 images categorized into four classes: bloodstained, cracked, dirty, and intact. The collected images were pre-processed through segmentation and cropping before being fed into the MHSA-AlexNet architecture. The extracted feature maps were flattened and passed through an MHSA layer with eight attention heads, followed by a fully connected layer and Softmax classifier. The proposed MHSA-AlexNet model achieved an average accuracy of 0.9847, outperforming the baseline AlexNet and surpassing other state-of-the-art CNNs. The model also surpassed conventional machine learning models, including Naïve Bayes, Random Forest, and Support Vector Machine, by 36.35–66.81%. Comparison with prior studies demonstrated that MHSA-AlexNet achieved superior accuracy, emphasizing the effectiveness of integrating self-attention mechanisms for egg defect detection.

Food and Bioprocess TechnologyVol. 19(4)
Tun Hussein Onn University of Malaysia (MY)
Zero hunger
Openalex Percentile: Top 34%
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.