A method and system for identifying dumpling micro-cracks

By constructing a multi-scale spatial feature pyramid and topology map, and combining convolutional networks and classification decision models, the problems of light sensitivity and insufficient topological structure analysis in the identification of microcracks on dumpling surfaces were solved, and high-precision microcrack identification was achieved.

CN122473149APending Publication Date: 2026-07-28PUYANG ZENGYUN FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PUYANG ZENGYUN FOOD CO LTD
Filing Date
2026-05-28
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing technologies suffer from low recognition accuracy due to light sensitivity, loss of multi-scale details, and lack of topological structure analysis in the identification of microcracks on dumpling surfaces, failing to meet the requirements for high-precision detection.

Method used

By extracting the principal curvature tensor and multi-directional phase consistency features of the image of the region to be tested, a multi-scale spatial feature pyramid is constructed. The membership feature map is calculated by combining a convolutional network, and a principal membership map is constructed. A local topological map is constructed by connecting domain skeletonization and topological node set. The local algebraic connectivity and linear structure degree are calculated and input into the classification decision model for recognition.

Benefits of technology

It improves the accuracy and reliability of dumpling microcrack identification, effectively filters background interference, and accurately identifies microcracks in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122473149A_ABST
    Figure CN122473149A_ABST
Patent Text Reader

Abstract

The present application provides a kind of dumpling micro crack identification method, system, the identification method includes collecting the image of the region to be measured, fusion pixel main curvature tensor and multi-direction phase consistency feature, constructs multi-scale feature pyramid;Rely on the multi-scale micro crack membership degree feature map generated by convolution network containing channel attention, weighted fusion obtains main membership degree atlas, calculates threshold screening pixel average membership degree as main membership value, screening pixel constructs binary connected domain and skeleton, extracts topological node, constructs local topological atlas according to the difference of node quantity;Solve Laplace matrix eigenvalue to obtain algebraic connectivity, combined with the eigenvalue proportion of covariance matrix to calculate linear structure degree, fusion three core indexes input classification decision model, realize accurate identification of dumpling surface micro crack.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of identification, and in particular relates to a method and system for identifying microcracks in dumplings. Background Technology

[0002] The integrity of the dumpling skin determines the product's cooking quality and consumer acceptance. Micro-cracks are one of the main defects causing dumplings to break and leak filling during processing and steaming. The dumpling surface not only has complex natural folds and dough textures, but also often has loose dry flour adhering to it. Combined with subtle fluctuations in the lighting environment inside the production equipment, these tiny cracks often appear as low-contrast, weak-edged, and discontinuous features in visual images. These micro-cracks are easily confused with the normal edge folds or deep folds of the dumpling. Traditional quality inspection methods relying on manual visual screening are not only inefficient and labor-intensive, but also prone to omissions and false positives due to visual fatigue among inspectors. They simply cannot meet the urgent needs of modern high-speed production lines for high-precision, high-rate-of-use inspections.

[0003] Existing feature extraction methods are often overly sensitive to illumination and lack depth representation of surface 3D geometric undulations. They fail to reliably combine illumination-invariant features such as the principal curvature tensor of pixels and multi-directional phase consistency, making it easy for algorithms to misclassify deep wrinkles and shadows as cracks. Conventional neural networks lack reliable channel attention mechanisms to focus on suspected regions during multi-scale feature transfer, making it impossible to accurately calculate pixel-level microcrack membership. Microcracks in images often present as discontinuous, irregular, and elongated branches, but existing technologies fail to analyze the geometric skeleton structure of cracks from a deep perspective of topology and graph theory. When processing connected subdomains, existing methods do not comprehensively consider the spatial geodesic distance and feature distance between branch points and endpoints, nor do they utilize the graph Laplacian matrix to calculate local algebraic connectivity or represent local linear structure through the node covariance matrix. This lack of high-order topological graph construction and connectivity mathematical representation mechanisms means that existing systems cannot provide highly discriminative structural features when faced with microcracks with local breaks and distorted shapes. Summary of the Invention

[0004] To address the issues of low microcrack recognition caused by the sensitivity of feature extraction to illumination, loss of multi-scale details, and lack of topological structure analysis in existing technologies.

[0005] In the first aspect, the present invention provides a method for identifying micro-cracks in dumplings, comprising the following steps: The process involves acquiring an image of the region to be tested, extracting the principal curvature tensor and multi-directional phase consistency features of each pixel in the image, and concatenating them into a fused feature vector. A multi-scale spatial feature pyramid is constructed based on this fused feature vector. A convolutional network is used to calculate membership feature maps at each scale, and a principal membership map is constructed. A set of pixels with membership values ​​greater than a preset threshold is selected from the principal membership map. If the set of pixels is empty, it is determined that the region to be tested has no microcracks, and the recognition process ends. If the set of pixels is not empty, the average membership value of the pixels in the set is calculated as the principal membership value, and subsequent steps are executed. Extract pixels with a value greater than a preset threshold from the principal membership graph to construct a binary connected domain and skeletonize it. Extract branch points and endpoints to form a set of topological nodes. For each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the bounding rectangle. Otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this. The second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map is calculated as the local algebraic connectivity. The local linear structure is calculated based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. The maximum values ​​of the local algebraic connectivity and local linear structure of each subdomain are extracted as the algebraic connectivity and linear structure, respectively. The principal membership value, algebraic connectivity, and linear structure are combined and input into the classification decision model to output the microcrack identification result.

