Abstract:With the expansion of production in food industry and the increasing demand for higher quality from consumers, traditional detection methods that rely on manual or chemical analysis are facing harsh challenges in terms of efficiency, objectivity and non-destructive testing. In order to achieve high-precision and automated non-destructive testing of food quality, this study proposes a new method for robot food quality testing based on extended morphology of non-local CapsNet. This method extracts multi-scale spatial structural features by extending morphological profiles, enhances global correlation of features using non-local attention mechanisms, and achieves deep feature learning and accurate classification through the dynamic routing mechanism of capsule networks. Banana storage quality inspection was used as a case study, a robotic hyperspectral detection system was constructed for validation. The results indicated that under normal temperature storage conditions, the overall classification accuracy of the proposed method can reach 99.13%, with a Kappa coefficient of 0.988 and a prediction time of only 22.124 seconds. Besides, an accuracy of 98.66% and a Kappa coefficient of 0.982 under low temperature conditions was maintained. Therefore, the performance is significantly better than traditional methods such as PCA-LDA and PLS-DA. The ablation experiment further exhibited that the accuracy of the CapsNet model with morphology and non-local mechanism was improved by 9.71% compared with the single module. In conclusion, this method not only markedly improves detection accuracy and speed but also enhances the robustness of the model to complex environments and sample variations, providing reliable technical reference for intelligent detection of robotic food quality.