<p>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.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

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

  • Pauline Ong,
  • Chee Kiong Sia,
  • Cheng Kit Cheong

摘要

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.