Aluminum foil meal box defect detection method based on image recognition

By constructing a defect detection process for aluminum foil lunch boxes based on high-pass filtering, multi-scale edge enhancement, and other technologies, and combining multimodal feature fusion and neural network classification, the problems of low efficiency and insufficient accuracy in existing detection methods are solved, and high-precision defect detection and quality control are achieved.

CN121169866APending Publication Date: 2025-12-19HUAIBEI HEJIA NEW MATERIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511311186.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing methods for detecting defects in aluminum foil food boxes rely on manual visual inspection, which is inefficient and easily affected by subjective factors. Image processing methods based on a single algorithm cannot fully identify defects in complex backgrounds and are difficult to achieve high-precision detection of minute defects.

Method used

A complete defect detection process for aluminum foil lunch boxes is constructed by employing high-pass filtering, multi-scale edge enhancement, affine and perspective transformation, multi-resolution stitching, adaptive region growing, multi-modal feature fusion, and a classification model combining convolutional neural networks and support vector machines. This process includes anchor point localization, template mapping, stitching neighborhood generation, region feature extraction, defect candidate analysis, and classification.

Benefits of technology

It achieves high-precision detection of various types of defects in aluminum foil lunch boxes, improving detection accuracy, stability, and traceability, and meeting the quality control requirements of mass production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169866A_ABST
    Figure CN121169866A_ABST
Patent Text Reader

Abstract

The invention discloses an aluminum foil meal box defect detection method based on image recognition. The method comprises the following steps: acquiring an aluminum foil meal box image and detecting edge anchor points and bevel anchor points to generate an anchor point set; constructing a pixel mapping relation from an original image domain to a template domain by using the anchor point set, and generating a template domain image; generating a stitching neighborhood mask in the template domain and executing stitching processing to obtain a structure continuity optimization image; dividing a main domain and a stitching sub-domain according to a stitching neighborhood mask, and respectively generating feature maps; defect candidate generation, boundary refinement and category judgment are carried out on the feature map, and a template domain summary result is obtained through fusion; converting the summarized result into an original image domain according to an inverse mapping relation to form a detection result; and selecting a parameter adjustment strategy according to the stitching sub-domain alarm density and a self-adaptive threshold value, and outputting an update detection result. According to the invention, high-precision defect identification capability can be maintained under complex backgrounds and deformation conditions, and detection efficiency and stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of defect detection, and in particular to an aluminum foil meal box defect detection method based on image recognition. BACKGROUND

[0002] With the wide application of food packaging industry, especially one-time aluminum foil meal box in scenarios such as take-out delivery, airline catering and food processing, higher requirements are put forward for the automatic detection of surface defects of aluminum foil meal box. The existing aluminum foil meal box quality detection mainly relies on manual inspection or image analysis method based on single edge extraction algorithm. Manual detection is not only low in efficiency and high in labor intensity, but also easily affected by subjective factors of operators, resulting in insufficient stability of detection results; the image processing method based on single algorithm is prone to incomplete boundary recognition and missing detection of subtle defects when dealing with surface reflection, deformation and complex texture background. In addition, the existing technology usually adopts traditional high-pass filtering or simple edge enhancement in the image preprocessing link, which lacks full utilization of multi-scale features, so it is difficult to realize effective complementation between shallow detail features and deep semantic features, and the sensitivity to small size defects such as fine cracks and indentations is weakened.

[0003] In the template matching and geometric correction process, the existing method often relies on single anchor point positioning and global transformation model, which cannot fully suppress the registration error caused by local deformation and shooting angle deviation, thereby affecting the accuracy of defect positioning. In the defect analysis stage, some algorithms only focus on single modal features such as gray scale or texture, ignoring the comprehensive utilization of multi-modal information such as gradient direction and structural coherence, resulting in insufficient recognition rate for defect regions with fuzzy boundaries and low contrast.

[0004] Therefore, how to provide an aluminum foil meal box defect detection method based on image recognition is a problem that those skilled in the art need to solve. SUMMARY

[0005] One object of the present application is to provide an aluminum foil meal box defect detection method based on image recognition. The present application constructs a complete processing flow from image acquisition, anchor point positioning, template mapping, stitching neighborhood generation, region feature extraction, defect candidate analysis, defect classification to defect statistics. High-pass filtering, multi-scale edge enhancement, affine and perspective transformation, multi-resolution stitching, adaptive region growing, multi-modal feature fusion and the classification model combining convolutional neural network and support vector machine are adopted to realize high-precision detection of multiple types of defects such as cracks, indentations and deformations.

[0006] According to the aluminum foil meal box defect detection method based on image recognition, the method comprises the following steps:

[0007] Step one: obtain the image of the aluminum foil lunch box, detect the edge anchor points and the corner anchor points of the aluminum foil lunch box in the image, and form an anchor point set;

[0008] Step two: generate a pixel mapping relationship from the original graph domain to the template domain based on the anchor point set, and generate a template domain image;

[0009] Step three: generate a stitching neighborhood mask in the template domain, and obtain a stitching processed template domain image through stitching processing;

[0010] Step four: divide the main domain and the stitching sub-domain in the template domain according to the stitching neighborhood mask, and generate the main domain feature map and the stitching sub-domain feature map respectively;

[0011] Step five: perform defect candidate generation, boundary refinement and category judgment on the main domain feature map and the stitching sub-domain feature map respectively, generate the main domain detection result and the stitching sub-domain detection result, and fuse to obtain the template domain summary result;

[0012] Step six: map the template domain summary result back to the original graph coordinate system according to the inverse mapping of the pixel mapping relationship from the original graph domain to the template domain, and generate the original graph domain detection result;

[0013] Step seven: detect the alarm density of the stitching sub-domain, if the alarm density is greater than the adaptive adjustment threshold, select a parameter adjustment strategy according to the alarm distribution, and obtain the updated original graph domain detection result.

[0014] Optionally, the step one is specifically:

[0015] Collect high-resolution images of the aluminum foil lunch box at a fixed imaging position, and the collection process includes obtaining a top view of the aluminum foil lunch box in a uniform lighting and anti-glare imaging environment;