[0006] Further, the extraction of the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested includes: Calculate the second-order Hessian matrix of the image of the region to be tested at each pixel; Eigenvalue decomposition is performed on the second-order Hessian matrix to obtain the first principal eigenvalue, the second principal eigenvalue, and the corresponding principal direction eigenvectors and secondary direction eigenvectors, respectively, and the principal curvature tensor is constructed accordingly. A multi-directional Log-Gabor filter is used to perform convolution operations on the image of the region under test to obtain the amplitude response and phase response in each direction, and the local phase consistency measure in each direction is calculated. The local phase consistency measures in each direction are normalized and weighted and fused to generate multi-directional phase consistency features.

[0007] Furthermore, the calculation of membership feature maps at various scales using convolutional networks includes: Input the multi-scale spatial feature pyramid into the convolutional network; In convolutional networks, global average pooling is used to obtain global statistics of channels at each scale, and fully connected layers and activation functions are used to calculate the attention weights of each channel. The attention weights are multiplied element-wise with the features of each channel, and the multi-channel features are fused into a single-channel response map through a 1×1 convolution. The output of the Sigmoid activation layer is then mapped to a probability matrix in the range of 0 to 1, which serves as the membership feature map of the pixel belonging to the suspected micro-crack class at the corresponding scale.

[0008] Furthermore, the spatial geodesic distance and characteristic Euclidean distance between the computation nodes are normalized, weighted, and summed, then converted into connection weights using a Gaussian kernel function, including: The shortest path length between any two nodes in a connected subdomain is calculated using the fast traversal algorithm and used as the spatial geodesic distance. Extract the fused feature vector corresponding to the node, and calculate the Euclidean distance between any two node fused feature vectors as the feature Euclidean distance; The spatial geodesic distance and the characteristic Euclidean distance are normalized by a preset distance scaling factor and then weighted and summed. The sum is then converted into connection weights between nodes using a Gaussian kernel function.

[0009] Furthermore, the classification decision model is a support vector machine model or a random forest model; The training process of the classification decision model is as follows: a large number of historical images of dumplings with known microcrack states are obtained to construct a training set. The principal membership value, algebraic connectivity and linear structure of each image in the training set are extracted to form the feature vector of the training sample. The corresponding microcrack state is used as the real label for supervised training. When the classification decision model is a support vector machine model, the model is trained by optimizing the objective function of the support vector machine, and training stops when the objective function satisfies the preset convergence condition. When the classification decision model is a random forest model, multiple decision trees are generated according to at least one of the preset training termination conditions: number of decision trees, maximum tree depth, and minimum number of leaf node samples. The training of the random forest model is completed based on the out-of-bag error or the performance of the validation set.

[0010] In a second aspect, the present invention also provides a dumpling micro-crack recognition system, comprising the following modules: The calculation module is used to acquire the image of the region to be tested, extract the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested, and concatenate them into a fusion feature vector. Based on the fusion feature vector, a multi-scale spatial feature pyramid is constructed. A convolutional network is used to calculate the membership feature map at each scale and construct the principal membership map. The set of pixels in the principal membership map that is greater than a preset threshold is selected. If the set of pixels is empty, it is determined that there are no microcracks in the region to be tested, and the recognition process ends. If the set of pixels is not empty, the average membership of the pixels in the set is calculated as the principal membership value, and subsequent steps are executed. The extraction module is used to extract pixels in the principal membership graph that are greater than a preset threshold, construct a binary connected domain and skeletonize it, extract branch points and endpoints to form a set of topological nodes, and for each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the circumscribed rectangle; otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this. The output module is used to calculate the second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map as the local algebraic connectivity. It calculates the local linear structure degree based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. It extracts the maximum values ​​of the local algebraic connectivity and local linear structure degree of each subdomain as the algebraic connectivity and linear structure degree, and inputs the principal membership value, algebraic connectivity, and linear structure degree into the classification decision model to output the microcrack recognition result.

[0011] Preferably, the extraction of the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested includes: Calculate the second-order Hessian matrix of the image of the region to be tested at each pixel; Eigenvalue decomposition is performed on the second-order Hessian matrix to obtain the first principal eigenvalue, the second principal eigenvalue, and the corresponding principal direction eigenvectors and secondary direction eigenvectors, respectively, and the principal curvature tensor is constructed accordingly. A multi-directional Log-Gabor filter is used to perform convolution operations on the image of the region under test to obtain the amplitude response and phase response in each direction, and the local phase consistency measure in each direction is calculated. The local phase consistency measures in each direction are normalized and weighted and fused to generate multi-directional phase consistency features.

[0012] Preferably, the step of using a convolutional network to calculate membership feature maps at various scales includes: Input the multi-scale spatial feature pyramid into the convolutional network; In convolutional networks, global average pooling is used to obtain global statistics of channels at each scale, and fully connected layers and activation functions are used to calculate the attention weights of each channel. The attention weights are multiplied element-wise with the features of each channel, and the multi-channel features are fused into a single-channel response map through a 1×1 convolution. The output of the Sigmoid activation layer is then mapped to a probability matrix in the range of 0 to 1, which serves as the membership feature map of the pixel belonging to the suspected micro-crack class at the corresponding scale.

[0013] Preferably, the spatial geodesic distance and characteristic Euclidean distance between the computing nodes are normalized, weighted, summed, and converted into connection weights using a Gaussian kernel function, including: The shortest path length between any two nodes in a connected subdomain is calculated using the fast traversal algorithm and used as the spatial geodesic distance. Extract the fused feature vector corresponding to the node, and calculate the Euclidean distance between any two node fused feature vectors as the feature Euclidean distance; The spatial geodesic distance and the characteristic Euclidean distance are normalized by a preset distance scaling factor and then weighted and summed. The sum is then converted into connection weights between nodes using a Gaussian kernel function.

