Intelligent food detection device based on visual recognition
By combining a multi-mode illumination system and multispectral imaging with an improved YOLOv8 deep learning model and evidence theory, the adaptability and detection accuracy problems of existing food detection devices are solved, realizing automated and efficient food detection.
Patent Information
- Application Number
- CN202611435712.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-06
AI Technical Summary
Existing food testing devices suffer from problems such as the inability of the lighting system to adapt and adjust, a single detection dimension, low accuracy of the detection algorithm, and a lack of multi-dimensional comprehensive judgment capabilities, resulting in low detection efficiency and low accuracy.
Employing a multi-mode illumination system, combining visible light and multispectral imaging units, and using an improved YOLOv8 deep learning model and evidence theory for multi-source information fusion decision-making, this system achieves adaptive illumination and multimodal perception, combined with automated conveying and rejection mechanisms.
It improves the consistency and adaptability of image acquisition, expands the detection dimensions, enhances detection accuracy and robustness, realizes full-process automation of food inspection, and reduces labor costs.
Smart Images

Figure CN123046098A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent detection technology and relates to an intelligent food detection device based on visual recognition. Background Technology
[0002] With increasingly stringent food safety standards and rising consumer demands for food quality, online testing technologies in the food production process are receiving more and more attention. Traditional food testing mainly relies on manual visual inspection, which suffers from prominent problems such as low testing efficiency, high subjectivity, high false negative rate, and high labor intensity, making it difficult to meet the needs of modern large-scale food production.
[0003] In recent years, machine vision technology has been gradually introduced into the field of food inspection. Existing vision-based food inspection devices typically include conveyor belts, image acquisition equipment, and image processing systems, which analyze images of the food surface to determine if defects exist. However, current technology still has the following shortcomings: First, the lighting systems of existing devices are mostly fixed light sources, which cannot be adaptively adjusted according to the surface characteristics of different types of food, resulting in unstable image quality. In particular, when detecting highly reflective or complex surface textures of food, the problem of overexposure or underexposure of images is serious, affecting the detection accuracy.
[0004] Second, existing devices typically rely solely on visible light image information for detection, making it difficult to detect internal defects or early quality changes in food, such as browning inside fruits or early spoilage of meat, resulting in a limited detection dimension.
[0005] Third, the detection algorithms of existing devices are mostly traditional image processing algorithms, which judge defects based on manually designed features. For foods with varied shapes and complex defect types, the detection accuracy and generalization ability are limited.
[0006] Fourth, existing equipment lacks the ability to make comprehensive decisions based on multiple test results, making it difficult to achieve multi-dimensional comprehensive judgment and accurate grading of food quality.
[0007] Therefore, there is an urgent need to develop a food detection device that can adaptively adjust lighting conditions, integrate multimodal perception information, and use deep learning algorithms for intelligent detection, in order to solve the problems existing in the above-mentioned technologies. Summary of the Invention
[0008] The purpose of this invention is to solve the above-mentioned problems and provide an intelligent food detection device based on visual recognition.
[0009] To achieve the above objectives, the present invention provides an intelligent food detection device based on visual recognition, comprising a conveying mechanism, a dark box, an illumination system, an image acquisition unit, a spectral imaging unit, a position sensor, a control and processing unit, and a rejection mechanism.
[0010] The conveying mechanism is used to carry and transport the food to be tested. Preferably, the conveying mechanism includes a conveyor belt, a drive roller, a driven roller, and a drive motor. The surface of the conveyor belt is provided with anti-slip texture to prevent the food from rolling or shifting during transport. A background plate is provided below the conveyor belt. The color of the background plate can be changed according to the type of food to be tested to provide optimal image contrast.
[0011] The dark box is positioned above the conveying mechanism to isolate ambient light from interfering with image acquisition. The inner wall of the dark box is coated with a diffuse reflection layer to ensure uniform distribution of illumination light inside. Food inlets and outlets are located on the front and rear sides of the dark box, respectively. Light-blocking curtains made of flexible light-blocking material are installed at both the food inlet and outlet to effectively prevent external light from entering while ensuring smooth food passage.
[0012] The lighting system, located inside the dark chamber, includes a ring-shaped LED light source array and a coaxial light source. The ring-shaped LED light source array consists of multiple LED beads with different color temperatures, specifically an inner ring light source and an outer ring light source. The inner ring light source has a color temperature of 5500K~6500K (daylight color temperature), and the outer ring light source has a color temperature of 2700K~3200K (warm white temperature). The brightness of the inner and outer ring light sources can be adjusted independently. The coaxial light source is positioned directly below the image acquisition unit to provide uniform vertical illumination and eliminate shadows on the food surface. By combining and adjusting the inner, outer, and coaxial light sources, optimal illumination for foods with different surface characteristics can be achieved.
[0013] The image acquisition unit is located inside the dark box and directly above the conveying mechanism. It includes a high-resolution industrial camera and lens for acquiring visible light images of the food.
[0014] The spectral imaging unit is located inside the dark chamber, adjacent to the image acquisition unit, and is used to acquire multispectral image information of the food. Preferably, the spectral imaging unit includes a multispectral filter wheel and a spectral camera. The multispectral filter wheel is equipped with at least four narrowband filters of different wavelengths, selected from the visible light band, near-infrared band, and short-wave infrared band. Through multispectral imaging, spectral reflectance information of the food surface and shallow layers can be obtained, thereby detecting internal defects and early quality changes in the food.
[0015] The position sensors are located on both sides of the conveying mechanism to detect whether the food has reached the image acquisition area, thereby triggering the image acquisition unit and the spectral imaging unit to perform synchronous acquisition.
[0016] The control and processing unit is electrically connected to the conveying mechanism, the lighting system, the image acquisition unit, the spectral imaging unit, and the position sensor, respectively. The control and processing unit includes an image preprocessing module, a feature extraction module, a defect detection module, and a classification decision module.
[0017] The image preprocessing module is used to perform denoising, enhancement, and segmentation processing on the food images acquired by the image acquisition unit. Specifically, the image preprocessing module uses median filtering or Gaussian filtering for denoising, histogram equalization or adaptive contrast enhancement algorithms for image enhancement, and threshold segmentation or edge detection algorithms for image segmentation.
[0018] The feature extraction module is used to extract color features, texture features, and shape features of food from the preprocessed image, and to extract spectral features from the multispectral image acquired by the spectral imaging unit. Specifically, the color features include the mean, variance, and distribution histogram of each channel in the RGB color space; the texture features include parameters such as contrast, correlation, energy, and homogeneity extracted from the gray-level co-occurrence matrix (GLCM); the shape features include area, perimeter, roundness, aspect ratio, and Hu moment; and the spectral features include the mean reflectance of each band and the shape features of the spectral curve.
[0019] The defect detection module is used to input the extracted features into a pre-trained deep learning detection model to determine whether the food has defects and the type of defects. Preferably, the deep learning detection model is a defect detection model based on an improved YOLOv8 network structure. The improved YOLOv8 network structure embeds an attention mechanism module (such as an SE module or a CBAM module) in the backbone network to enhance the ability to focus on key features, and adds a multi-scale feature fusion layer in the neck network to improve the detection capability of defects of different sizes. The defect types include at least appearance defects (such as scratches, indentations, deformation, abnormal color, etc.), foreign matter contamination (such as hair, plastic fragments, metal shavings, etc.), and quality abnormalities (such as mold, spoilage, abnormal maturity, etc.).
[0020] The classification decision module is used to generate control commands based on the judgment results of the defect detection module. The classification decision module employs evidence theory (DS evidence theory) to perform multi-source information fusion decision-making on visible light image detection results and multispectral image detection results, thereby improving the accuracy and reliability of detection.
[0021] The rejection mechanism is located downstream of the conveying mechanism and electrically connected to the control and processing unit, used to reject substandard food products from the conveying mechanism. Preferably, the rejection mechanism includes a pneumatic nozzle array and a waste collection box. The pneumatic nozzle array is positioned above the conveying mechanism, with the spray direction of the pneumatic nozzle array forming a 30° to 60° angle with the conveying direction of the conveying mechanism. The waste collection box is located on one side of the conveying mechanism.
[0022] Preferably, the control and processing unit further includes an adaptive lighting control module, which is used to dynamically adjust the brightness and color temperature of each LED bead in the annular LED light source array according to the brightness and color distribution of the image acquired by the image acquisition unit, so as to ensure that high-quality images can be obtained under different detection conditions.
[0023] Preferably, the device further includes a cleaning mechanism disposed inside the dark chamber, comprising a compressed air nozzle and a brush roller. The compressed air nozzle is used to blow away dust from the lens surfaces of the image acquisition unit and the spectral imaging unit, and the brush roller is used to clean the surface of the conveyor belt to ensure the detection stability during long-term operation.
[0024] This invention also provides a visual recognition-based intelligent food detection method, comprising the following steps: S1: Start the conveyor mechanism to transport the food to be tested to the image acquisition area inside the dark box; S2: After the position sensor detects that the food has arrived in the image acquisition area, it triggers the image acquisition unit to acquire the visible light image of the food, and at the same time triggers the spectral imaging unit to acquire the multispectral image of the food. S3: The image preprocessing module performs denoising, enhancement, and segmentation preprocessing on the acquired visible light and multispectral images; S4: The feature extraction module extracts the color, texture, and shape features of food from the preprocessed visible light image, and extracts spectral features from the preprocessed multispectral image; S5: Input the extracted features into a pre-trained deep learning detection model to determine whether the food has defects and the types of defects. The types of defects include at least appearance defects, foreign matter contamination, and quality abnormalities. S6: The classification decision module generates control commands based on the detection results; S7: If the food is deemed unqualified, the rejection mechanism removes the food from the conveyor and places it in the waste collection bin; if the food is deemed qualified, the conveyor continues to transport the food to the next workstation.
[0025] Compared with the prior art, the present invention has the following advantages: This invention, by setting up a multi-mode lighting system consisting of an inner ring light source, an outer ring light source, and a coaxial light source, and by setting up an adaptive lighting control module, can dynamically adjust the brightness and color temperature of the light source according to the surface characteristics of different types of food. This effectively solves the problem of unstable image acquisition quality for highly reflective or complex textured foods, and improves the adaptability and consistency of image acquisition.
[0026] This invention achieves multimodal perception of the appearance and internal quality of food by simultaneously setting up a visible light image acquisition unit and a multispectral imaging unit. It can not only detect appearance defects such as scratches, deformation, and abnormal color on the surface of food, but also detect early quality changes such as browning, mold, and spoilage inside food through multispectral information, significantly expanding the detection dimensions.
[0027] This invention employs a deep learning detection model based on an improved YOLOv8. By embedding an attention mechanism and multi-scale feature fusion, it can automatically learn and extract deep features of food defects. Compared with traditional manually designed feature methods, it has higher detection accuracy and stronger generalization ability.
[0028] This invention, by setting up a classification decision module and employing evidence theory to perform multi-source information fusion decision-making on visible light detection results and multispectral detection results, can make robust detection decisions even when information is uncertain or conflicting, effectively improving the reliability and robustness of detection.
[0029] This invention automates the entire food inspection process by setting up automated conveying mechanisms, image acquisition, intelligent detection, and rejection mechanisms, significantly improving inspection efficiency, reducing labor costs, and making it suitable for online real-time inspection in food production lines. Attached Figure Description
[0030] Figure 1 The schematic diagram illustrates the structural layout of a vision-based intelligent food detection device according to one embodiment of the present invention. Figure 2 A schematic diagram illustrating the module connection of a control and processing unit according to an embodiment of the present invention; Figure 3 The diagram illustrates the detection process of a vision-based intelligent food detection device according to one embodiment of the present invention. Detailed Implementation
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0032] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The embodiments cannot be described in detail here, but the embodiments of the present invention are not limited to the following embodiments.
[0033] Combination Figures 1-3 As shown, the present invention provides an intelligent food detection device based on visual recognition, including a conveying mechanism 1, a dark box 2, an illumination system 3, an image acquisition unit 4, a spectral imaging unit 5, a position sensor 6, a control and processing unit 7, and a rejection mechanism 8.
[0034] According to one embodiment of the present invention, the conveying mechanism 1 includes a conveyor belt, a driving roller, a driven roller, and a drive motor. The surface of the conveyor belt is provided with anti-slip texture to prevent the food from rolling or shifting during conveying. A background plate is provided below the conveyor belt, and the color of the background plate can be changed according to the type of food to be detected. For example, a blue background plate is used when detecting red fruit, and a black background plate is used when detecting white food to provide optimal image contrast.
[0035] The dark box 2 is positioned above the conveyor mechanism to isolate ambient light from interfering with image acquisition. The inner wall of the dark box is coated with a diffuse reflection layer to ensure even distribution of illumination within the box, preventing areas of excessive brightness or darkness. Food inlets and outlets are located on the front and rear sides of the dark box, respectively. Light-blocking curtains, made of flexible light-blocking materials (such as black rubber sheets or light-blocking cloth), are installed at both the inlet and outlet to effectively prevent external light from entering the dark box while ensuring smooth food passage.
[0036] The lighting system 3 is located inside the dark box 2 and includes a ring-shaped LED light source array and a coaxial light source. The ring-shaped LED light source array consists of multiple LED beads with different color temperatures, including an inner ring light source and an outer ring light source. The color temperature of the inner ring light source is 5500K~6500K (daylight color temperature), and the color temperature of the outer ring light source is 2700K~3200K (warm white temperature). The brightness of the inner and outer ring light sources can be adjusted independently. The coaxial light source is located directly below the image acquisition unit and projects light vertically onto the food surface through a beam splitter to provide uniform vertical illumination and eliminate shadows on the food surface. By adjusting different combinations of the inner ring light source, outer ring light source, and coaxial light source, the lighting needs of foods with different surface characteristics (such as high reflectivity, roughness, transparency, etc.) can be adapted.
[0037] The image acquisition unit 4 is located inside the dark box 2 and directly above the conveyor mechanism 1, and includes a high-resolution industrial camera and a lens. The industrial camera is preferably a CMOS or CCD industrial camera with a resolution of not less than 5 million pixels, and the lens is preferably a fixed-focus or zoom industrial lens, capable of clearly acquiring visible light images of the food on the conveyor belt.
[0038] The spectral imaging unit 5 is located inside the dark box 2, adjacent to the image acquisition unit 4, and is used to acquire multispectral image information of the food. The spectral imaging unit includes a multispectral filter wheel and a spectral camera. The multispectral filter wheel is equipped with at least four narrowband filters of different wavelengths, selected from the visible light band (e.g., 450nm, 550nm, 650nm), near-infrared band (e.g., 850nm, 950nm), and short-wave infrared band (e.g., 1200nm, 1450nm). By rotating the multispectral filter wheel, the spectral camera can sequentially acquire spectral images of the food at different wavelengths, thereby obtaining multispectral information of the food. Through multispectral imaging, spectral reflectance information of the food surface and shallow layers can be obtained, which can be used to detect internal defects and early quality changes in the food.
[0039] Position sensors 6 are located on both sides of the conveying mechanism 1, at the front end of the image acquisition area. The position sensors are preferably photoelectric sensors or proximity sensors, used to detect whether food has arrived in the image acquisition area. When the position sensors detect the arrival of food, they trigger the image acquisition unit and the spectral imaging unit to perform synchronous acquisition.
[0040] The control and processing unit 7 is electrically connected to the conveying mechanism 1, the lighting system 3, the image acquisition unit 4, the spectral imaging unit 5, and the position sensor 6, respectively. The control and processing unit 7 includes an image preprocessing module 71, a feature extraction module 72, a defect detection module 73, a classification decision module 74, and an adaptive lighting control module 75.
[0041] The image preprocessing module 71 is used to preprocess the visible light image of food acquired by the image acquisition unit and the multispectral image acquired by the spectral imaging unit. Specifically, the image preprocessing module uses median filtering or Gaussian filtering for noise reduction, histogram equalization or adaptive contrast enhancement algorithms for image enhancement, and threshold segmentation or edge detection algorithms to segment the food area from the background area.
[0042] The feature extraction module 72 is used to extract multidimensional features of food from the preprocessed image. Color features extracted from the visible light image include the mean, variance, and histograms of each channel in the RGB color space; texture features include parameters such as contrast, correlation, energy, and homogeneity extracted through the gray-level co-occurrence matrix (GLCM); shape features include area, perimeter, roundness, aspect ratio, and Hu moment. Spectral features extracted from the multispectral image include the mean reflectance of each band and the shape features of the spectral curve (such as peak position and slope).
[0043] The defect detection module 73 is used to input multiple extracted features into a pre-trained deep learning detection model to determine whether food has defects and the type of defects. The deep learning detection model is a defect detection model based on an improved YOLOv8 network structure. The backbone network of this model embeds attention mechanism modules (such as SE or CBAM modules) to enhance the ability to focus on key features; a multi-scale feature fusion layer is added to the neck network to improve the detection capability of defects of different sizes. Defect types include at least appearance defects (such as scratches, indentations, deformation, color abnormalities, etc.), foreign matter contamination (such as hair, plastic fragments, metal shavings, etc.), and quality abnormalities (such as mold, spoilage, abnormal maturity, etc.). The model is trained using a large dataset of food images labeled with defect types and locations, and the generalization ability of the model is improved through transfer learning and data augmentation techniques.
[0044] The classification decision module 74 generates control commands based on the judgment results of the defect detection module. The classification decision module employs evidence theory (DS evidence theory) to perform multi-source information fusion decision-making on visible light image detection results and multispectral image detection results. Specifically, the visible light detection results and multispectral detection results are treated as two pieces of evidence. The confidence function of each hypothesis (qualified, appearance defect, foreign matter contamination, quality abnormality, etc.) is calculated using DS synthesis rules. The hypothesis with the highest confidence is selected as the final decision result to improve the accuracy and reliability of the detection.
[0045] The adaptive lighting control module 75 dynamically adjusts the brightness and color temperature of each LED in the annular LED light source array based on the brightness and color distribution of the image acquired by the image acquisition unit. Specifically, when the overall image is detected to be too dark, the light source brightness is increased; when overexposed areas are detected, the light source brightness in the corresponding direction is reduced; and when color deviation is detected, the color temperature of the light source is adjusted for compensation. Through adaptive lighting control, high-quality images are ensured to be obtained under different detection conditions.
[0046] The rejection mechanism 8 is located downstream of the conveying mechanism 1 and is electrically connected to the control and processing unit 7. The rejection mechanism 8 includes a pneumatic nozzle array and a waste collection bin 9. The pneumatic nozzle array is positioned above the conveying mechanism, with its spray direction forming a 30°~60° angle with the conveying direction of the conveying mechanism. When the classification decision module determines that the food is unqualified, the control and processing unit issues a rejection command, and the pneumatic nozzle array sprays high-pressure gas to blow the unqualified food off the conveyor belt into the waste collection bin.
[0047] The apparatus in this embodiment also includes a cleaning mechanism, which is located inside the dark chamber and includes a compressed air nozzle and a brush roller. The compressed air nozzle is used to periodically or as needed to blow away dust from the lens surfaces of the image acquisition unit and the spectral imaging unit; the brush roller is located below or to the side of the conveyor belt to clean the surface of the conveyor belt, preventing the accumulation of food residue or dust from affecting the accuracy of subsequent detection and ensuring the stability of detection during long-term operation.
[0048] This embodiment provides a visual recognition-based intelligent food detection method, employing the visual recognition-based intelligent food detection device of the present invention, and includes the following steps: S1: Start the conveyor mechanism and place the food to be tested onto the conveyor belt in sequence. The conveyor belt will transport the food to the image acquisition area inside the dark box.
[0049] S2: After the position sensor detects that the food has arrived in the image acquisition area, it triggers the image acquisition unit to acquire a visible light image of the food, and simultaneously triggers the spectral imaging unit to acquire a multispectral image of the food. Specifically, the spectral imaging unit acquires spectral images of the food in multiple narrowband bands sequentially by rotating the multispectral filter wheel.
[0050] S3: The image preprocessing module preprocesses the acquired visible light and multispectral images. Preprocessing includes: median filtering for noise reduction to remove noise introduced during image acquisition; adaptive contrast enhancement to improve image contrast and clarity; and threshold segmentation to separate the food area from the background area, extracting the clean food image region.
[0051] S4: The feature extraction module extracts color, texture, and shape features of the food from the preprocessed visible light image, and extracts spectral features from the preprocessed multispectral image. Specifically, color features include the mean and variance of the RGB three channels; texture features include contrast, energy, and homogeneity extracted from the gray-level co-occurrence matrix; shape features include area, perimeter, and roundness; and spectral features include reflectance values for each band.
[0052] S5: Input the extracted features into a pre-trained deep learning detection model (improved YOLOv8 network) to determine whether the food has defects and the type of defects. Defect types include appearance defects (such as scratches, indentations, deformation, abnormal color, etc.), foreign matter contamination (such as hair, plastic fragments, metal shavings, etc.), and quality abnormalities (such as mold, spoilage, abnormal maturity, etc.).
[0053] S6: Based on the judgment results of the defect detection module, the classification decision module uses evidence theory to fuse the visible light detection results and multispectral detection results to generate the final control command.
[0054] S7: If the food is determined to be non-compliant, the control and processing unit controls the pneumatic nozzle array of the rejection mechanism to remove the food from the conveyor belt and into the waste collection bin; if the food is determined to be compliant, the conveyor belt will continue to transport the food to the next station for subsequent packaging or processing.
[0055] The above description is merely one embodiment of the present invention and is not intended to limit the invention. Those skilled in the art will recognize that the present invention can be modified and varied in various ways. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A visual recognition-based intelligent food detection device, characterized in that, include: The conveying mechanism is used to carry and transport the food to be tested; A dark box is installed above the conveying mechanism, and the inner wall of the dark box is provided with a diffuse reflection coating; The lighting system, located inside the dark box, includes a ring-shaped LED light source array and a coaxial light source. The ring-shaped LED light source array consists of multiple LED beads with different color temperatures, and the coaxial light source is located directly below the image acquisition unit. An image acquisition unit, located inside the dark box and directly above the conveying mechanism, includes a high-resolution industrial camera and a lens; A spectral imaging unit is located inside the dark box and adjacent to the image acquisition unit, and is used to acquire multispectral image information of food. Position sensors are installed on both sides of the conveying mechanism to detect whether the food has reached the image acquisition area; The control and processing unit is electrically connected to the conveying mechanism, the lighting system, the image acquisition unit, the spectral imaging unit, and the position sensor, respectively. A rejection mechanism is located downstream of the conveying mechanism and electrically connected to the control and processing unit, used to reject unqualified food from the conveying mechanism. The control and processing unit includes an image preprocessing module, a feature extraction module, a defect detection module, and a classification decision module; The image preprocessing module is used to perform noise reduction, enhancement, and segmentation processing on the food images acquired by the image acquisition unit; The feature extraction module is used to extract the color features, texture features, and shape features of food from the preprocessed image, and to extract spectral features from the multispectral image acquired by the spectral imaging unit; The defect detection module is used to input the extracted features into a pre-trained deep learning detection model to determine whether the food has defects and the type of defects. The classification decision module is used to generate control commands based on the judgment results of the defect detection module, and control the action of the rejection mechanism.
2. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The conveying mechanism includes a conveyor belt, a drive roller, a driven roller, and a drive motor. The surface of the conveyor belt is provided with anti-slip texture, and a background plate is provided below the conveyor belt. The color of the background plate can be changed according to the type of food to be tested.
3. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The ring-shaped LED light source array includes an inner ring light source and an outer ring light source. The color temperature of the inner ring light source is 5500K~6500K, and the color temperature of the outer ring light source is 2700K~3200K. The brightness of the inner ring light source and the outer ring light source can be adjusted independently.
4. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The spectral imaging unit includes a multispectral filter wheel and a spectral camera. The multispectral filter wheel is provided with at least four narrowband filters of different wavelengths, and the wavelengths of the narrowband filters are selected from the visible light band, the near-infrared band and the short-wave infrared band, respectively.
5. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The dark box has a food inlet and a food outlet on its front and back sides, respectively. A light-blocking curtain is installed at the food inlet and the food outlet, and the light-blocking curtain is made of flexible light-blocking material.
6. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The rejection mechanism includes a pneumatic nozzle array and a waste collection box. The pneumatic nozzle array is positioned above the conveying mechanism, and the spraying direction of the pneumatic nozzle array forms an angle of 30° to 60° with the conveying direction of the conveying mechanism. The waste collection box is positioned on one side of the conveying mechanism.
7. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The deep learning detection model is a defect detection model based on an improved YOLOv8 network structure. The improved YOLOv8 network structure embeds an attention mechanism module in the backbone network and adds a multi-scale feature fusion layer in the neck network.
8. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, The control and processing unit also includes an adaptive lighting control module, which is used to dynamically adjust the brightness and color temperature of each LED bead in the annular LED light source array according to the brightness and color distribution of the image acquired by the image acquisition unit.
9. The intelligent food detection device based on visual recognition according to claim 1, characterized in that, It also includes a cleaning mechanism, which is located inside the dark box and includes a compressed air nozzle and a brush roller. The compressed air nozzle is used to blow away dust from the lens surfaces of the image acquisition unit and the spectral imaging unit, and the brush roller is used to clean the surface of the conveyor belt.
10. A visual recognition-based intelligent food detection method, employing the visual recognition-based intelligent food detection device as described in any one of claims 1-9, characterized in that, Includes the following steps: S1: Start the conveyor mechanism to transport the food to be tested to the image acquisition area inside the dark box; S2: After the position sensor detects that the food has arrived in the image acquisition area, it triggers the image acquisition unit to acquire the visible light image of the food, and at the same time triggers the spectral imaging unit to acquire the multispectral image of the food. S3: The image preprocessing module performs denoising, enhancement, and segmentation preprocessing on the acquired visible light and multispectral images; S4: The feature extraction module extracts the color, texture, and shape features of food from the preprocessed visible light image, and extracts spectral features from the preprocessed multispectral image; S5: Input the extracted features into a pre-trained deep learning detection model to determine whether the food has defects and the types of defects. The types of defects include at least appearance defects, foreign matter contamination, and quality abnormalities. S6: The classification decision module generates control commands based on the detection results; S7: If the food is deemed unqualified, the rejection mechanism removes the food from the conveyor and places it in the waste collection bin; if the food is deemed qualified, the conveyor continues to transport the food to the next workstation.
