Preformed dish semi-finished product defect identification method and system with AI algorithm

By combining multi-source illumination and adaptive filtering with deep learning algorithms, the problems of noise interference and feature confusion in the defect identification of pre-cooked semi-finished products were solved, achieving high-precision defect identification and production process optimization, thereby improving product quality and production efficiency.

CN120953190AInactive Publication Date: 2025-11-14GUANGXI COMMERCIAL TECHNICIAN COLLEGE
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511033184.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing defect identification methods struggle to adapt to the diverse defect forms and complex backgrounds of pre-prepared semi-finished dishes, resulting in decreased identification accuracy. They are particularly ineffective in detecting subtle or atypical defects, and the noise interference and feature confusion issues of gradient analysis have not been effectively resolved.

Method used

Multiple sets of image data are acquired by illuminating from multiple light sources at different angles. Noise is removed by adaptive filtering. Combined with gradient histogram statistics and cluster analysis, feature extraction and classification are performed using deep convolutional networks and support vector machines. Complete defect areas are obtained by combining region growing algorithms. Time series analysis is used to monitor fluctuations in the production process.

Benefits of technology

It significantly improves the accuracy and robustness of defect identification, enhances the identification precision of subtle and atypical defects, realizes the transformation from passive detection to proactive process optimization, stabilizes product quality, and reduces the defect rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953190A_ABST
    Figure CN120953190A_ABST
Patent Text Reader

Abstract

The invention provides a prefabricated dish semi-finished product defect identification method and system with an AI algorithm, and the method comprises the steps: extracting semantic features from a refined defect candidate region set, carrying out the feature mapping of each region through a deep convolutional network according to the demands of atypical defect identification, and obtaining the defect description represented by a high-dimensional feature vector; marking original image data through a final defect identification result, and for inhibition of complex background interference, performing outward expansion from defect edge features by adopting a region growing algorithm to obtain complete defect region boundary information; after complete defect area boundary information is obtained, defect distribution changes of continuous batches of images are compared through a time sequence analysis method according to the monitoring requirement of production process fluctuation, and the quantitative basis of process adjustment is determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of information technology and food engineering, and in particular to a method and system for identifying defects in pre-prepared semi-finished food products using AI algorithms. Background Technology

[0002] Defect identification in pre-prepared food products is a crucial research area in intelligent manufacturing within the food industry, directly impacting product quality and safety as well as production efficiency. With consumers increasingly demanding higher food safety and quality standards, the ability to quickly and accurately identify defects in pre-prepared foods using intelligent methods has become a key technological requirement driving industry development. Research in this area can not only reduce the cost and error of manual inspection but also provide technical support for large-scale automated production, possessing significant practical and economic value.

[0003] However, current mainstream defect identification methods, such as those based on traditional image processing or simple machine learning, often exhibit limitations when faced with the diverse defect forms and complex backgrounds of pre-prepared food semi-finished products. These methods typically rely on pre-set feature templates or rules, making it difficult to adapt to the fluctuations in defect features caused by differences in raw materials and changes in production processes, resulting in decreased identification accuracy, especially in the detection of subtle or atypical defects.

[0004] Against this backdrop, improving the accuracy of defect identification faces several core challenges, with gradient analysis of key points becoming a focal point for technological breakthroughs. Gradient analysis, as a crucial means of describing defect edges or feature changes, directly impacts defect localization and classification. However, due to the complex surface textures, uneven lighting, and irregular morphology of pre-prepared food products, the gradient information of key points is often affected by noise interference or feature confusion, leading to reduced reliability of gradient calculations. Furthermore, effectively combining gradient analysis with the semantic features of defects remains a technical challenge that has not yet been fully resolved. These factors collectively constrain the performance optimization of defect identification.

[0005] Therefore, how to overcome noise interference and improve the robustness of feature extraction through gradient analysis of key points to achieve high-precision identification of defects in pre-prepared food products has become an urgent technical problem to be solved. Solving this problem will provide a new technical path for intelligent defect detection and improve the quality control level of the pre-prepared food industry. Summary of the Invention

[0006] This invention provides a method for identifying defects in pre-prepared food semi-finished products using AI algorithms, mainly including: The raw image data of the pre-cooked semi-finished food is obtained, and surface information is collected by high-resolution imaging equipment. In the case of complex surface texture and uneven light distribution, multiple sets of image data are obtained by irradiation from multiple light sources at different angles to determine a preliminary candidate set of defect areas. The image dataset extracts the parts with significant brightness changes from multiple sets of image data. To mitigate the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images, resulting in a denoised image set that preserves the clarity of defect edge features. The gradient magnitude and direction of each pixel are calculated based on the denoised image set. To address the feature confusion caused by complex surface textures, the changing trend of each candidate region is statistically analyzed through gradient histograms to obtain the distribution pattern of defect edge features. Candidate regions are clustered based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset. The consistency of gradient information within each feature subset is obtained. To meet the accuracy requirements of detecting subtle defects, the subsets are filtered using a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions. Semantic features are extracted from the refined defect candidate region set. To meet the needs of atypical defect identification, a deep convolutional network is used to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector. The defect descriptions are classified based on high-dimensional feature vectors. To improve the robustness of feature extraction, the vectors are trained and predicted using the support vector machine algorithm to determine whether each candidate region belongs to a defect, and the final defect identification result is output. The original image data is labeled based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information. After obtaining complete defect area boundary information, to meet the monitoring needs of production process fluctuations, time series analysis is used to compare the defect distribution changes of consecutive batch images to determine the quantitative basis for process adjustments.

[0007] This invention provides a pre-cooked food semi-finished product defect identification system with AI algorithm, mainly comprising: The image acquisition module is used to acquire raw image data of pre-cooked semi-finished products. It acquires surface information through high-resolution imaging equipment. For cases with complex surface texture and uneven light distribution, it uses multiple light source angles to obtain multiple sets of image data and determine a preliminary candidate set of defect areas. The image preprocessing module is used to extract the parts with significant brightness changes from multiple sets of image data. To address the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images to obtain a denoised image set while preserving the clarity of defect edge features. The gradient analysis module is used to calculate the gradient magnitude and direction of each pixel based on the denoised image set. To address feature confusion caused by complex surface textures, the module uses gradient histograms to statistically analyze the changing trends of each candidate region and obtain the distribution patterns of defect edge features. The clustering module is used to cluster candidate regions based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset. The candidate filtering module is used to obtain the consistency of gradient information within each feature subset. Based on the accuracy requirements of fine defect detection, the subset is filtered through a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions. The feature extraction module is used to extract semantic features from the refined defect candidate region set. In order to meet the needs of atypical defect identification, a deep convolutional network is used to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector. The classification and recognition module is used to classify defect descriptions based on high-dimensional feature vectors. To improve the robustness of feature extraction, the vectors are trained and predicted using the support vector machine algorithm to determine whether each candidate region belongs to a defect and output the final defect recognition result. The region labeling module is used to label the original image data based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information. The process monitoring module is used to obtain complete defect area boundary information and, in response to the monitoring needs of production process fluctuations, compare the defect distribution changes of consecutive batch images using time series analysis methods to determine the quantitative basis for process adjustments.