[0014] Preferably, the classification decision model is a support vector machine model or a random forest model; The training process of the classification decision model is as follows: a large number of historical images of dumplings with known microcrack states are obtained to construct a training set. The principal membership value, algebraic connectivity and linear structure of each image in the training set are extracted to form the feature vector of the training sample. The corresponding microcrack state is used as the real label for supervised training. When the classification decision model is a support vector machine model, the model is trained by optimizing the objective function of the support vector machine, and training stops when the objective function satisfies the preset convergence condition. When the classification decision model is a random forest model, multiple decision trees are generated according to at least one of the preset training termination conditions: number of decision trees, maximum tree depth, and minimum number of leaf node samples. The training of the random forest model is completed based on the out-of-bag error or the performance of the validation set.

[0015] This invention extracts principal curvature tensors and multi-directional phase consistency features to detect subtle geometric changes on dumpling surfaces from multiple dimensions. Combining a multi-scale spatial feature pyramid and channel attention mechanism, it filters background interference and focuses on key microcrack features, improving the accuracy of locating suspected microcrack areas and calculating membership. A local topological map is constructed through connected component skeletonization and extraction of topological node sets. The spatial geodesic distance and feature Euclidean distance are used to characterize node weights, reflecting the spatial distribution pattern of microcracks. By calculating the algebraic connectivity corresponding to the Laplacian matrix and the linear structure degree based on the covariance matrix, the connectivity and morphological characteristics of cracks are deeply analyzed. The fusion of multi-dimensional representation indicators and input into the classification decision model eliminates interference from normal surface wrinkles and artifacts, improving the accuracy and reliability of dumpling microcrack identification. Attached Figure Description

[0016] Figure 1 A flowchart of a method for identifying micro-cracks in dumplings; Figure 2 This is a schematic diagram of the convergence curve of the out-of-bag error rate of the random forest model; Figure 3 This is a diagram showing the comparison of the performance evaluation indicators of various models in the ablation experiment. Detailed Implementation

[0017] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0018] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0019] This disclosure provides a method for identifying micro-cracks in dumplings, such as... Figure 1 As shown, it includes the following steps: S1. Acquire the image of the region to be tested, extract the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested, and concatenate them into a fusion feature vector. Construct a multi-scale spatial feature pyramid based on the fusion feature vector, use a convolutional network to calculate the membership feature map at each scale, and construct a principal membership map. Filter the set of pixels in the principal membership map that is greater than a preset threshold. If the set of pixels is empty, it is determined that there are no microcracks in the region to be tested, and the recognition process ends. If the set of pixels is not empty, calculate the average membership value of the pixels in the set as the principal membership value, and execute the subsequent steps.

[0020] A color image of the dumpling surface is read and converted to grayscale. A Gaussian smoothing filter (cv2) with the GaussianBlur function is applied to remove high-frequency noise, yielding the image of the region to be tested. The principal curvature tensor extraction process involves calculating the Hessian matrix of the image. The second-order partial derivatives of the image in the horizontal, vertical, and intersecting directions are calculated using the cv2.Sobel operator or the second-order Gaussian derivative, respectively. Based on these, a 2×2 Hessian matrix is ​​constructed for each pixel. Eigenvalue decomposition is performed on this real symmetric Hessian matrix to obtain two signed eigenvalues. The first eigenvalue, the second eigenvalue, and their corresponding unit eigenvectors are used to construct the principal curvature tensor feature containing intensity and direction information.

[0021] The multi-directional phase consistency feature extraction process involves constructing multiple filter kernels in different directions using a LogGabor filter. The `fft2` function from the NumPy library is used to perform a two-dimensional fast Fourier transform on the image, multiplying the image's frequency domain information with the LogGabor filter in the frequency domain. The `ifft2` function from the NumPy library is then used to perform an inverse two-dimensional fast Fourier transform to calculate the amplitude and phase response in each direction. Based on the amplitude, phase, and local energy of the filter response in each direction, a local phase consistency metric is calculated for the corresponding direction, rather than directly aggregating the phase responses. Then, the local phase consistency metrics for each direction are weighted, fused, and normalized to obtain the multi-directional phase consistency features. Finally, the `concatenate` function from the NumPy library is used to combine the normalized principal curvature tensor features with the normalized multi-directional phase consistency features along the channel dimension to obtain a fused feature vector.

[0022] The process of constructing a multi-scale spatial feature pyramid involves first inputting the fused feature vector into a convolutional mapping layer to obtain a basic feature map. Then, multiple scale feature maps with different spatial resolutions and channel numbers are generated through multi-layer convolutional modules and downsampling modules. Bilinear interpolation downsampling is used to change the spatial resolution of the feature maps, and the convolutional mapping layer is used to adjust the number of channels in each scale feature map. The process of calculating membership feature maps using a convolutional network with a channel attention mechanism involves constructing a residual network with a channel attention module. Spatial features are compressed using a global average pooling layer, and the weight distribution of each channel is calculated using a fully connected layer. After multiplying the weights by the input features, a 1×1 convolution is used to compress the number of channels to 1. Finally, a sigmoid activation function layer outputs probability values ​​mapped to the 0-1 interval, yielding the membership feature maps for each scale. The weighted fusion process of membership feature maps involves upsampling to restore the feature maps at each scale to their original resolution and then using a pixel-by-pixel weighted averaging algorithm to generate a principal membership map by adding them according to preset scale weights. Pixels with values ​​greater than a preset threshold in the principal membership map are selected. If the selection result is empty, it is determined that there are no microcracks in the area to be tested, and the recognition process ends. If the selection result is not empty, the average membership value of these pixels is calculated as the principal membership value, and subsequent operations are performed.

