AI-based pastry quality detection method and system

Through the AI-based pastry quality inspection method, the problems of complex lighting and unstable image quality in industrial sites are solved, high-precision identification of minor defects and quality inspection are achieved, meeting the inspection needs of high-speed production lines, and improving inspection efficiency and product quality.

CN120182964BActive Publication Date: 2025-09-05SHAANXI ZIQI FOOD GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510663301.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-09-05
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

Existing machine vision-based pastry quality inspection technology suffers from unstable image acquisition quality in complex lighting environments at industrial sites. Problems such as uneven brightness, overlapping image sequences, and missing perspectives make it difficult to identify tiny defects and limit detection accuracy.

Method used

An AI-based pastry quality detection method is adopted. The pastry area is extracted through the image segmentation model, the illumination distribution and center coordinates are analyzed, and adjacent pastry groups are formed. Image matching and illumination distribution calculation are performed. The integrity coefficient and the influencing color difference value are combined to construct the defect detection results, and the anomaly detection algorithm is used to judge the pastry quality.

Benefits of technology

It improves the accuracy of identifying tiny defects and the detection precision, meets the detection needs of high-speed production lines, enhances quality control capabilities, and improves production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182964B_ABST
    Figure CN120182964B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and discloses an AI-based pastry quality detection method and system, comprising: obtaining a standard image of a pastry and a production image of the pastry, calculating the illumination distribution of the captured image of each pastry, dividing multiple pastries into adjacent pastry groups, performing image matching between the corresponding captured image and the pastry standard image, obtaining an image matching result between the captured image and the pastry standard image, calculating the color difference value of each pixel of each pastry in the adjacent pastry group, using multiple captured images of a single pastry, superimposing the multiple captured images of the single pastry with the pastry standard image, calculating the integrity coefficient of each pastry in the single adjacent pastry group based on the superposition result, and completing the production quality detection of each pastry based on the integrity coefficient and the color difference value of each pastry in the multiple captures. The present invention comprehensively and quantitatively evaluates the quality of pastries by extracting the illumination distribution of pastry images, accurately identifying pastry areas, efficiently locating, and comprehensively analyzing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an AI-based pastry quality detection method and system. Background Art

[0002] Quality control is crucial in pastry production and processing. Pastry quality not only impacts consumer taste and health, but also directly impacts a company's brand image and market competitiveness. Every step in the production process, from raw material selection to process control, can impact final product quality. Traditional manual visual inspection methods suffer from subjectivity, inconsistent standards, and a high rate of missed inspections. These methods struggle to meet the demands of large-scale production, where thousands of products are inspected per hour.

[0003] To address these issues, artificial intelligence (AI) technology has been introduced into the field of pastry quality inspection. Through machine learning and deep learning, AI builds neural network models, analyzes and processes large amounts of data, and implements functions such as image recognition, driving the intelligent development of various industries. In pastry quality inspection, the application of AI is key to improving inspection efficiency and accuracy.

[0004] However, although the existing automated inspection technology based on machine vision can realize surface defect recognition, it still faces multiple technical bottlenecks in practical applications: First, the complex lighting environment of the industrial site leads to unstable image acquisition quality. The mutual occlusion of adjacent cakes under a single light source will produce uneven light and dark areas, affecting the extraction of defect features; second, when the production line is running at high speed, the image sequence generated by multi-angle shooting has partial overlap and missing perspectives, which increases the complexity of image processing, reduces detection accuracy, makes it difficult to accurately identify tiny defects, and affects the overall detection effect. Summary of the Invention

[0005] The objects of the present invention are:

[0006] In order to solve the problem of limited detection accuracy due to unstable image acquisition quality, uneven brightness and darkness, image sequence overlap and missing perspectives under complex lighting conditions in industrial sites and multi-angle shooting of high-speed production lines, the present invention provides an AI-based pastry quality inspection method and system to achieve the above objectives.

[0007] In the first aspect, the AI-based pastry quality detection method includes: obtaining a production image set and a standard image in the pastry production process; using an image segmentation model to process the production image set, extracting pastry areas, analyzing the illumination distribution and central horizontal and vertical coordinates of each pastry area, and clustering to form several adjacent pastry groups, and numbering the pastry areas in the adjacent pastry groups; performing image matching on each pastry area in the adjacent pastry group and the standard image, and calculating the affected color difference value of the corresponding pixel point of each pastry based on the matching result and the illumination distribution; constructing a graph structure for the adjacent pastry group, analyzing the proximity relationship of all adjacent pastry groups and the number of each pastry to identify a single pastry area, obtaining multiple production images of each pastry area in the adjacent pastry group and superimposing them with the standard image, and calculating the integrity coefficient of each pastry area in a single adjacent pastry group; constructing the defect detection result of each pastry area in the standard image according to the integrity coefficient and the affected color difference value, performing anomaly detection based on the defect detection result, and judging the production quality of each pastry.