[0008] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: 1. Improved accuracy and robustness of defect identification: By using multi-angle illumination to suppress uneven illumination and innovatively introducing a candidate region screening mechanism based on gradient information consistency, interference from complex textures and noise is effectively filtered out, significantly improving the identification accuracy of subtle and atypical defects.

[0009] 2. Enhanced targeting and effectiveness of feature extraction: This invention adopts a multi-stage hybrid feature extraction strategy that combines traditional gradient analysis with deep convolutional networks. First, it uses computationally efficient gradient features for rapid localization and refinement, and then uses deep networks to extract semantic features. This achieves complementary advantages and solves the problem that single feature extraction methods cannot balance efficiency and deep semantics.

[0010] 3. Achieved closed-loop intelligent monitoring and optimization of the production process: This invention transforms defect detection results into quantitative monitoring data for production process fluctuations through time series analysis, realizing a shift from passive "post-event detection" to proactive "process control." This not only identifies product defects but also guides the dynamic adjustment of production parameters, thereby stabilizing product quality and reducing the defect rate, demonstrating significant industrial application value. Attached Figure Description

[0011] Figure 1 This is a flowchart of a method for identifying defects in pre-cooked semi-finished dishes with an AI algorithm according to the present invention.

[0012] Figure 2 This is a schematic diagram of a method and system for identifying defects in pre-cooked semi-finished dishes with AI algorithms according to the present invention.

[0013] Figure 3 This is another schematic diagram of a method and system for identifying defects in pre-cooked semi-finished dishes with AI algorithms according to the present invention. Detailed Implementation

[0014] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0015] like Figure 1-3 This embodiment of a method and system for identifying defects in pre-prepared semi-finished dishes with AI algorithms may specifically include: S101. Obtain the original image data of the pre-cooked semi-finished product. Collect surface information through a high-resolution imaging device. For cases with complex surface texture and uneven light distribution, use multiple light source angles to obtain multiple sets of image data and determine a preliminary candidate set of defect areas.

[0016] Image data of the prepared vegetable surface was acquired using a high-resolution imaging device. Multiple sets of images were generated by illuminating the surface from multiple angles, resulting in a preliminary image set. For areas with complex textures within the image set, edge detection algorithms were used to extract features and identify regions containing potential defects. From this region set, a subset of areas with uneven illumination was selected. If the brightness variation within a subset exceeded a preset threshold, mean filtering was used to adjust the illumination distribution, resulting in a balanced image set. Based on the balanced image set, the texture complexity of each region was calculated to determine a candidate set of defect regions. Features of each region in the candidate set were acquired and classified using a support vector machine algorithm to identify a high-confidence defect region set. This defect region set was then grouped using a clustering algorithm to obtain the final defect distribution set. Based on this defect distribution set, spatial mapping data of the defects on the prepared vegetable surface was generated to determine the location and extent of the defects.

[0017] For example, when acquiring image data of the surface of pre-prepared vegetables using a high-resolution imaging device, an industrial-grade CCD camera can be used to acquire images with a resolution of 2000×2000 pixels.

[0018] For example, when inspecting the surface of pre-prepared dishes such as fish balls, the camera captures images at 10 frames per second to ensure the capture of subtle textures. Multiple sets of image data are generated using multi-angle lighting. Four LED light sources can be set, illuminating from angles of 0°, 45°, 90°, and 135° respectively, with the light intensity adjusted to 5000 lumens each time, generating four sets of images with different lighting effects. This method can highlight surface irregularities or potential defects, facilitating subsequent analysis. For areas with complex textures in the image set, the Canny algorithm can be selected when using edge detection algorithms to extract features.

[0019] For example, by setting a low threshold of 50 and a high threshold of 150, the complex texture edges formed on the surface of fish balls due to uneven oil distribution can be detected to identify a set of regions containing potential defects, such as cracks or air bubbles.

[0020] It should be noted that edge detection can effectively separate texture boundaries, which helps to focus on problem areas. When obtaining a subset of unevenly lit areas from a set of regions, brightness values ​​can be analyzed.

[0021] For example, if the brightness range of a certain area within a subset exceeds the preset threshold of 180 from 100 to 220, it indicates that the illumination distribution is uneven.

[0022] In one possible implementation, the illumination distribution is adjusted by mean filtering using a 5×5 pixel filter window to smooth brightness transitions, resulting in a balanced image set. This processing reduces illumination interference and improves the accuracy of defect identification. When calculating texture complexity based on the balanced image set, a gray-level co-occurrence matrix can be used.

[0023] For example, if the contrast value of a certain area on the surface of a fish ball is calculated to be 0.8 and the correlation value is 0.6, and if it exceeds the complexity threshold of 0.7, it is included in the candidate set of defect areas.

[0024] Specifically, this method quantifies texture roughness, providing a basis for subsequent classification. After obtaining the region features in the candidate set, features such as edge sharpness and area size can be extracted during classification using the support vector machine algorithm.

[0025] For example, if a region has an edge sharpness of 0.9 and an area of ​​50 pixels, and is input into an SVM model, the training data contains 1000 labeled samples. The classification results show that it is a high-confidence defect region, such as a surface crack.

[0026] Preferably, SVM can effectively distinguish between normal textures and defects, improving detection reliability. When grouping defect regions using clustering algorithms, the K-means algorithm can be used.

[0027] For example, by setting the cluster number K=3, the defects on the surface of the fish balls are divided into three groups: small cracks, large pits, and bubbles, resulting in the final defect distribution set. This grouping helps to analyze the distribution patterns of defect types. When generating spatial mapping data from the defect distribution set, a two-dimensional heat map can be drawn.

[0028] For example, if a defect on the surface of a fish ball is concentrated within a 2-centimeter diameter area, the thermal map will show a high-density red area, indicating that the defect is severe.

[0029] In one embodiment, this mapping can visually represent the location and extent of defects, facilitating the precise removal of problematic products during production.

[0030] For example, combining multi-angle light sources with edge detection and SVM classification can significantly improve the accuracy and efficiency of surface defect detection in pre-prepared vegetables.

[0031] For example, the defect detection rate increased from 85% to 95% compared to single-light source detection.

[0032] Understandably, balanced illumination and cluster analysis further optimize the visualization and operability of the results, providing technical support for quality control.

[0033] S102. Extract the parts with significant brightness changes from multiple sets of image data. To address the impact of gradient information noise, use an adaptive filtering method to preprocess each set of images to obtain a denoised image set while preserving the clarity of defect edge features.

[0034] Multiple sets of original images of pre-prepared vegetables were acquired, and the brightness distribution histogram of each set was calculated. Significant brightness variation regions were identified based on the peak differences in the histograms. For these significant regions, a Gaussian filter was used for initial noise reduction to decrease random noise interference in the gradient information. Edge contour information was extracted from the images using an edge detection algorithm to construct an edge feature map, preserving the geometric shape features of defect edges. Based on the edge feature map, a median filter with an adaptive window size was designed to perform targeted noise reduction in different regions, preserving edge details. If local noise still existed in the filtered image, a non-local mean filtering method was used for further noise reduction optimization to improve the overall image clarity. A contrast enhancement algorithm was applied to the denoised image set to highlight the difference between potential defect areas and the background, facilitating subsequent defect detection and analysis. Morphological operations were used to extract candidate defect regions from the enhanced images, resulting in the final set of pre-prepared vegetable defect detection images.

