In food processing, foreign matter inevitably contaminates packaged food. To ensure food safety, ray-based detection is used; however, the original images suffer from aberrations and noise that degrade quality and hinder further processing. Thus, images are preprocessed to enhance quality by highlighting key features and suppressing irrelevant ones before abnormal pattern recognition. Following image segmentation, a BP neural network algorithm is applied for foreign object detection. In tests with contaminants such as metal wires, stones, and glass, the algorithm identified distinct abnormal fluctuations at gray levels of 132, 108, and 34, respectively, allowing it to reliably detect foreign objects. Although the practical detection rate reached 100%, occasional misjudgments suggest that further optimization is needed. Overall, this method introduces a novel approach to detecting foreign objects in food and offers promising new strategies for improving food safety monitoring.
1970-2025 CP (Manitoba, Canada) unless otherwise stated.