[0008] By solving complex lighting and image quality issues, the accuracy of identifying tiny defects is improved, ensuring the reliability of the quality inspection results for each pastry, and enhancing the company's quality control capabilities; introducing the concept of comprehensive lighting distribution, quantifying the impact of lighting on color difference calculation, improving the accuracy of color difference values, and ensuring the reliability of defect identification; combining the integrity coefficient and the influencing color difference value to construct defect detection results, comprehensively evaluate the quality of each pastry, and effectively solve the detection accuracy problems caused by missing perspectives and image overlap; through the anomaly detection algorithm, the quality of pastry production can be quickly judged, meeting the high-speed inspection needs of the pastry production line, and improving production efficiency and product quality.

[0009] Preferably, the illumination distribution includes:

[0010] Convert the pastry area from RGB color space to HSV color space, obtain the color distribution of the pastry area in HSV space and the brightness value of each pixel to form a brightness channel image;

[0011] Perform filtering on the brightness channel image to obtain a significant brightness channel image. Use the Otsu threshold method to perform light and dark segmentation on the significant brightness channel image, divide the pixels in the image into bright areas and dark areas, and obtain the light and dark segmentation result.

[0012] Perform connected domain analysis on the light and dark segmentation results to obtain the horizontal and vertical coordinates of the center of the bright area and the center of the dark area, calculate the vector from the center of the bright area to the center of the dark area, and obtain the lighting distribution of each pastry area.

[0013] By improving the accuracy of light distribution calculations, enhancing the effects of subsequent image processing and analysis, and providing detailed light distribution information, it helps to perform image matching and color difference calculations more accurately, and improve the accuracy of pastry production quality inspection.

[0014] Preferably, the step of numbering the pastry areas in adjacent pastry groups comprises:

[0015] Among them, a cluster corresponds to a neighboring pastry group, and each neighboring pastry group contains multiple pastry areas;

[0016] Number the leftmost position in the adjacent pastry group as 1, calculate the Euclidean distance values ​​of the remaining pastries to the pastry corresponding to number 1, sort the Euclidean distance values ​​from small to large, and get the number of the pastry area in the adjacent pastry group. In response to the existence of pastries with the same Euclidean distance values, the numbers of the corresponding pastries are the same.

[0017] Preferably, the influencing color difference value satisfies the following relationship:

[0018] ;

[0019] Where, Indicates the The pastry area in the standard image The color difference value affected by each pixel is Indicates the The pastry area in the standard image The illumination coefficient of each pixel, Indicates the The pastry area in the standard image The color difference value of each pixel.

[0020] Preferably, the complete coefficients include:

[0021] Obtain the bright areas from the multiple matching results of each pastry area and the standard image, set the values ​​of all pixels in the standard image to 1, and also set the values ​​of the pixels belonging to the bright area in each production image to 1. Subtract the values ​​of each pixel in the corresponding bright area from the values ​​of the pastry standard image to complete the superposition;

[0022] If the value of the pixel after superposition is 0, it means that the coverage is normal; if the value of the pixel after superposition is 1, it means that there is an area with poor lighting or an area that is not photographed; if the value is negative, it means that there are multiple superpositions at the same location, but multiple superpositions are also normal coverage, and the superposition value of the pixel is used as the complete coefficient of a single pixel.

[0023] By comparing the bright areas of production images and standard images, areas with insufficient lighting or missed shots can be accurately identified, thereby improving lighting conditions or shooting angles. The changes in pixel values ​​after superposition are used to quantify the integrity coefficient of each pixel point, providing reliable lighting and coverage information for subsequent quality inspections. The normal coverage of multiple superpositions is taken into account to avoid misjudgments and ensure that the test results truly reflect the production quality of the pastries.

[0024] Preferably, the defect detection result satisfies the following relationship:

[0025] ;