[0035] For example, when acquiring multiple sets of raw image data of pre-prepared dishes, surface images of different batches of pre-prepared dishes can be captured using a high-resolution camera.

[0036] For example, using an industrial camera with a resolution of 3000×3000 pixels, images of pre-prepared dishes such as chicken meatballs are taken. Each set of data contains 20 images, reflecting the surface condition under different lighting and angles. When calculating the brightness distribution histogram, the grayscale values ​​of each image can be divided into 256 levels, and the number of pixels in each level can be counted to generate a histogram.

[0037] For example, if the histogram of a set of images shows peaks concentrated at gray values ​​of 80 and 200, with a large difference in peak values, it indicates that there may be defects or foreign objects in areas with significant brightness variations. Using a Gaussian filter for noise reduction in these areas can effectively smooth the image.

[0038] For example, by setting the Gaussian kernel size to 3×3 and the pixel standard deviation to 1, we can handle the minor noise caused by dust or oil stains on the surface of chicken meatballs. This method can reduce random interference in gradient information, making subsequent edge extraction easier.

[0039] It should be noted that Gaussian filtering, through blurring and smoothing, can preserve the main structural features. Next, when constructing the edge feature map using an edge detection algorithm, the Sobel operator can be selected.

[0040] For example, in the detection of chicken meatball surfaces, the Sobel operator calculates the gradients in the horizontal and vertical directions to generate edge contours, highlighting the geometry of cracks or depressions, which helps in defect localization.

[0041] In one possible implementation, when designing a median filter with an adaptive window size, the window can be adjusted according to the region complexity in the edge feature map.

[0042] For example, densely textured areas are treated with 5x5 windows, while smooth areas are treated with 3x3 windows to remove minute noise left on the surface of chicken meatballs due to processing. This targeted denoising preserves edge details and improves image quality.

[0043] Specifically, if local noise still exists after filtering, nonlocal mean filtering can be used for optimization.

[0044] For example, by setting the search window to 11×11 and processing the noise reflected by grease on the surface of chicken meatballs, the sharpness is further improved by weighted averaging of similar pixels.

[0045] Preferably, when applying a contrast enhancement algorithm to the denoised image set, histogram equalization can be used.

[0046] For example, redistributing the grayscale values ​​of a chicken meatball image can make dark defects such as bubbles more noticeable against the background, facilitating subsequent analysis.

[0047] Understandably, this method highlights potential problem areas by stretching the grayscale range. When extracting candidate defect regions using morphological operations, dilation and erosion operations can be used.

[0048] For example, an enhanced chicken meatball image is first dilated using a 3×3 structuring element, then eroded to separate crack or foreign object areas, generating a final defect detection result image set. This processing can effectively delineate problem areas, providing support for quality monitoring.

[0049] In one embodiment, the above process forms a complete detection chain, from brightness analysis to morphological processing.

[0050] For example, after processing images of a batch of chicken meatballs, small crack areas with a diameter of 1 mm were successfully identified, and the heat map showed that they were concentrated at the edges. This multi-step collaborative approach can significantly improve the comprehensiveness and accuracy of defect detection, providing a data foundation for production optimization.

[0051] S103. Calculate the gradient magnitude and direction of each pixel based on the denoised image set. To address feature confusion caused by complex surface textures, analyze the changing trend of each candidate region through gradient histogram statistical analysis to obtain the distribution pattern of defect edge features.

[0052] The gradient magnitude and direction of each pixel in the denoised image are calculated to obtain preliminary gradient information. Based on this preliminary gradient information, histogram statistics are used to analyze the changing trends of candidate regions and determine the feature distribution characteristics within each region. If the changing trend indicates complex surface texture, the boundaries of the candidate regions are adjusted by changing the gradient direction to obtain a more accurate region division. Based on the adjusted candidate regions, the salient parts of the defect edges are extracted from the gradient magnitude to obtain an edge feature set. A distribution pattern map is constructed using the edge feature set to determine the degree of influence of feature confusion on the defect edges. Edge features less affected by feature confusion are selected using the distribution pattern map to obtain optimized defect edge data. Morphological operations are applied to the optimized defect edge data to highlight edge features, obtaining the final defect region image.

[0053] S104. Cluster the candidate regions according to the distribution pattern. For the case of diverse defect morphologies, use a density-based clustering algorithm to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset.

[0054] Preliminary segmentation of candidate defect regions in pre-prepared dishes is performed based on distribution patterns. A density-based clustering algorithm is used to process the data within these regions, resulting in multiple feature subsets. Gradient information is acquired within each feature subset, and the consistency of gradient information within each subset is assessed. If the consistency of gradient information is below a preset threshold, the boundaries of the feature subsets are adjusted using a density algorithm, resulting in an optimized subset set. Based on the optimized subset set, features related to the morphology of defects in pre-prepared dishes are extracted from the gradient information to determine the distribution of regions with diverse morphologies. Based on the distribution characteristics of these morphologically diverse regions, information analysis methods are used to reorder the gradient information, obtaining a sorted feature sequence. Morphological operations are applied to the sorted feature sequence to highlight the differences between subsets, yielding the final region segmentation result. Key features are extracted from the final pre-prepared dish defect region segmentation result to determine the distribution trend of defect morphologies.

[0055] For example, the distribution patterns can be used to initially divide the candidate areas for defects in pre-cooked dishes, that is, to delineate potential defect areas by utilizing the spatial distribution characteristics of the data.

[0056] For example, in an image of a pre-prepared dish's surface, if the distribution pattern shows that pixel values ​​in certain areas change relatively uniformly, these areas can be initially classified as candidate regions. One possible implementation is to generate a distribution pattern map by statistically analyzing the differences between each pixel and its neighbors, thereby dividing the surface of a pre-prepared dish into multiple initial regions. For instance, a pre-prepared dish surface could be divided into 10 candidate regions, each approximately 50x50 pixels in size. This can be achieved by using a density-based clustering algorithm to process the data within these regions.

[0057] Preferably, the DBSCAN algorithm can be used to cluster the pixels in each candidate region.

[0058] For example, if the neighborhood radius is set to 5 pixels and the minimum number of points is 10, if the pixel density in a certain region is high, they are clustered into a feature subset. For instance, if there are 3 high-density subsets in a candidate region, containing 20, 15, and 10 pixels respectively, these feature subsets can be obtained.

[0059] It should be noted that this method can effectively separate dense and sparse regions. When obtaining gradient information and judging the consistency of gradient information within a feature subset, this can be achieved by calculating the gradient magnitude of pixels within each subset.

[0060] Specifically, if the gradient magnitudes of 20 pixels in a subset all fluctuate within the range of 50-60, the gradient information consistency is relatively high and can be set to 0.9; if the gradient magnitudes of another subset jump from 20 to 80, the gradient information consistency is relatively low, such as 0.4. If the gradient information consistency is lower than the preset threshold of 0.7, the boundary is adjusted using a density algorithm.

