Abstract
Eggshell cracks are a critical factor affecting egg quality and food safety, with traditional detection methods often struggling to detect fine cracks, especially under multi-colored shells and complex backgrounds. To address this issue, we propose a non-destructive detection approach based on an enhanced three-dimensional convolutional neural network (3D-CNN), named 3D-CrackNet, integrated with hyperspectral imaging (HSI) for high-precision identification and localization of eggshell cracks. Operating within the 1000-2500 nm spectral range, the proposed framework employs spectral preprocessing and optimal band selection to improve discriminative feature representation. A residual learning module is incorporated to mitigate gradient degradation during deep joint spectral-spatial feature extraction, while a parameter-free SimAM attention mechanism adaptively enhances crack-related regions and suppresses background interference. This architecture enables the network to effectively capture both fine-grained spatial textures and contiguous spectral patterns associated with cracks. Experiments on a self-constructed dataset of 400 egg samples show that 3D-CrackNet achieves an F1-score of 75.49% and an Intersection over Union (IoU) of 60.62%, significantly outperforming conventional 1D-CNN and 2D-CNN models. These findings validate that 3D-CrackNet offers a robust, non-destructive, and efficient solution for accurately detecting and localizing subtle eggshell cracks, demonstrating strong potential for intelligent online egg quality grading and micro-defect monitoring in industrial applications.