[0026] Where, Indicates the The pastry area in the standard image Pixel defect detection, Indicates that the pastry group is nearby The first collection The pastry area on the standard image The color difference value affected by low light corresponding to each pixel, represents the minimum function, Represented by natural numbers The exponential function with base , represents the activation function, Indicates the The pastry area in the standard image The complete coefficients of pixels, represents a hyperparameter.

[0027] Preferably, the abnormality detection is performed based on the defect detection results to judge the production quality of each cake, including:

[0028] The LOF anomaly detection algorithm is used to detect the defects of each pixel in each pastry area in the standard image to obtain an anomaly detection score. When the anomaly detection score is greater than the preset anomaly threshold, the corresponding pixel in the pastry area in the pastry standard image is a defective pixel. Otherwise, if it is less than or equal to the preset anomaly threshold, there is no production defect in the pastry area in the pastry standard image.

[0029] In a second aspect, an AI-based pastry quality detection system includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned AI-based pastry quality detection method is implemented.

[0030] Compared with the existing technology, the AI-based pastry quality detection method and system of the embodiment of the present invention has the following beneficial effects: by extracting the illumination distribution of the pastry image, filtering, light and dark segmentation, and connected domain analysis techniques are used to accurately calculate the illumination distribution, providing a stable and reliable basis for subsequent image matching and color difference calculation; using the instance segmentation model to accurately identify the area of ​​each pastry, and forming adjacent pastry groups through clustering, effectively solving the problems of image overlap and missing perspective, thereby improving detection accuracy; using graph structure construction and matching technology, each pastry can be efficiently identified and located, and by matching the graph structure data of adjacent pastry groups, the same group of pastries in different collected images can be quickly determined, greatly improving detection efficiency and meeting the real-time detection requirements of the pastry production line under high-speed operation; and the quality of the pastries can be comprehensively evaluated through a comprehensive analysis of the integrity coefficient and color difference value. By introducing the integrity coefficient, the system can quantify the coverage integrity and illumination effect of each pixel point, providing richer information for quality assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a method flow chart of steps S1 to S4 in the AI-based pastry quality detection method according to an embodiment of the present invention.

[0032] Figure 2 This is a structural block diagram of an AI-based pastry quality detection system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0034] like Figure 1 As shown, the AI-based pastry quality detection method of the preferred embodiment of the present invention includes steps S1 to S4, which are specifically as follows:

[0035] S1: Obtain a set of production images and standard images from the pastry production process, use an image segmentation model to process the production image set, extract pastry areas, analyze the illumination distribution and central horizontal and vertical coordinates of each pastry area, and cluster them to form several adjacent pastry groups. Number the pastry areas within the adjacent pastry groups.

[0036] By installing RGB cameras at multiple positions and angles on the pastry production line, and collecting production images of pastries, the production images are sent to the data processing center for pastry quality inspection. At the same time, multi-angle images that meet the pastry production quality requirements are obtained through manual collection as standard images.

[0037] An instance segmentation model is used to identify the pastry areas in multiple pastry areas during the production process, to obtain multiple pastry area images containing only pastries, and to obtain the horizontal and vertical coordinates of each pastry area image in the pastry area.

[0038] The instance segmentation model is a DNN network model consisting of an encoder and a decoder. During model training, the pastry area of ​​​​cakes collected from multiple angles is used to form a dataset. Pixels in each image belonging to the pastry area are marked as 1, and pixels in the non-pastry area are marked as 0. After the labeling is completed, this dataset is used for training. The model can adopt existing network models such as Fast-RCNN and ResNet. The specific training process of the model is well-known technical means and will not be repeated in this invention.

[0039] Light distribution includes:

[0040] Convert the pastry area from RGB color space to HSV color space, obtain the color distribution of the pastry area in HSV space and the brightness value of each pixel to form a brightness channel image;

[0041] Perform filtering on the brightness channel image to obtain a significant brightness channel image. Use the Otsu threshold method to perform light and dark segmentation on the significant brightness channel image, divide the pixels in the image into bright areas and dark areas, and obtain the light and dark segmentation result.

[0042] Perform connected domain analysis on the light and dark segmentation results to obtain the horizontal and vertical coordinates of the center of the bright area and the center of the dark area, calculate the vector from the center of the bright area to the center of the dark area, and obtain the lighting distribution of each pastry area.