[0023] In one embodiment, the extraction of the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested includes: Calculate the second-order Hessian matrix of the image of the region to be tested at each pixel; Eigenvalue decomposition is performed on the second-order Hessian matrix to obtain the first principal eigenvalue, the second principal eigenvalue, and the corresponding principal direction eigenvectors and secondary direction eigenvectors, respectively, and the principal curvature tensor is constructed accordingly. A multi-directional Log-Gabor filter is used to perform convolution operations on the image of the region under test to obtain the amplitude response and phase response in each direction, and the local phase consistency measure in each direction is calculated. The local phase consistency measures in each direction are normalized and weighted and fused to generate multi-directional phase consistency features.

[0024] Before calculating the second-order Hessian matrix, the standard deviation is used as follows: A Gaussian smoothing filter with a value of 1.2 and a kernel size of 5×5 is used to denoise the grayscale image of the region under test. Second-order partial derivatives along the horizontal and vertical directions are calculated at each pixel to construct a 2×2 Hessian matrix, and the first principal eigenvalue is calculated through eigenvalue decomposition. With the second principal eigenvalue Among them, satisfying and the corresponding directional feature vector and For dumpling-shaped microcrack regions exhibiting tubular or linear dark textures, a typical characteristic is that the absolute value of one principal feature is significantly greater than the absolute value of another principal feature. For example, if a suspected crack pixel is calculated... =145.2 and =12.1, based on this, the tensor product formula Generate the corresponding principal curvature tensor to characterize the local gray-scale curvature changes and propagation direction of the crack.

[0025] Texture feature extraction is performed using a multi-directional Log-Gabor filter, with the center frequency of the filter being optimally set. =1 / 3 and the bandwidth control parameter is set to 0.55, and N=6 distribution directions are evenly selected, such as the direction angle. The input image is subjected to frequency domain convolution. After convolution, the amplitude and phase responses of each pixel in each direction are obtained through inverse Fourier transform, and the local phase consistency metric parameters in each direction are calculated based on the local energy model. The metric results in the above six directions are linearly superimposed through arithmetic equations with weighted coefficients, where the weight coefficients for each direction are non-negative and the sum of the weight coefficients is 1. Alternatively, the linear superposition result is normalized so that the fused feature values ​​are within the feature interval of 0 to 1. The output scalar value is the multi-directional phase consistency feature representing the pixel edge intensity and continuity. Concatenating and splicing the normalized multidimensional tensor with this consistency feature can enhance the distinguishability of extremely fine cracks against the background of a complex dumpling skin.

[0026] In one embodiment, the step of using a convolutional network to calculate membership feature maps at various scales includes: Input the multi-scale spatial feature pyramid into the convolutional network; In convolutional networks, global average pooling is used to obtain global statistics of channels at each scale, and fully connected layers and activation functions are used to calculate the attention weights of each channel. The attention weights are multiplied element-wise with the features of each channel, and the multi-channel features are fused into a single-channel response map through a 1×1 convolution. The output of the Sigmoid activation layer is then mapped to a probability matrix in the range of 0 to 1, which serves as the membership feature map of the pixel belonging to the suspected micro-crack class at the corresponding scale.

[0027] The input to the convolutional network incorporating channel attention is a multi-scale spatial feature pyramid, and the output is a membership feature map indicating the pixel's membership in a suspected micro-splitting class at each scale. The structure of the convolutional network includes a global average pooling layer, fully connected layers, activation layers, and convolutional layers. Assuming the multi-scale spatial feature pyramid input to the convolutional network contains three levels with resolutions of one-quarter, one-eighth, and one-sixteenth of the original image, the number of channels in each scale feature map is adjusted through a convolutional mapping layer or multiple convolutional modules, corresponding to channel numbers C of 64, 128, and 256, respectively. For any specific scale, such as a bottom-level feature map of size 128×128×64, a global average pooling layer is applied to compress the two-dimensional spatial features into a 1×1×64 one-dimensional channel representation. This one-dimensional channel representation is then input into a bottleneck mapping structure consisting of two fully connected layers. The first fully connected layer uses a scaling ratio r=16 for dimensionality reduction, compressing 64 neurons into 4, and introduces non-linear fitting capability through the ReLU activation function. The second fully connected layer further reconstructs the dimension to restore the original number of channels (64), and uses the Sigmoid function to output an attention weight feature vector distributed in the closed interval between 0 and 1. After obtaining this attention weight vector, the weight coefficients are multiplied element-wise along the channel dimension with the original input feature tensor of size 128×128×64, thereby giving higher activation response values ​​to channels containing micro-crack edge features and suppressing invalid dumpling skin background texture channels. The recalibrated feature map is fed into a dimensionality-reduced convolutional layer with a kernel size of 1×1 and an output channel of 1, fusing and mapping it into a single-channel two-dimensional spatial feature. Through the final Sigmoid activation function, all pixel-level feature values ​​are mapped to the probability distribution interval between 0 and 1, forming a floating-point matrix of size 128×128×1. If a pixel in the matrix has a value of 0.85, it means that the pixel belongs to the suspected micro-crack class target with a confidence level of 85%, thereby completing the prediction and generation of membership feature maps at various independent scales.

