A pet food pellet quality identification system based on image recognition

By combining image sampling, preprocessing, segmentation, and judgment modules, the problem of image recognition for small-batch customized pet food particles was solved, achieving efficient and stable quality inspection.

CN121504825BActive Publication Date: 2026-05-26BEIJING PINCHUANG INTELLIGENT EQUIPMENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING PINCHUANG INTELLIGENT EQUIPMENT CO LTD
Filing Date
2025-10-28
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In the scenario of small-batch customized pet food, existing technologies are difficult to use traditional large-sample training methods for image recognition, and the large differences in particle appearance caused by coatings and high moisture content make it difficult to reliably detect complex defects.

Method used

The image sampling module is used to sample stable images, and the preprocessing and synchronization modules are used for geometric and color correction. The segmentation and feature extraction module is used to extract multi-source features and perform instance segmentation. The judgment and execution module is used to judge qualified, unqualified and suspicious, and unqualified particles are removed.

Benefits of technology

In small-batch scenarios with new formulations, only a small number of labeled samples are needed to complete model adaptation, improve detection stability, overcome batch differences in appearance, and reduce false detection and false negative rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504825B_ABST
    Figure CN121504825B_ABST
Patent Text Reader

Abstract

The present application relates to the field of machine vision, and provide a kind of pet food particle quality identification system based on image recognition, comprising: image sampling module, for the stable and traceable image sampling of each pet food particle conveyed on food production line;Preprocessing and synchronization module, for original image and metadata are corrected in time sequence, geometry and color correction, after noise removal and enhancement to generate structured input package;Splitting extraction feature module, for accurately separating single pet food particle instance from the image after preprocessing and synchronization, and extracting multiple source features capable of distinguishing defects from each instance, while labeling and caching low confidence samples to support online learning and rapid adaptation;Determination execution module, for receiving fusion discriminant vector and confidence, making qualified, unqualified, suspicious three kinds of determination for each pet food particle according to predetermined rules, and executing corresponding rejection for unqualified pet food particles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision, specifically to a pet food pellet quality identification system based on image recognition. Background Technology

[0002] In recent years, pet food has become increasingly diversified. As the requirements for product differentiation, quality and safety continue to rise, the manufacturing end needs more refined online quality control to ensure the consistency of the appearance and internal quality of each batch of products.

[0003] The Chinese patent application (CN201810004284.X) discloses a deep learning-based method for detecting defects in granular products. This method includes: separating the target area and background in the LAB color space to better eliminate the influence of lighting variations and improve accuracy; detecting granular product targets based on C-HOG features and an SVM classification algorithm; and employing an improved deep learning algorithm for granular product target classification, tailored to the characteristics of granular products, compared to the traditional NCC template matching algorithm. This allows for more accurate extraction of the tablet's texture information and more precise target classification. Compared to traditional algorithms, this method reduces the false positive and false negative rates, significantly lowering production costs and improving production efficiency for enterprises.

[0004] In the field of machine vision, although there are technologies that use industrial cameras to obtain images of target products and then use neural networks to identify defects based on those images, existing technologies have the following problems in the scenario of small-batch customized pet food:

[0005] 1. Since small-batch customized pet food often means fewer reference samples, it is difficult to directly apply traditional large-sample training methods in particle quality detection for image recognition.

[0006] 2. When dealing with granules with customized requirements such as coatings and fillings, the products contain high moisture content, resulting in significant differences in the appearance of different batches of granules, making it difficult to consistently detect complex defects.

[0007] Therefore, a system is needed that can identify the quality of small-batch customized pet food based on image recognition to solve the problems of the existing technology. Summary of the Invention

[0008] This invention provides a pet food pellet quality identification system based on image recognition, aiming to solve the problems of insufficient training samples for small-batch customized pet food pellets and the difficulty in uniformly and specifically detecting the appearance of different customized pellets.

[0009] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a pet food pellet quality identification system based on image recognition, comprising:

[0010] The image sampling module is used to perform stable and traceable image sampling on each pet food granule being transported on the food production line, and to obtain high-quality image sequences and corresponding metadata for subsequent preprocessing, segmentation and feature extraction.

