Industrial defect segmentation method based on neural network architecture search
Through neural network architecture search and optimization of the combination of convolutional neural network, Transformer and multi-layer perceptron, the problem of insufficient detection accuracy and efficiency in industrial defect segmentation is solved, and efficient detection and segmentation of complex defects is achieved.
Patent Information
- Application Number
- CN202411261011.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The existing industrial defect segmentation method based on deep learning is difficult to effectively detect and segment complex industrial product surface defects due to the limited receptive field of convolutional neural networks and the lack of local information exchange mechanism of Transformer, and the multi-layer perceptron has a small sample number. In the case, it is easy to overfit, resulting in insufficient detection accuracy and efficiency.
Using a method based on neural network architecture search, the convolutional neural network, Transformer and multi-layer perceptron are combined through a cross-size weight sharing strategy to build a hypernetwork and perform evolutionary search, optimize the network structure to adapt to the characteristics of different sizes, and build the optimal Subnetworks are used for defect segmentation.
It significantly improves the accuracy and efficiency of surface defect detection of industrial products, can accurately detect and divide various types of defects, solves the shortcomings of traditional methods in terms of accuracy, efficiency and adaptability, and provides a more effective and reliable solution. plan.
Smart Images

Figure CN119205810A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial defect segmentation, and in particular to an industrial defect segmentation method based on neural network architecture search. Background Art
[0002] Surface defect segmentation of industrial products is a critical task in various industrial applications. The main challenge lies in the variability of surface defects, which may vary greatly in shape and size. Modern inspection technologies such as machine vision, deep learning, and automated inspection systems can significantly improve the speed and accuracy of inspection. However, commonly used deep learning-based methods such as convolutional neural networks (CNNs) usually have difficulty modeling long-range dependencies due to their limited receptive fields, which can lead to discontinuities in defect segmentation. Transformers lack local mechanisms for information exchange within local regions, which may cause local details of defects (such as edges and shapes) to be lost. In addition, the high flexibility and large capacity of multi-layer perceptrons (MLPs) make them prone to overfitting during training, especially when the number of samples in the defect dataset is small.
[0003] Given the advantages and disadvantages of the above architectures, no single architecture is suitable for all defect segmentation tasks. A direct solution is to design a hybrid network architecture. In recent years, the neural network architecture search (NAS) method has been used to automatically design the most effective architecture. However, due to the characteristics of different operators, most methods based on network architecture search fail to efficiently combine these operators, and as the number of operators increases, the search efficiency decreases significantly, making it impractical in practical applications. Another difficulty is how to fuse multi-level features. Studies have shown that multi-level features are crucial for surface defect segmentation. High-level features capture discriminative information, while low-level features contain rich texture information. Therefore, it is necessary to develop an effective method based on neural network architecture search for application in defect detection on the surface of industrial products. Summary of the invention
[0004] Based on this, it is necessary to provide an industrial defect segmentation method based on neural network architecture search, which includes:
[0005] S1: Preprocessing of the industrial product surface defect dataset with pixel-level annotation;
[0006] S2: using a cross-size weight sharing strategy to enable weight-initialized convolutional neural networks, transformers, and multi-layer perceptrons to share weights with each other at different sizes; constructing a search space, and placing the weight-shared convolutional neural networks, transformers, and multi-layer perceptrons into the search space; the search space is used to search the three networks simultaneously;
[0007] S3: construct a super network based on all combinations of the three networks in the search space and train the super network;
[0008] S4: performing evolutionary search on the trained super network to obtain the optimal sub-network;
[0009] S5: training the optimal sub-network based on the preprocessed industrial product surface defect data set, and constructing a defect segmentation model based on the trained optimal sub-network; inputting the image to be detected into the defect segmentation model to output a pixel-level segmentation result.
[0010] Beneficial effects: This method reduces training time and resource consumption by optimizing the network structure, while significantly improving the accuracy of industrial product surface defect detection, and can accurately detect and segment various types of defects; this method solves the shortcomings of traditional detection methods in terms of accuracy, efficiency and adaptability, and provides a more effective and reliable solution for industrial product surface defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0012] Figure 1 This is a flowchart of an industrial defect segmentation method based on neural network architecture search according to an embodiment of the present application.
[0013] Figure 2 This is a flowchart of the operation of the defect segmentation model according to an embodiment of the present application. DETAILED DESCRIPTION
[0014] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.
[0015] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0016] like Figure 1 As shown, this embodiment provides an industrial defect segmentation method based on neural network architecture search, the method comprising:
[0017] S1: Preprocessing of the pixel-level annotated industrial product surface defect dataset.
[0018] Specifically, the step includes:
[0019] S1.1: Divide the industrial product surface defect dataset into a training set (60%), a validation set (20%) and a test set (20%);
[0020] S1.2: Perform tensor transformation and normalization on the training set, validation set, and test set in turn to obtain the preprocessed training set, preprocessed validation set, and preprocessed test set, respectively.
[0021] In this embodiment, the pixel-level annotated industrial product surface defect dataset uses the magnetic tile surface defect dataset MTDD, which contains a total of 1344 images. The dataset contains five types of defects: blowhole, break, crack, fray, and unevenness. For training and testing, this example only selects defect images from the data for experiments (a total of 782 images), and resizes all images to 320×320 pixels.
[0022] S2: Through the cross-size weight sharing strategy, the weight-initialized convolutional neural network, Transformer, and multi-layer perceptron share weights with each other at different sizes; construct a search space, and put the convolutional neural network, Transformer, and multi-layer perceptron processed with weight sharing into the search space; the search space is used to search the three networks simultaneously.
[0023] Specifically, in the search space, given a standard convolution, it can be described as Where k represents the size of the convolution kernel. Assume that the input feature map Output feature map Where h and w represent the width and height of the feature map respectively, and the calculation process of the convolutional neural network is expressed as:
[0024]
[0025] S(x i,j ,Δm,Δn)=x i+Δm,j+Δn ;
[0026] Among them, y i,j′ represents the value of the first output feature map at (i, j); a, b represent the convolution kernel at (a, b), a, b∈{0,1,…,k-1}, k represents the size of the convolution kernel; S(·) represents the Shift function; k (a,b) Represents the convolution kernel weight at (a, b); represents the feature obtained by passing the value of the input feature map at (i, j) through the convolution kernel at (a, b); x i,j represents the value of the input feature map at (i, j); Δm represents the horizontal displacement; Δn represents the vertical displacement; x i+Δm,j+Δn Represents the eigenvalue of (i, j) after two steps of shifting Δm and Δn in the input feature map;
[0027] There are H heads in Transformer (self-attention), assuming the input feature map Output feature map Where h and w represent the width and height of the feature map respectively, and the calculation process of Transformer is expressed as:
[0028] y i,j ″=Concat(x i,j head (1) ,…,x i,j head (H) )W O ;
[0029]
[0030] Among them, y i,j ″ represents the value of the second output feature map at (i, j); Concat(·) represents the concatenation operation; W O represents the first linear projection parameter; x i,j head (1) Indicates the feature obtained by the first head after the value of the input feature map at (i, j); x i,j head (H) represents the feature obtained by passing the value of the input feature map at (i, j) through the Hth head; x i,j head (l) represents the feature obtained by the value of the input feature map at (i, j) after passing through the lth head; Attention(·) represents the self-attention mechanism; represents the second linear projection parameters; represents the third linear projection parameters; represents the fourth linear projection parameter; Q represents query; K represents key; V represents value; softmax(·) represents softmax function; T represents transpose; d K The characteristic dimension of the representation key;
[0031] Assume input feature map Output feature map Where h and w represent the width and height of the feature map, respectively. Using the spatial shift paradigm in S2 MLPv2 (an advanced MLP structure), the calculation process of the multilayer perceptron is expressed as:
[0032]
[0033] Among them, y i,j ″′ represents the value of the third output feature map at (i, j); MLP(·) represents a multi-layer perceptron; SA(·) represents recalibration of different branches through a multi-layer perceptron; Indicates that each element in the value of the third output feature map at (i, j) is moved down by one position; Indicates that each element in the value of the third output feature map at (i, j) is moved down by two positions; Indicates that each element in the value of the third output feature map at (i, j) is moved down by three positions; X represents the input feature map; Represents the input feature map after multi-layer perceptron calibration.
[0034] In this embodiment, the above three networks are converted to the same format and placed in a search space with unified weight sharing. The three networks first share weights through three 1×1 convolutions, and then the encoder in the defect segmentation model selects a network combination of different paradigms. The structure of the search space is shown in Table 1;
[0035] Table 1 is the structure table of the search space;
[0036]
[0037] As shown in Table 1, the search space includes four stages, each stage samples three networks respectively, and the depth, number of channels, feedforward neural network ratio, and model size of the three networks in each stage are different.
[0038] Furthermore, the cross-size weight sharing strategy includes:
[0039] For convolutional neural networks, in each model size at each stage, the remaining convolution kernels except the largest convolution kernel inherit the weight of the largest convolution kernel; the first inheritance relationship is expressed as:
[0040]
[0041] in, Represents the weight of the convolution kernel S in the i-th layer of the convolutional neural network; represents the weight of the largest convolution kernel L in the i-th layer of the convolutional neural network; (p, q) represents the starting position of the inheritance process; k S represents the size of the convolution kernel S; k L Indicates the size of the maximum convolution kernel;
[0042] For Transformer and multi-layer perceptron, in each model size at each stage, all blocks except the largest block inherit the weight of the largest block; the second inheritance relationship is expressed as:
[0043]
[0044] in, represents the weight of block S′ in the i-th layer of Transformer or multi-layer perceptron; represents the weight of the largest block L′ in the i-th layer of the Transformer or multi-layer perceptron; c S, represents the embedding dimension of block S′.
[0045] S3: Construct a super network based on all combinations of the three networks in the search space and train the super network.
[0046] Specifically, each combination of the three networks in the search space is used as a subnetwork in the super network; the training super network includes:
[0047] Step 1: AdamW is used as the optimizer, the initial first learning rate is set to 0.0004, the first learning rate adopts a cosine decay strategy, and data enhancement operations are performed on the images in the preprocessed training set. The training cycle is set to 2000 epochs; the data enhancement operations include random horizontal flipping, random resizing, and random rotation;
[0048] Step 2: Randomly sample the subnetwork, and only update the weight of the sampled subnetwork during each training;
[0049] Step 3: For the convolutional neural network in the subnet, only the largest convolution kernel is trained; for the Transformer and multi-layer perceptron in the subnet, only the largest block is trained;
[0050] Step 4: During the training process, the performance of the sampled subnetwork is evaluated using the preprocessed validation set.
[0051] S4: Perform evolutionary search on the trained super network to obtain the optimal sub-network.
[0052] Specifically, in S4, performing evolutionary search on the trained super network includes:
[0053] Step 1: Obtain a trained super network, wherein the trained super network includes multiple sub-networks; the search space includes parameter combinations of the multiple sub-networks;
[0054] Step 2: Randomly initialize a population, where each individual represents a parameter combination of a subnetwork in the search space;
[0055] Step 3: In each iteration, select the top k subnetworks with the highest average intersection-to-union ratio as the parent network;
[0056] When the preset crossover probability is met, these parents are crossovered to generate new offspring;
[0057] When the preset mutation probability is met, mutation operations are performed on the offspring of these parents to generate new offspring;
[0058] Step 4: The generated offspring will be added to the population;
[0059] Step 5: Repeat steps 3-4 until the predetermined number of iterations is reached, and select the parameter combination of the subnet with the largest average intersection-to-union ratio in the population as the optimal solution;
[0060] Step 6: extracting a subnet that meets the parameter requirements from the super network according to the searched optimal solution as the optimal subnet.
[0061] S5: training the optimal sub-network based on the preprocessed industrial product surface defect data set, and constructing a defect segmentation model based on the trained optimal sub-network; inputting the image to be detected into the defect segmentation model to output a pixel-level segmentation result.
[0062] In this embodiment, the training of the optimal sub-network based on the preprocessed industrial product surface defect dataset includes:
[0063] Based on the preprocessed training set, Adam is used as the optimizer, the initial second learning rate is set to 0.0001, and a multi-learning rate scheduler is used, and the training cycle is set to 500 epochs;
[0064] After training, testing is performed based on the preprocessed test set.
[0065] Furthermore, the defect segmentation model is constructed based on the trained optimal sub-network, including:
[0066] Step 1: Use the trained optimal sub-network as the encoder of the defect segmentation model;
[0067] Step 2: Design a multi-level feature aggregation module as the decoder of the defect segmentation model;
[0068] The multi-level feature aggregation module uses multiple feature extraction operations to refine the multi-level features extracted by the encoder; the refinement process includes N F nodes and N E The invention provides a directed acyclic graph with edges, wherein each node represents a feature graph, and each directed edge represents a candidate operation; the types of candidate operations include 1×1 convolution, 3×3 convolution, 5×5 convolution, 3×3 dilated convolution, and 3×3 depth-separable convolution; after refinement, a pyramid pooling module is used to fuse and output the refined multi-level features.
[0069] In this embodiment, the defect segmentation model includes four stages, and the parameters in the defect segmentation model include: the depth of each stage, the expansion ratio of the feedforward neural network of each layer in each stage, the number of feature extraction heads of each layer in each stage, the network type used in each layer in each stage, the number of input channels in each stage, the type of candidate operations in the multi-level feature aggregation module of each stage, and the scale of the pooling layer in the pyramid pooling module.
[0070] Furthermore, the specific description of the parameters is:
[0071] 1. Depth: represents the depth of each stage in the network, that is, the number of layers contained in each stage. Specifically, the network contains four stages, each with 3, 5, 6 and 4 layers respectively;
[0072] 2.FFN_ratio: represents the expansion ratio of the feedforward neural network in each layer of each stage in the network. Specifically, the network consists of four stages. The first stage has three layers, and the FFN ratios are 7.5, 7.5, and 8.0 respectively; the second stage has five layers, and the FFN ratios are 8.0, 8.0, 8.5, 8.0, and 7.5 respectively; the third stage has six layers, and the FFN ratios are 4.5, 4.5, 3.5, 3.5, 3.5, and 4.5 respectively; the fourth stage has four layers, and the FFN ratios are 4.5, 4.0, 3.5, and 4.0 respectively;
[0073] 3. Num_heads: indicates the number of heads in the feature extraction block of each layer in each stage of the network. Specifically, the network consists of four stages. The first stage has three layers with the number of heads being 1, 1, 1 respectively; the second stage has five layers with the number of heads being 3, 3, 2, 2, 2 respectively; the third stage has six layers with the number of heads being 6, 5, 5, 5, 6, 5 respectively; the fourth stage has four layers with the number of heads being 8, 7, 7, 8 respectively;
[0074] 4. Operation: Indicates the type of operation used in each layer in each stage of the network. Among them, 0 represents MLP operation, 1 represents Transformer operation, 3 represents 3×3 convolution, and 5 represents 5×5 convolution. Specifically, the network consists of four stages. The first stage has three layers, and the operation types are 1, 0, and 1 respectively; the second stage has five layers, and the operation types are 0, 0, 1, 1, 0 respectively; the third stage has six layers, and the operation types are 0, 3, 1, 3, 0, 5 respectively; the fourth stage has four layers, and the operation types are 1, 0, 5, 1 respectively;
[0075] 5. Channel: indicates the number of input channels in each stage. Specifically, the network consists of four stages, the first stage has 64 input channels, the second stage has 128 input channels, the third stage has 384 input channels, and the fourth stage has 448 input channels;
[0076] 6. Conv_choice: represents the candidate operations in the multi-level feature aggregation module. Among them, 0 represents 1×1 convolution, 1 represents 3×3 convolution, 2 represents 5×5 convolution, 3 represents 3×3 dilated convolution, and 4 represents 3×3 depthwise separable convolution. Specifically, the network contains four stages, among which the operation types of the first stage are 2, 1, the operation types of the second stage are 1, 3, the operation types of the third stage are 4, 2, and the operation types of the fourth stage are 0, 1, 1, 2;
[0077] 7.Pool_scale: corresponds to the scale of the pooling layer in the pyramid pooling module PPM, which can be 1×1, 2×2, 3×3 or 6×6 pooling operations.
[0078] like Figure 2 As shown, this embodiment shows the operation process of the defect segmentation model, including:
[0079] Step 1: The encoder obtains the image to be detected, performs linear projection processing on the image to be detected inside the encoder, and then performs Tansformer operation, convolution operation, and MLP operation respectively. The features after the three operations are passed through the feedforward neural network to obtain multi-level features;
[0080] Step 2: The decoder obtains multi-level features, and the multi-level feature aggregation module uses multiple feature extraction operations to refine the multi-level features. The pyramid pooling module cascades and upsamples the refined multi-level features in sequence, and outputs the upsampled pixel-level segmentation results.
[0081] The industrial defect segmentation method based on neural network architecture search provided in this embodiment has the following advantages:
[0082] Beneficial effects:
[0083] This method reduces training time and resource consumption by optimizing the network structure, while significantly improving the accuracy of industrial product surface defect detection and being able to accurately detect and segment various types of defects. This method solves the shortcomings of traditional detection methods in terms of accuracy, efficiency and adaptability, and provides a more effective and reliable solution for industrial product surface defects.
[0084] The network architecture of this method searches for an end-to-end segmentation network architecture by jointly searching CNN, Transformer, and MLP operators, which can adapt to the detection and segmentation of a wide variety of defect types.
[0085] CNN is good at processing local features in images, such as edges, textures, and local patterns, which makes it excellent in detecting subtle differences in industrial defects; Transformer can capture global information and long-range dependencies in images through the self-attention mechanism, which gives it a significant advantage in dealing with complex global features and long-range dependency problems; MLP provides a simple and efficient way to process numerical features and some linear relationships. By combining these three operators, this method can not only effectively process various local and global features in images, but also flexibly adapt to multiple defect types in different industrial scenarios.
[0086] At the same time, the network directly uses segmentation accuracy as an indicator during the search process. After training, there is no need to adapt to other segmentation frameworks. The segmentation results can be obtained by inputting the detection image. This comprehensiveness and adaptability enable this method to maintain high efficiency and accuracy in various industrial defect detection tasks, thereby improving the overall detection performance and reliability.
[0087] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0088] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. An industrial defect segmentation method based on neural network architecture search, characterized in that: include: S1: Preprocessing of the pixel-level annotated industrial product surface defect dataset; S2: using a cross-size weight sharing strategy to enable weight-initialized convolutional neural networks, transformers, and multi-layer perceptrons to share weights with each other at different sizes; constructing a search space, and placing the weight-shared convolutional neural networks, transformers, and multi-layer perceptrons into the search space; the search space is used to search the three networks simultaneously; S3: construct a super network based on all combinations of the three networks in the search space and train the super network; S4: performing evolutionary search on the trained super network to obtain the optimal sub-network; S5: training the optimal sub-network based on the preprocessed industrial product surface defect data set, and constructing a defect segmentation model based on the trained optimal sub-network; inputting the image to be detected into the defect segmentation model to output a pixel-level segmentation result.
2. The industrial defect segmentation method based on neural network architecture search according to claim 1 is characterized in that: S1 includes: S1.1: Divide the industrial product surface defect dataset into a training set, a validation set and a test set; S1.2: Perform tensor transformation and normalization on the training set, validation set, and test set in turn to obtain the preprocessed training set, preprocessed validation set, and preprocessed test set, respectively.
3. The industrial defect segmentation method based on neural network architecture search according to claim 1 is characterized in that: In the search space, the calculation process of the convolutional neural network is expressed as: S(x i,j ,Δm,Δn)=x i+Δm,j+Δn ; Among them, y i,j ′ represents the value of the first output feature map at (i, j); a, b represent the convolution kernel at (a, b), a, b∈{0,1,…,k-1}, k represents the size of the convolution kernel; S(·) represents the Shift function; k (a,b) Represents the convolution kernel weight at (a, b); represents the feature obtained by passing the value of the input feature map at (i, j) through the convolution kernel at (a, b); x i,j represents the value of the input feature map at (i, j); Δm represents the horizontal displacement; Δn represents the vertical displacement; x i+Δm,j+Δn Represents the eigenvalue of (i, j) after two steps of shifting Δm and Δn in the input feature map; The calculation process of Transformer is expressed as: y i,j ″=Concat(x i,j head (1) ,…,x i,j head (H) )W O ; Among them, y i,j ″ represents the value of the second output feature map at (i, j); Concat(·) represents the concatenation operation; W O represents the first linear projection parameter; x i,j head (1) Indicates the feature obtained by the first head after the value of the input feature map at (i, j); x i, j head (H) represents the feature obtained by passing the value of the input feature map at (i, j) through the Hth head; x i,j head (l) represents the feature obtained by the value of the input feature map at (i, j) after passing through the lth head; Attention(·) represents the self-attention mechanism; represents the second linear projection parameters; represents the third linear projection parameters; represents the fourth linear projection parameter; Q represents query; K represents key; V represents value; softmax(·) represents softmax function; T represents transpose; d K The characteristic dimension of the representation key; The calculation process of the multilayer perceptron is expressed as: Among them, y i,j ″′ represents the value of the third output feature map at (i, j); MLP(·) represents a multi-layer perceptron; SA(·) represents recalibration of different branches through a multi-layer perceptron; Indicates that each element in the value of the third output feature map at (i, j) is moved down by one position; Indicates that each element in the value of the third output feature map at (i, j) is moved down by two positions; Indicates that each element in the value of the third output feature map at (i, j) is moved down by three positions; X represents the input feature map; Represents the input feature map after multi-layer perceptron calibration.
4. The industrial defect segmentation method based on neural network architecture search according to claim 1 is characterized in that: The search space includes four stages, each stage samples three networks respectively, and the depth, number of channels, feedforward neural network ratio and model size of the three networks in each stage are different.
5. The industrial defect segmentation method based on neural network architecture search according to claim 4 is characterized in that: The cross-size weight sharing strategy includes: For convolutional neural networks, in each model size at each stage, the remaining convolution kernels except the largest convolution kernel inherit the weight of the largest convolution kernel; the first inheritance relationship is expressed as: in, Represents the weight of the convolution kernel S in the i-th layer of the convolutional neural network; represents the weight of the largest convolution kernel L in the i-th layer of the convolutional neural network; (p, q) represents the starting position of the inheritance process; k S represents the size of the convolution kernel S; k L Indicates the size of the maximum convolution kernel; For Transformer and multi-layer perceptron, in each model size at each stage, all blocks except the largest block inherit the weight of the largest block; the second inheritance relationship is expressed as: in, represents the weight of block S′ in the i-th layer of Transformer or multi-layer perceptron; represents the weight of the largest block L′ in the i-th layer of the Transformer or multi-layer perceptron; c S, represents the embedding dimension of block S′.
6. The industrial defect segmentation method based on neural network architecture search according to claim 2 is characterized in that: In S3, each combination of the three networks in the search space is used as a subnet in the super network; the training super network includes: Step 1: AdamW is used as the optimizer, the initial first learning rate is set to 0.0004, the first learning rate adopts a cosine decay strategy, and data enhancement operations are performed on the images in the preprocessed training set. The training cycle is set to 2000 epochs; the data enhancement operations include random horizontal flipping, random resizing, and random rotation; Step 2: Randomly sample the subnetwork, and only update the weight of the sampled subnetwork during each training; Step 3: For the convolutional neural network in the subnet, only the largest convolution kernel is trained; for the Transformer and multi-layer perceptron in the subnet, only the largest block is trained; Step 4: During the training process, the performance of the sampled subnetwork is evaluated using the preprocessed validation set.
7. The industrial defect segmentation method based on neural network architecture search according to claim 2 is characterized in that: In S4, performing evolutionary search on the trained super network includes: Step 1: Obtain a trained super network, wherein the trained super network includes multiple sub-networks; the search space includes parameter combinations of the multiple sub-networks; Step 2: Randomly initialize a population, where each individual represents a parameter combination of a subnetwork in the search space; Step 3: In each iteration, select the top k subnetworks with the highest average intersection-to-union ratio as the parent network; When the preset crossover probability is met, these parents are crossovered to generate new offspring; When the preset mutation probability is met, mutation operations are performed on the offspring of these parents to generate new offspring; Step 4: The generated offspring will be added to the population; Step 5: Repeat steps 3-4 until the predetermined number of iterations is reached, and select the parameter combination of the subnet with the largest average intersection-to-union ratio in the population as the optimal solution; Step 6: extracting a subnet that meets the parameter requirements from the super network according to the searched optimal solution as the optimal subnet.
8. The industrial defect segmentation method based on neural network architecture search according to claim 7 is characterized in that: The training of the optimal sub-network based on the pre-processed industrial product surface defect data set includes: Based on the preprocessed training set, Adam is used as the optimizer, the initial second learning rate is set to 0.0001, and a multi-learning rate scheduler is used, and the training cycle is set to 500 epochs; After training, testing is performed based on the preprocessed test set.
9. The industrial defect segmentation method based on neural network architecture search according to claim 8 is characterized in that: In S5, constructing a defect segmentation model based on the trained optimal sub-network includes: Step 1: Use the trained optimal sub-network as the encoder of the defect segmentation model; Step 2: Design a multi-level feature aggregation module as the decoder of the defect segmentation model; The multi-level feature aggregation module uses multiple feature extraction operations to refine the multi-level features extracted by the encoder; the refinement process includes N F nodes and N E The invention provides a directed acyclic graph with edges, wherein each node represents a feature graph, and each directed edge represents a candidate operation; the types of candidate operations include 1×1 convolution, 3×3 convolution, 5×5 convolution, 3×3 dilated convolution, and 3×3 depth-separable convolution; after refinement, a pyramid pooling module is used to fuse and output the refined multi-level features.
10. The industrial defect segmentation method based on neural network architecture search according to claim 9 is characterized in that: The defect segmentation model includes four stages, and the parameters in the defect segmentation model include: the depth of each stage, the expansion ratio of the feedforward neural network of each layer in each stage, the number of feature extraction heads of each layer in each stage, the network type used in each layer in each stage, the number of input channels of each stage, the type of candidate operations in the multi-level feature aggregation module of each stage, and the scale of the pooling layer in the pyramid pooling module.
Citation Information
Patent Citations
Method for searching and constructing binary neural network based on neural network architecture
CN116542301A
Network architecture search method and device, image classification method and device and electronic equipment
CN116796797A
Surface defect detection method based on differentiable neural architecture search
CN117173091A
Neural network structure searching method and device and storage medium
CN117688984A
Evolution of architectures for multitask neural networks
IN202047025046A
Cited By
Adaptive evolutionary neural network method for visual detection of defects of moving contact assembly
CN121303204A
