Abstract:
Single nondestructive detection cannot simultaneously identify shell structural damage and internal quality abnormalities in walnuts. This study aims to identify walnut quality defects using dual-modal fusion of impact acoustic signals and X-ray patterns. Four target categories were selected as the intact, shell-damaged, shriveled, and moldy walnuts. A dual-modal nondestructive detection was constructed to combine acoustic and X-ray patterns. A structure prior-guided cross-modal gated fusion network (termed SP-CGFNet) was proposed to identify walnut quality defects. Mel-frequency cepstral coefficients were used to represent the acoustic responses during walnut impact. Whereas X-ray images were used to describe internal tissue structure, kernel filling condition, and defect information. Thus, the two modalities were utilized to characterize walnut quality from the perspectives of impact response and internal structure. The SP-CGFNet was integrated with cross-modal attention, structure prior-guided gating, residual enhancement, and consistency constraints. The acoustic and X-ray features were aligned to fully exploit their complementary information, due to their substantial difference in data form, feature dimension, and semantic representation. Cross-modal attention was used to establish semantic interactions between acoustic responses and X-ray features, thus allowing each modality to obtain useful cues from another. Structure prior-guided gating was used X-ray structural information to regulate multimodal feature contributions, where quality information was emphasized to suppress less reliable interference. Residual enhancement was to preserve effective discriminative information from the original modal features. While the consistency constraint was to improve the coordination between structural prior information and the final fusion prediction. Together, these components were to effectively fusion the acoustic and X-ray structural information. Single-modal experiments showed that both impact acoustic signals and X-ray images contained discriminative information to detect walnut quality. Each individual modality shared the limitations to identify the defects. Acoustic responses were reflected the variation in the shell structure and overall internal condition, but the samples with similar acoustic characteristics remained difficult to distinguish reliably. X-ray images were used to reveal the differences in internal tissue structure, kernel filling condition, and defect characteristics. But only one single structural modality failed to fully represent all quality information. Two modalities were provided different and complementary evidence to identify walnut defects. In the dual-modal fusion experiments, SP-CGFNet was achieved in the high accuracy, precision, F1-score, and recall of 98.6%. All four metrics were higher than those of feature-level concatenation, two decision-level fusion, and module-combination comparison models. The strategy was more effectively integrated with impact acoustic responses with X-ray structural information than conventional fusion and incomplete module combinations. Modal contribution analysis further showed that X-ray structural information was provided important structural evidence for fusion classification. The fusion model was distinguished from the samples difficult to identify with only one modality, particularly for acoustic responses of the samples with unstable single-modal predictions or similar category characteristics. Furthermore, the structure prior-guided mechanism was improved classification stability to coordinate the contribution rates of two modalities. Overall, SP-CGFNet effectively combined acoustic responses and X-ray structural information to identify walnut quality defects. The findings can also provide a strong reference for the nondestructive detection of multiple internal and external quality defects in walnut products.