[0043] According to the illumination distribution in the same pastry area and the corresponding horizontal and vertical coordinates of the pastry center, pastries with consistent illumination distribution and similar coordinates are divided into one category as a neighboring pastry group, wherein the classification algorithm can adopt an adaptive classification method, such as the SOM algorithm, the iosdata algorithm, etc.; it should be noted that a pastry category is regarded as a neighboring pastry group, and each neighboring pastry group contains multiple pastries, indicating that the pastries belong to the same local area in terms of pastry production quality.

[0044] Since the pastries have been separated from the mold during the pastry production quality inspection, the distribution of the pastries is chaotic. Therefore, the pastries are tracked and numbered according to the distribution relationship between adjacent pastries to avoid inspection confusion.

[0045] A graph structure is constructed for adjacent pastry groups, with a single pastry as a node and the Euclidean distance between two nodes corresponding to pastries as the edge weight. After obtaining the graph structure of adjacent pastry groups, the graph structure data of each adjacent pastry group in different pastry areas are matched;

[0046] In response to the consistency of the number of nodes and the edge value between any two nodes, they are the same group of adjacent cakes. Since they are the same group of adjacent cakes in different captured images, they represent the positions of different cakes in different production lines.

[0047] Number each pastry in the same group of adjacent pastries, where the numbering method is: take the upper left position of the pastry coordinate as number 1, calculate the Euclidean distance values ​​of the remaining pastries in the same group of adjacent pastries to the pastry corresponding to number 1, and number the Euclidean distance values ​​from small to large. In response to pastries with the same Euclidean distance values, the two pastries have the same number, and the vectors of the two pastries to the node number 1 can be used as a distinction.

[0048] S2: Perform image matching on each pastry area in the adjacent pastry group and the standard image, and calculate the color difference value of the corresponding pixel point of each pastry based on the matching results and the illumination distribution.

[0049] Since the positions of the pastries between adjacent pastry groups are adjacent and the illumination distribution is similar, the matching results between each pastry area and the standard image are obtained. The matching method is: calculate the sift feature points corresponding to each pastry area and the standard image respectively, use the brute force matching method to pair the feature points, use the paired feature points to perform affine space transformation on the pastry area, transform the space of the pastry area to be consistent with the space of the pastry standard image, and complete the matching between each pastry area and the standard image.

[0050] The color difference value of each pixel is calculated in the spatially consistent pastry area and the standard image. The larger the color difference value, the more obvious the production defect is. However, since the illumination collected when each pastry area is collected is different, color difference deviation will occur when the color difference is directly calculated, affecting the pastry defect detection results.

[0051] Specifically, the color difference value satisfies the following relationship:

[0052] ;

[0053] Where, Indicates the The pastry area in the standard image The color difference value affected by each pixel is Indicates the The pastry area in the standard image The illumination coefficient of each pixel, Indicates the The pastry area in the standard image The color difference value affected by each pixel.

[0054] Since the illumination distributions of adjacent pastry groups are similar, the illumination distributions between adjacent pastry groups are obtained. The comprehensive illumination distribution of adjacent pastry groups is obtained by taking the vector mean of the illumination distribution corresponding vectors of each pastry in the adjacent pastry group as the illumination distribution of the adjacent pastry group.

[0055] Get the The pastry area in the standard image The vectors from the pixel point to the two corresponding illumination distribution centers should be between the two mapping coordinates in the standard image of the pastry. The two vectors are added by vector arithmetic operations to obtain the comprehensive vector. The cosine similarity between the comprehensive vector and the comprehensive illumination distribution on the vector is calculated as the illumination coefficient. ; Since the cosine similarity value ranges from -1 to 1, Normalize and then The smaller it is, the greater the difference from the original light distribution, and the less affected by light.

[0056] Color difference value The larger the color difference value is, the more likely the pixel point in the current pastry is to be a defective pastry production result. Conversely, the smaller the color difference value is, the more likely the pixel point in the current pastry is to be a normal pastry production result. The color difference value is calculated as follows: The pastry area in the standard image The pixel and the The Euclidean distance value of the RGB three components corresponding to the pixel points in the pastry area is used as the color difference value.

[0057] Low light affects the color difference value The smaller it is, the less it is affected by light and the greater the probability that it is a normal pastry.

[0058] S3: Construct a graph structure for adjacent pastry groups, analyze the proximity relationship of all adjacent pastry groups and the numbers of each pastry to identify a single pastry area, obtain multiple production images of each pastry area in the adjacent pastry group and superimpose them with the standard image, and calculate the integrity coefficient of each pastry area in a single adjacent pastry group.