[0011] The preprocessing and synchronization module is used to perform temporal, geometric and color correction on the original image and metadata, and generate a structured input package after denoising and enhancement. It maps the temporal and spatial consistency across modules for use by the segmentation and feature extraction modules.

[0012] The segmentation and feature extraction module is used to accurately separate individual pet food particle instances from preprocessed and synchronized images, extract multi-source features that can identify defects from each instance, and label and cache low-confidence samples to support online learning and rapid adaptation.

[0013] The judgment execution module is used to receive the fused discrimination vector and confidence level, classify each pet food granule into three categories: qualified, unqualified, and suspicious according to predetermined rules, remove unqualified pet food granules accordingly, record logs and update statistical indicators, and send low-confidence samples back for online fine-tuning.

[0014] As a preferred embodiment, the specific steps of the image sampling module are as follows: an industrial line scan camera and a matching lighting unit are deployed horizontally above the pet food conveyor belt. The lighting unit specifically includes a top-light polarized strobe LED light source and a side-light diffuse reflection supplementary light component. The industrial line scan camera is internally calibrated for distortion correction. White balance and brightness calibration are performed when the system is online to obtain correction parameters for subsequent color and size measurements.

[0015] A photoelectric switch is installed on the conveyor belt to trigger an industrial line scan camera. The sampling time is synchronized with the position information of the conveyor belt, and a unique identifier is generated for each sample. The sampling method is dynamically selected based on the conveyor belt speed and the size of the pet food particles. After sampling, the image quality is initially checked, invalid images are identified and marked, and the corresponding unique identifier is recorded to generate a log. Invalid images are replaced by resampling. The acquired image, the selected sampling mode, the equipment calibration parameters, the image unique identifier, and the sampling timestamp are encapsulated and stored as a structured object in JSON format.

[0016] As a preferred embodiment, the specific steps of the preprocessing and synchronization module are as follows: using the PTP precise time protocol in the system to unify the time reference between each acquisition device and the trigger; by converting the geometrically corrected image after distortion correction from the camera's original space to a unified color space; using a color mapping matrix for color correction to obtain color consistency between different samples; wherein the color mapping matrix is ​​obtained by first shooting a standard color chart and extracting the camera's RGB values ​​for each color block, reading the target color value of the color block, obtaining a set of sample pairs; and performing least squares fitting on the camera's linearized RGB and the target color values ​​to solve for the transformation matrix and bias vector, thereby obtaining the mapping relationship used to map the pixels acquired by the camera to the unified color space.

[0017] Real-time noise reduction is achieved using bilateral filtering, with adaptive histogram equalization to enhance local contrast. A local neighborhood is selected around each pixel to be processed, and pixel values ​​within this neighborhood are weighted and averaged based on spatial distance and pixel value differences. This is combined with the current pixel position and the output filtering of pixels in the neighborhood. The formula is as follows:

[0018] ,

[0019] in This represents the output filter, where o represents the normalization coefficient, q represents the neighborhood pixels, p represents the current pixel, and N represents the neighborhood set centered at p. This represents the pixel value of pixel p. Let q represent the pixel value, and exp represent the exponential function. Indicates spatial standard deviation. It represents the standard deviation of the numerical range.

[0020] As a preferred implementation, the specific steps of the segmentation and feature extraction module are as follows: First, the preprocessed and synchronized image is segmented using a combination of traditional and depth methods to obtain pixel-level masks and bounding boxes for each pet food particle. After the mask is generated, the mask contour is refined through connected component analysis and morphological operations to improve the accuracy of the pet food particle segmentation results.