[0061] For example, by shrinking the boundary of the subset with low gradient information consistency inward and removing outliers, the optimized subset may be reduced from 15 pixels to 12. This is then used when extracting features related to the morphology of defects in pre-prepared dishes based on the optimized subset.

[0062] In one embodiment, the continuity of gradient direction can be considered. If the gradient direction in a subset gradually changes from 0° to 45°, it indicates the possible presence of crack-like defects; while in another subset, the directions are disordered, which may indicate blemishes. The diverse distribution of regions is thus determined, for example, crack regions account for 30% and blemish regions account for 20%. Gradient information is then reordered based on the distribution characteristics of these diverse regions.

[0063] In one embodiment, the gradient magnitudes can be sorted by significance.

[0064] For example, features with higher gradient magnitudes in crack regions are ranked first, while lower features in blemish regions are ranked later, forming an ordered feature sequence. This ranking helps to highlight key defects. Morphological operations can also be used to highlight differences between subsets.

[0065] Preferably, the dilation operation can be used to amplify the differences in subset boundaries.

[0066] For example, applying a 3x3 expansion kernel to the crack subset makes its edges more prominent, while leaving the blemish subset unchanged, resulting in a clearer final region segmentation. Extracting key features from this data allows us to determine the distribution trend of defect morphology; for instance, cracks tend to concentrate at the edges of precast dishes, while blemishes are scattered in the center. This analysis provides a more reliable basis for subsequent quality inspection.

[0067] S105. Obtain the consistency of gradient information within each feature subset. Based on the accuracy requirements for detecting subtle defects, the subset is filtered using a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions.

[0068] Gradient information is acquired within each feature subset, and the direction of information processing is determined by calculating the consistency of the gradient information. If the consistency of the gradient information is lower than a preset threshold, the corresponding feature subset is removed, resulting in a filtered subset set. For the filtered subset set, information processing methods are used to extract gradient information features related to minor defects. The extracted gradient information features are grouped using a density clustering algorithm to obtain a preliminary distribution of defect candidate regions. Based on the region set in the preliminary distribution, the consistency of each region is obtained to determine the feasibility of the refined result. For the refined result, morphological operations are used to highlight the differences between defect candidate regions, determining the final region set. Key features related to minor defects are extracted from the final region set to determine the distribution trend of defects in the pre-prepared food.

[0069] For example, gradient information is obtained within each feature subset, i.e., the changing trend of pixels is extracted from the image of the prepared food surface.

[0070] For example, in an image of a prepared dish, if a subset of features contains 25 pixels, gradient information can be generated by analyzing the direction and intensity of brightness changes in these pixels. For instance, an area where the brightness gradually transitions from 100 to 120 may reflect a smooth surface, while an area that suddenly jumps from 50 to 150 may suggest a defective edge.

[0071] In one possible implementation, the degree of consistency of gradient information can be calculated based on the similarity of gradient information.

[0072] Specifically, if the gradient directions of 20 pixels in a subset fluctuate between 10° and 15°, the gradient information consistency is relatively high and can be set to 0.85; if the directions are scattered from 5° to 60°, the gradient information consistency is relatively low, such as 0.3.

[0073] It should be noted that if the preset threshold is 0.6, subsets with gradient information consistency below this value will be removed.

[0074] For example, a subset might be removed due to excessive dispersion in orientation, leaving four subsets with 18, 22, 15, and 10 pixels respectively. This filtering process removes noisy data, improving the reliability of subsequent analysis. Gradient information features related to subtle defects are then extracted from the filtered subsets.

[0075] Preferably, attention can be paid to small changes in the gradient magnitude.

[0076] In one embodiment, if the gradient magnitude in a subset fluctuates slightly between 5 and 10, it may indicate a minor scratch; while the magnitude in another subset remains stable at 20, which may be associated with a more noticeable indentation.

[0077] For example, after analyzing a subset of 18 pixels, the amplitude was found to be concentrated around 7, suggesting potential subtle defects. This method helps to capture features that are not easily noticed. When grouping gradient information features using density clustering algorithms, the OPTICS algorithm can be used for processing.

[0078] For example, with a neighborhood radius of 3 pixels and a minimum number of points of 5, 15 pixels within a subset are divided into two density groups: one containing 9 points and the other containing 6 points, thus initially forming a distribution of candidate defect regions. This grouping effectively reflects the spatial clustering of defects. When judging the consistency of gradient information based on the region sets in the initial distribution...

[0079] Specifically, the stability of gradient information within each region can be checked.

[0080] For example, the gradient directions of the 9 point regions are all around 20°, and the gradient information consistency level reaches 0.9, while the directions of the 6 point regions are scattered, and the gradient information consistency level is only 0.5.

[0081] It should be noted that regions with high consistency in gradient information are more likely to be real defects, thus making the refined results more reliable. Morphological operations are used to highlight the differences between candidate defect regions.

[0082] In one embodiment, an erosion operation can be applied to regions with high gradient information consistency to shrink the boundary, and an expansion operation can be applied to regions with low gradient information consistency to amplify the differences.

[0083] For example, a region with nine points becomes more focused after its boundaries are tightened, while a region with six points becomes more distinct from other regions after it is expanded, resulting in a clearer final region set. When extracting key features related to subtle defects from the final region set, attention is paid to the regularity of the gradient direction.

[0084] For example, a region where the orientation smoothly transitions from 15° to 30° may indicate a fine crack; another region where the orientation is disordered may indicate a tiny blemish.

[0085] For example, analysis revealed that crack-like defects were concentrated at the top of the prepared dishes, while stains were mostly distributed at the bottom. This trend analysis can provide a precise basis for quality control.

[0086] S106. Extract semantic features from the refined defect candidate region set. To meet the needs of atypical defect identification, use a deep convolutional network to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector.

[0087] A deep convolutional network is used to perform feature mapping on candidate regions for defects in pre-prepared food, resulting in a preliminary description represented by high-dimensional feature vectors. Semantic features are extracted from these high-dimensional feature vectors to determine the defect description content for each region. A clustering algorithm is used to group the semantic features, obtaining the regional distribution of atypical defects. Based on the regional distribution, the density of the high-dimensional feature vector within each region is calculated to determine the salience of the defect description. If the salience is below a preset threshold, the corresponding region is removed, resulting in a refined set of defect descriptions. Morphological operations are then used on the refined set of defect descriptions to highlight the differences between regions, determining the final distribution of atypical defects. Key information related to atypical defects is extracted from the final distribution to obtain a feature representation of the defect trend.

[0088] S107. Based on the high-dimensional feature vector, the defect description is classified. To improve the robustness of feature extraction, the vector is trained and predicted using the support vector machine algorithm. The algorithm determines whether each candidate region belongs to a defect and outputs the final defect identification result.

[0089] A classification model is obtained by training high-dimensional feature vectors using a support vector machine. High-dimensional feature vectors are then extracted from candidate regions using an extraction method. The classification model is used to predict these high-dimensional feature vectors, yielding preliminary prediction results. If the prediction indicates a region is a defect, the feature vector of that region is retained, creating a defect candidate set. Based on the defect candidate set, the feature vector distribution density of each region is calculated to determine its saliency. Morphological operations are used to process salient regions, determining the final defect distribution of the pre-prepared food. Key information is extracted from the final defect distribution to obtain the defect feature representation.