[0059] Since the influence of light distribution is different at different image acquisition positions, in order to obtain the pastry defect detection results at multiple acquisition positions, all acquired images from the first acquisition to the last acquisition are obtained.

[0060] The image structure data of adjacent pastry groups are used to match the image structure data of adjacent pastry groups to identify adjacent pastry groups. The positioning of individual pastries is completed by numbering each pastry in the adjacent pastry group. Among them, when matching the image structure data, the number of nodes and the edge weights between nodes are required to be consistent.

[0061] Obtain the matching results of a single cake in multiple images with the cake standard image. A single cake in different acquisition positions leads to different lighting distributions, so the bright area of ​​the cake in a single matching result is obtained as the acquisition area with good lighting effect.

[0062] Obtain the bright areas from the multiple matching results of each pastry area and the standard image, set the values ​​of all pixels in the standard image to 1, and also set the values ​​of the pixels belonging to the bright area in each production image to 1. Subtract the values ​​of each pixel in the corresponding bright area from the values ​​of the pastry standard image to complete the superposition;

[0063] If the value of the pixel after superposition is 0, it means that the coverage is normal; if the value of the pixel after superposition is 1, it means that there is an area with poor lighting or an area that is not photographed; if the value is negative, it means that there are multiple superpositions at the same location, but multiple superpositions are also normal coverage, and the superposition value of the pixel is used as the complete coefficient of a single pixel.

[0064] S4: Based on the integrity coefficient and the influencing color difference value, the defect detection results of each pastry area are constructed in the standard image, and anomaly detection is performed based on the defect detection results to judge the production quality of each pastry.

[0065] Get the first The pastry area in the standard image Defect detection results of pixels :

[0066] ;

[0067] Where, Indicates the The pastry area in the standard image Pixel defect detection, Indicates that the pastry group is nearby The first collection The pastry area on the standard image The color difference value affected by low light corresponding to each pixel, represents the minimum function, Represented by natural numbers The exponential function with base , represents the activation function, Indicates the The pastry area in the standard image The complete coefficients of pixels, represents a hyperparameter.

[0068] Get the minimum color difference value of low light in multiple acquisition results. The larger the minimum value, the greater the probability of pastry production defects. Because after the superposition of multiple acquisition positions, the light distribution basically has the smallest impact, so if the color difference itself is larger, the probability of low light in the calculation is higher. The larger the value is.

[0069] If the integrity coefficient value is 1, it means that there is a missing collection and the result is unreliable, indicating that the test result has the risk of uncertainty. If the integrity coefficient value is smaller, it means that the defect detection result is after multiple collections, indicating that the test result does not have the risk of uncertainty. However, in order not to affect the calculation of the color difference value, Mapping yields: ,in Function Representation When it is less than or equal to 0, The value is 0, 1 o'clock . It is a piecewise function, in which Perform exponential mapping so that When the value is 0, The value is 1, where As a hyperparameter, this scheme takes =3, which can be adjusted by the implementer according to the specific implementation scenario.

[0070] You can Written as a piecewise function. When it is less than or equal to 0, , When it is less than or equal to 1, .

[0071] Get the The defect detection results of each pixel point in the standard image of each pastry area are obtained by using the LOF anomaly detection algorithm, and the anomaly detection score of each pixel point is set. A preset anomaly threshold is set. In response to the anomaly detection score being greater than the preset anomaly threshold, the corresponding pixel point in the pastry area in the pastry standard image is a defective pixel point. Otherwise, if it is less than or equal to the preset anomaly threshold, there is no production defect in the pastry area in the pastry standard image. The preset anomaly threshold is 6, which can be adjusted by the implementer according to the specific implementation scenario.

[0072] Through the above steps, the AI-based pastry quality detection method is completed.

[0073] The present invention also provides a cake quality detection system based on AI. Figure 2As shown, the system includes a processor and a memory. The memory stores computer program instructions. When executed by the processor, the computer program instructions implement the AI-based pastry quality detection method according to the first aspect of the present invention. The system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are well known in the art and are not described in detail here.

[0074] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary counting personnel in this technical field, several improvements and substitutions can be made without departing from the counting principle of the present invention. These improvements and substitutions should also be regarded as the scope of protection of the present invention.

Claims