[0028] S2, extract pixels in the principal membership graph that are greater than a preset threshold to construct a binary connected domain and skeletonize it. Extract branch points and endpoints to form a set of topological nodes. For each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the circumscribed rectangle. Otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this.

[0029] The process of constructing binary connected components involves assigning a value of 1 to pixels in the principal membership graph that are greater than a preset threshold, and assigning the rest to 0 to generate a binary image. All eight-connected regions are then searched to obtain each independent connected subdomain. The skeletonization process involves calling the `skeletonize` function from the `skimage` point morphology library to refine the connected subdomains and extract a single-pixel wide central skeleton map. The extraction of branch points and endpoints involves traversing each foreground pixel in the central skeleton map and using a lookup table algorithm to count the number of foreground pixels in their eight neighborhoods. When the number of foreground pixels in a neighborhood is equal to 1 and the center is foreground, it is determined to be an endpoint. When the number of foreground pixels in a neighborhood is greater than 2 and the center is foreground, it is determined to be a branch point. The two-dimensional coordinates of the endpoints and branch points are aggregated into a topological node set.

[0030] The processing procedure for each connected subdomain involves determining the total number of topological nodes. If the total number is less than two, the local algebraic connectivity is set to zero. The `cv2.minAreaRect` function is then called to calculate the minimum bounding rectangle of the connected subdomain and extract the long side L and the short side W, based on the normalization formula. Calculate the local linear structure degree, where To prevent the preset minimum value of division by zero, and .

[0031] If there are two or more topological nodes, a skeleton pixel adjacency graph is constructed on the central skeleton graph. A fast traversal algorithm is used to calculate the shortest cumulative path length along the skeleton path between any two topological nodes as the spatial geodesic distance. The weight of horizontal or vertical adjacent edges is set to 1, and the weight of diagonal adjacent edges is set to... Extract the fusion feature vectors of corresponding nodes from the fusion feature map aligned with the spatial resolution of the principal membership graph, and calculate the feature Euclidean distance between the corresponding feature vectors. Normalize both distance matrices to the interval 0 to 1. Multiply the normalized distances by preset weight parameters and sum them to obtain the fusion distance matrix. Take the negative square of each element of the fusion distance matrix, divide it by twice the square of the Gaussian kernel parameter, and then calculate the exponential function value to complete the Gaussian kernel function transformation to obtain the connection weight matrix. Construct an undirected weighted graph based on the connection weight matrix to build a local topological graph.

[0032] In one embodiment, the spatial geodesic distance and characteristic Euclidean distance between the computing nodes are normalized, weighted, summed, and converted into connection weights using a Gaussian kernel function, including: The shortest path length between any two nodes in a connected subdomain is calculated using the fast traversal algorithm and used as the spatial geodesic distance. Extract the fused feature vector corresponding to the node, and calculate the Euclidean distance between any two node fused feature vectors as the feature Euclidean distance; The spatial geodesic distance and the characteristic Euclidean distance are normalized by a preset distance scaling factor and then weighted and summed. The sum is then converted into connection weights between nodes using a Gaussian kernel function.

[0033] For the set of topological nodes in the microcrack connected subdomain extracted through binary skeletonization, for any two topological nodes i and j within the subdomain, a fast traversal algorithm is used to perform wavefront evolution propagation along the skeleton morphology with a width of one pixel. The shortest cumulative pixel length along the bending path of the crack morphology is calculated, and this pixel length is used as the spatial geodesic distance. Compared with the calculated straight-line distance, this distance helps to characterize the complex actual extension state of the microcrack. For example, the straight-line Euclidean distance between two nodes in the image coordinate system is only 10 pixels, but the geodesic extension distance along the bending crack may reach 15.5 pixels. The fused feature vectors corresponding to nodes i and j are retrieved from the fused feature map, and the feature Euclidean distance between the two high-dimensional vectors is calculated using the L2 norm calculation formula. The calculation result is 2.42, which is used to represent the high-dimensional semantic similarity between the two points in terms of local curvature and phase features. To unify the dimensional scales of different features and eliminate numerical bias, an extreme value normalization method is adopted. This method combines the maximum and minimum values ​​of each distance within the current connected domain as distance scaling factors, mapping and scaling both spatial geodesic distances and feature Euclidean distances to a standard range of 0 to 1. This is achieved through preset structured hyperparameters. and The two normalized distances are linearly weighted and summed, and the spatial shape weights are optimally set. =0.6 and feature difference weight =0.4, and then the comprehensive metric distance is calculated. The bandwidth adjustment parameter is set to... Gaussian kernel function formula with a value of 0.5 This composite distance is mapped to node connection weights that decrease smoothly and monotonically. For example, when the composite metric distance between a pair of adjacent nodes is calculated to be 0.38, the connection weights output by the kernel function are approximately 0.749.

[0034] S3. Calculate the second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map as the local algebraic connectivity. Calculate the local linear structure degree based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. Extract the maximum values ​​of the local algebraic connectivity and local linear structure degree of each subdomain as the algebraic connectivity and linear structure degree, respectively. Combine the principal membership value, algebraic connectivity, and linear structure degree and input them into the classification decision model to output the microcrack identification result.

[0035] The process of calculating local algebraic connectivity is as follows: sum the elements of each row of the connection weight matrix of the local topological graph to generate a pairwise angle matrix. Subtract the connection weight matrix from the degree matrix to obtain the Laplacian matrix. Use the eigvalsh function of the linalg library to solve for all eigenvalues ​​of the Laplacian matrix and sort them in ascending order. Extract the second eigenvalue as the local algebraic connectivity.