[0090] For example, support vector machines are a commonly used classification algorithm that can play an important role in the detection of defects in prepared dishes.

[0091] For example, a large number of pre-made food image samples, including defective and non-defective samples, can be collected, from which high-dimensional feature vectors can be extracted as training data.

[0092] In one possible implementation, a convolutional neural network is used to extract deep features from the image, resulting in a high-dimensional feature vector.

[0093] It should be noted that the method for extracting high-dimensional feature vectors is crucial to model performance.

[0094] Specifically, a sliding window method can be used to move gradually across the pre-made food image, extracting a feature vector at each position.

[0095] In one embodiment, the window size can be set to 64x64 pixels with a step size of 32 pixels, which can obtain feature vectors of a large number of candidate regions.

[0096] Preferably, a kernel function can be used to map the feature vector to a high-dimensional space to improve classification accuracy.

[0097] For example, using radial basis function (RBF) kernels can effectively handle nonlinearly separable data.

[0098] After obtaining the preliminary prediction results, further analysis of the defect candidate regions is required.

[0099] In one embodiment, the feature vector density around each candidate region can be calculated.

[0100] For example, the number of candidate regions within a 50-pixel radius is counted. If the density exceeds a threshold (e.g., 3 candidate regions per 100 square pixels), the region is considered highly significant. Morphological operations can further optimize the shape of defective regions.

[0101] For example, a dilation operation is first performed to connect adjacent defect pixels, followed by an erosion operation to remove isolated noise points. This results in a smoother, more continuous defect contour, which is beneficial for subsequent feature extraction. Finally, when extracting key information from the defect distribution, geometric features such as defect area, perimeter, and roundness, as well as statistical features such as average grayscale and texture of the defect region, can be considered. These features can comprehensively characterize the nature of the defect, providing a basis for subsequent defect classification and severity assessment.

[0102] S108. The original image data is labeled based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information.

[0103] Initial annotations are performed on the original image based on the defect identification results of pre-prepared food, yielding initial annotation data. A region growing algorithm is used to expand outwards from the edge features, obtaining the pixel distribution along the expansion direction to determine the preliminary complete region. To address background interference in complex backgrounds, suppression methods are applied to adjust the annotation data, resulting in an optimized complete region. Boundary information is extracted from the optimized complete region, and its closure is determined; if closed, the annotation data for that region is retained. Image processing techniques are used to smooth the retained annotation data, obtaining smoothed boundary information. The original image is then re-annotated based on the smoothed boundary information to obtain the final complete region boundary information. Key distribution features are extracted from the final complete region boundary information to determine the integrity of the defective region.

[0104] For example, the initial labeling of defects in pre-cooked food serves as the basis for subsequent processing.

[0105] For example, a threshold segmentation method can be used to binarize the grayscale image to obtain the initial defect region contour.

[0106] It should be noted that the choice of threshold is crucial to the segmentation effect.

[0107] In one possible implementation, the OTSU algorithm can be used to adaptively calculate the optimal threshold to adapt to images under different lighting conditions. Region growing algorithms can effectively expand the initial contour.

[0108] Specifically, seed points can be selected on the outline and expanded outwards.

[0109] In one embodiment, the growth criterion may be set to a difference of less than 10 between the pixel grayscale value and the seed point.

[0110] Preferably, edge detection operators such as the Sobel operator can be introduced, combined with gradient information, to constrain the growth process and avoid overexpansion. Morphological operations can be used to suppress interference from complex backgrounds.

[0111] For example, first perform an opening operation to remove small noise areas, and then perform a closing operation to fill the small holes inside the defect.

[0112] It should be noted that the size and shape of the structuring elements will affect the suppression effect and need to be adjusted according to the actual defect characteristics. Boundary closure can be determined using the contour tracing method.

[0113] In one embodiment, the contour can be traced point by point along the boundary, and if it returns to the starting point, it is considered closed. For non-closed contours, a live contour model (Snake) can be used for repair.

[0114] For example, internal and external energy functions can be set to gradually converge the contour to the true boundary using the principle of energy minimization. Smoothing helps remove jagged noise at the boundary.

[0115] In one possible implementation, a Gaussian filter can be applied, with the filter kernel size set to 5x5 and the standard deviation σ=1.5.

[0116] It should be noted that excessive smoothing may lead to the loss of boundary details, so the filter parameters need to be carefully balanced.

[0117] S109. After obtaining complete defect area boundary information, in order to meet the monitoring needs of production process fluctuations, the defect distribution changes of consecutive batch images are compared using time series analysis methods to determine the quantitative basis for process adjustment.

[0118] Defect distribution data is extracted from consecutive batches of images using time series analysis to obtain time series information on process fluctuations and determine distribution trends. Based on these trends, image comparison methods are used to analyze the differences in defect distribution between consecutive batches, confirming the batch analysis results. Boundary information is extracted from the batch analysis results to obtain the distribution characteristics of defective areas in the pre-prepared food and assess regional integrity. If regional integrity meets a preset threshold, the distribution characteristics are processed using feature extraction methods to obtain quantitative data on process fluctuations. Based on this quantitative data, a parameter adjustment calculation method is used to generate quantitative basis for process adjustments and determine the adjustment parameter values. By comparing the adjustment parameter values ​​with time series information, the changes in defect distribution after process fluctuation adjustments are obtained, yielding optimized distribution characteristics. Boundary information is extracted from the optimized distribution characteristics to determine whether the defect distribution is stable, obtaining the final process monitoring data.

[0119] For example, extracting defect distribution data from consecutive batches of images through time series analysis is a dynamic monitoring method based on the time dimension.

[0120] For example, on a pre-cooked food production line, surface images of each batch of products are continuously collected, and the location and number of defects such as cracks or foreign objects are recorded to form time-series data.

[0121] For example, a production line produces 10 batches per day, and 100 images are collected for each batch. By counting the number of defect points in each image, a distribution curve that changes over time is obtained.

[0122] In one possible implementation, the total number of defects in each batch can be plotted as a line graph to visually reflect the trend of process fluctuations.

[0123] It should be noted that this method can help identify whether defects exhibit periodic changes over time. For example, a significant increase in the number of defects every three batches suggests potential periodic equipment failure. This is particularly relevant when using image comparison methods to analyze differences in defect distribution between consecutive batches.

[0124] Specifically, the defect distribution maps of adjacent batches can be compared at the pixel level.

[0125] For example, suppose the defects in the fifth batch of images are concentrated in the upper left corner of the image, while the defects in the sixth batch are scattered in the lower right corner. By comparing the distribution heatmaps of the two batches, it can be determined whether the process parameters have shifted.

[0126] In one embodiment, color coding technology can be introduced to mark different areas in red and the same areas in green, so as to visually display the changes.

[0127] Preferably, statistical indicators such as defect overlap rate can be used to quantify the degree of difference between two batches. For example, if the overlap rate is less than 20%, it indicates a significant difference in distribution. This is used when extracting boundary information from batch analysis results.