[0021] Initial binarization is performed using an adaptive threshold. Morphological operations are then used to remove noise and fill small holes. Connected components are analyzed and filtered by area threshold to obtain candidate patches. For overlapping areas in the candidate patches, distance transform is calculated and local values ​​are extracted as distinguishing points. These distinguishing points are used to segment the target region into candidate regions. Candidate regions generated by traditional processing are cropped according to predetermined filling and fed into a lightweight deep instance segmentation network for fine-grained segmentation and confidence scoring. Specifically, the lightweight deep instance segmentation network employs a lightweight backbone network, a lightweight feature fusion module, and a single-stage instance segmentation head, combined with candidate region pre-screening and simple post-processing, to significantly reduce computation and processing latency while maintaining high segmentation accuracy. Instances from adjacent frames are fused through temporal consistency verification. By using majority voting fusion of the segmentation results of the same pet food particle across multiple consecutive frames, the critical boundaries are fine-tuned to obtain a stable mask sequence.

[0022] Faced with the segmented overlapping region, the instance-based pet food particle mask is preferentially split according to the local edge curvature. The module obtains the discrimination quantity for surface and optical anomalies by calculating the shape geometry and static features. For each candidate region, the temporal brightness curve, polarization change over time and mask deformation are calculated, and transient features are extracted to obtain the dynamic discrimination quantity for near-surface physical property differences. The above features are standardized and fused into a unified discrimination vector in a low-dimensional space.

[0023] By calculating the local curvature at each location on the edge of the candidate overlapping region and identifying depression points, a segmentation line is constructed at the depression locations to separate the overlapping targets. The formula for calculating the local curvature is as follows:

[0024] ,

[0025] in Let represent the local curvature of contour point i, where i represents the index of the contour point, and k represents the span parameter. Let i represent the contour point, and area represent the area of ​​the triangle formed by connecting the three contour points.

[0026] The confidence scores for the segmentation results and each type of feature are calculated. The fusion confidence score is obtained by combining the pixel-level confidence score, mask consistency confidence score, and boundary confidence score according to their respective weights. The pixel-level confidence score is obtained by using the pixel prediction probability of the network, the mask consistency confidence score is obtained by comparing the current mask with the projection mask of the previous frame, and the boundary confidence score is obtained by normalizing the boundary smoothness.

[0027] As a preferred implementation, the specific steps of the judgment execution module are as follows: based on the fusion confidence score output by the feature extraction module, the fusion confidence score is divided according to the threshold. Those with a fusion confidence score higher than 0.9 are judged as qualified, those with a confidence score lower than 0.6 are judged as unqualified, and those between 0.6 and 0.9 are judged as suspicious. For pet food particles judged as unqualified, the executor first issues a trigger command, and the trigger is precisely triggered according to the calculated delay. The target pet food particles are removed at the corresponding physical location. For pet food particles judged as suspicious, the majority decision within the time window is used to process the suspicious pet food particles.

[0028] By collecting the confidence calibration results of each frame within the capture time window of each pet food particle, and by conducting a majority vote on the suspicious markers of the same image according to their confidence, when the number of suspicious votes accounts for more than half of the total votes, the particle is judged as suspicious and enters the cache review process.

[0029] The beneficial effects of this invention are as follows:

[0030] 1. This invention extracts multi-source features and calculates confidence levels for each sample, enabling model adaptation through rapid data augmentation and fine-tuning in small-batch scenarios with new formulations, requiring only a small number of labeled samples.

[0031] 2. This invention obtains multi-dimensional discriminative evidence of different particle appearances by combining color correction and bilateral filtering noise reduction with multi-channel fusion, thereby improving detection stability and overcoming the differences in appearance between batches. Attached Figure Description

[0032] Figure 1 This is a module diagram of a pet food pellet quality identification system based on image recognition.

[0033] Figure 2 This is a comparison chart of the effects of an image recognition-based pet food pellet quality identification system. Detailed Implementation

[0034] To make the technical means, creative features, objectives, and effects of this invention easier to understand, the invention is further described below with reference to specific embodiments. However, the following embodiments are merely preferred embodiments of this invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention.

[0035] Example 1, as Figure 1 This is a pet food pellet quality identification system based on image recognition, including an image sampling module, a preprocessing and synchronization module, a segmentation and feature extraction module, and a decision-making and execution module. The specific implementation steps are as follows:

[0036] The image sampling module is used to perform stable and traceable image sampling on each pet food granule being transported on the food production line, and to obtain high-quality image sequences and corresponding metadata for subsequent preprocessing, segmentation and feature extraction.

[0037] The preprocessing and synchronization module is used to perform temporal, geometric and color correction on the original image and metadata, and generate a structured input package after denoising and enhancement. It maps the temporal and spatial consistency across modules for use by the segmentation and feature extraction modules.

[0038] The segmentation and feature extraction module is used to accurately separate individual pet food particle instances from preprocessed and synchronized images, extract multi-source features that can identify defects from each instance, and label and cache low-confidence samples to support online learning and rapid adaptation.

[0039] The judgment execution module is used to receive the fused discrimination vector and confidence level, classify each pet food granule into three categories: qualified, unqualified, and suspicious according to predetermined rules, remove unqualified pet food granules accordingly, record logs and update statistical indicators, and send low-confidence samples back for online fine-tuning.

[0040] like Figure 2 A pet food pellet quality identification system based on image recognition is presented. The horizontal axis lists key performance indicators, and the vertical axis represents exemplified performance scores ranging from 0 to 100. Higher values ​​indicate better performance. The system aims to visually demonstrate the expected improvement of the invention in key capabilities compared to typical prior art.

[0041] Example 2, this example is an explanation of Example 1, specifically describing the implementation steps of the image sampling module:

[0042] By deploying an industrial line scan camera and its matching lighting unit horizontally above the pet food conveyor belt, the lighting unit specifically includes a top-light polarized strobe LED light source and a side-light diffuse reflection supplementary light component, the industrial line scan camera is internally calibrated for distortion correction, and white balance and brightness are calibrated when the system is online to obtain correction parameters for subsequent color and size measurements.

[0043] Specifically, the intrinsic parameters and distortion correction of the industrial line scan camera are performed by moving a calibration plate with a pre-set grid spacing in different postures and positions, and scanning and acquiring a calibration sequence of images with the industrial line scan camera. By detecting the grid center in each sampled image and performing parameter estimation and least squares optimization based on the pinhole imaging model and the radial distortion model, the intrinsic parameters of the camera, including focal length, principal point coordinates, pixel ratio, etc., and the value of the distortion coefficient, are obtained. The intrinsic parameters and distortion coefficients are used to generate a distortion correction mapping table and the pixel is applied to the mapping for real-time correction to obtain a geometrically corrected image after distortion correction.

[0044] A photoelectric switch is installed on the conveyor belt to trigger an industrial line scan camera. The sampling time is synchronized with the position information of the conveyor belt, and a unique identifier (resourceId) is generated for each sample. The sampling method is dynamically selected according to the conveyor belt speed and the size of the pet food particles. For example, if the conveyor belt speed is less than 0.2 m / s and the pet food particles are between 3 and 8 mm, a single-frame sampling method is selected. After sampling, the image undergoes preliminary quality verification. Invalid images such as overexposed, blurred, or occluded images are identified and marked. The corresponding unique identifier is recorded to generate a log, and invalid images are replaced by resampling. The acquired image, selected sampling mode, equipment calibration parameters, image unique identifier, and sampling timestamp are encapsulated and stored as a structured object in JSON format.

[0045] Example 3 is an explanation of Example 1, specifically outlining the implementation steps of the preprocessing and synchronization module:

[0046] The system uses the PTP precise time protocol to unify the time reference between various acquisition devices and triggers. By converting the geometrically corrected image after distortion correction from the camera's original space to a unified color space, color correction is performed using a color mapping matrix to obtain color consistency between different samples. The color mapping matrix is ​​obtained by first photographing a standard color chart and extracting the camera's RGB values ​​for each color block, then reading the target color value of the color block to obtain a set of sample pairs. The least squares fit is then performed on the camera's linearized RGB values ​​and the target color values ​​to solve for the transformation matrix and bias vector, resulting in the mapping relationship used to map the pixels acquired by the camera to the unified color space.

