Method and system for detecting surface defects of a material based on machine vision
By using a dual-view detection model and a dual-branch collaborative learning framework, the problems of single feature extraction and insufficient data utilization in existing technologies are solved, achieving high accuracy and wide applicability in material surface defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MINGSCHIN IND MATERIAL
- Filing Date
- 2026-04-30
- Publication Date
- 2026-06-05
AI Technical Summary
In the detection of surface defects in materials, existing technologies rely on a single deep neural network for feature extraction, which fails to fully explore feature information at different dimensions and levels, ignores the global structural information of the dataset, and limits the generalization ability of the model.
A dual-view detection model is adopted, which captures the deep semantic associations and surface statistical information of images in parallel through multi-dimensional feature extraction layers. Adjacency matrices of auxiliary view and learner view are constructed, and redundant mixed-order feature aggregation is performed. Multi-scale features are fused through a bidirectional feature transfer mechanism and a dual-branch collaborative learning framework, utilizing labeled and unlabeled data.
It significantly improves the accuracy and generalization ability of material surface defect detection, and realizes efficient and robust automated defect detection.
Smart Images

Figure CN122156189A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual recognition technology, and more particularly to a method and system for detecting surface defects in materials based on machine vision. Background Technology
[0002] Accurate and efficient detection of material surface defects is a crucial aspect of quality control in modern industrial production, directly impacting product performance, reliability, and safety. With the rapid development of computer vision and artificial intelligence technologies, automated defect detection technology based on machine vision has emerged. This technology utilizes image acquisition equipment to obtain material surface information and analyzes it using intelligent algorithms, achieving objectivity, high speed, and standardization in the detection process. It has become the mainstream trend replacing traditional detection methods. In recent years, to address the core challenges of scarce defect samples and high annotation costs in industrial settings, detection methods based on transfer learning have received widespread attention and application. The published patent document CN 115471727 B proposes a defect detection method for composite materials. This method uses non-destructive testing techniques such as eddy current C-scanning to acquire images and employs the advanced Faster R-CNN target detection framework. By introducing a similar source domain matching strategy, it selects samples highly similar to the target defect from public datasets in other fields as pre-training data. Combined with transfer learning techniques, it effectively alleviates the problem of insufficient target domain samples.
[0003] Despite the significant progress made by the aforementioned existing technologies, their technical paradigms still have some inherent limitations. At the feature extraction level, this method mainly relies on a single deep neural network as the backbone, and its feature learning path is relatively simple, failing to fully explore and integrate feature information from different dimensions and levels. Although this method alleviates the problem of insufficient data through transfer learning, its model training still relies entirely on labeled supervised data, failing to utilize the large amount of easily accessible but unlabeled data information in industrial sites, thus limiting the model's ability to learn and generalize further. More importantly, this method treats each image as an independent sample for learning, ignoring the potential and complex relationships between samples in the entire dataset, and failing to utilize the global structural information of the dataset to enhance the model's ability to discriminate local samples. Summary of the Invention
[0004] The technical problem solved by this invention is that existing technologies mainly rely on a single deep neural network as the backbone at the feature extraction level. Their feature learning path is relatively simple and fails to fully explore and integrate feature information of different dimensions and levels. Although existing technologies alleviate the problem of insufficient data through transfer learning, their model training still relies entirely on labeled supervised data. They fail to utilize the large amount of easily obtainable but unlabeled data information in industrial sites, which limits the model's ability to learn and generalize further. More importantly, this method treats each image as an independent sample for learning, ignoring the potential and complex relationships between samples in the entire dataset. It fails to utilize the global structural information of the dataset to enhance the model's ability to distinguish local samples.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a material surface defect detection method based on machine vision, comprising the following steps:
[0006] Step S1: Input the standard material surface image into the pre-constructed dual-view detection model, and extract the latent feature matrix and surface feature matrix through the multi-dimensional feature extraction layer in the dual-view detection model;
[0007] Step S2: Based on the latent feature matrix, construct the similarity adjacency matrix of the auxiliary perspective, and construct the topological adjacency matrix of the learner perspective based on the basic feature distance;
[0008] Step S3: In the dual-view network layer of the dual-view detection model, perform redundancy removal and hybrid-order feature aggregation on the latent feature matrix and the similarity adjacency matrix to obtain the auxiliary feature matrix. Perform standard graph convolution on the surface feature matrix and the topological adjacency matrix to obtain the learner feature matrix. Obtain the enhanced feature matrix after fusing the auxiliary features and learner features through a bidirectional feature transfer mechanism.
[0009] Step S4: Based on the enhanced feature matrix, the detection results of material surface defects are output through a dual-branch collaborative learning framework.
[0010] Preferably, acquiring the surface image of the standard material includes:
[0011] Acquire material surface images, perform multi-dimensional preprocessing on the material surface images to obtain standard material surface images;
[0012] The multi-dimensional preprocessing includes logarithmic transformation enhancement, median filtering for noise reduction, histogram equalization, and size normalization.
[0013] Preferably, step S1 includes:
[0014] The dual-view detection model includes a multi-dimensional feature extraction layer and a dual-view network layer;
[0015] The multi-dimensional feature extraction layer includes a latent feature extraction branch and a backbone network surface feature extraction branch;
[0016] The dual-view network includes an auxiliary view network and a learning view network;
[0017] The standard material surface image is input into the latent feature extraction branch and the backbone network surface feature extraction branch, and the latent feature vector is obtained through the processing of the latent feature extraction branch;
[0018] The surface feature vector is obtained by processing the surface feature extraction branch of the backbone network, and the latent feature vector and the surface feature vector are normalized.
[0019] The normalized latent eigenvectors of all standard material surface images constitute the latent feature matrix;
[0020] The normalized surface feature vectors of all standard material surface images constitute the surface feature matrix.
[0021] Preferably, step S2 includes:
[0022] Constructing a similarity adjacency matrix specifically includes:
[0023] Calculate the comprehensive similarity between the latent feature vectors of any two standard material surface images, where the comprehensive similarity is a weighted sum of the similarity calculated by cosine similarity and Gaussian hot kernel function;
[0024] Based on the comprehensive similarity, the K nearest neighbor algorithm is used to select the K nodes with the highest similarity for each node to construct the similarity adjacency matrix of the auxiliary perspective;
[0025] Constructing the topological adjacency matrix specifically includes:
[0026] Obtain the basic feature vector of the standard material surface image, calculate the Euclidean distance between the basic feature vectors of any two standard material surface images, treat each standard material surface image as a node, and use the K-nearest neighbor algorithm to find the N nearest neighbor nodes to the standard material surface image;
[0027] Construct a topological adjacency matrix, setting the intersection position of a node and its neighboring nodes to 1, and the rest to 0.
[0028] Preferably, step S2 further includes:
[0029] The similarity adjacency matrix is calculated to its powers from 1st to Mth to obtain the neighborhood relations of each order, and the neighborhood relations of each order are deredundant.
[0030] The calculation formula for redundancy removal is:
[0031] ;
[0032] in, Let be a k-order adjacency matrix. This is the k-order adjacency matrix after redundancy removal. To sum over all adjacency matrices of order less than k;
[0033] The adjacency matrices of each order after redundancy removal are subjected to graph convolution with the latent feature vectors, and the results are weighted and fused to obtain auxiliary features.
[0034] Preferably, step S2 further includes:
[0035] Performing standard graph convolution on the surface feature matrix and topological adjacency matrix includes:
[0036] Add the topological adjacency matrix to the identity matrix to obtain a new adjacency matrix. Based on the new adjacency matrix, obtain the corresponding degree matrix.
[0037] A new surface feature matrix is obtained by projecting the weight matrix onto the surface feature matrix.
[0038] The new surface feature matrix is symmetrically normalized using the degree matrix and the new adjacency matrix. The mathematical expression for symmetric normalization is:
[0039] ;
[0040] in, For the new adjacency matrix, For degree matrix, For the new surface feature matrix;
[0041] The learner feature matrix is obtained by processing the symmetrically normalized matrix through a nonlinear activation function.
[0042] Preferably, step S2 further includes:
[0043] The bidirectional feature transfer mechanism is as follows:
[0044] The auxiliary feature matrix is transformed by the first transformation matrix, and the transformed auxiliary feature matrix is added to the original learner feature matrix to obtain the enhanced learner feature matrix.
[0045] The learner feature matrix is transformed using the second transformation matrix. The transformed learner feature matrix is then added to the original auxiliary feature matrix to obtain the enhanced auxiliary feature matrix.
[0046] Preferably, step S3 includes:
[0047] A dual-branch collaborative learning framework is constructed, which includes a supervisory branch and an auxiliary collaborative branch;
[0048] The input to the supervised branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image. The enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image are used to obtain the first classification prediction probability through the first classification head, and the supervised loss is calculated.
[0049] The method for calculating the supervision loss is the cross-entropy loss function;
[0050] The input to the auxiliary co-branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to all standard material surface images. The enhanced learner feature matrix is passed through the second classification head to obtain the second classification prediction probability from the learner's perspective. The enhanced auxiliary feature matrix is passed through the third classification head to obtain the third classification prediction probability from the auxiliary perspective. KL divergence is used to calculate the consistency loss between the classification prediction probability distribution from the learner's perspective and the classification prediction probability from the auxiliary perspective.
[0051] Construct a total loss function, which is a weighted sum of the supervision loss and the consistency loss.
[0052] Preferably, step S4 includes:
[0053] The dual-view detection model is trained by inputting a real-time standard material surface image after multi-dimensional preprocessing to obtain the detection results.
[0054] A machine vision-based material surface defect detection system includes a feature extraction module, a feature fusion module, a dual-view learning module, and a detection module.
[0055] The feature extraction module is used to input the standard material surface image into the pre-constructed dual-view detection model, and extract the latent feature matrix and the surface feature matrix through the multi-dimensional feature extraction layer in the dual-view detection model.
[0056] The feature fusion module is used to construct a similarity adjacency matrix from an auxiliary perspective based on the latent feature matrix, and to construct a topological adjacency matrix from the learner's perspective based on the basic feature distance.
[0057] The dual-view learning module is used in the dual-view network layer of the dual-view detection model to perform redundancy removal and hybrid-order feature aggregation on the latent feature matrix and similarity adjacency matrix to obtain the auxiliary feature matrix, to perform standard graph convolution on the surface feature matrix and topological adjacency matrix to obtain the learner feature matrix, and to obtain the enhanced feature matrix after fusing the auxiliary features and learner features through a bidirectional feature transfer mechanism.
[0058] The detection module is used to process the enhanced feature matrix through a dual-branch collaborative learning framework and output the detection results of material surface defects.
[0059] The beneficial effects of this invention are as follows: By constructing a dual-view collaborative learning architecture, this invention significantly improves the accuracy and generalization ability of material surface defect detection. Its core advantage lies in capturing the deep semantic associations and surface statistical information of images in parallel through multi-dimensional feature extraction layers, forming complementary latent feature matrices and surface feature matrices, laying a rich feature foundation for accurate discrimination. Based on comprehensive similarity and basic feature distance, adjacency matrices for the auxiliary view and learner view are constructed respectively, quantifying the complex associations between samples from different levels and fully mining the global structural information of the dataset. This invention introduces a redundancy-removing hybrid-order feature aggregation mechanism, which removes low-order information redundancy in high-order neighborhood relationships, integrates orthogonal and complementary multi-scale features, and combines a bidirectional feature transfer mechanism to achieve deep complementarity and enhancement of information from the two viewpoints, generating a more discriminative enhanced feature matrix. Through the dual-branch collaborative learning framework, while using labeled data for supervised learning, the value of unlabeled data is fully explored with the help of KL divergence consistency loss, forcing the dual-view prediction results to tend to be consistent, thereby greatly improving the model's generalization ability in industrial scenarios with scarce labels, and finally forming an efficient, robust, and high-precision automated defect detection solution. Attached Figure Description
[0060] Figure 1 This is a schematic diagram of the basic process of a machine vision-based material surface defect detection method provided in one embodiment of the present invention.
[0061] Figure 2 This is a schematic diagram of the framework of the dual-view detection model. Detailed Implementation
[0062] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0063] Reference Figure 1 As an embodiment of the present invention, a method for detecting material surface defects based on machine vision is provided, comprising the following steps:
[0064] Step S1: Input the standard material surface image into the pre-built dual-view detection model, and extract the latent feature matrix and surface feature matrix through the multi-dimensional feature extraction layer in the dual-view detection model;
[0065] Step S2: Based on the latent feature matrix, construct the similarity adjacency matrix from the auxiliary perspective, and construct the topological adjacency matrix from the learner's perspective based on the basic feature distance;
[0066] Step S3: In the dual-view network layer of the dual-view detection model, perform redundancy removal and hybrid-order feature aggregation on the latent feature matrix and similarity adjacency matrix to obtain the auxiliary feature matrix. Perform standard graph convolution on the surface feature matrix and topological adjacency matrix to obtain the learner feature matrix. Obtain the enhanced feature matrix after fusing the auxiliary features and learner features through a bidirectional feature transfer mechanism.
[0067] Step S4: Based on the enhanced feature matrix, the detection results of material surface defects are output through a dual-branch collaborative learning framework.
[0068] This invention constructs a dual-view detection model, which realizes in-depth mining and fusion of material surface image features from two dimensions: latent semantics and surface statistics. By combining redundancy removal and mixed-order feature aggregation, bidirectional feature transfer mechanism and dual-branch collaborative learning framework, it effectively overcomes the limitations of a single feature learning path, makes full use of the global structural information of the dataset and the value of unlabeled data, and significantly improves the model's defect detection accuracy and generalization ability in complex industrial scenarios.
[0069] Obtaining images of standard material surfaces includes:
[0070] Acquire material surface images, perform multi-dimensional preprocessing on the material surface images to obtain standard material surface images;
[0071] Multidimensional preprocessing includes logarithmic transformation enhancement, median filtering for noise reduction, histogram equalization, and size normalization.
[0072] In one specific embodiment of the present invention, the material surface image includes a labeled image and an unlabeled image, wherein the labeled image contains an image with a defect category and a defect area marked;
[0073] The labeled images are from the publicly available metal surface defect dataset NEU-DET, and need to cover 6 typical surface defects: internal scale, plaque, crack, pitting, inclusions and scratches. NEU-DET provides an XML format annotation file for each image, which includes the category name of all defects in the image and the bounding box coordinates of each defect.
[0074] Logarithmic transformation enhancement involves iterating through each pixel of the image, calculating the enhanced pixel value, expanding the defect details in low-brightness areas, and outputting the enhanced image.
[0075] The formula for calculating enhanced pixel values is:
[0076] ;
[0077] in, coordinates The pixel value after pixel enhancement The original pixel value range is usually 0~255;
[0078] Median filtering denoising involves performing a 3×3 neighborhood median filter on the enhanced image. For each pixel, the median value of the 9 pixels in its 3×3 neighborhood is taken as the new pixel value. Edge pixels are filled with mirror images to complete the neighborhood and remove salt and pepper noise.
[0079] Histogram equalization involves calculating the image's gray-level histogram, designing a gray-level transformation function using the cumulative distribution function, updating all pixel values, and optimizing the brightness distribution.
[0080] The mathematical expression for the cumulative distribution function is:
[0081] ;
[0082] in, Let M be the value of the cumulative distribution function, M be the width of the image, and N be the height of the image. For the current grayscale level, 4. Total pixels of the image, 3A h(i) is the number of pixels with gray level i;
[0083] The mathematical expression for the grayscale transformation function is:
[0084] ;
[0085] in, This is a rounding function because pixel values must be integers. This is the new gray level mapped to after equalization of the original gray level;
[0086] Size normalization involves scaling the preprocessed image to 608×608 pixels, using bilinear interpolation to maintain the image aspect ratio, avoid stretching distortion, and output a standardized image.
[0087] This invention effectively improves image quality, enhances the discernibility of defect details, suppresses noise interference, and unifies data format by implementing multi-dimensional preprocessing such as logarithmic transformation enhancement, median filtering denoising, histogram equalization, and size normalization. This provides standardized, high-quality input data for subsequent high-precision feature extraction and model training.
[0088] Step S1 includes:
[0089] The dual-view detection model includes a multi-dimensional feature extraction layer and a dual-view network layer;
[0090] The multi-dimensional feature extraction layer includes a latent feature extraction branch and a backbone network surface feature extraction branch;
[0091] Dual-view networks include auxiliary view networks and learning view networks;
[0092] The standard material surface image is input into the latent feature extraction branch and the backbone network surface feature extraction branch, and the latent feature vector is obtained through the processing of the latent feature extraction branch;
[0093] The surface feature vector is obtained by processing the surface feature extraction branch of the backbone network, and the latent feature vector and the surface feature vector are normalized.
[0094] The normalized latent eigenvectors of all standard material surface images constitute the latent feature matrix;
[0095] The normalized surface feature vectors of all standard material surface images constitute the surface feature matrix.
[0096] In a specific embodiment of the present invention, a standard material surface image of 608×608×3 is input to the latent feature extraction branch. After three layers of convolution (3×3 convolution kernel, 48, 24, 24 channels) and two layers of max pooling (2×2, stride of 2), a bottleneck layer feature of 160×160×24 is obtained. The feature map of each channel is aggregated into a scalar through a global average pooling layer to obtain a 24-dimensional vector, which is used to aggregate spatial information to generate a compact feature vector. At the same time, the number of parameters is greatly reduced, reducing the risk of overfitting. After two fully connected layers (24, 1024, 512), a 512-dimensional latent feature vector is output.
[0097] The surface feature extraction branch of the backbone network uses ResNet50 as the backbone network. The input is a standard material surface image of 608×608×3. After processing by Conv1 (7×7 convolution with stride of 2), MaxPool, and Conv2-Conv5 (a total of 6 bottleneck blocks), the output is a 7×7×2048 surface feature map. The 2048 channels are aggregated into a 2048-dimensional vector through a global average pooling layer. This aims to extract the high-level semantic information learned by ResNet50 and compress it into a vector. Then, a fully connected layer is used for dimensionality reduction, and finally a 512-dimensional surface feature vector is output.
[0098] The latent feature vectors and surface feature vectors are normalized using L2 normalization, which aims to eliminate scale differences between different feature vectors. The normalized latent feature vectors of each image are stacked together to form the latent feature matrix. The same method can be used to obtain the surface feature matrix.
[0099] This invention designs a multi-dimensional feature extraction layer that includes a latent feature extraction branch and a backbone network surface feature extraction branch. This layer can capture the deep semantic associations and surface detail features of an image in parallel, forming a complementary feature matrix. This lays a rich and multi-layered feature foundation for the subsequent construction of a dual-view graph structure and the realization of accurate defect discrimination.
[0100] Step S2 includes:
[0101] Constructing a similarity adjacency matrix specifically includes:
[0102] Calculate the comprehensive similarity between the latent feature vectors of any two standard material surface images. The comprehensive similarity is a weighted sum of the similarity calculated by the cosine similarity and the similarity calculated by the Gaussian hot kernel function.
[0103] The comprehensive similarity calculation yields a similarity score between 0 and 1. This score represents the comprehensive correlation between two images in terms of defect type and local structure in feature space. Its purpose is to construct a more robust and comprehensive similarity judgment standard than a single similarity measure, providing a basis for the subsequent construction of high-quality graph structures.
[0104] Based on comprehensive similarity, the K-nearest neighbor algorithm is used to select the K nodes with the highest similarity for each node to construct a similarity adjacency matrix for the auxiliary viewpoint. This matrix is a sparse matrix composed of 0 and 1, which defines which image nodes are considered as neighbors in the latent feature space. Its role is to provide a topological structure based on high-level semantic similarity for the graph neural network of the auxiliary viewpoint, which is used to aggregate information of similar samples.
[0105] Constructing the topological adjacency matrix specifically includes:
[0106] Obtain the basic feature vector of the standard material surface image, calculate the Euclidean distance between the basic feature vectors of any two standard material surface images, treat each standard material surface image as a node, and use the K-nearest neighbor algorithm to find the N nearest neighbor nodes to the standard material surface image;
[0107] Construct a topological adjacency matrix, setting the intersection position of a node and its neighboring nodes to 1, and the rest to 0.
[0108] Based on the Euclidean distance and KNN algorithm of the basic feature vectors, a learner-view topological adjacency matrix is obtained. This matrix is also a sparse matrix, which defines which image nodes are neighbors in the basic feature space. Its role is to provide a topological structure based on low-level statistical features for the learner-view graph neural network, which contrasts with and complements the auxiliary perspective.
[0109] In a specific embodiment of the present invention, the comprehensive similarity between all potential feature vectors of all images in the current batch is calculated. This similarity consists of two parts: one part is the cosine similarity, which measures the closeness of feature vectors in direction and represents the similarity of defect types; the other part is the Gaussian hot kernel function. The comprehensive similarity is the mean of the two similarities.
[0110] For each image, select the three images with the highest overall similarity and construct a similarity adjacency matrix. Choosing 3 is to ensure the connectivity of the graph structure while avoiding the introduction of too many weakly correlated noise connections. It is a balance between sparsity and information content. The values of the elements in the matrix are determined according to the overall similarity. Only the elements corresponding to the three images with the highest overall similarity to the current image are 1, and the rest are 0.
[0111] The values of the elements in the similarity adjacency matrix can only be 1 or 0. 1 indicates that there is a connection and the two corresponding images are determined to be neighbors, while 0 indicates that there is no connection and the two images are unrelated.
[0112] A similarity adjacency matrix is generated in real time for each batch of input data. The network constructs a relationship graph based on feature similarity. The neighbor information is gathered by concatenating the features of the first-order and second-order neighbors through a hybrid-order feature aggregation layer. Then, the feature is transformed through two fully connected layers (512, 1024, 512) and finally outputs a feature rich in global correlation information.
[0113] The basic feature vectors of standard material surface images are obtained. The basic features of standard material surface images include color features, texture features and shape features. These features do not depend on deep networks and can describe the low-level statistical and structural information of the image from different perspectives, providing prior knowledge that is complementary to deep features for constructing topological relationships.
[0114] Color features include the RGB mean, variance, and color histogram of the entire image;
[0115] Texture features include LBP local binary pattern histogram, and statistical contrast and correlation of gray-level co-occurrence matrix;
[0116] Shape features include the perimeter, area, and roundness of contours in the image. The shape features are extracted by the Canny edge detection algorithm to extract the edges of the image, and then the contour finding algorithm such as findContours is used to obtain the set of pixels of the individual contours. Finally, the perimeter, area, and roundness of each contour are calculated.
[0117] The contour finding algorithm traverses all edge pixels and combines interconnected edge points into a sequence of one or more contours. Each contour is a set of coordinates of points on the boundary of an object.
[0118] For a contour defined by a series of point coordinates, the perimeter is the sum of the lengths of the lines connecting these points, obtained by calculating and summing the Euclidean distances between adjacent points. OpenCV provides efficient approximation algorithms such as chain codes for calculation.
[0119] The area is calculated by counting the number of pixels in the region enclosed by the outline, using Green's formula, which calculates the area based solely on the vertex coordinates of the outline.
[0120] Circularity is a measure of how close a contour shape is to a circle. It is a derived feature and requires the perimeter and area to be calculated first. Circularity is equal to four times pi multiplied by the area, and then divided by the square of the perimeter.
[0121] For a perfect circle, the roundness is equal to 1. For any other shape, the roundness is less than 1. The more irregular or elongated the shape, the closer the value is to 0.
[0122] The basic feature vector is obtained by normalizing the values of the basic features and concatenating them into a vector. The normalization method is min-max normalization.
[0123] Obtain the multidimensional basic feature vector for each image. The feature dimension of the basic vector depends on the number of basic features.
[0124] Calculate the Euclidean distance between any two images and construct a distance matrix. Each element in the distance matrix represents the Euclidean distance between the corresponding two images. The diagonal elements of the distance matrix are 0. For each node (i.e., each image), find the two nearest neighboring nodes (i.e., the two images). Fill the adjacency matrix according to the relationship between the node and its neighboring nodes. Each element in the adjacency matrix represents whether the corresponding two images are neighbors. If they are neighbors, the corresponding element is 1; otherwise, it is 0.
[0125] This invention innovatively constructs an auxiliary perspective adjacency matrix based on comprehensive similarity and a learner perspective topological adjacency matrix based on basic feature distance. It quantifies the correlation between samples from two different levels: high-level semantics and low-level statistics, forming a complementary graph structure. This provides key data structure support for the model to enhance the local sample discrimination ability by utilizing global information.
[0126] Step S2 also includes:
[0127] The similarity adjacency matrix is calculated to its powers from 1st to Mth to obtain the neighborhood relations of each order. Redundancy removal is performed on each order neighborhood relation to obtain a redundancy-removed k-order adjacency matrix. This matrix represents the pure k-order relations, that is, there are paths of length k between nodes, but no shorter paths exist. Its purpose is to remove the redundancy of low-order information included in high-order relations, so that the 1st and 2nd order features fused later are orthogonal and complementary in terms of information, thereby learning richer graph structure information.
[0128] The calculation formula for redundancy removal is:
[0129] ;
[0130] in, Let be a k-order adjacency matrix. This is the k-order adjacency matrix after redundancy removal. To sum over all adjacency matrices of order less than k;
[0131] The adjacency matrices of each order after redundancy removal are subjected to graph convolution with the latent feature vectors, and the results are weighted and fused to obtain auxiliary features. This matrix integrates the pure information from direct and indirect neighbors. Its function is to allow the model to autonomously adjust its dependence on local information (order 1) and slightly wider information (order 2) through a weighting mechanism, thereby generating more discriminative auxiliary features.
[0132] In a specific embodiment of the present invention, the first to second order powers of the similarity adjacency matrix are calculated to obtain the neighborhood relations of each order. Redundancy removal processing is performed on the neighborhood relations of each order. Specifically, the similarity adjacency matrix is used as a first-order adjacency matrix and a redundancy-removed first-order matrix. The product of the first-order adjacency matrix and the first-order adjacency matrix is used as a second-order adjacency matrix. The difference between the second-order adjacency matrix and the first-order adjacency matrix is used as a redundancy-removed second-order matrix.
[0133] The purpose of this operation is to remove redundant connections that can be explained by lower-order relations, so that the subsequent fused first-order and second-order features are orthogonal and complementary in terms of information.
[0134] The latent feature vectors are aggregated using a first-order and a second-order redundancy removal matrix. The first-order and second-order redundancy removal matrices are then multiplied with the latent feature matrix to obtain the first-order aggregated features and the second-order aggregated features, respectively.
[0135] The first-order aggregated features and the second-order aggregated features are weighted and fused together to obtain auxiliary features. The weight of the first-order aggregated features is a preset weight of 0.7, and the weight of the second-order aggregated features is a preset weight of 0.3. The weights of 0.7 and 0.3 are set because the importance of direct first-order neighbor information is usually higher than that of indirect second-order neighbor information. This is a weighting strategy based on prior knowledge.
[0136] This invention introduces a redundancy-removing hybrid-order feature aggregation mechanism, which can accurately extract pure, non-redundant feature information from neighborhood relationships of each order. This effectively avoids the repeated coverage of low-order information by high-order features, so that the fused auxiliary feature matrix contains orthogonal and complementary multi-scale neighborhood knowledge, thereby significantly enhancing the model's ability to represent complex defect patterns.
[0137] Step S2 also includes:
[0138] Performing standard graph convolution on the surface feature matrix and topological adjacency matrix includes:
[0139] Add the topological adjacency matrix to the identity matrix to obtain a new adjacency matrix. Based on the new adjacency matrix, obtain the corresponding degree matrix.
[0140] A new surface feature matrix is obtained by projecting the weight matrix onto the surface feature matrix.
[0141] The new surface feature matrix is symmetrically normalized using the degree matrix and the new adjacency matrix. The mathematical expression for symmetric normalization is:
[0142]
[0143] For the new adjacency matrix, For degree matrix, For the new surface feature matrix;
[0144] ;
[0145] The learner feature matrix is obtained by processing the symmetrically normalized matrix through a nonlinear activation function.
[0146] Symmetric normalization eliminates numerical instability caused by differences in node degree (i.e., the number of connections), making model training more stable and improving performance.
[0147] In a specific embodiment of the present invention, the surface feature matrix is added to the identity matrix, and the identity matrix and the surface feature matrix have the same dimension to obtain a new adjacency matrix. The purpose of adding the identity matrix I is to introduce self-loops so that each node can retain its own information when aggregating neighbor information, which is a standard operation in GCN.
[0148] Construct a degree matrix, which is a diagonal matrix. The elements on the diagonal of the degree matrix are the sum of each row of the new adjacency matrix, and the remaining elements are 0.
[0149] The surface feature matrix is projected onto the weight matrix to obtain a new surface feature matrix, that is, the product of the surface feature matrix and the weight matrix is used as the new surface feature matrix.
[0150] The weight matrix is randomly initialized at the beginning of training and is continuously adjusted during training through backpropagation and gradient descent until it reaches a state that optimizes the overall performance of the model.
[0151] The weight matrix is initialized using Xavier initialization, which ensures that the flow of signals and gradients is healthy at the start of training, and the dimension of the weight matrix is set to a dimension that can perform normal operations with the surface feature matrix.
[0152] Nonlinear activation functions are linear rectified functions, and their role is to introduce nonlinear expressive power into the model, enabling the network to learn more complex function mappings.
[0153] This invention performs standard graph convolution with self-loops and symmetric normalization on the surface feature matrix and the topological adjacency matrix, which can stably and efficiently aggregate structured information from the local neighborhood and effectively generate learner feature matrices that can reflect the underlying correlations between samples, providing reliable local perspective features for subsequent feature transfer and fusion.
[0154] Step S2 also includes:
[0155] The bidirectional feature transfer mechanism is as follows:
[0156] The auxiliary feature matrix is transformed by the first transformation matrix, and the transformed auxiliary feature matrix is added to the original learner feature matrix to obtain the enhanced learner feature matrix.
[0157] After multiplying the auxiliary feature matrix with the first transformation matrix, it is added to the original learner feature matrix to obtain the enhanced learner feature matrix. This matrix integrates information from the auxiliary perspective and its function is to realize the information transfer from the auxiliary perspective to the learner perspective. It uses the global correlation information learned from the auxiliary perspective to make up for the lack of local information that may exist in the learner perspective, thereby enhancing the expressive power of learner features.
[0158] The learner feature matrix is transformed using the second transformation matrix. The transformed learner feature matrix is then added to the original auxiliary feature matrix to obtain the enhanced auxiliary feature matrix.
[0159] The purpose of this mechanism is to achieve information complementarity and enhancement between two perspectives. By linearly transforming the features of one perspective and injecting them into another, the lack of information from a single perspective can be compensated for, thereby obtaining more discriminative enhanced features.
[0160] In one specific embodiment of the present invention, the auxiliary feature matrix is multiplied by the first transformation matrix, the dimension of the product result is consistent with the original learner feature matrix, and the two are added together to obtain the learner feature matrix.
[0161] The learner feature matrix is multiplied by the second transformation matrix, and the dimension of the product is the same as that of the original auxiliary feature matrix. The two matrices are then added together to obtain the enhanced auxiliary feature matrix.
[0162] The elements in the first and second transformation matrices are randomly initialized before training begins, using Xavier initialization.
[0163] The dimensions of the first transformation matrix and the second transformation matrix satisfy the operation conditions. The dimensions of both the first transformation matrix and the second transformation matrix are F×F, where F is the dimension of the row vectors of the learner feature matrix and the auxiliary feature matrix. This dimension design ensures that the transformation matrix can perform linear transformation on the N×F dimensional learner feature matrix and auxiliary feature matrix, and guarantees that the dimension of the transformed matrix is consistent with the original matrix, thereby achieving effective feature fusion.
[0164] This invention achieves bidirectional flow and complementary enhancement of information between the auxiliary perspective and the learner's perspective through a bidirectional feature transfer mechanism. The global correlation information of the auxiliary perspective can make up for the lack of local information in the learner's perspective. Through this cross-perspective feature fusion, a more robust and discriminative enhanced feature matrix is generated.
[0165] Step S3 includes:
[0166] Construct a two-branch collaborative learning framework, which includes a supervisory branch and an auxiliary collaborative branch;
[0167] The input to the supervised branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image. The enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image are passed through the first classification head, which includes a fully connected layer and a Softmax layer, to obtain the first classification prediction probability, and the supervised loss is calculated.
[0168] The method for calculating the supervision loss is the cross-entropy loss function;
[0169] The input to the auxiliary co-branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to all standard material surface images. The enhanced learner feature matrix is passed through the second classification head to obtain the second classification prediction probability from the learner's perspective. The enhanced auxiliary feature matrix is passed through the third classification head to obtain the third classification prediction probability from the auxiliary perspective. KL divergence is used to calculate the consistency loss between the classification prediction probability distribution from the learner's perspective and the classification prediction probability from the auxiliary perspective.
[0170] Construct a total loss function, which is a weighted sum of the supervision loss and the consistency loss.
[0171] In one specific embodiment of the present invention, a dual-branch collaborative learning framework is used to process labeled images and unlabeled images;
[0172] A batch of images is input into the dual-view detection model. This batch of images contains labeled images and unlabeled images. After processing in steps S1 and S2, each image generates an augmentation learner feature vector and an augmentation auxiliary feature vector. Further, labeled augmentation learner feature matrix, labeled augmentation auxiliary feature matrix, unlabeled augmentation learner feature matrix, and unlabeled augmentation auxiliary feature matrix are obtained.
[0173] The labeled reinforcement learner feature matrix and the labeled reinforcement auxiliary feature matrix are input into the supervision branch. The two matrices are added element by element to obtain the fused supervision feature matrix. The supervision feature matrix is fed into the classification head, which includes a fully connected layer and a softmax layer, and outputs a probability distribution matrix. The probability distribution matrix is compared with the real labels corresponding to the labeled images using the cross-entropy loss function to obtain the supervision loss.
[0174] The labeled reinforcement learner feature matrix, the labeled reinforcement auxiliary feature matrix, the unlabeled reinforcement learner feature matrix, and the unlabeled reinforcement auxiliary feature matrix are input into the auxiliary co-operation branch;
[0175] The labeled and unlabeled feature matrices of the reinforcement learners are concatenated. For example, if both the labeled and unlabeled feature matrices are 16×512 dimensional matrices, they are concatenated to form a 32×512 dimensional matrix. The concatenated matrix is then fed into the second classification head, which includes a fully connected layer and a Softmax layer, to obtain the probability distribution from the learner's perspective.
[0176] Concatenating all features along the batch dimension is to impose a consistency constraint on all samples in the entire batch, thereby making full use of unlabeled data to improve the model's generalization ability.
[0177] Similarly, the labeled and unlabeled augmented auxiliary feature matrices are concatenated and fed into a third classification head that includes fully connected layers and Softmax layers to obtain the probability distribution of the auxiliary viewpoint.
[0178] The consistency loss between the probability distribution of the learner's viewpoint and the probability distribution of the auxiliary viewpoint is calculated by KL divergence. KL divergence is used to measure the difference between the two probability distributions. Minimizing this loss will force the two viewpoints to make consistent classification predictions for the same image.
[0179] The mathematical expression for consistency loss is:
[0180] ;
[0181] Where N is the number of images of all standard material surfaces. Predicting probabilities for the second classification from the learner's perspective. The third classification prediction probability is given by the auxiliary viewpoint, where i represents traversing all images in this batch;
[0182] The weight hyperparameter λ is set to 0.5, indicating that consistency is considered equally important as supervised learning. The total loss is calculated, and the mathematical expression of the total loss function is:
[0183] ;
[0184] in, For the total loss function, For weight hyperparameters, This results in a loss of consistency.
[0185] This invention constructs a dual-branch collaborative learning framework that includes a supervisory branch and an auxiliary collaborative branch. It not only utilizes labeled data for accurate supervised learning, but also fully explores the value of unlabeled data through KL divergence consistency constraints, forcing the prediction results from the two perspectives to converge. This significantly improves the model's generalization ability and detection performance in scenarios with scarce labels.
[0186] Step S4 includes:
[0187] The dual-view detection model is trained by inputting a real-time standard material surface image after multi-dimensional preprocessing to obtain the detection results.
[0188] The test results include the defect type and the defect area.
[0189] In one specific embodiment of the present invention, a dataset for training and evaluation is first constructed. Specifically, labeled grayscale image files are obtained from the publicly available metal surface defect dataset NEU-DET as labeled data sources. At the same time, unlabeled defect images of metal material surfaces in industrial production scenarios are collected. These images cover different angles and light intensities and serve as unlabeled data sources. After multi-dimensional preprocessing of all images, an initial hybrid dataset is formed.
[0190] From the labeled images, a separate test set is selected using stratified sampling to ensure that each defect category is selected proportionally. This test set is strictly isolated throughout the training and parameter tuning process and is only used in the final performance evaluation. The remaining labeled images are randomly divided into a labeled training set and a labeled validation set in an 8:2 ratio. The data used in the training phase consists of both labeled training set and unlabeled images.
[0191] The model training employs an early stopping strategy to prevent overfitting and determine the optimal model. After each training iteration, the total loss is calculated using a labeled validation set. If the total loss on the validation set does not reach a new historical low within 15 consecutive iterations, training automatically terminates. During training, whenever the total loss on the validation set reaches a new low, the system automatically saves the parameters of the current model as a checkpoint. After training stops, the model using the parameters corresponding to the historical best checkpoint is determined as the final optimized model used for detection.
[0192] In each training iteration, the model automatically calculates the gradient of the total loss with respect to all trainable parameters in the model. These trainable parameters include: the weights of the backbone network, the weights of the graph convolutional layers, the parameters of the first and second transformation matrices, the weights of the supervised branch classification heads, and the weights of the two auxiliary branch classification heads. The optimizer (Adam) updates all parameters based on these gradients, completing one training iteration.
[0193] The image to be detected is input into the model to obtain the detection results. The detection results include the location information of the defect area, which is represented in the form of bounding boxes, including the pixel coordinates that can accurately outline the location of the defect.
[0194] The detection results also include defect categories, which, according to the NEU-DET dataset, include internal scale, plaques, cracks, pitting, inclusions, and scratches.
[0195] The detection results also include the detection confidence score, a floating-point number between 0 and 1, which represents the model's confidence in the detection result (i.e., the combination of position and category). The higher the confidence score, the greater the likelihood that the model considers the result to be correct, providing users with an adjustable threshold.
[0196] In this embodiment, the confidence threshold is set to 0.8, and only detection results higher than this threshold are displayed or processed, thereby effectively filtering out false alarms and improving the reliability of the system.
[0197] A machine vision-based material surface defect detection system includes a feature extraction module, a feature fusion module, a dual-view learning module, and a detection module.
[0198] The feature extraction module is used to input standard material surface images into a pre-built dual-view detection model, and extract latent feature matrices and surface feature matrices through the multi-dimensional feature extraction layer in the dual-view detection model;
[0199] The feature fusion module is used to construct a similarity adjacency matrix from an auxiliary perspective based on the latent feature matrix, and to construct a topological adjacency matrix from the learner's perspective based on the basic feature distance.
[0200] The dual-view learning module is used in the dual-view network layer of the dual-view detection model to perform redundancy removal and mixed-order feature aggregation on the latent feature matrix and similarity adjacency matrix to obtain the auxiliary feature matrix, and to perform standard graph convolution on the surface feature matrix and topological adjacency matrix to obtain the learner feature matrix. The enhanced feature matrix after fusing the auxiliary features and learner features is obtained through a bidirectional feature transfer mechanism.
[0201] The detection module is used to process the enhanced feature matrix through a two-branch collaborative learning framework and output the detection results of material surface defects.
[0202] This invention significantly improves the accuracy and generalization ability of material surface defect detection by constructing a dual-view collaborative learning architecture. Its core advantage lies in capturing the deep semantic associations and surface statistical information of images in parallel through multi-dimensional feature extraction layers, forming complementary latent feature matrices and surface feature matrices, laying a rich feature foundation for accurate discrimination. Based on comprehensive similarity and basic feature distance, adjacency matrices for the auxiliary and learner perspectives are constructed respectively, quantifying the complex associations between samples from different levels and fully mining the global structural information of the dataset. This invention introduces a redundancy-removing hybrid-order feature aggregation mechanism, which removes low-order information redundancy in high-order neighborhood relationships, integrates orthogonal and complementary multi-scale features, and combines a bidirectional feature transfer mechanism to achieve deep complementarity and enhancement of information from the two perspectives, generating a more discriminative enhanced feature matrix. Through the dual-branch collaborative learning framework, while using labeled data for supervised learning, the value of unlabeled data is fully explored with the help of KL divergence consistency loss, forcing the prediction results of the two perspectives to tend to be consistent, thereby greatly improving the generalization ability of the model in industrial scenarios where labels are scarce, and finally forming an efficient, robust, and high-precision automated defect detection solution.
[0203] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media including computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0204] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting surface defects in materials based on machine vision, characterized in that, Includes the following steps: Step S1: Input the standard material surface image into the pre-constructed dual-view detection model, and extract the latent feature matrix and surface feature matrix through the multi-dimensional feature extraction layer in the dual-view detection model; Step S2: Based on the latent feature matrix, construct the similarity adjacency matrix of the auxiliary perspective, and construct the topological adjacency matrix of the learner perspective based on the basic feature distance; Step S3: In the dual-view network layer of the dual-view detection model, perform redundancy removal and hybrid-order feature aggregation on the latent feature matrix and the similarity adjacency matrix to obtain the auxiliary feature matrix. Perform standard graph convolution on the surface feature matrix and the topological adjacency matrix to obtain the learner feature matrix. Obtain the enhanced feature matrix after fusing the auxiliary features and learner features through a bidirectional feature transfer mechanism. Step S4: Based on the enhanced feature matrix, the detection results of material surface defects are output through a dual-branch collaborative learning framework.
2. The material surface defect detection method based on machine vision as described in claim 1, characterized in that, Obtaining the surface image of the standard material includes: Acquire material surface images, perform multi-dimensional preprocessing on the material surface images to obtain standard material surface images; The multi-dimensional preprocessing includes logarithmic transformation enhancement, median filtering for noise reduction, histogram equalization, and size normalization.
3. The material surface defect detection method based on machine vision as described in claim 2, characterized in that, Step S1 includes: The dual-view detection model includes a multi-dimensional feature extraction layer and a dual-view network layer; The multi-dimensional feature extraction layer includes a latent feature extraction branch and a backbone network surface feature extraction branch; The dual-view network includes an auxiliary view network and a learning view network; The standard material surface image is input into the latent feature extraction branch and the backbone network surface feature extraction branch, and the latent feature vector is obtained through the processing of the latent feature extraction branch; The surface feature vector is obtained by processing the surface feature extraction branch of the backbone network, and the latent feature vector and the surface feature vector are normalized. The normalized latent eigenvectors of all standard material surface images constitute the latent feature matrix; The normalized surface feature vectors of all standard material surface images constitute the surface feature matrix.
4. The material surface defect detection method based on machine vision as described in claim 3, characterized in that, Step S2 includes: Constructing a similarity adjacency matrix specifically includes: Calculate the comprehensive similarity between the latent feature vectors of any two standard material surface images, where the comprehensive similarity is a weighted sum of the similarity calculated by cosine similarity and Gaussian hot kernel function; Based on the comprehensive similarity, the K nearest neighbor algorithm is used to select the K nodes with the highest similarity for each node to construct the similarity adjacency matrix of the auxiliary perspective; Constructing the topological adjacency matrix specifically includes: Obtain the basic feature vector of the standard material surface image, calculate the Euclidean distance between the basic feature vectors of any two standard material surface images, treat each standard material surface image as a node, and use the K-nearest neighbor algorithm to find the N nearest neighbor nodes to the standard material surface image; Construct a topological adjacency matrix, setting the intersection position of a node and its neighboring nodes to 1, and the rest to 0.
5. The material surface defect detection method based on machine vision as described in claim 4, characterized in that, Step S2 further includes: The similarity adjacency matrix is calculated to its powers from 1st to Mth to obtain the neighborhood relations of each order, and the neighborhood relations of each order are deredundant. The calculation formula for redundancy removal is: ; in, Let be a k-order adjacency matrix. This is the k-order adjacency matrix after redundancy removal. To sum over all adjacency matrices of order less than k; The adjacency matrices of each order after redundancy removal are subjected to graph convolution with the latent feature vectors, and the results are weighted and fused to obtain auxiliary features.
6. The material surface defect detection method based on machine vision as described in claim 5, characterized in that, Step S2 further includes: Performing standard graph convolution on the surface feature matrix and topological adjacency matrix includes: Add the topological adjacency matrix to the identity matrix to obtain a new adjacency matrix. Based on the new adjacency matrix, obtain the corresponding degree matrix. A new surface feature matrix is obtained by projecting the weight matrix onto the surface feature matrix. The new surface feature matrix is symmetrically normalized using the degree matrix and the new adjacency matrix. The mathematical expression for symmetric normalization is: For the new adjacency matrix, For degree matrix, For the new surface feature matrix; 7. The material surface defect detection method based on machine vision as described in claim 6, characterized in that, Step S2 further includes: The bidirectional feature transfer mechanism is as follows: The auxiliary feature matrix is transformed by the first transformation matrix, and the transformed auxiliary feature matrix is added to the original learner feature matrix to obtain the enhanced learner feature matrix. The learner feature matrix is transformed using the second transformation matrix. The transformed learner feature matrix is then added to the original auxiliary feature matrix to obtain the enhanced auxiliary feature matrix.
8. The material surface defect detection method based on machine vision as described in claim 7, characterized in that, Step S3 includes: A dual-branch collaborative learning framework is constructed, which includes a supervisory branch and an auxiliary collaborative branch; The input to the supervised branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image. The enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to the labeled standard material surface image are used to obtain the first classification prediction probability through the first classification head, and the supervised loss is calculated. The method for calculating the supervision loss is the cross-entropy loss function; The input to the auxiliary co-branch is the enhanced learner feature matrix and the enhanced auxiliary feature matrix corresponding to all standard material surface images. The enhanced learner feature matrix is passed through the second classification head to obtain the second classification prediction probability from the learner's perspective. The enhanced auxiliary feature matrix is passed through the third classification head to obtain the third classification prediction probability from the auxiliary perspective. KL divergence is used to calculate the consistency loss between the classification prediction probability distribution from the learner's perspective and the classification prediction probability from the auxiliary perspective. Construct a total loss function, which is a weighted sum of the supervision loss and the consistency loss.
9. The material surface defect detection method based on machine vision as described in claim 8, characterized in that, Step S4 includes: The dual-view detection model is trained by inputting a real-time standard material surface image after multi-dimensional preprocessing to obtain the detection results.
10. A material surface defect detection system based on machine vision, characterized in that, It includes a feature extraction module, a feature fusion module, a dual-view learning module, and a detection module; The feature extraction module is used to input the standard material surface image into the pre-constructed dual-view detection model, and extract the latent feature matrix and the surface feature matrix through the multi-dimensional feature extraction layer in the dual-view detection model. The feature fusion module is used to construct a similarity adjacency matrix from an auxiliary perspective based on the latent feature matrix, and to construct a topological adjacency matrix from the learner's perspective based on the basic feature distance. The dual-view learning module is used in the dual-view network layer of the dual-view detection model to perform redundancy removal and hybrid-order feature aggregation on the latent feature matrix and similarity adjacency matrix to obtain the auxiliary feature matrix, to perform standard graph convolution on the surface feature matrix and topological adjacency matrix to obtain the learner feature matrix, and to obtain the enhanced feature matrix after fusing the auxiliary features and learner features through a bidirectional feature transfer mechanism. The detection module is used to process the enhanced feature matrix through a dual-branch collaborative learning framework and output the detection results of material surface defects.