[0128] For example, contour extraction techniques can be used to locate the edges of defective regions.

[0129] In one embodiment, for crack defects in a batch of images, grayscale processing is first used to highlight the crack features, and then edge detection is used to generate boundary lines to obtain the shape and size data of the defect area.

[0130] It should be noted that the integrity of boundary information directly affects subsequent judgments; if the boundary is broken, the integrity of the area may be misjudged.

[0131] In one possible implementation, the number of consecutive pixels along the boundary line can be counted; if the number of consecutive pixels exceeds 50, the region is considered to have high integrity. This method helps quantify defect distribution characteristics, providing a basis for process adjustments. When processing distribution characteristics using feature extraction methods...

[0132] Specifically, parameters such as the area, perimeter, and distribution density of defects can be extracted.

[0133] For example, the average area of ​​a batch of defective regions is 20 square pixels, the perimeter is 15 pixels, and the density is 2 defects per 100 pixels. These data reflect the specific manifestations of process fluctuations.

[0134] Preferably, these characteristics can be compared with historical data to determine whether the current batch is abnormal. For example, if the area exceeds the average by 30%, it indicates a possible problem with the raw materials. This quantitative data provides an intuitive basis for subsequent adjustments. When using adjustment parameter calculation methods to generate quantitative basis for process adjustments...

[0135] For example, equipment pressure parameters can be adjusted based on changes in defect density.

[0136] In one embodiment, if the defect density of a batch increases from 2 defects per 100 pixels to 5 defects per 100 pixels, it can be inferred that the pressure is too high, leading to an increase in cracks. It is recommended to reduce the pressure from 10 MPa to 8 MPa.

[0137] This adjustment, based on time-series comparison verification, can effectively reduce the defect rate. This is achieved by adjusting parameter values ​​and comparing time-series information.

[0138] Specifically, one can observe whether the defect distribution tends to stabilize after adjustment.

[0139] For example, after adjusting the pressure, five batches were monitored continuously. If the number of defects decreased from 50 per batch to 20, and the distribution area changed from scattered to concentrated, it indicates that the optimization was effective.

[0140] In one possible implementation, a comparison chart of the distribution before and after the adjustment can be plotted to verify the stability of the process. This method can visually reflect the improvements brought about by the adjustment. Boundary information is extracted from the optimized distribution characteristics to determine whether the defect distribution is stable.

[0141] For example, the smoothness and uniformity of the boundary lines can be checked.

[0142] In one embodiment, if the continuity of the adjusted boundary line increases to over 80% and the defect distribution no longer shows concentrated outbreaks, it indicates that the process has stabilized.

[0143] Preferably, a distribution uniformity index can be introduced, such as considering the monitoring data reliable when the standard deviation of the number of defects per region is less than 5. This approach provides reliable support for the final process optimization.

[0144] Example 1 This embodiment uses frozen dumplings as an example to illustrate the application of the defect identification method described in this invention. During the production process, frozen dumplings may exhibit defects such as broken skin, exposed filling, and excessive ice crystals. These defects can seriously affect product quality and consumer experience.

[0145] S201: Image Acquisition On the production line, a conveyor belt transports frozen dumplings at a speed of 0.5 meters per second. An industrial camera with a resolution of 4096x3072 pixels, equipped with a ring-shaped LED light source, is installed 1 meter above the conveyor belt. The camera continuously captures images of the dumplings at a rate of 30 frames per second. To address the complex reflections caused by ice crystals on the dumpling surface, the system employs a four-trigger exposure strategy. The LED light source illuminates the dumpling from four different quadrants (0°, 90°, 180°, 270°) at a brightness of 2000 lumens, thus obtaining four sets of raw image data under different lighting conditions. These four sets of images together constitute a complete observation of a single dumpling, effectively suppressing the potential for missed features caused by reflections or shadows from a single angle.

[0146] S202: Image Preprocessing The system first analyzes the four sets of acquired images. By calculating the brightness histogram of each set, it was found that the brightness peak differences between the second and fourth sets of images (corresponding to 90° and 270° light sources) exceeded the preset 120 gray levels, indicating significant brightness variations in these areas and potentially containing key defect information. For these four sets of images, the system uses a 5x5 Gaussian filter for initial noise reduction to smooth out the subtle noise caused by ice crystals. Subsequently, the Canny edge detection algorithm (low threshold set to 40, high threshold set to 120) is used to extract the contours of the dumpling skin and potential damaged edges, forming a preliminary edge feature map. Based on the complexity of the edge feature map, the system adaptively selects the window size of the median filter, using a 7x7 window for areas with complex textures such as dumpling skin folds, and a 3x3 window for relatively smooth surfaces, thus effectively reducing noise while preserving the clarity of damaged edges to the greatest extent. Finally, histogram equalization technology is used to enhance the contrast of the processed image, making the boundary between damaged and intact areas clearer.

[0147] S203: Gradient Analysis and Clustering The system calculates the gradient magnitude and direction of each pixel in the preprocessed image. Analysis of the gradient histogram reveals that the gradient directions in the broken dumpling skin area exhibit a divergent distribution from the inside out, while the gradient directions in the wrinkled areas show a regular parallel arrangement. Based on this pattern, the system uses the DBSCAN (neighborhood radius Eps = 10 pixels, minimum sample point MinPts = 20) clustering algorithm to process candidate regions. Broken dumpling skin areas are clustered into one or more compact feature subsets due to high gradient information consistency (convergent gradient directions and drastic magnitude changes). For example, a 2mm tear area is identified as a feature subset containing 150 pixels, with an internal gradient consistency of 0.92. Meanwhile, some pseudo-defect areas caused by ice crystals or dough wrinkles are filtered out because their gradient information is more scattered and their consistency is lower than the preset threshold of 0.7.

[0148] S204: Feature Extraction and Classification For the refined set of defect candidate regions, the system uses a pre-trained ResNet-50 deep convolutional neural network for feature extraction. Each candidate region is input into the network, generating a 2048-dimensional high-dimensional feature vector. This vector not only contains low-level information such as the defect's color and texture, but also captures higher-level semantic features such as "damage" and "cracks" through deep learning. Subsequently, these high-dimensional feature vectors are input into a support vector machine (SVM) classifier based on radial basis function (RBF) kernels. This SVM classifier, trained with 100,000 samples (50,000 positive samples and 50,000 negative samples), can accurately determine whether a candidate region is a real defect. For example, a feature vector representing "exposed filling" was judged as a defect by the SVM with a confidence level of 99.8%.

[0149] S205: Area Marking and Process Monitoring Once a defect is confirmed, the system uses a region growing algorithm to precisely annotate the original image. Using the core defect pixels identified by the SVM classifier as seed points, the algorithm expands outwards based on color and texture similarity (color difference threshold less than 30, texture similarity greater than 0.8) until the entire defect area is completely delineated. For example, an irregularly shaped broken dumpling skin area is precisely selected. This defect data with precise boundary information is recorded and stored in the database. The system further monitors changes in the type, quantity, and location distribution of defects in continuous production batches (e.g., within the past 24 hours) through time series analysis. If the system detects that the "skin breakage" defect rate increases by 15% within a specific time period (e.g., from 2 PM to 4 PM), mainly concentrated at the third station of the production line, the system generates an alarm and provides quantitative evidence to the process engineer, suggesting checking the pressure parameters of the dumpling forming machine at that station or replacing the mold.