1. AI-based pastry quality detection method, characterized in that: The method comprises the following steps: Obtain a production image set and a standard image during the pastry production process, process the production image set using an image segmentation model, extract pastry regions, analyze the illumination distribution and central horizontal and vertical coordinates of each pastry region, perform clustering, form several adjacent pastry groups, and number the pastry regions within the adjacent pastry groups; Perform image matching between each pastry area in the adjacent pastry group and the standard image, and calculate the color difference value of the corresponding pixel point of each pastry based on the matching results and illumination distribution; Construct a graph structure for adjacent pastry groups, analyze the proximity relationship of all adjacent pastry groups and the number of each pastry to identify a single pastry area, obtain multiple production images of each pastry area in the adjacent pastry group and superimpose them with the standard image, and calculate the integrity coefficient of each pastry area in a single adjacent pastry group; The complete coefficients include: Obtain the bright areas from the multiple matching results of each pastry area and the standard image, set the values ​​of all pixels in the standard image to 1, and also set the values ​​of the pixels belonging to the bright area in each production image to 1. Subtract the values ​​of each pixel in the corresponding bright area from the values ​​of the pastry standard image to complete the superposition; If the value of the pixel after superposition is 0, it means that the coverage is normal; if the value of the pixel after superposition is 1, it means that there is an area with poor lighting or an area that is not photographed; if the value is negative, it means that there are multiple superpositions at the same location, but multiple superpositions are also normal coverage, and the superposition value of the pixel is used as the complete coefficient of a single pixel; Based on the integrity coefficient and the influencing color difference value, the defect detection results of each pastry area are constructed in the standard image. Based on the defect detection results, anomaly detection is performed to judge the production quality of each pastry; The color difference value satisfies the following relationship: , where Indicates the The pastry area in the standard image The color difference value affected by each pixel is Indicates the The pastry area in the standard image The illumination coefficient of each pixel, Indicates the The pastry area in the standard image The color difference value of each pixel.

2. The AI-based pastry quality detection method according to claim 1, characterized in that: The illumination distribution includes: Convert the pastry area from RGB color space to HSV color space, obtain the color distribution of the pastry area in HSV space and the brightness value of each pixel to form a brightness channel image; Perform filtering on the brightness channel image to obtain a significant brightness channel image. Use the Otsu threshold method to perform light and dark segmentation on the significant brightness channel image, divide the pixels in the image into bright areas and dark areas, and obtain the light and dark segmentation result. Perform connected domain analysis on the light and dark segmentation results to obtain the horizontal and vertical coordinates of the center of the bright area and the center of the dark area, calculate the vector from the center of the bright area to the center of the dark area, and obtain the lighting distribution of each pastry area.

3. The AI-based pastry quality detection method according to claim 1, characterized in that: The pastry areas in the adjacent pastry groups are numbered, include: Among them, a cluster corresponds to a neighboring pastry group, and each neighboring pastry group contains multiple pastry areas; Number the leftmost position in the adjacent pastry group as 1, calculate the Euclidean distance values ​​of the remaining pastries to the pastry corresponding to number 1, sort the Euclidean distance values ​​from small to large, and get the number of the pastry area in the adjacent pastry group. In response to the existence of pastries with the same Euclidean distance values, the numbers of the corresponding pastries are the same.

4. The AI-based pastry quality detection method according to claim 1, characterized in that: The defect detection results satisfy the following relationship: ; Where, Indicates the The pastry area in the standard image Pixel defect detection, Indicates that the pastry group is nearby The first collection The pastry area on the standard image The color difference value affected by low light corresponding to each pixel, represents the minimum function, Represented by natural numbers The exponential function with base , represents the activation function, Indicates the The pastry area in the standard image The complete coefficients of pixels, represents a hyperparameter.

5. The AI-based pastry quality detection method according to claim 1, characterized in that: The abnormality detection is performed based on the defect detection results to judge the production quality of each cake, including: The LOF anomaly detection algorithm is used to detect the defects of each pixel in each pastry area in the standard image to obtain an anomaly detection score. When the anomaly detection score is greater than the preset anomaly threshold, the corresponding pixel in the pastry area in the pastry standard image is a defective pixel. Otherwise, if it is less than or equal to the preset anomaly threshold, there is no production defect in the pastry area in the pastry standard image.

6. AI-based pastry quality detection system, characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the AI-based pastry quality detection method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Hardware part production quality detection method and system based on artificial intelligence

    CN116205919A

  • PCB quality detection method based on computer vision

    CN117994258A