[0016] Preprocess the image based on high-pass filtering and multi-scale edge enhancement; the multi-scale edge enhancement is performed by constructing a Gaussian pyramid of different scales and performing gradient amplitude promotion at each scale;

[0017] Extract the lunch box boundary contour using an edge tracking algorithm combining curvature change detection and morphological operators;

[0018] Locate the corner anchor points based on the corner response function on the boundary contour, and locate the edge anchor points based on the continuous curvature extreme value detection;

[0019] Combine the corner anchor points and the edge anchor points into an initial anchor point set, and perform stability evaluation on the initial anchor point set, remove anchor points with a response amplitude lower than a preset stability threshold, and form an optimized anchor point set.

[0020] Optionally, the step two is specifically:

[0021] Based on the optimized anchor set, a geometric mapping model between the original domain and the template domain is constructed, which is fitted by combining affine transformation and perspective transformation to the corresponding relationship between the anchor point positions of the original domain and the standard positions of the template domain;

[0022] For each pixel point in the original domain, the mapping coordinates in the template domain are calculated according to the geometric mapping model, and a pixel mapping relationship table from the original domain to the template domain is generated;

[0023] Using the pixel mapping relationship table, the pixel gray value or color value in the original domain image is resampled and filled into the corresponding template domain position, and in the resampling process, bilinear interpolation or cubic convolution interpolation is adopted, to generate the template domain image.

[0024] Optionally, the pre-processing based on high-pass filtering and multi-scale edge enhancement is specifically:

[0025] The collected aluminum foil meal box image is input into the high-pass filtering link, and a Gaussian filter constructed in the frequency domain is used to attenuate the low-frequency components of the image and retain the high-frequency components;

[0026] On the basis of the high-pass filtering output result, a Gaussian pyramid containing multiple scales is constructed, and the gradient amplitude map is obtained by gradient calculation after Gaussian smoothing of the image at each scale;

[0027] The gradient amplitude maps at each scale are normalized, and are partitioned according to the numerical range of the gradient intensity distribution, the region with normalized gradient amplitude greater than the first intensity threshold is defined as the high-intensity region, and the region with normalized gradient amplitude less than the second intensity threshold is defined as the low-intensity region; the amplitude of the high-intensity region is amplified by the first weight coefficient, and the amplitude of the low-intensity region is suppressed by the second weight coefficient;

[0028] The enhanced gradient amplitude maps at each scale are fused layer by layer, and in the fusion process, higher weight is assigned to the edge region with consistent gradient direction, and lower weight is assigned to the region with larger gradient direction difference, to obtain the final enhanced image.

[0029] Optionally, the step three is specifically:

[0030] In the template domain, the gradient similarity and the region consistency index between adjacent pixel blocks are calculated according to the gradient direction distribution and the gray consistency distribution of the template domain image, to generate a stitching neighborhood mask; the stitching neighborhood mask is used to mark the region that needs to be optimized in structure continuity;

[0031] Within the stitching neighborhood mask range, a multi-resolution stitching algorithm is used for processing, specifically: texture features and structure features of the region to be stitched are extracted respectively at multiple resolution levels, feature matching degrees at different resolution levels are calculated, and pixel-level registration is performed at the resolution level with the highest matching degree;

[0032] The registered images at different resolution levels are synthesized through a pyramid fusion strategy, and in the fusion process, a first weight coefficient is assigned to pixels with a feature matching degree greater than a first preset threshold, and a second weight coefficient is assigned to pixels with a feature matching degree less than or equal to the first preset threshold, wherein the first weight coefficient is greater than the second weight coefficient, thereby generating a template domain image with optimized structure continuity.

[0033] Optionally, the step four is specifically:

[0034] Within the template domain, the template domain image is regionally divided using the stitching neighborhood mask to determine the spatial distribution range of the main domain and the stitching sub-domain;

[0035] Within the main domain range, multi-modal features such as gray scale, texture, and gradient are extracted, and a main domain feature map is constructed;

[0036] Within the stitching sub-domain range, an adaptive region growing algorithm is used to expand the region from the initial seed pixel in the mask according to the growth criteria set for the gray scale difference, gradient direction difference, and texture similarity between pixels, until the growth termination condition is reached, thereby generating a stitching sub-domain region segmentation result;

[0037] In the region growing process, a boundary smoothing constraint is introduced, and the curvature change is calculated in the growth boundary neighborhood, and the boundary shape is adjusted using a morphological smoothing operator;

[0038] The segmented stitching sub-domain is encoded according to the gray scale mean, texture variance, and gradient amplitude features, thereby generating a stitching sub-domain feature map;

[0039] The main domain feature map and the stitching sub-domain feature map are spliced and fused in a unified template domain coordinate system, and in the fusion process, different fusion weight distribution strategies are used according to the region type, thereby generating a template domain feature map.

[0040] Optionally, the step five is specifically:

[0041] Within the template domain, the template domain feature map is read and combined with the stitching neighborhood mask to select a target region that needs to be analyzed for defects;

[0042] In the target region, a multi-dimensional feature vector set composed of gray scale, texture direction, and gradient features is extracted;

[0043] Similarity calculation is performed on the region feature vector set and a preset standard feature model to determine the matching degree value of each pixel or pixel block.

[0044] According to the matching degree distribution, a defect possibility map is established, and a low matching degree region is identified as a suspected defect region;

[0045] In the range of the suspected defect region, a gray scale gradient direction consistency, a texture periodicity and a structure continuity index are calculated, and a defect mask is generated by combining a threshold value determination;

[0046] The defect mask is used to locate a defect position in a template domain feature map, and a defect detection result data set containing a spatial coordinate and a defect category is output.

[0047] Optionally, the step six is specifically:

[0048] In the template domain, for each defect region identified in the defect detection result data set, multi-modal features in the region are extracted, including a gray scale distribution, a texture direction histogram, a gradient amplitude statistics and a morphological shape descriptor;

[0049] The multi-modal features are input into a defect classification model, and the defect classification model is a classifier combined by a convolutional neural network and a support vector machine after training;

[0050] In the convolutional neural network part, multi-layer convolution and pooling operations are performed to extract high-dimensional feature representations, and a feature vector is output in the full connection layer;

[0051] In the support vector machine part, the feature vector and a preset category boundary are used for discriminant analysis to output a corresponding defect category label;

