Foreign object annotation method and intelligent detection algorithm for X-ray food images
-
-
Abstract
To address the issues of diverse foreign object types and the difficulty in recognizing edge information in food X‑ray images, a multi‑label foreign object annotation method and a foreign object detection method based on multi‑scale edge feature fusion were proposed. First, foreign objects were annotated using both single-label and multi-label approaches, and detection models were separately established based on the original YOLOv8 algorithm. The detection accuracy of the models trained with the two annotation methods was compared. Then, the YOLOv8 algorithm was improved as follows: 1) a multi‑scale edge feature fusion module was added to the backbone network; 2) an efficient attention mechanism was embedded between the backbone and neck networks; 3) a shared convolution detection head was designed; 4) the Wise‑WIoU loss function was introduced. Finally, detection models were trained using the multi‑label annotated dataset with both the original and the improved YOLOv8 algorithms, and their foreign object detection performance was compared. Experimental results demonstrated that the proposed multi-label annotation method and the improved algorithm significantly enhanced the detection accuracy of foreign objects in food X‑ray images, particularly in scenarios with complex foreign object types, blurred edges, and substantial background interference, where superior detection capability and generalization performance were achieved.
-
-