[0150] Through the above embodiments, the method and system of the present invention can efficiently and accurately identify various defects in the production process of frozen dumplings, and provide data support for continuous optimization of the production process through intelligent analysis, significantly improving the automation and intelligence level of product quality control.

[0151] This invention provides a pre-cooked food semi-finished product defect identification system with AI algorithm, mainly comprising: The image acquisition module is used to acquire raw image data of pre-cooked semi-finished products. It acquires surface information through high-resolution imaging equipment. For cases with complex surface texture and uneven light distribution, it uses multiple light source angles to obtain multiple sets of image data and determine a preliminary candidate set of defect areas. The image preprocessing module is used to extract the parts with significant brightness changes from multiple sets of image data. To address the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images to obtain a denoised image set while preserving the clarity of defect edge features. The gradient analysis module is used to calculate the gradient magnitude and direction of each pixel based on the denoised image set. To address feature confusion caused by complex surface textures, the module uses gradient histograms to statistically analyze the changing trends of each candidate region and obtain the distribution patterns of defect edge features. The clustering module is used to cluster candidate regions based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset. The candidate filtering module is used to obtain the consistency of gradient information within each feature subset. Based on the accuracy requirements of fine defect detection, the subset is filtered through a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions. The feature extraction module is used to extract semantic features from the refined defect candidate region set. In order to meet the needs of atypical defect identification, a deep convolutional network is used to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector. The classification and recognition module is used to classify defect descriptions based on high-dimensional feature vectors. To improve the robustness of feature extraction, the vectors are trained and predicted using the support vector machine algorithm to determine whether each candidate region belongs to a defect and output the final defect recognition result. The region labeling module is used to label the original image data based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information. The process monitoring module is used to obtain complete defect area boundary information and, in response to the monitoring needs of production process fluctuations, compare the defect distribution changes of consecutive batch images using time series analysis methods to determine the quantitative basis for process adjustments.

[0152] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A method for identifying defects in pre-prepared semi-finished food products using an AI algorithm, characterized in that, The method includes: The raw image data of the pre-cooked semi-finished food is obtained, and surface information is collected by high-resolution imaging equipment. In the case of complex surface texture and uneven light distribution, multiple sets of image data are obtained by irradiation from multiple light sources at different angles to determine a preliminary candidate set of defect areas. The image dataset extracts the parts with significant brightness changes from multiple sets of image data. To mitigate the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images, resulting in a denoised image set that preserves the clarity of defect edge features. The gradient magnitude and direction of each pixel are calculated based on the denoised image set. To address the feature confusion caused by complex surface textures, the changing trend of each candidate region is statistically analyzed through gradient histograms to obtain the distribution pattern of defect edge features. Candidate regions are clustered based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset. The consistency of gradient information within each feature subset is obtained. To meet the accuracy requirements of detecting subtle defects, the subsets are filtered using a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions. Semantic features are extracted from the refined defect candidate region set. To meet the needs of atypical defect identification, a deep convolutional network is used to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector. The defect descriptions are classified based on high-dimensional feature vectors. To improve the robustness of feature extraction, the vectors are trained and predicted using the support vector machine algorithm to determine whether each candidate region belongs to a defect, and the final defect identification result is output. The original image data is labeled based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information. After obtaining complete defect area boundary information, to meet the monitoring needs of production process fluctuations, time series analysis is used to compare the defect distribution changes of consecutive batch images to determine the quantitative basis for process adjustments.

2. The method according to claim 1, characterized in that, The process involves acquiring raw image data of the pre-cooked semi-finished food product, collecting surface information using a high-resolution imaging device, and, for cases with complex surface textures and uneven lighting distribution, using multi-source angle illumination to obtain multiple sets of image data to determine a preliminary candidate set of defect areas, including: Image data of the surface of pre-prepared vegetables is acquired by high-resolution imaging equipment, and multiple sets of image data are generated by irradiation with multi-angle light sources to obtain a preliminary image set. For regions with complex textures in an image set, an edge detection algorithm is used to extract features and identify a set of regions containing potential defects. The image set is obtained by acquiring a subset of unevenly lit regions. If the brightness variation within the subset exceeds a preset threshold, the illumination distribution is adjusted by mean filtering to obtain a balanced image set. Based on the balanced image set, calculate the texture complexity of each region and determine the candidate set of defective regions; The features of each region in the candidate set are obtained and classified using the support vector machine algorithm to determine the set of defective regions with high confidence. For the defect region set, a clustering algorithm is used to group them to obtain the final defect distribution set; By using the defect distribution set, spatial mapping data of surface defects in pre-prepared dishes is generated to determine the location and extent of defects.

3. The method according to claim 1, characterized in that, The process involves extracting regions with significant brightness variations from multiple sets of image data. To mitigate the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images, resulting in a denoised image set that preserves the clarity of defect edge features. This includes: Multiple sets of original images of pre-prepared vegetables were acquired, and the brightness distribution histogram of each set of images was calculated. Significant brightness variation regions were identified based on the peak differences in the histograms. For these significant regions, a Gaussian filter was used for initial noise reduction to decrease random noise interference in the gradient information. Edge contour information was extracted from the images using an edge detection algorithm to construct an edge feature map, preserving the geometric shape features of defective edges. Based on the edge feature map, a median filter with an adaptive window size was designed to perform targeted noise reduction in different regions, preserving edge details. If local noise still existed in the filtered image, a non-local mean filtering method was used for further noise reduction optimization to improve the overall image clarity. A contrast enhancement algorithm was applied to the denoised image set to highlight the difference between potential defective areas and the background, facilitating subsequent defect detection and analysis. Defect candidate regions were extracted from the enhanced images using morphological operations to obtain the final set of pre-prepared vegetable defect detection results images.

4. The method according to claim 1, characterized in that, The process involves calculating the gradient magnitude and direction of each pixel based on the denoised image set. To address feature confusion caused by complex surface textures, the variation trend of each candidate region is statistically analyzed using gradient histograms to obtain the distribution pattern of defect edge features. This includes: Preliminary gradient information is obtained by calculating the gradient magnitude and direction of each pixel in the denoised image; Based on the preliminary gradient information, histogram statistical methods are used to analyze the changing trends of candidate regions and determine the characteristic distribution properties within the regions; If the trend of change indicates that the surface texture is complex, the candidate region boundary can be adjusted by adjusting the gradient direction to obtain a more accurate region division; Based on the adjusted candidate region, the significant part of the defect edge is extracted from the gradient magnitude to obtain the edge feature set; A distribution pattern map is constructed using edge feature sets to determine the degree of influence of feature confusion on defect edges; By filtering out edge features less affected by feature confusion using the distribution pattern map, optimized defect edge data is obtained. For the optimized defect edge data, morphological operations are applied to highlight edge features and obtain the final defect region image.