[0052] The classification result is bound with the defect spatial coordinate to form a defect annotation data set containing position, category and shape information.

[0053] Optionally, the step seven is specifically:

[0054] A size measurement process is performed on the defect region in the defect annotation data set;

[0055] In each defect region, the length and width of the circumscribed rectangle are calculated based on the pixel coordinates, and the physical size is converted according to the spatial resolution of the template domain;

[0056] The area, perimeter and circularity index of the defect region are also calculated;

[0057] The geometric features and defect category information are associated and stored to generate a defect measurement report, which includes defect number, position coordinate, category, length, width, area, perimeter and shape description index; and the defect measurement report is output to the data interface of the detection system in the form of a data table.

[0058] Optionally, it further includes:

[0059] A defect statistics and traceability analysis module is established to statistically analyze the detection results of a batch of aluminum foil meal boxes;

[0060] The statistical analysis includes the total number of defects, the proportion of the number of each type of defect, the size distribution interval, the spatial distribution characteristics and the occurrence frequency;

[0061] According to the statistical results, a batch quality evaluation report is generated, which contains the numerical values of various indicators and visual charts;

[0062] The batch quality evaluation report is stored in the detection database in association with the production batch number, production time, equipment number and operator information;

[0063] When quality is traced back, the corresponding detection data and evaluation report are queried according to the production batch number.

[0064] The beneficial effects of the present application are:

[0065] The present application uses a combination of high-pass filtering and multi-scale edge enhancement preprocessing to solve the problems of edge reflection interference, boundary blur and detail texture loss in aluminum foil meal box images. The curvature change detection and morphological operator combined edge tracking algorithm is used to realize the stable extraction of the corner anchor point and the edge anchor point. Based on the geometric mapping model combined with affine and perspective transformation, high-precision mapping from the original domain to the template domain is completed. In the template domain, a suture neighborhood mask is generated by introducing gradient direction and gray consistency constraints, and a multi-resolution stitching algorithm is used to realize structure continuity optimization. The main domain and suture sub-domain feature maps are constructed by adaptive region growing and boundary smoothing constraints. In the defect candidate generation link, a defect possibility map is established by combining gray, texture direction and gradient features, and a classification model combining convolutional neural network and support vector machine is used to realize accurate recognition and classification of defects such as cracks, indentations and deformations. In the detection result feedback process, the spatial coordinates are kept consistent, and the defect measurement report is output by combining the geometric features such as defect size, area and shape. Finally, through the defect statistics and traceability analysis module, batch quality evaluation and production process traceability are realized, which significantly improves the detection accuracy, stability and traceability, and meets the quality control requirements of batch production. BRIEF DESCRIPTION OF DRAWINGS

[0066] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application. In the drawings:

[0067] Fig. 1 A flowchart of an aluminum foil meal box defect detection method based on image recognition is provided for the present application;

[0068] Fig. 2 An image acquisition and anchor point extraction schematic diagram is provided for the present application;

[0069] Fig. 3 This is a schematic diagram illustrating the stitching neighborhood generation and optimization proposed in this invention. Detailed Implementation

[0070] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0071] refer to Figs. 1-3 A defect detection method for aluminum foil lunch boxes based on image recognition includes the following steps:

[0072] Step 1: Acquire an image of the aluminum foil lunch box. Use an anchor point extraction method based on a combination of multi-scale edge response enhancement and curvature change analysis to detect the edge anchor points and corner anchor points of the aluminum foil lunch box in the image. Then, use an anchor point stability evaluation model to remove unstable anchor points and form an optimized anchor point set.

[0073] Step 2: Based on the optimized anchor point set, construct a bidirectional pixel mapping relationship between the original image domain and the template domain. In the mapping calculation, introduce deformation balance constraints and local feature preservation strategies to generate a template domain image with minimized distortion.

[0074] Step 3: Generate a stitching neighborhood mask based on gradient similarity and region consistency in the template domain. Use a multi-resolution stitching algorithm to stitch the image within the mask area to obtain a template domain image with optimized structural continuity.

[0075] Step 4: Within the template domain, the main domain and the stitching subdomain are divided using a combination of adaptive region growing and boundary smoothing constraints based on the stitching neighborhood mask, and feature maps of the main domain and the stitching subdomain are generated respectively.

[0076] Step 5: Perform multi-scale defect candidate generation, boundary refinement based on deformable convolution, and category determination by fusing global context information on the main domain feature map and the stitched subdomain feature map, respectively, to generate the main domain detection results and the stitched subdomain detection results, and obtain the template domain summary results based on the confidence weighted fusion strategy.

[0077] Step 6: Map the template domain summary results back to the original image coordinate system according to the inverse mapping of the bidirectional pixel mapping relationship to generate the original image domain detection results;

[0078] Step 7: Detect the alarm density of the stitched subdomain. If the alarm density is greater than the adaptive adjustment threshold, select the parameter adjustment strategy according to the alarm distribution to obtain the updated original image domain detection result.

[0079] In this embodiment, step one specifically includes:

[0080] The process of acquiring a high-resolution image of the aluminum foil lunch box to be tested at a fixed imaging position includes: under the condition of constant light intensity and constant color temperature, using an industrial camera with high pixel resolution and moderate focal length, suppressing metal reflection interference in an imaging environment with a polarizing filter, and obtaining a top view of the aluminum foil lunch box.

[0081] The image is preprocessed based on high-pass filtering and multi-scale edge enhancement. The high-pass filtering process uses a frequency-domain Gaussian filter and sets a cutoff frequency ratio to attenuate low-frequency components and retain high-frequency details. The multi-scale edge enhancement process includes: constructing a Gaussian pyramid containing multiple scales, processing between layers according to a fixed downsampling ratio, and after Gaussian smoothing of each scale image with an appropriate standard deviation, calculating the horizontal and vertical gradients through a gradient operator, generating a gradient magnitude map using the square root formula, and multiplying the gradient magnitude by a set enhancement coefficient according to the normalized intensity range to highlight the edges.

[0082] In the enhanced image, an edge tracking algorithm combining curvature change detection based on the three-point curvature formula with a morphological operator that performs closing operations using circular structuring elements is used to extract the continuous boundary contour of the lunchbox.