[0036] The process of calculating local linear structure involves extracting the horizontal and vertical coordinates of all skeleton pixels within the connected subdomains to construct a coordinate matrix. The mean of each dimension is calculated and zero-mean normalized. The covariance matrix is ​​obtained by multiplying the transpose of the zero-mean coordinate matrix by the zero-mean coordinate matrix. The `eigh` function is used to calculate all eigenvalues ​​of the covariance matrix. The maximum eigenvalue is extracted and divided by the sum of all eigenvalues ​​to calculate the ratio as the local linear structure. The maximum value is obtained by comparing the local algebraic connectivity of all connected subdomains within the image and selecting the maximum value as the algebraic connectivity. Similarly, the local linear structure is compared, and the maximum value is selected as the linear structure. The process of combining the input to the classification decision model output involves concatenating the principal membership value, algebraic connectivity, and linear structure into a three-dimensional feature vector. A support vector machine algorithm is then used to construct the classification decision model. The SVC class from the sklearn library is instantiated by configuring the radial basis function kernel. The three-dimensional feature vector is passed to the trained SVC model and the predict method is called for inference calculation. The model's decision surface determines the category of the input features and outputs a classification label indicating whether the input features are normal or have micro-fractures to complete the recognition.

[0037] In one embodiment, the classification decision model is a support vector machine model or a random forest model; The training process of the classification decision model is as follows: a large number of historical images of dumplings with known microcrack states are obtained to construct a training set. The principal membership value, algebraic connectivity and linear structure of each image in the training set are extracted to form the feature vector of the training sample. The corresponding microcrack state is used as the real label for supervised training. When the classification decision model is a support vector machine model, the model is trained by optimizing the objective function of the support vector machine, and training stops when the objective function satisfies the preset convergence condition. When the classification decision model is a random forest model, multiple decision trees are generated according to at least one of the preset training termination conditions: number of decision trees, maximum tree depth, and minimum number of leaf node samples. The training of the random forest model is completed based on the out-of-bag error or the performance of the validation set.

[0038] During the initialization phase of training the classification decision model, a structured training set containing sufficient and balanced sample data needs to be manually collected and established beforehand. This set could include 5000 images of dumpling surfaces taken with an industrial camera, with 2500 positive class images showing microcracks and 2500 negative class images showing no microcracks. For each image in the training set, a pre-processed image extraction and topological graph calculation algorithm is executed, parsing and outputting the scalar values ​​of the image's principal membership, maximum local algebraic connectivity, and maximum local linear structure.

[0039] The three core parameters mentioned above will be concatenated in a fixed index order to form a training sample feature vector X with a shape size of 3×1. For example, the feature vector of a typical microcrack sample extracted is as follows: The image corresponding to the quality inspection expert's manual judgment conclusion is usually set as the true label of microcrack state as 1 and the label of normal state without microcrack as 0 or -1 as the target true label and enters into the supervised training queue.

[0040] During the model fitting and optimization phase, if a support vector machine is chosen as the classification decision machine, the radial basis function kernel will be preferentially used to handle the nonlinear multidimensional decision boundary in the aforementioned three-dimensional low-dimensional feature space. The optimal hyperparameter combination will be determined using a grid parameter search method combined with a ten-fold cross-validation mechanism. The preferred search range for the penalty relaxation coefficient C is set to 0.1 to 10, with a value of 1.2 used for convergence. The kernel bandwidth parameter... The preferred value is set to 0.05. During the training iteration process, the sequential minimum optimization algorithm is used to continuously solve for and update the Lagrange multiplier parameters of the support vectors. When the duality gap or the change in the global objective function between two consecutive iterations is stably less than a preset convergence tolerance limit, such as 10, the optimization process continues. -4 When the optimization objective of the support vector machine model satisfies the convergence condition, training is stopped.

[0041] If a random forest model is used instead, the parameters are configured such that the ensemble decision trees within the model are 150 trees, the maximum depth of a single tree is limited to 10 layers, and Gini impurity is used as the node feature splitting criterion for parallel training. The generation of each individual decision tree is completed when the number of decision trees reaches the preset size, the maximum depth limit of a single tree is reached, the number of leaf node samples meets the preset stopping condition, or the node can no longer split effectively. The stability of the random forest model is evaluated using the out-of-bag error rate or validation set performance. Figure 2 As shown in the figure, the out-of-bag error rate of the random forest model is a convergence curve as the number of decision trees changes. It can be seen that as the number of decision trees increases, the out-of-bag error rate decreases rapidly and gradually stabilizes. When the number of decision trees reaches 150, the error rate has dropped below the preset threshold, thus confirming that the random forest model training is complete.

[0042] This experiment used 5000 images of dumpling surfaces taken by an industrial camera as the standard dataset, including 2500 positive samples of microcracks and 2500 negative samples of normal surfaces. These were randomly divided into a training set of 4000 images and a test set of 1000 images. The hardware environment used uniform high-performance computing nodes. The classification and decision-making stages employed a random forest model containing 150 decision trees with a maximum growth depth of 10 layers. Four comparison groups were set up: Model A removed the principal curvature tensor and multi-directional phase consistency feature extraction modules and replaced them with conventional grayscale features; Model B removed the channel attention mechanism structure from the convolutional network; Model C removed spatial geodesic distance and retained only the Euclidean distance feature when calculating node connection weights; and Model D was the complete model containing all the core technical features of this invention.