[0047] Real-time noise reduction is achieved using bilateral filtering, with adaptive histogram equalization to enhance local contrast. A local neighborhood is selected around each pixel to be processed, and pixel values ​​within this neighborhood are weighted and averaged based on spatial distance and pixel value differences. This is combined with the current pixel position and the output filtering of pixels in the neighborhood. The formula is as follows:

[0048] ,

[0049] in This represents the output filter, where o represents the normalization coefficient, q represents the neighborhood pixels, p represents the current pixel, and N represents the neighborhood set centered at p. This represents the pixel value of pixel p. Let q represent the pixel value, and exp represent the exponential function. Indicates spatial standard deviation. Represents the standard deviation of the numerical range;

[0050] Example 4 is an explanation of Example 1, specifically outlining the implementation steps of the segmentation and feature extraction module:

[0051] First, a hybrid traditional and deep learning approach is used to segment the preprocessed and synchronized images to obtain pixel-level masks and bounding boxes for each pet food particle. After the masks are generated, connected component analysis and morphological operations are used to refine the mask contours and improve the accuracy of single pet food particle segmentation results.

[0052] Specifically, the method employs a hybrid approach combining traditional and deep learning to obtain masks and bounding boxes. Initial binarization is performed using an adaptive threshold. Morphological operations such as dilation and opening / closing are used to remove noise and fill small holes. Connected components are analyzed, and pixels with an area threshold (e.g., less than 50 pixels) are considered noise. Candidate patches are obtained through filtering. For overlapping areas within the candidate patches, distance transforms are calculated, and local maxima are extracted as distinguishing points. These distinguishing points are used to segment the target region into candidate regions. The candidate regions generated by traditional processing are cropped according to a predetermined filling method and fed into a lightweight deep instance segmentation network for refined segmentation and confidence scoring. This lightweight deep instance segmentation network utilizes a lightweight backbone network such as MobileNet, a lightweight feature fusion module, and a single-stage instance segmentation head, combined with candidate region pre-screening and simple post-processing, to significantly reduce computational load and processing latency while maintaining high segmentation accuracy. Instances from adjacent frames are fused using temporal consistency checks. The critical boundaries are fine-tuned by using majority voting fusion of the segmentation results of the same pet food particle across multiple consecutive frames, resulting in a more stable mask sequence.

[0053] Faced with the segmented overlapping region, the instance-based pet food particle mask is split first according to the local edge curvature. The module obtains the discrimination quantity for surface and optical anomalies by calculating static features such as shape geometry, area, perimeter, color statistics, texture description and polarization difference index. For each frame candidate region, the temporal brightness curve, polarization change over time and mask deformation are calculated, and transient features are extracted to obtain the dynamic discrimination quantity for near-surface physical property differences. The above features are standardized and fused into a unified discrimination vector in low-dimensional space.

[0054] Specifically, the instance-based pet food particle mask is segmented based on local edge curvature. This is achieved by calculating the local curvature at each location on the edge of the candidate overlapping region and identifying depressions. Segmentation lines are then constructed at these depressions to separate the overlapping targets. The formula for calculating the local curvature is as follows:

[0055] ,

[0056] in Let represent the local curvature of contour point i, where i represents the index of the contour point, and k represents the span parameter. Let i represent the contour point, and area represent the area of ​​the triangle formed by connecting the three contour points.

[0057] The confidence scores for the segmentation results and each type of feature are calculated. The fusion confidence score is obtained by combining the pixel-level confidence score, mask consistency confidence score, and boundary confidence score according to their respective weights. The pixel-level confidence score is obtained by using the pixel prediction probability of the network, the mask consistency confidence score is obtained by comparing the current mask with the projection mask of the previous frame, and the boundary confidence score is obtained by normalizing the boundary smoothness.

[0058] Example 5 is an explanation of Example 1, specifically outlining the implementation steps of the determination and execution module:

[0059] Based on the fusion confidence score output by the feature extraction module, the fusion confidence scores are divided according to a threshold. Those with a fusion confidence score higher than 0.9 are considered qualified, those with a confidence score lower than 0.6 are considered unqualified, and those between 0.6 and 0.9 are considered suspicious. For unqualified pet food particles, the actuator first issues a trigger command, which is precisely triggered according to the calculated delay, and the target pet food particles are removed at the corresponding physical location. For pet food particles that are considered suspicious, the majority decision within the time window is used to process the suspicious pet food particles.