[0083] On the boundary contour, an improved corner response function is applied to locate corner anchor points, and edge anchor points are extracted by combining a continuous curvature local extremum detection method. The gray-level gradient direction histogram is extracted within a local window, and the local gradient distribution surface is fitted using the weighted least squares method. The corner intensity response value is calculated by combining the eigenvalues ​​of the second-order moment matrix. Gradient direction consistency constraints are introduced during the fitting process to reduce the interference of high-frequency noise on the corner detection results.

[0084] The corner anchor points and edge anchor points are combined into an initial anchor point set. The stability of the response amplitude of each anchor point is evaluated. The inverse of the mean square error of the detection results of multiple frames is calculated as a stability index. Anchor points with stability indexes lower than a preset threshold are removed to obtain the optimized anchor point set.

[0085] This implementation method acquires a high-resolution top view of an aluminum foil lunchbox under controlled imaging conditions. High-pass filtering is used to remove low-frequency interference, and multi-scale Gaussian pyramids are combined to achieve multi-level enhancement of gradient amplitude, thereby significantly improving the clarity of fine edges and complex contours. On this basis, continuous boundary extraction is achieved through the synergistic effect of curvature change detection and morphological operators. Corner response functions and continuous curvature extremum detection are used to accurately locate corners and edges. After stability evaluation to screen out low-response interference points, a high-precision and stable anchor point set is obtained, providing reliable feature support for subsequent geometric mapping and defect detection.

[0086] In this embodiment, step two specifically includes:

[0087] Based on the optimized anchor point set, the least squares method is used to solve the affine transformation matrix parameters between the original map domain anchor point coordinates and the template domain standard coordinates. A perspective transformation matrix is ​​introduced on the basis of the affine transformation matrix calculation, and a comprehensive geometric transformation matrix is ​​formed by matrix multiplication.

[0088] For the homogeneous coordinates of any pixel in the original image domain, matrix operations are performed using the comprehensive geometric transformation matrix to obtain the mapped coordinates in the template domain.

[0089] During the mapping coordinate calculation process, template domain boundary constraints are applied. When the mapping result exceeds the effective range of the template domain, boundary clipping is performed to ensure that all mapping coordinates are within the effective pixel range of the template domain.

[0090] A pixel mapping relationship table from the original image domain to the template domain is established using the mapping coordinate information. The pixel mapping relationship table is indexed by the pixel coordinates of the template domain and records the corresponding pixel position and grayscale value or color value of the original image domain pixel.

[0091] During pixel resampling, bilinear interpolation or cubic convolution interpolation is used to calculate the target pixel value for the pixel position with floating-point mapping coordinates. The interpolation calculation is based on the pixel values ​​of the upper, lower and left and right neighboring pixels around the mapping coordinates and the weight coefficients to perform a weighted summation, generating a continuous and smooth template domain image.

[0092] This implementation achieves high-precision geometric mapping from the original image domain to the template domain by establishing a comprehensive geometric transformation matrix combining affine and perspective transformations based on the optimized anchor point set. Template domain boundary constraints are introduced during the mapping process to prevent mapping out of bounds and improve the effectiveness of the mapped coordinates. A pixel mapping relationship table indexed by template domain pixel coordinates ensures the traceability and consistency of the mapped data. In the pixel resampling stage, bilinear interpolation or cubic convolution interpolation is applied based on the weights of neighboring pixels to generate a continuous and smooth template domain image, effectively eliminating distortion and jaggedness introduced by geometric transformations, maintaining the integrity of image details and the accuracy of geometric structure, and providing high-quality aligned image input for subsequent image analysis and defect detection.

[0093] In this embodiment, the preprocessing based on high-pass filtering and multi-scale edge enhancement specifically includes:

[0094] The acquired image of the aluminum foil lunchbox is input into a high-pass filter processing stage. A Gaussian high-pass filter is constructed in the frequency domain. By setting the cutoff frequency, filter size, and standard deviation, low-frequency components are attenuated while high-frequency components are preserved. The distribution of the filter in the two-dimensional discrete Fourier transform matrix is ​​calculated according to the Gaussian function formula, with the center position corresponding to the zero-frequency component. The filter coefficients are determined by the radial distance from the center position, thereby enhancing edge details.

[0095] Based on the high-pass filtering output, a Gaussian pyramid structure composed of multiple scales is constructed. After Gaussian smoothing, the Sobel operator is used to perform convolution operations in the horizontal and vertical directions to calculate gradient components and synthesize a gradient magnitude map, while simultaneously calculating the gradient direction map. The gradient magnitude map is then normalized, mapping its magnitude range to a uniform intensity interval for subsequent magnitude enhancement operations.

[0096] Based on the normalized gradient magnitude distribution and the numerical range of the gradient intensity distribution, regions with normalized gradient magnitudes greater than a first intensity threshold are defined as high-intensity regions, and regions with normalized gradient magnitudes less than a second intensity threshold are defined as low-intensity regions. An exponential function-based weight mapping strategy is used to amplify the gradient magnitudes in high-intensity regions and attenuate the gradient magnitudes in low-intensity regions. The parameters of the weight mapping function are related to the statistical distribution characteristics of the gradient magnitudes. The slope and offset of the mapping function are determined through histogram analysis to highlight important edge features.

[0097] The gradient magnitude maps at each scale, after magnitude adjustment, are weighted and fused in scale order. The fusion weights are assigned based on the consistency of gradient directions. Directional consistency is determined by the condition that the angle difference is less than a preset tolerance. Regions with consistent directions are assigned larger fusion weights, while regions with large directional differences are assigned smaller fusion weights. During the fusion process, weight normalization is performed to ensure that the enhanced image maintains stability in brightness and contrast, ultimately resulting in an enhanced image with prominent edge details.

[0098] This implementation constructs a Gaussian high-pass filter in the frequency domain to attenuate low-frequency components and preserve high-frequency components. Combined with gradient magnitude calculation and normalization processing of multi-scale Gaussian pyramids, it effectively extracts subtle edge features from aluminum foil lunchbox images. An exponential function-based weight mapping strategy is used to enhance the magnitude of important edge regions and suppress noise areas, achieving a significant improvement in edge features. Gradient direction consistency determination and weight normalization processing are introduced during multi-scale fusion to ensure the stability of the enhancement results in terms of brightness and contrast, thereby obtaining an enhanced image with clear edge details and good noise suppression, providing high-quality input data for subsequent feature localization and geometric matching.