[0043] After training the models with the same parameters, the test results showed that Model A achieved a comprehensive classification accuracy of 82.4% on the test set, a recall rate of 79.1% for microcrack targets, and a false positive rate of 16.5%. Model B achieved a test set accuracy of 86.7%, a recall rate of 84.5%, and a false positive rate of 12.3%. Model C achieved a test set accuracy of 89.2%, a recall rate of 88.0%, and a false positive rate of 10.1%. The complete model D proposed in this invention achieved an accuracy of 97.5% on the same test set, with the microcrack recall rate jumping to 96.8%, while the false positive rate decreased to 1.9%. The performance metrics of each comparative model in the experiment are shown in the bar chart below. Figure 3 As shown, the complete model improves accuracy by 15.1 percentage points compared to model A, demonstrating that the principal curvature tensor and multi-directional phase features enhance the discriminative power of extremely fine cracks against a complex dumpling skin background. The performance improvement compared to model B indicates that the channel attention mechanism improves the prediction accuracy of pixel-level membership feature maps by suppressing ineffective background texture channels and assigning higher activation responses to microcrack edge features. The improvement compared to model C further validates that the input spatial geodesic distance helps characterize the complex spatial bending and extension states of microcracks, improving the overall system's decision-making performance.

[0044] This disclosure also provides a dumpling micro-crack recognition system, including the following modules: The calculation module is used to acquire the image of the region to be tested, extract the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested, and concatenate them into a fusion feature vector. Based on the fusion feature vector, a multi-scale spatial feature pyramid is constructed. A convolutional network is used to calculate the membership feature map at each scale and construct the principal membership map. The set of pixels in the principal membership map that is greater than a preset threshold is selected. If the set of pixels is empty, it is determined that there are no microcracks in the region to be tested, and the recognition process ends. If the set of pixels is not empty, the average membership of the pixels in the set is calculated as the principal membership value, and subsequent steps are executed. The extraction module is used to extract pixels in the principal membership graph that are greater than a preset threshold, construct a binary connected domain and skeletonize it, extract branch points and endpoints to form a set of topological nodes, and for each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the circumscribed rectangle; otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this. The output module is used to calculate the second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map as the local algebraic connectivity. It calculates the local linear structure degree based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. It extracts the maximum values ​​of the local algebraic connectivity and local linear structure degree of each subdomain as the algebraic connectivity and linear structure degree, and inputs the principal membership value, algebraic connectivity, and linear structure degree into the classification decision model to output the microcrack recognition result.

[0045] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0046] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for identifying dumpling micro-cracks, characterized in that, Includes the following steps: The image of the region to be tested is acquired, the principal curvature tensor and multi-directional phase consistency features of each pixel in the image are extracted and concatenated into a fusion feature vector, a multi-scale spatial feature pyramid is constructed based on the fusion feature vector, a convolutional network is used to calculate the membership feature map at each scale, and a principal membership map is constructed. The set of pixels in the principal membership map that are greater than a preset threshold is selected. If the set of pixels is empty, it is determined that there are no microcracks in the area to be tested, and the identification process ends. If the pixel set is not empty, calculate the average membership degree of the pixels in the pixel set as the principal membership degree value, and then perform the subsequent steps. Extract pixels with a value greater than a preset threshold from the principal membership graph to construct a binary connected domain and skeletonize it. Extract branch points and endpoints to form a set of topological nodes. For each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the bounding rectangle. Otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this. The second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map is calculated as the local algebraic connectivity. The local linear structure is calculated based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. The maximum values ​​of the local algebraic connectivity and local linear structure of each subdomain are extracted as the algebraic connectivity and linear structure, respectively. The principal membership value, algebraic connectivity, and linear structure are combined and input into the classification decision model to output the microcrack identification result.

2. The method of claim 1, wherein, The extraction of the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested includes: Calculate the second-order Hessian matrix of the image of the region to be tested at each pixel; Eigenvalue decomposition is performed on the second-order Hessian matrix to obtain the first principal eigenvalue, the second principal eigenvalue, and the corresponding principal direction eigenvectors and secondary direction eigenvectors, respectively, and the principal curvature tensor is constructed accordingly. A multi-directional Log-Gabor filter is used to perform convolution operations on the image of the region under test to obtain the amplitude response and phase response in each direction, and the local phase consistency measure in each direction is calculated. The local phase consistency measures in each direction are normalized and weighted and fused to generate multi-directional phase consistency features.

3. The method of claim 2, wherein, The calculation of membership feature maps at various scales using convolutional networks includes: Input the multi-scale spatial feature pyramid into the convolutional network; In convolutional networks, global average pooling is used to obtain global statistics of channels at each scale, and fully connected layers and activation functions are used to calculate the attention weights of each channel. The attention weights are multiplied element-wise with the features of each channel, and the multi-channel features are fused into a single-channel response map through a 1×1 convolution. The output of the Sigmoid activation layer is then mapped to a probability matrix in the range of 0 to 1, which serves as the membership feature map of the pixel belonging to the suspected micro-crack class at the corresponding scale.

4. The method according to claim 1, characterized in that, The spatial geodesic distance and characteristic Euclidean distance between the computation nodes are normalized, weighted, summed, and transformed into connection weights using a Gaussian kernel function, including: The shortest path length between any two nodes in a connected subdomain is calculated using the fast traversal algorithm and used as the spatial geodesic distance. Extract the fused feature vector corresponding to the node, and calculate the Euclidean distance between any two node fused feature vectors as the feature Euclidean distance; The spatial geodesic distance and the characteristic Euclidean distance are normalized by a preset distance scaling factor and then weighted and summed. The sum is then converted into connection weights between nodes using a Gaussian kernel function.