[0060] Specifically, the majority decision within the time window involves collecting the confidence calibration judgment results of each frame within a capture time window of each pet food particle, such as a fixed duration of 3 seconds, and conducting majority voting on suspicious markers in the same image based on their confidence levels. When the number of suspicious votes accounts for more than half of the total votes, the particle is judged as suspicious and enters the cache review process.

[0061] The embodiments of the present invention described above are subject to modification and change of method by those skilled in the art without departing from the embodiments and broader aspects of the present invention. The appended claims are intended to include all such modifications and changes of method that do not depart from the present invention.

Claims

1. A pet food pellet quality identification system based on image recognition, characterized in that, include: The image sampling module is used to perform stable and traceable image sampling on each pet food granule being transported on the food production line, and to obtain high-quality image sequences and corresponding metadata for subsequent preprocessing, segmentation and feature extraction. The preprocessing and synchronization module is used to perform temporal, geometric and color correction on the original image and metadata, and generate a structured input package after denoising and enhancement. It maps the temporal and spatial consistency across modules for use by the segmentation and feature extraction modules. The segmentation and feature extraction module is used to accurately separate individual pet food particle instances from preprocessed and synchronized images, extract multi-source features that can identify defects from each instance, and label and cache low-confidence samples to support online learning and rapid adaptation. Initial binarization is performed using an adaptive threshold. Morphological operations are then used to remove noise and fill small holes. Connected components are analyzed and filtered by area threshold to obtain candidate patches. For overlapping areas in the candidate patches, distance transform is calculated and local values ​​are extracted as distinguishing points. These distinguishing points are used to segment the target region into candidate regions. Candidate regions generated by traditional processing are cropped according to predetermined filling and fed into a lightweight deep instance segmentation network for fine-grained segmentation and confidence scoring. Specifically, the lightweight deep instance segmentation network employs a lightweight backbone network, a lightweight feature fusion module, and a single-stage instance segmentation head, combined with candidate region pre-screening and simple post-processing, to significantly reduce computation and processing latency while maintaining high segmentation accuracy. Instances from adjacent frames are fused through temporal consistency verification. By using majority voting fusion of the segmentation results of the same pet food particle across multiple consecutive frames, the critical boundaries are fine-tuned to obtain a stable mask sequence. Faced with the segmented overlapping region, the instance-based pet food particle mask is preferentially split according to the local edge curvature. The module obtains the discrimination quantity for surface and optical anomalies by calculating the shape geometry and static features. For each candidate region, the temporal brightness curve, polarization change over time and mask deformation are calculated, and transient features are extracted to obtain the dynamic discrimination quantity for near-surface physical property differences. The above features are standardized and fused into a unified discrimination vector in a low-dimensional space. By calculating the local curvature at each location on the edge of the candidate overlapping region and identifying depression points, a segmentation line is constructed at the depression locations to separate the overlapping targets. The formula for calculating the local curvature is as follows: , in Let represent the local curvature of contour point i, where i represents the index of the contour point, and k represents the span parameter. Let i represent the contour point, and area represent the area of ​​the triangle formed by connecting the three contour points. The confidence scores for the segmentation results and each type of feature are calculated. The fusion confidence score is obtained by combining the pixel-level confidence score, mask consistency confidence score, and boundary confidence score according to their respective weights. The pixel-level confidence score is obtained by using the pixel prediction probability of the network, the mask consistency confidence score is obtained by comparing the current mask with the projection mask of the previous frame, and the boundary confidence score is obtained by normalizing the boundary smoothness. The judgment execution module is used to receive the fused discrimination vector and confidence level, classify each pet food granule into three categories: qualified, unqualified, and suspicious according to predetermined rules, remove unqualified pet food granules accordingly, record logs and update statistical indicators, and send low-confidence samples back for online fine-tuning.