[0099] In this embodiment, step three specifically includes:

[0100] Within the template domain, the gradient direction distribution and gray-level consistency distribution of the template domain image are used to analyze adjacent pixel blocks based on a preset neighborhood window. The gradient direction distribution is calculated from the gradient components of the template domain image, and the gray-level consistency distribution is obtained by calculating the mean and variance of the pixel blocks. Based on this, cosine similarity is used to measure gradient direction similarity, and normalized cross-correlation coefficient is used to measure gray-level consistency. Gradient similarity and gray-level consistency are weighted and fused to generate a comprehensive similarity index. When the comprehensive similarity index is less than a preset threshold, the corresponding pixel block position is marked as a region where structural continuity needs optimization, forming a stitched neighborhood mask.

[0101] Within the stitching neighborhood mask, a multi-resolution pyramid image sequence is constructed. At each resolution level, texture and structural features of the region to be stitched are extracted. Texture features are obtained using local binary pattern encoding, and structural features are described by histograms of gradient directions. Feature matching is performed between the region to be stitched and the reference region at each resolution level. Matching scores are calculated and ranked, and the resolution level with the highest matching score is selected as the optimal resolution level. Pixel-level registration is performed at the optimal resolution level, using affine transformation and sub-pixel interpolation methods to achieve alignment.

[0102] The registered images at various resolution levels are then synthesized into the final result using a pyramid fusion strategy. During the fusion process, pixels with feature matching scores greater than a first preset threshold are assigned a first weight coefficient, while pixels with feature matching scores less than or equal to the first preset threshold are assigned a second weight coefficient, with the first weight coefficient being greater than the second weight coefficient. The weight allocation follows a normalization principle to ensure global consistency in brightness and contrast across all fusion results. Finally, a template domain image with optimized structural continuity is generated, providing high-precision, low-artifact input data for subsequent defect detection and feature analysis.

[0103] This implementation generates a stitching neighborhood mask within the template domain based on gradient direction distribution and grayscale consistency distribution. A multi-resolution stitching algorithm is then used within the mask area for texture and structural feature extraction and matching, effectively identifying and optimizing regions with poor structural continuity. The combination of multi-resolution feature matching and pixel-level registration compensates for local structural shifts and texture misalignments while maintaining overall geometric consistency. A pyramid fusion strategy, coupled with a hierarchical weight allocation mechanism based on feature matching degree, highlights structural details in high-matching-degree regions during the fusion process while smoothing the transition in low-matching-degree regions. This results in a template domain image with continuous texture, complete structure, and stable brightness and contrast, providing a high-precision, low-artifact image input foundation for subsequent defect identification and feature analysis.

[0104] In this embodiment, step four specifically includes:

[0105] Within the template domain, the template domain image is divided into regions using a stitched neighborhood mask. The spatial distribution range of the main domain and stitched sub-domain is determined by connected component analysis. The boundaries of each region are determined based on the classification rules of the mask boundary pixels.

[0106] Within the main domain, grayscale features, texture features, and gradient features are extracted. Grayscale features include statistical indicators such as mean and variance. Texture features are obtained by calculating grayscale co-occurrence matrix parameters and local binary pattern encoding. Gradient features are calculated using orientation histograms and generated as main domain feature maps at a uniform resolution.

[0107] Within the stitched subdomain, an adaptive region growing algorithm is employed. Initial seed pixels are selected from within the mask based on a combined ranking of local gray-level mean and gradient magnitude. The region is then expanded according to a normalized distance criterion composed of gray-level difference, gradient direction difference, and texture similarity. The growth termination condition includes any one of the following: gray-level difference exceeds a threshold, gradient direction difference exceeds a threshold, or texture similarity is below a threshold.

[0108] Boundary smoothing constraints are introduced during the region growing process. Curvature changes are obtained by calculating the second derivative based on polynomial fitting. Morphological smoothing operators are used to adjust the boundary morphology. The shape and size of the operator convolution kernel are set according to the principle of balancing structure preservation and smoothness. The number of iterations is limited to the curvature threshold range.

[0109] After completing the segmentation of the stitched subdomain, feature vectors are constructed based on gray-level mean, texture variance, and gradient magnitude, and then normalized to form the feature map of the stitched subdomain.

[0110] The main domain feature map and the stitched sub-domain feature map are spliced ​​and fused in a unified template domain coordinate system. The fusion process dynamically calculates the fusion weight based on the region classification label and feature variance, assigning greater weight to regions with high matching degree and smaller weight to regions with low matching degree. Multi-scale gradient fusion and Poisson fusion methods are applied at the splicing gap to ensure the stability of the template domain feature map in terms of visual continuity and feature consistency.

[0111] This implementation introduces a spatial division of the main domain and stitched subdomains within the template domain, and performs multimodal feature extraction, adaptive region growth, boundary smoothing constraints, and feature encoding for different regions. Combined with dynamic adjustment of fusion weights and multi-scale gradient fusion strategies, it achieves a significant improvement in the template domain feature map in terms of detail fidelity, structural continuity, and feature consistency. It effectively reduces brightness abrupt changes and texture breaks at the stitching seams, and enhances the stability and robustness of the feature map in subsequent matching, detection, and recognition processes.

[0112] In this embodiment, step five specifically includes:

[0113] The template domain feature map is read within the template domain, and the spatial range is filtered by combining the stitching neighborhood mask. The target area for defect analysis is selected by spatial coordinate matching. During the reading of the pixel data of the target area, normalized intensity adjustment is performed to ensure that the gray level, texture direction and gradient features are within a uniform intensity range, so as to reduce the impact of ambient lighting changes on feature calculation.

[0114] Within the target region, for each pixel or pixel block, the mean gray level, gray level variance, texture orientation histogram, gradient magnitude, and gradient direction are calculated separately, forming a multi-dimensional feature vector set containing gray level features, texture orientation features, and gradient features. The feature calculation process employs a uniform window size and sliding step size to ensure the consistency of the feature vector set in spatial distribution.