5. The method according to claim 1, characterized in that, The classification decision model is a support vector machine model or a random forest model; The training process of the classification decision model is as follows: a large number of historical images of dumplings with known microcrack states are obtained to construct a training set. The principal membership value, algebraic connectivity and linear structure of each image in the training set are extracted to form the feature vector of the training sample. The corresponding microcrack state is used as the real label for supervised training. When the classification decision model is a support vector machine model, the model is trained by optimizing the objective function of the support vector machine, and training stops when the objective function satisfies the preset convergence condition. When the classification decision model is a random forest model, multiple decision trees are generated according to at least one of the preset training termination conditions: number of decision trees, maximum tree depth, and minimum number of leaf node samples. The training of the random forest model is completed based on the out-of-bag error or the performance of the validation set.

6. A dumpling micro-crack recognition system, characterized in that, Includes the following modules: The calculation module is used to acquire the image of the region to be tested, extract the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested and concatenate them into a fusion feature vector, construct a multi-scale spatial feature pyramid based on the fusion feature vector, use a convolutional network to calculate the membership feature map at each scale, construct the principal membership map, and filter the set of pixels in the principal membership map that are greater than a preset threshold. If the set of pixels is empty, it is determined that there are no microcracks in the area to be tested, and the identification process ends. If the pixel set is not empty, calculate the average membership degree of the pixels in the pixel set as the principal membership degree value, and then perform the subsequent steps. The extraction module is used to extract pixels in the principal membership graph that are greater than a preset threshold, construct a binary connected domain and skeletonize it, extract branch points and endpoints to form a set of topological nodes, and for each connected subdomain, if there are fewer than two topological nodes, set the local algebraic connectivity to a constant and calculate the local linear structure degree based on the length and width of the circumscribed rectangle; otherwise, calculate the spatial geodesic distance and feature Euclidean distance between nodes and construct a local topological graph based on this. The output module is used to calculate the second smallest eigenvalue of the Laplacian matrix corresponding to the local topological map as the local algebraic connectivity. It calculates the local linear structure degree based on the ratio of the largest eigenvalue of the skeleton pixel coordinate covariance matrix to the sum of all eigenvalues ​​within the connected subdomain. It extracts the maximum values ​​of the local algebraic connectivity and local linear structure degree of each subdomain as the algebraic connectivity and linear structure degree, and inputs the principal membership value, algebraic connectivity, and linear structure degree into the classification decision model to output the microcrack recognition result.

7. The system according to claim 6, characterized in that, The extraction of the principal curvature tensor and multi-directional phase consistency features of each pixel in the image of the region to be tested includes: Calculate the second-order Hessian matrix of the image of the region to be tested at each pixel; Eigenvalue decomposition is performed on the second-order Hessian matrix to obtain the first principal eigenvalue, the second principal eigenvalue, and the corresponding principal direction eigenvectors and secondary direction eigenvectors, respectively, and the principal curvature tensor is constructed accordingly. A multi-directional Log-Gabor filter is used to perform convolution operations on the image of the region under test to obtain the amplitude response and phase response in each direction, and the local phase consistency measure in each direction is calculated. The local phase consistency measures in each direction are normalized and weighted and fused to generate multi-directional phase consistency features.

8. The system according to claim 6, characterized in that, The calculation of membership feature maps at various scales using convolutional networks includes: Input the multi-scale spatial feature pyramid into the convolutional network; In convolutional networks, global average pooling is used to obtain global statistics of channels at each scale, and fully connected layers and activation functions are used to calculate the attention weights of each channel. The attention weights are multiplied element-wise with the features of each channel, and the multi-channel features are fused into a single-channel response map through a 1×1 convolution. The output of the Sigmoid activation layer is then mapped to a probability matrix in the range of 0 to 1, which serves as the membership feature map of the pixel belonging to the suspected micro-crack class at the corresponding scale.

9. The system according to claim 6, characterized in that, The spatial geodesic distance and characteristic Euclidean distance between the computation nodes are normalized, weighted, summed, and transformed into connection weights using a Gaussian kernel function, including: The shortest path length between any two nodes in a connected subdomain is calculated using the fast traversal algorithm and used as the spatial geodesic distance. Extract the fused feature vector corresponding to the node, and calculate the Euclidean distance between any two node fused feature vectors as the feature Euclidean distance; The spatial geodesic distance and the characteristic Euclidean distance are normalized by a preset distance scaling factor and then weighted and summed. The sum is then converted into connection weights between nodes using a Gaussian kernel function.

10. The system according to claim 6, characterized in that, The classification decision model is a support vector machine model or a random forest model; The training process of the classification decision model is as follows: a large number of historical images of dumplings with known microcrack states are obtained to construct a training set. The principal membership value, algebraic connectivity and linear structure of each image in the training set are extracted to form the feature vector of the training sample. The corresponding microcrack state is used as the real label for supervised training. When the classification decision model is a support vector machine model, the model is trained by optimizing the objective function of the support vector machine, and training stops when the objective function satisfies the preset convergence condition. When the classification decision model is a random forest model, multiple decision trees are generated according to at least one of the preset training termination conditions: number of decision trees, maximum tree depth, and minimum number of leaf node samples. The training of the random forest model is completed based on the out-of-bag error or the performance of the validation set.