5. The method according to claim 1, characterized in that, The process involves clustering candidate regions based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets. The consistency of gradient information within each subset is then determined, including: Based on the distribution pattern, the candidate regions for defects in pre-cooked dishes are initially divided. Then, a density-based clustering algorithm is used to process the data within the regions to obtain multiple feature subsets. For data within a feature subset, obtain gradient information and determine the consistency of information within each subset. If the consistency is lower than the preset threshold, the feature subset boundary is adjusted by the density algorithm to obtain the optimized subset set. Based on the optimized subset set, features related to the morphology of defects in pre-cooked dishes are extracted from the gradient information to determine the regional distribution of diverse morphologies. By leveraging the distribution characteristics of diverse morphological regions, information analysis methods are employed to reorder gradient information, thereby obtaining a sorted feature sequence. For the sorted feature sequences, morphological operations are applied to highlight the differences between subsets, resulting in the final region partitioning results; Key features are extracted from the final defect area division results of pre-cooked food to determine the distribution trend of defect morphology.

6. The method according to claim 1, characterized in that, The process involves obtaining the consistency of gradient information within each feature subset. To meet the accuracy requirements of subtle defect detection, subsets are filtered using a preset threshold. If the consistency level is below the threshold, the subset is removed, resulting in a refined set of defect candidate regions, including: Obtain gradient information within each feature subset and determine the direction of information processing by calculating the degree of consistency. If the consistency level is lower than the preset threshold, the corresponding feature subset is removed to obtain the filtered subset set; For the selected subset, information processing methods are used to extract gradient information features related to subtle defects; The extracted gradient information features are grouped using a density clustering algorithm to obtain the preliminary distribution of defect candidate regions; Based on the region set in the initial distribution, obtain the degree of consistency in each region to determine the feasibility of the refining results; Based on the refining results, morphological operations are used to highlight the differences between candidate defect regions and determine the final region set; Key features related to minor defects are extracted from the final region to determine the distribution trend of defects in pre-cooked dishes.

7. The method according to claim 1, characterized in that, The process involves extracting semantic features from the refined defect candidate region set. To address the need for identifying atypical defects, a deep convolutional network is used to perform feature mapping on each region, resulting in a high-dimensional feature vector representation of the defect description, including: By using a deep convolutional network to perform feature mapping on candidate regions of defects in pre-prepared vegetables, a preliminary description of high-dimensional feature vector representation is obtained; Semantic features are extracted from high-dimensional feature vectors to determine the defect description content for each region; Clustering algorithms are used to group semantic features to obtain the regional distribution of atypical defects; Based on the regional distribution, calculate the density of high-dimensional feature vectors in each region to determine the salience of the defect description; If the significance is lower than the preset threshold, the corresponding region is removed to obtain a refined set of defect descriptions; For the refined defect description set, morphological operations are used to highlight the differences between regions and determine the final distribution of atypical defects; Key information related to atypicality is extracted from the final distribution to obtain a characteristic representation of the defect trend.

8. The method according to claim 1, characterized in that, The process of classifying defect descriptions based on high-dimensional feature vectors aims to improve the robustness of feature extraction. This is achieved by training and predicting the vectors using a support vector machine algorithm to determine whether each candidate region belongs to a defect, and finally outputting the defect identification result, including: A classification model is obtained by training high-dimensional feature vectors using a support vector machine; High-dimensional feature vectors are obtained by using extraction methods from the candidate regions; For high-dimensional feature vectors, a classification model is used for prediction to obtain preliminary prediction results; If the prediction result indicates that the region belongs to a defect, then the feature vector of that region is retained to obtain a defect candidate set; Based on the defect candidate set, calculate the feature vector distribution density of each region and determine the region's saliency. The final defect distribution of pre-cooked dishes is determined by processing salient regions through morphological operations; Key information is extracted from the final defect distribution to obtain defect feature representations.

9. The method according to claim 1, characterized in that, The original image data is annotated based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information, including: The original image is initially annotated using the defect identification results of pre-cooked food to obtain initial annotation data; A region growing algorithm is used to expand outward from the edge features, obtain the pixel distribution in the expansion direction, and determine the preliminary complete region; To address background interference in complex backgrounds, suppression methods are applied to adjust the labeled data, resulting in an optimized complete region. Extract boundary information from the optimized complete region, determine whether the boundary information is closed, and if it is closed, retain the labeled data of the region; Image processing techniques are used to smooth the retained labeled data to obtain smoothed boundary information; The original image is re-annotated based on the smoothed boundary information to obtain the final complete region boundary information; Key distribution features are extracted from the final complete region boundary information to determine the integrity of the defective region.

10. A pre-prepared food semi-finished product defect identification system with AI algorithm, characterized in that, The system includes: The image acquisition module is used to acquire raw image data of pre-cooked semi-finished products. It acquires surface information through high-resolution imaging equipment. For cases with complex surface texture and uneven light distribution, it uses multiple light source angles to obtain multiple sets of image data and determine a preliminary candidate set of defect areas. The image preprocessing module is used to extract the parts with significant brightness changes from multiple sets of image data. To address the impact of gradient information noise, an adaptive filtering method is used to preprocess each set of images to obtain a denoised image set while preserving the clarity of defect edge features. The gradient analysis module is used to calculate the gradient magnitude and direction of each pixel based on the denoised image set. To address feature confusion caused by complex surface textures, the module uses gradient histograms to statistically analyze the changing trends of each candidate region and obtain the distribution patterns of defect edge features. The clustering module is used to cluster candidate regions based on distribution patterns. For cases with diverse defect morphologies, a density-based clustering algorithm is used to divide the region into multiple feature subsets and determine the degree of consistency of gradient information within each subset. The candidate filtering module is used to obtain the consistency of gradient information within each feature subset. Based on the accuracy requirements of fine defect detection, the subset is filtered through a preset threshold. If the consistency is lower than the threshold, the subset is removed, resulting in a refined set of defect candidate regions. The feature extraction module is used to extract semantic features from the refined defect candidate region set. In order to meet the needs of atypical defect identification, a deep convolutional network is used to perform feature mapping on each region to obtain a defect description represented by a high-dimensional feature vector. The classification and recognition module is used to classify defect descriptions based on high-dimensional feature vectors. To improve the robustness of feature extraction, the vectors are trained and predicted using the support vector machine algorithm to determine whether each candidate region belongs to a defect and output the final defect recognition result. The region labeling module is used to label the original image data based on the final defect identification results. To suppress interference from complex backgrounds, a region growing algorithm is used to expand outward from the defect edge features to obtain complete defect region boundary information. The process monitoring module is used to obtain complete defect area boundary information and, in response to the monitoring needs of production process fluctuations, compare the defect distribution changes of consecutive batch images using time series analysis methods to determine the quantitative basis for process adjustments.

Citation Information

Cited By

  • Lightweight convolutional neural network construction method and system for glue pudding defect detection

    CN122089740A

  • Metal surface defect detection method and related equipment

    CN122156211A

  • Method for detecting defects on a metal surface and related apparatus

    CN122156211B

  • Method and device for detecting crystal structure defects of sapphire substrate

    CN122265744A