[0115] The similarity between the regional feature vector set and the preset standard feature model is calculated. The similarity measurement method can be cosine similarity, Euclidean distance, or Mahalanobis distance. Based on the similarity calculation results, a matching degree value is generated for each pixel or pixel block, and a defect probability map is constructed according to the matching degree distribution. In the defect probability map, areas with low matching degree are marked as suspected defect areas, and their corresponding spatial coordinates are recorded.

[0116] Within the suspected defect area, grayscale gradient direction consistency, texture periodicity, and structural coherence indices are calculated. These indices are compared to preset thresholds, and pixel regions meeting the defect criteria are marked in the defect mask. Morphological opening and closing operations are introduced during the defect mask generation process to smooth the boundaries, remove isolated noise points, and maintain the shape integrity of the defect area.

[0117] This method uses a defect mask to locate defects in a template domain feature map, outputting a defect detection result dataset containing spatial coordinates, defect category, and matching degree statistics. The output data is encoded in a standardized format for easy retrieval and analysis in quality control systems or defect repair modules.

[0118] This implementation uses a template domain feature map and a stitched neighborhood mask to filter target regions within the template domain. It then extracts grayscale, texture direction, and gradient features from the target region to form a multi-dimensional feature vector set. Similarity calculations are performed with a preset standard feature model to accurately obtain the matching degree distribution of pixels or pixel blocks, thus effectively identifying suspected defect areas in the defect probability map. A defect mask is generated by combining indicators such as grayscale gradient direction consistency, texture periodicity, and structural coherence, which can effectively eliminate non-defect noise areas and maintain the integrity of boundary shapes during defect localization. The final output defect detection result dataset contains precise spatial coordinates and defect category information, achieving high-precision detection and classification of defects in the target region, improving the accuracy and robustness of defect identification.

[0119] In this embodiment, step six specifically includes:

[0120] Within the template domain, feature extraction is performed for each defect region identified in the defect detection result dataset. Gray-level distribution features are obtained by calculating pixel gray-level histograms and statistically analyzing the mean, variance, skewness, and kurtosis; texture orientation histogram features are based on the gray-level co-occurrence matrix, calculating local directional energy distribution; gradient magnitude statistical features are obtained by extracting horizontal and vertical gradient components using the Sobel operator and calculating gradient magnitude histograms; morphological shape descriptors include region area, perimeter, compactness, aspect ratio, and boundary curvature distribution. These feature data are then normalized to form a multimodal feature matrix.

[0121] The multimodal feature matrix is ​​input into the defect classification model, which consists of a concatenated convolutional neural network and a support vector machine. The convolutional neural network includes several convolutional layers, pooling layers, and fully connected layers. The kernel size, stride, and activation function parameters can be set according to the distribution of training samples. The feature maps output by the convolutional layers are downsampled by the pooling layers to compress the feature dimension and suppress noise. The fully connected layers map the multidimensional features into one-dimensional high-dimensional feature vectors, and the batch normalization layer maintains the stability of the feature distribution.

[0122] The Support Vector Machine (SVM) receives high-dimensional feature vectors from the convolutional neural network (CNN), constructs a nonlinear classification boundary using the radial basis function (RBF) kernel, and determines the positions of the support vectors and class hyperplanes during the training phase. During discriminant analysis, the SVM calculates the distance from the input features to each class hyperplane and outputs the defect class label corresponding to the maximum distance.

[0123] By binding defect category labels with the spatial coordinates and morphological shape descriptors of the defect region, a defect annotation dataset containing defect location, category, and shape information is formed. The defect annotation dataset can be used for quality statistics, defect source analysis, and automatic repair strategy generation.

[0124] This implementation performs multimodal feature extraction on the defect regions identified in the defect detection result dataset within the template domain. It combines grayscale distribution features, texture direction histogram features, gradient magnitude statistical features, and morphological shape descriptors and inputs them into a defect classification model composed of a concatenated convolutional neural network and a support vector machine. The convolutional neural network part completes the high-dimensional feature representation extraction, and the support vector machine part completes the nonlinear classification and discrimination, thereby achieving high-precision identification of defect categories. The identification results are then bound with the defect spatial coordinates and morphological features to generate a defect annotation dataset, thereby improving the accuracy and stability of defect classification.

[0125] In this embodiment, step seven specifically includes:

[0126] Perform a dimensional measurement process on the defect regions in the defect annotation dataset;

[0127] Within each defect region, the lengths of the major and minor axes of the circumscribed rectangle are calculated based on pixel coordinates and converted into physical dimensions according to the spatial resolution of the template domain.

[0128] Simultaneously calculate the area, perimeter, and roundness index of the defective region;

[0129] The geometric features are associated with and stored with the defect category information to generate a defect measurement report. The report includes the defect number, location coordinates, category, length, width, area, perimeter, and shape description indicators. The defect measurement report is then output to the data interface of the detection system in the form of a data table.

[0130] This implementation method performs geometric measurements on the defect areas in the defect annotation dataset, calculates the major and minor axis lengths of the circumscribed rectangle based on pixel coordinates, and converts them into physical dimensions by combining the spatial resolution of the template domain. At the same time, it obtains shape description indicators such as the area, perimeter, and roundness of the defect area. The above geometric features are associated with and stored with defect category information to form a defect measurement report containing defect number, location coordinates, category, length, width, area, perimeter, and shape description indicators. The report is then output to the data interface of the detection system in the form of a data table, realizing the dimensional and quantitative description of defects and the standardized information output. This provides accurate and traceable measurement data support for quality assessment, trend analysis, and production process improvement.

[0131] In this embodiment, it also includes:

[0132] Establish a defect statistics and traceability analysis module to statistically analyze the test results of a batch of aluminum foil lunch boxes produced;

[0133] Statistical analysis includes the total number of defects, the proportion of each type of defect, the size distribution range, spatial distribution characteristics, and the frequency of occurrence;

[0134] A batch quality assessment report is generated based on the statistical results. The report includes numerical values ​​and visualization charts for each indicator.

[0135] The batch quality assessment report is linked with the production batch number, production time, equipment number, and operator information and stored in the testing database;

[0136] During quality traceability, the corresponding test data and evaluation report can be retrieved based on the production batch number.

[0137] Example 1:

[0138] To verify the feasibility of this invention in practice, it was applied to an aluminum foil lunchbox production line in a food packaging factory. This production line produces approximately 50,000 aluminum foil lunchboxes daily and has long suffered from low efficiency, high missed detection rate, and high false detection rate in manual inspection. Manual inspection requires quality inspectors to observe the production line visually for extended periods, which is easily affected by fatigue, leading to misjudgments. This is especially true on highly reflective, textured aluminum foil surfaces, where minute indentations, scratches, and forming wrinkles are often overlooked.

[0139] In practical applications, the detection system of this invention is directly deployed at the end of the production line. The acquisition module uses a high-speed industrial camera to acquire a frontal view image of each lunchbox without affecting the production cycle, with an image resolution of 4096×2160 pixels. After three months of operation, the system sequentially performs steps such as high-pass filtering, multi-scale edge enhancement, template domain mapping, stitching neighborhood processing, defect analysis and classification, and geometric dimension measurement after image acquisition, and feeds the detection results back to the production management system in real time.

[0140] During system operation, approximately 4.5 million lunch boxes were inspected. The recorded and labeled defect types mainly included four categories: scratches, dents, molding wrinkles, and coating peeling. Before deployment, the average missed detection rate for manual inspection was 8.5%, and the false detection rate was 6.3%. After deploying this invention, the missed detection rate dropped to 0.9%, the false detection rate dropped to 1.2%, and the average inspection time per item was reduced from 2.4 seconds manually to 0.15 seconds.

[0141] During the three months of operation, test data from 15 production batches each month were extracted and compared, resulting in Table 1.

[0142] Table 1 Comparison of the effects of the detection method of the present invention and manual detection.

[0143]

[0144]

[0145] As shown in Table 1, the detection method of this invention is significantly superior to manual detection in terms of both false negative and false positive rates. The false negative rate is reduced by approximately 89.4%, and the false positive rate is reduced by approximately 80.95%. Due to the adoption of fully automated image processing and intelligent recognition, the detection speed is increased by more than 15 times, and the detection stability score is improved to 9.6, indicating that the system has a strong adaptability to factors such as changes in illumination and background interference during long-term continuous operation.

[0146] To further evaluate the accuracy of the present invention in defect size measurement, a comparative test on measurement accuracy was conducted on defect samples randomly selected within three months. The results are shown in Table 2.

[0147] Table 2 Comparison of Defect Size Measurement Accuracy

[0148] Measurement item Defect length Defect width Defect area Reference standard size (mm) 12.50 3.20 25.60 Manual measurement average error (mm) 0.84 0.46 2.35 Invention measurement average error (mm) 0.11 0.07 0.28 Accuracy improvement rate (%) 86.90 84.78 88.09

[0149] As shown in Table 2, the average error in defect size measurement using this invention is controlled within 0.3 mm. Compared with manual measurement, the measurement accuracy of length, width, and area is improved by more than 84%. This is mainly due to the high-precision processing of template domain mapping, defect mask generation, and geometric feature calculation in this invention, which avoids the deviations caused by visual judgment and the limitations of manual tool accuracy in manual measurement.

[0150] In summary, the application of this invention in aluminum foil food box production lines not only effectively solves the problems of low efficiency, high missed detection rate, and insufficient measurement accuracy in manual inspection, but also reduces labor intensity and costs while improving the stability and consistency of production quality. Especially against highly reflective and complex texture backgrounds, this invention, through the combination of high-pass filtering and multi-scale edge enhancement, enables the stable detection of even minute defects, providing a reliable technical means for large-scale industrial inspection.

[0151] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A defect detection method for aluminum foil lunch boxes based on image recognition, characterized in that, Includes the following steps: Step 1: Acquire an image of the aluminum foil lunch box, detect the edge anchor points and corner anchor points of the aluminum foil lunch box in the image, and form an anchor point set; Step 2: Generate the pixel mapping relationship from the original image domain to the template domain based on the anchor point set, and generate the template domain image; Step 3: Generate a stitching neighborhood mask in the template domain, and obtain the stitched template domain image through stitching processing; Step 4: Within the template domain, divide the main domain and the stitching subdomain according to the stitching neighborhood mask, and generate the main domain feature map and the stitching subdomain feature map respectively; Step 5: Perform defect candidate generation, boundary refinement, and category determination on the main domain feature map and the stitched subdomain feature map respectively to generate the main domain detection results and the stitched subdomain detection results. After fusion, the template domain summary result is obtained. Step 6: Reverse the mapping of the template domain summary results back to the original image coordinate system according to the pixel mapping relationship from the original image domain to the template domain, and generate the original image domain detection results; Step 7: Detect the alarm density of the stitched subdomain. If the alarm density is greater than the adaptive adjustment threshold, select the parameter adjustment strategy according to the alarm distribution to obtain the updated original image domain detection result.

2. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 1, characterized in that, Step one specifically involves: A high-resolution image of the aluminum foil lunch box to be tested is acquired at a fixed imaging position. The acquisition process includes obtaining a top view of the aluminum foil lunch box in an imaging environment with uniform illumination and suppression of reflective interference. The image is preprocessed based on high-pass filtering and multi-scale edge enhancement; The multi-scale edge enhancement is achieved by constructing Gaussian pyramids of different scales and performing gradient magnitude boosting at each scale. An edge tracking algorithm combining curvature change detection and morphological operators was used to extract the boundary contour of the lunchbox. Corner anchor points are located on the boundary contour based on the corner response function, and edge anchor points are located based on the detection of continuous curvature extrema. The corner anchor points and edge anchor points are combined to form an initial anchor point set, and the stability of the initial anchor point set is evaluated. Anchor points with response amplitudes lower than a preset stability threshold are removed to form an optimized anchor point set.

3. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 2, characterized in that, Step two specifically involves: Based on the optimized anchor point set, a geometric mapping model between the original image domain and the template domain is constructed. The geometric mapping model fits the correspondence between the anchor point positions of the original image domain and the standard positions of the template domain through a combination of affine transformation and perspective transformation. For each pixel in the original image domain, calculate its mapping coordinates in the template domain according to the geometric mapping model, and generate a pixel mapping relationship table from the original image domain to the template domain; Using the pixel mapping table, the pixel grayscale or color values ​​in the original image domain are resampled and filled into the corresponding template domain positions. During the resampling process, bilinear interpolation or cubic convolution interpolation is used to generate the template domain image.

4. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 3, characterized in that, The preprocessing based on high-pass filtering and multi-scale edge enhancement specifically includes: The acquired image of the aluminum foil lunch box is input into the high-pass filter stage. The low-frequency components of the image are attenuated by the Gaussian filter constructed in the frequency domain, while the high-frequency components are preserved. Based on the high-pass filter output, a Gaussian pyramid with multiple scales is constructed. The gradient of each scale image is calculated after Gaussian smoothing to obtain the gradient magnitude map. The gradient magnitude maps at each scale are normalized, and the regions are divided according to the numerical range of the gradient intensity distribution. Regions with normalized gradient magnitudes greater than the first intensity threshold are defined as high-intensity regions, and regions with normalized gradient magnitudes less than the second intensity threshold are defined as low-intensity regions. The magnitudes of high-intensity regions are amplified by the first weighting coefficient, and the magnitudes of low-intensity regions are suppressed by the second weighting coefficient. The enhanced gradient magnitude maps at each scale are fused layer by layer. During the fusion process, higher weights are assigned to edge regions with consistent gradient directions, while lower weights are assigned to regions with significantly different gradient directions, resulting in the final enhanced image.

5. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 4, characterized in that, Step three specifically involves: In the template domain, based on the gradient direction distribution and grayscale consistency distribution of the template domain image, the gradient similarity and region consistency index between adjacent pixel blocks are calculated to generate a stitched neighborhood mask; the stitched neighborhood mask is used to mark the regions that need structural continuity optimization. Within the stitching neighborhood mask, a multi-resolution stitching algorithm is used for processing. Specifically, the texture and structural features of the area to be stitched are extracted at multiple resolution levels, the feature matching degree at different resolution levels is calculated, and pixel-level registration is performed at the resolution level with the highest matching degree. The registered images at each resolution level are synthesized using a pyramid fusion strategy. During the fusion process, pixels with a feature matching degree greater than a first preset threshold are assigned a first weight coefficient, and pixels with a feature matching degree less than or equal to the first preset threshold are assigned a second weight coefficient, wherein the first weight coefficient is greater than the second weight coefficient, thereby generating a template domain image with optimized structural continuity.

6. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 5, characterized in that, Step four specifically involves: Within the template domain, the template domain image is divided into regions using a stitching neighborhood mask to determine the spatial distribution range of the main domain and the stitching subdomain. Within the main domain, multimodal features such as grayscale, texture, and gradient are extracted, and a main domain feature map is constructed. Within the stitched subdomain, an adaptive region growing algorithm is used. Starting from the initial seed pixel in the mask, the region is expanded according to the growth criteria set by the gray-level difference between pixels, the gradient direction difference, and the texture similarity, until the growth termination condition is reached, thus generating the stitched subdomain region segmentation result. In the process of region growth, boundary smoothing constraints are introduced. The curvature change is calculated in the neighborhood of the growth boundary and the boundary shape is adjusted by using morphological smoothing operators. The segmented stitching subdomains are encoded according to gray-level mean, texture variance, and gradient magnitude features to generate stitching subdomain feature maps; The main domain feature map and the stitched sub-domain feature map are spliced ​​and fused in a unified template domain coordinate system. During the fusion process, different fusion weight allocation strategies are adopted according to the region type to generate the template domain feature map.

7. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 6, characterized in that, Step five specifically involves: Within the template domain, read the template domain feature map and combine it with the stitching neighborhood mask to select the target area for defect analysis. In the target region, a multi-dimensional feature vector set composed of grayscale, texture direction and gradient features is extracted; The similarity calculation is performed using the regional feature vector set and the preset standard feature model to determine the matching degree value of each pixel or pixel block; Based on the matching degree distribution, a defect probability map is established, and areas with low matching degree are marked as suspected defect areas; Within the suspected defect area, the gray-level gradient direction consistency, texture periodicity, and structural coherence indices are calculated, and a defect mask is generated by combining the threshold judgment. The defect location is located in the template domain feature map using a defect mask, and the defect detection result dataset containing spatial coordinates and defect category is output.

8. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 7, characterized in that, Step six specifically involves: Within the template domain, for each defect region identified in the defect detection result dataset, multimodal features within the region are extracted, including grayscale distribution, texture orientation histogram, gradient magnitude statistics, and morphological shape descriptor. Multimodal features are input into a defect classification model, which is a classifier that combines a trained convolutional neural network and a support vector machine. In the convolutional neural network part, multi-layer convolution and pooling operations are performed to extract high-dimensional feature representations, and feature vectors are output in the fully connected layer. In the support vector machine part, discriminant analysis is performed using feature vectors and preset category boundaries to output the corresponding defect category label; The classification results are bound to the spatial coordinates of the defects to form a defect annotation dataset containing location, category, and shape information.

9. The method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 8, characterized in that, Step seven specifically involves: Perform a dimensional measurement process on the defect regions in the defect annotation dataset; Within each defect region, the lengths of the major and minor axes of the circumscribed rectangle are calculated based on pixel coordinates and converted into physical dimensions according to the spatial resolution of the template domain. Simultaneously calculate the area, perimeter, and roundness index of the defective region; The geometric features are associated with and stored with the defect category information to generate a defect measurement report. The report includes the defect number, location coordinates, category, length, width, area, perimeter, and shape description indicators. The defect measurement report is then output to the data interface of the detection system in the form of a data table.

10. A method for detecting defects in aluminum foil lunch boxes based on image recognition according to claim 9, characterized in that, Also includes: Establish a defect statistics and traceability analysis module to statistically analyze the test results of a batch of aluminum foil lunch boxes produced; Statistical analysis includes the total number of defects, the proportion of each type of defect, the size distribution range, spatial distribution characteristics, and the frequency of occurrence; A batch quality assessment report is generated based on the statistical results. The report includes numerical values ​​and visualization charts for each indicator. The batch quality assessment report is linked with the production batch number, production time, equipment number, and operator information and stored in the testing database; During quality traceability, the corresponding test data and evaluation report can be retrieved based on the production batch number.