高级检索+

基于改进一维卷积神经网络的鸡蛋熟度检测

Detection of egg cooking degree based on improved one-dimensional convolutional neural network model

  • 摘要: 针对鸡蛋熟度无损、快速检测的实际需求,该研究基于可见/近红外光谱技术,提出了一种融合双注意力机制的改进一维卷积神经网络模型,用于实现熟蛋、小溏心蛋与大溏心蛋的分类。模型在基础一维卷积神经网络(one-dimensional convolutional neural network,1D-CNN)架构上,引入了卷积注意力模块(convolutional block attention module,CBAM)与通道上下文注意力模块(channel context attention module,CCA)。改进后的模型能够自适应地聚焦于与鸡蛋蛋白质变性及水分状态相关的关键光谱波段,从而有效捕捉不同熟度间的细微光谱差异。试验结果表明,该模型无需光谱预处理,对熟蛋、小溏心蛋及大溏心蛋的识别准确率分别达到98.65%、96.00%与91.89%,整体三分类准确率达95.52%,宏平均F1分数(macro-average F1 score,Macro-F1)为0.94,平均单样本检测时间仅为46.50 ms,浮点运算量仅为3.76 M。而对熟蛋和溏心蛋的二分类准确率可达到99.55%。该模型在鸡蛋熟度检测方面有较高的识别准确率,为实现鸡蛋煮制过程的精准控制与熟度在线分级提供了有效的检测方法,并为便携式光谱检测设备的研发提供了理论基础。

     

    Abstract: Egg cooking degree detection is essential for the standardized grading and industrial processing of egg products. Traditional non-destructive detection methods, including optical perspective, acoustic detection and density testing, rely heavily on manual sensory judgment, featuring cumbersome operation, low efficiency, low accuracy and poor stability, which failed to adapt to large-scale modern industrial production. Meanwhile, the original visible/near-infrared spectral data of eggs contain substantial environmental noise and redundant band information. The conventional one-dimensional convolutional neural network showed weak anti-interference ability for invalid spectral information and could not effectively extract key characteristic bands reflecting protein denaturation and water state changes in cooked eggs, restricting its application in egg cooking degree classification. To solve the above problems, this study developed an improved CC-1D-CNN model by embedding the convolutional block attention module (CBAM) and channel context attention module (CCA) into the basic 1D-CNN structure. Without relying on complex spectral preprocessing, the proposed model directly utilized original egg visible/near-infrared spectra to achieve rapid and accurate multi-class detection of egg cooking degrees, which greatly simplified the detection process. Systematic experiments were performed to validate the model’s feasibility and superiority. Original spectral analysis results indicated that the spectral differences of eggs with three cooking degrees were mainly concentrated in the 700~1 100 nm band, corresponding to the overtone and combination vibration absorption of N-H and O-H chemical bonds. This band effectively reflected the physicochemical changes of internal moisture and protein during egg thermal processing, providing a theoretical basis for spectral feature identification of egg cooking grades. Ablation experiments verified the effectiveness of the dual-attention collaborative improvement strategy. Single CBAM or CCA only realized one-dimensional feature optimization with limited ability to capture critical spectral features, whereas the combination of CBAM and CCA achieved dual screening of channel and context features, suppressed spectral noise and redundant interference, enhanced the model’s effective feature perception capability, and significantly improved the feature extraction performance of the original 1D-CNN model. Comparative tests with multiple mainstream time-series spectral models confirmed that the CC-1D-CNN model exhibited the best comprehensive performance, with an average single-sample detection time of 46.5 ms, meeting the real-time detection requirements of industrial production lines. Confusion matrix results demonstrated the model’s outstanding classification accuracy and stability: the recognition accuracy for large soft-boiled eggs, small soft-boiled eggs and fully cooked eggs was 98.65%, 96% and 91.89%, respectively. The overall three-classification accuracy of the test set reached 95.52%, and the binary classification accuracy for soft-boiled and fully cooked eggs was up to 99.55%. No obvious under-fitting or over-fitting occurred during model training and iteration, proving its favorable generalization and robustness. The established CC-1D-CNN model realized efficient and intelligent non-destructive detection of egg cooking degrees, avoiding spectral preprocessing and balancing high accuracy and fast detection speed. It effectively overcame the deficiencies of traditional detection methods and single neural network models, providing a feasible technical scheme for industrial automatic grading of cooked eggs and laying a foundation for the subsequent development of portable spectral detection equipment for egg cooking degree detection. Future research will expand the dataset of eggs with different sizes, freshness and growth conditions to optimize model parameters, improve the model’s universality in complex industrial scenarios, and promote the industrial application of egg cooking degree non-destructive detection technology.

     

/

返回文章
返回