2. The pet food pellet quality identification system based on image recognition according to claim 1, characterized in that: The specific steps of the image sampling module are as follows: By deploying an industrial line scan camera and its matching lighting unit horizontally above the pet food conveyor belt, the lighting unit specifically includes a top-light polarized strobe LED light source and a side-light diffuse reflection supplementary lighting component, the industrial line scan camera is internally calibrated for distortion correction. White balance and brightness calibration are performed when the system is online to obtain correction parameters for subsequent color and size measurements.

3. The pet food pellet quality identification system based on image recognition according to claim 2, characterized in that: The specific steps of the image sampling module also include: A photoelectric switch is installed on the conveyor belt to trigger an industrial line scan camera. The sampling time is synchronized with the position information of the conveyor belt, and a unique identifier is generated for each sample. The sampling method is dynamically selected based on the conveyor belt speed and the size of the pet food particles. After sampling, the image quality is initially checked, invalid images are identified and marked, and the corresponding unique identifier is recorded to generate a log. Invalid images are replaced by resampling. The acquired image, the selected sampling mode, the equipment calibration parameters, the image unique identifier, and the sampling timestamp are encapsulated and stored as a structured object in JSON format.

4. The pet food pellet quality identification system based on image recognition according to claim 1, characterized in that: The specific steps of the preprocessing and synchronization module are as follows: The system uses the PTP precise time protocol to unify the time reference between various acquisition devices and triggers. By converting the geometrically corrected image after distortion correction from the camera's original space to a unified color space, color correction is performed using a color mapping matrix to obtain color consistency between different samples. The color mapping matrix is ​​obtained by first photographing a standard color chart and extracting the camera's RGB values ​​for each color block, then reading the target color value of that color block to obtain a set of sample pairs. The least squares fit is then performed on the camera's linearized RGB values ​​and the target color values ​​to solve for the transformation matrix and bias vector, resulting in the mapping relationship used to map the pixels acquired by the camera to the unified color space.

5. A pet food pellet quality identification system based on image recognition according to claim 4, characterized in that: The specific steps of the preprocessing and synchronization module also include: Real-time noise reduction is achieved using bilateral filtering, with adaptive histogram equalization to enhance local contrast. A local neighborhood is selected around each pixel to be processed, and pixel values ​​within this neighborhood are weighted and averaged based on spatial distance and pixel value differences. This is combined with the current pixel position and the output filtering of pixels in the neighborhood. The formula is as follows: , in This represents the output filter, where o represents the normalization coefficient, q represents the neighborhood pixels, p represents the current pixel, and N represents the neighborhood set centered at p. This represents the pixel value of pixel p. Let q represent the pixel value, and exp represent the exponential function. Indicates spatial standard deviation. It represents the standard deviation of the numerical domain.

6. The pet food pellet quality identification system based on image recognition according to claim 1, characterized in that: The specific steps of the segmentation and feature extraction module are as follows: First, a hybrid traditional and deep learning approach is used to segment the preprocessed and synchronized images, obtaining pixel-level masks and bounding boxes for each pet food particle. After mask generation, the mask contours are refined through connected component analysis and morphological operations to improve the accuracy of single pet food particle segmentation.

7. A pet food pellet quality identification system based on image recognition according to claim 1, characterized in that: The specific steps of the determination and execution module are as follows: Based on the fusion confidence score output by the feature extraction module, the fusion confidence scores are divided according to a threshold. Those with a fusion confidence score higher than 0.9 are considered qualified, those with a confidence score lower than 0.6 are considered unqualified, and those between 0.6 and 0.9 are considered suspicious. For unqualified pet food particles, the actuator first issues a trigger command, which is precisely triggered according to the calculated delay, and the target pet food particles are removed at the corresponding physical location. For pet food particles that are considered suspicious, the majority decision within the time window is used to process the suspicious pet food particles. By collecting the confidence calibration results of each frame within the capture time window of each pet food particle, and by conducting a majority vote on the suspicious markers of the same image according to their confidence, when the number of suspicious votes accounts for more than half of the total votes, the particle is judged as suspicious and enters the cache review process.