Cross-scenario strip steel surface defect detection method based on domain adaptation

Through the multi-level distribution alignment domain adaptation model, the distribution alignment of the source domain and target domain images is achieved, which solves the problem of poor generalization performance of the strip surface defect detection model in different production scenarios, improves the detection accuracy and efficiency, and performs better than traditional method.

CN115035097BActive Publication Date: 2024-09-13HEBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210790005.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2024-09-13
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

The existing strip surface defect detection model has poor generalization performance in different production scenarios, mainly due to the difference in data distribution between the source domain and the target domain, resulting in low detection accuracy.

Method used

A multi-level distribution alignment domain adaptation model is used to achieve pixel-level, feature-level and category-level distribution alignment of source and target domain images through the style expansion module, feature extractor and domain discriminator, generate pseudo labels for training, and improve the generalization of the model. chemical performance.

Benefits of technology

It improves the accuracy and generalization performance of cross-scenario strip surface defect detection, reduces dependence on label data, improves detection efficiency, and performs better than traditional machine vision or deep learning methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035097B
    Figure CN115035097B
Patent Text Reader

Abstract

The present invention is a cross-scenario strip steel surface defect detection method based on domain adaptation. First, a multi-level distribution alignment domain adaptation model consisting of a style expansion module, a feature extractor, a domain discriminator and a classifier is constructed. The style expansion module performs style expansion on source domain and target domain images, generates source domain and target domain images that are completely different in style from the original source domain and target domain images, and realizes pixel-level distribution alignment of the two domain images; the domain discriminator performs adversarial learning on the source domain image and the target domain image, assigns domain labels to the source domain image and the target domain image, and realizes feature-level distribution alignment of the two domain images; the classifier is used to obtain classification results, and generates pseudo labels based on a voting mechanism, and realizes category-level distribution alignment of the two domain images; the defect detection model is constructed using the trained feature extractor and classifier. This method improves the degree of data distribution alignment between the source domain and the target domain, and improves the generalization performance of the defect detection model for cross-scenario strip steel surface defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of defect detection, and specifically is a cross-scenario strip surface defect detection method based on domain adaptation. Background Art

[0002] As one of the main steel products, strip steel is widely used in chemical equipment, automobile industry and other industrial fields. In the production process of strip steel, due to the influence of factors such as factory environment, some defects will inevitably exist on the surface of the strip steel. The surface defects of strip steel not only reduce the oxidation resistance, cold bending and other properties of the product, but also easily cause safety accidents, resulting in serious personnel and economic losses. Traditional strip steel defect detection is mainly through manual measurement and judgment, and the detection results are easily affected by human factors such as the subjective will, emotions, and visual fatigue of the inspectors, resulting in missed detection and false detection. Defect detection technology based on machine vision can overcome the shortcomings of manual detection, make the detection results more standardized, and improve the degree of automation of the entire production system.

[0003] In the actual production of strip steel, due to the differences in production processes, equipment parameters, and imaging conditions on different production lines, the online detection environments in different production scenarios are different. The defect detection model obtained by training with the defective images of strip steel in a certain production scenario can only achieve good detection results in this production scenario, and cannot be applied to other production scenarios. The generalization performance of the defect detection model is poor. Deep domain adaptation technology is a representative branch of deep transfer learning. It uses a labeled dataset similar to the dataset to be detected as the source domain and the dataset to be detected as the target domain, which can solve the generalization problem of the model for different production scenarios. However, the generalization ability of the existing domain adaptation model is poor, mainly because the styles of the source domain and the target domain are different, resulting in large differences in the data distribution of the source domain and the target domain. During the training process, the data distribution of the source domain and the target domain is difficult to align, and the extracted features are biased towards the source domain. The model has low detection accuracy for the target domain data. Summary of the invention

[0004] In view of the deficiencies in the prior art, the technical problem to be solved by the present invention is to provide a cross-scenario strip surface defect detection method based on domain adaptation.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] A cross-scenario strip steel surface defect detection method based on domain adaptation, characterized in that the method comprises the following steps:

[0007] Step 1: Obtain source domain and target domain data sets; the source domain data set consists of source domain images, which are defect images with labels; the target domain data set consists of target domain images, which are images to be detected;

[0008] Step 2: construct a multi-level distribution alignment domain adaptation model, which includes a style expansion module, a feature extractor, a domain discriminator, and a classifier;

[0009] The style expansion module includes multiple style change submodules and a style fusion module, each of which includes a convolution layer, an instance normalization layer, an affine transformation and a deconvolution layer. Given an original source domain image x s and the original target domain image x t Each style change submodule performs style changes on the original source domain image and the original target source image respectively, generating source domain images and target domain images with styles completely different from the original source domain images and target domain images, and realizing pixel-level distribution alignment of the two domain images; for the i-th style change submodule, the convolutional layer is first used to extract the feature maps of the two domain images. and Then, the feature map is normalized by an instance normalization layer. and Perform instance normalization to obtain feature maps and The style parameter of the instance normalization is:

[0010]

[0011] In the formula, μ i,c , Respectively represent the mean and variance of the feature map channel, H and W represent the height and width of the feature map, respectively. wh Represents the pixel value of the feature point (w,h);

[0012] Then, using the learnable style parameter θ i =(μ i ,σ i ) for the feature map and The style is affine transformed to generate new style feature maps and The expression of affine transformation is:

[0013]

[0014] In the formula, g i (·) represents the i-th style change submodule g i The affine transformation operation, f i,c Represents the i-th style change submodule gi The feature map on channel c extracted by the convolution layer, f i, ' c Represents the new style feature map on channel c;

[0015] Finally, the new style feature map and The deconvolution layers are used to generate source and target images that are completely different in style from the original source and target images, respectively, to achieve pixel-level style shift.

[0016] The style fusion module is used to perform weighted summation on the source domain images and target domain images generated by all style change submodules to obtain the source domain fusion image and the target domain fusion image; the expression of the weighted summation is:

[0017]

[0018] In the formula, ω i represents a learnable adaptive parameter whose initial value follows a normal distribution and takes a random value between (0,1); K represents the number of style change submodules, z i represents the output image of the i-th style change submodule, and z′ represents the fused image;

[0019] The original source domain and the original target domain images, the generated source domain and target domain images, and the source domain and target domain fusion images are input into the feature extractor. After passing through the feature extractor, the feature maps of each image are obtained. After gradient inversion, each feature map extracted by the feature extractor is input into the domain discriminator for adversarial learning, and a domain label is assigned to each feature map to achieve feature-level distribution alignment of the two domain images.

[0020] At the same time, each feature map extracted by the feature extractor is input into the classifier. The classifier votes for the defect category of each feature map based on the hard voting method, obtains the probability that each feature map belongs to a different defect category, and generates pseudo labels to achieve category-level distribution alignment of the two domain images; hard voting means that the defect category output by the classifier is the category that appears most frequently in all voting results;

[0021] Step 3: adjust the size of the images in the source domain and target domain datasets, input the source domain images and the target domain images into the multi-level distribution alignment domain adaptation model in the form of small batches, train the multi-level distribution alignment domain adaptation model, and obtain the trained style expansion module, feature extractor, domain discriminator and classifier;

[0022] Step 4: Use the trained feature extractor and classifier to build a defect detection model, input the image to be detected into the trained feature extractor to obtain a feature map, and output the prediction result after the feature map passes through the classifier;

[0023] At this point, cross-scenario strip steel surface defect detection based on domain adaptation is completed.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] 1. The multi-level distribution alignment domain adaptation model of the present invention includes four parts: a style expansion module and a feature extractor based on a deep convolutional neural network, a classifier and a domain discriminator based on a fully connected layer; the style change submodule of the style expansion model normalizes the style of the original source domain and target domain images, and generates source domain and target domain images that are completely different from the original source domain and target domain images through learnable style parameters. The styles of the source domain and target domain images generated by each style change submodule are consistent, so that the styles of the source domain and target domain images are close, and the pixel-level distribution alignment of the two domain images is achieved, and data enhancement is achieved, solving the problem of less training data. The source domain and target domain images are adversarially learned by the domain discriminator, and then the feature extractor is trained to achieve feature-level distribution alignment of the two domain images; the source domain and target domain images are both input into the classifier, and the classifier is trained. The classifier generates pseudo labels based on a voting mechanism to achieve category-level distribution alignment of the two domain images, improve the degree of data distribution alignment of the source domain and target domain, and improve the generalization performance of the defect detection model for cross-scenario strip surface defect detection. In addition, the target domain images are input into the classifier for training, which improves the accuracy of strip surface defect detection.

[0026] 2. The present invention applies the unsupervised domain adaptation method to cross-scenario strip surface defect detection, which not only improves the detection efficiency, but also alleviates the dependence of deep learning on labeled data. Under the premise of ensuring recognition accuracy and real-time performance, it does not require a large amount of labeled training data, reducing labor costs. The defect detection model has better generalization ability for target domain data, and its performance is far superior to defect detection methods based on traditional machine vision or deep learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of the present invention;

[0028] Figure 2 It is a structural schematic diagram of the multi-level distribution alignment domain adaptation model of the present invention;

[0029] Figure 3 It is a structural schematic diagram of the style expansion module of the present invention;

[0030] Figure 4 It is a structural schematic diagram of the style change submodule of the present invention;

[0031] Figure 5 This is a visualization result diagram of defect detection. DETAILED DESCRIPTION

[0032] The technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings and specific implementation methods, but this does not limit the protection scope of the present application.

[0033] The present invention is a cross-scenario strip steel surface defect detection method based on domain adaptation (hereinafter referred to as the method), and the specific steps are as follows:

[0034] Step 1, obtain source domain and target domain data sets; the source domain data set consists of source domain images, which are labeled and are generally defect images collected from different manufacturers or different production lines; the target domain data set consists of target domain images, which are images to be detected collected from the production line. The data structures of source domain images and target domain images are similar and are images with a common label space;

[0035] Step 2: Build a multi-level distribution alignment domain adaptation model to achieve pixel-level, feature-level, and category-level distribution alignment of source domain and target domain images through the multi-level distribution alignment domain adaptation model.

[0036] like Figure 2 As shown, the multi-level distribution alignment domain adaptation model includes four parts: style expansion module, feature extractor, domain discriminator and classifier; the style expansion module generates source domain images and target domain images that are completely different in style from the original source domain images and the original target domain images through trainable style parameters, so as to achieve pixel-level distribution alignment of the two domain images; the feature extractor is used to extract features of the source domain and target domain images; the domain discriminator assigns domain labels to the source domain images and the target domain images through adversarial learning on the source domain images and the target domain images, and then trains the feature extractor to achieve feature-level distribution alignment of the two domain images; the classifier is used to obtain classification results, and generate pseudo labels based on a voting mechanism to achieve category-level distribution alignment of the two domain images;

[0037] like Figure 3 As shown in , the style expansion module includes multiple style change sub-modules and a style fusion module, each of which includes a convolution layer, an instance normalization layer, an affine transformation and a deconvolution layer; Figure 3 As shown, given the original source domain image x s ∈X s and the original target domain image x t ∈X t , X s , X t denote the source domain dataset and the target domain dataset respectively. Each style change submodule performs style changes on the original source domain image and the original target source image respectively, and generates source domain images and target domain images with styles completely different from the original source domain and target domain images, so as to achieve pixel-level distribution alignment of the two domain images. For the i-th style change submodule gi First, the convolutional layer is used to extract the feature maps of the two domain images. and Then, the feature map is normalized by an instance normalization layer. and Perform instance normalization to obtain feature maps and The style parameters of the feature map, that is, the mean and variance of each channel, are used to normalize the styles of the two domain images with different styles, and the independence between channels is maintained to achieve the integration of global image information. The expression of instance normalization is:

[0038]

[0039] In the formula, μ i,c , Respectively represent the mean and variance of the feature map channel, H and W represent the height and width of the feature map, respectively. wh Represents the pixel value of the feature point (w,h);

[0040] Then, using the learnable style parameter θ i =(μ i ,σ i ) for the feature map and The style is affine transformed to generate new style feature maps and The expression of affine transformation is:

[0041]

[0042] In the formula, g i (·) represents the i-th style change submodule g i The affine transformation operation, f i,c Represents the i-th style change submodule g i The feature map on channel c extracted by the convolution layer, f i, ' c Represents the new style feature map on channel c;

[0043] Finally, the new style feature map and The deconvolution layers are used to generate source and target images that are completely different in style from the original source and target images, respectively, to achieve pixel-level style shift.

[0044] The style fusion module is used to perform weighted summation on the source domain images and target domain images generated by all style change submodules to obtain the source domain fusion image and the target domain fusion image; the expression of the weighted summation is:

[0045]

[0046] In the formula, ω i represents a learnable adaptive parameter whose initial value follows a normal distribution and takes a random value between (0,1); K represents the number of style change submodules, z i represents the output image of the i-th style change submodule, and z′ represents the fused image;

[0047] The original source domain and original target domain images, the generated source domain and target domain images, and the source domain and target domain fusion images are input into the feature extractor. After passing through the feature extractor, the feature map of each image is obtained; the feature extractor is based on the VGG-16 network, including five groups of convolution operations, each group of convolution operations includes two or three convolution layers, and each convolution layer is connected to a batch normalization layer and a pooling layer; after five groups of convolution operations, the feature map of 512 channels with 32 times downsampling is finally output; a multi-scale feature fusion strategy is adopted in the feature extraction process, that is, a branch consisting of a convolution layer and a pooling layer is added after the third and fourth groups of convolution operations, then the feature map of The feature extractor has three branches, and the feature map output by each branch is 4*4 in size; the feature maps output by the three branches are stretched into one-dimensional vectors and then spliced ​​together to form a 4*4*3 two-dimensional feature map, where 3 represents the channel. This two-dimensional feature map is the feature map extracted by the feature extractor; all convolution kernels of the VGG-16 network have a size of 3×3, a step size of 1, a pooling window size of 2*2, and a step size of 2; the convolution kernel size of the branch after the third group of convolution operations is 3*3, a step size of 2, a pooling window size of 2*2, and a step size of 2; the convolution kernel size of the branch after the fourth group of convolution operations is 3*3, a step size of 1, a pooling window size of 2*2, and a step size of 2.

[0048] The domain discriminator and the classifier have the same structure, both consisting of three fully connected layers. The first two fully connected layers use the ReLU activation function, and the last fully connected layer uses the softmax activation function. After the gradient of each feature map extracted by the feature extractor is reversed, it is input into the domain discriminator for adversarial learning, and a domain label is assigned to each feature map. The probability that the feature map is a source domain image and a target domain image is obtained, so that the feature level distribution of the two domain images is aligned.

[0049] At the same time, each feature map extracted by the feature extractor is input into the classifier. In order to ensure that target domain images of different styles have the same pseudo-label, the classifier votes for the defect category of each feature map based on the voting mechanism, obtains the probability that each feature map belongs to a different defect category, and generates a pseudo-label, and then performs supervised learning on the target domain dataset to achieve category-level distribution alignment of the two domain images; according to the different defect categories output by the classifier, the voting mechanism is divided into hard voting and soft voting. Hard voting means that the defect category output by the classifier is the category that appears most frequently in all voting results, and soft voting means that the voting results sum the probabilities of the same defect category according to the defect category, and the defect category with the largest probability is the defect category output by the classifier; since the source domain and target domain images generate source domain and target domain images of different styles through the style change submodule, in order to improve the stability of the pseudo-label, this method prefers the hard voting method; soft voting cannot be judged because the probabilities of the two defect categories are close.

[0050] Step 3: Adjust the source domain image and the target domain image to a size of 240*240 pixels. Input the source domain image and the target domain image into the multi-level distribution alignment domain adaptation model in small batches. Train the multi-level distribution alignment domain adaptation model and use the overall loss function minL cls +αL pseudo +βL adv Calculate model training loss; L cls represents the classification loss function, L pseudo represents the pseudo-label loss function, L adv represents the adversarial loss function, α and β are weight factors; the classification loss function is used to measure the difference between the classifier's prediction value and the class label for each image, and supervised training is performed on the multi-level distribution alignment domain adaptation model to achieve pixel set distribution alignment of the two domain images; the adversarial loss function is used to measure the difference between the domain prediction value and the domain label of the source domain and target domain images by the domain discriminator to achieve feature-level distribution alignment of the two domain images; the pseudo-label loss function is used to measure the difference between the classifier's prediction value and the pseudo-label for images of different styles to achieve category-level distribution alignment of the two domain images; the three loss functions all use the cross entropy loss function;

[0051] The relevant parameters in the training process are set as follows: the batch size is 32, and the training is repeated for 100 cycles. Each cycle includes 200 batches. 200 batches in each cycle refers to the total number of samples in the source domain dataset / the batch size is 32=200. The cycle corresponds to the cyclic training cycle set in the model training. The total number of training steps N is 100*200, and the learning rate is 0.0001. α and β are 0.4 and 0.6 respectively.

[0052] Step 4: Use the trained feature extractor and classifier to build a defect detection model. Input the image to be detected into the trained feature extractor. After the feature map obtained by the feature extractor passes through the classifier, the prediction result is output.

[0053] At this point, cross-scenario strip steel surface defect detection based on domain adaptation is completed.

[0054] Experimental verification

[0055] In order to verify the effectiveness of the method of the present invention, an experiment was designed to test it. The strip steel defect dataset (HSDD) of Handan Iron and Steel Group was used as the original dataset. The light brightness was adjusted by gamma correction method to generate three datasets with different light intensities: HSDD_N1, HSDD_N2 and HSDD_N3. The gamma parameters were 0.7, 1 and 1.5 respectively. The original dataset contained 1814 samples, including 6 defects: gradient, scratch, oil stain, edge, mesh and oil spot. The defect types and sample numbers of the three datasets are shown in Table 1.

[0056] Table 1 Defect type and sample size of each data set

[0057]

[0058] The cross-scenario strip steel surface defect detection of the present invention refers to a defect detection model trained in one production scenario, and is also applicable to other production scenarios. Therefore, this experiment sets up 6 migration tasks, namely HSDD_N1→HSDD_N2, HSDD_N1→HSDD_N3, HSDD_N2→HSDD_N1, HSDD_N2→HSDD_N3, HSDD_N3→HSDD_N1 and HSDD_N3→HSDD_N2; using the existing method for comparison, the experimental results shown in Table 2 are obtained;

[0059] Table 2 Experimental results on the HSDD dataset

[0060]

[0061] Note: P stands for precision, R stands for recall, and F stands for F1 measure;

[0062] In the table, RseNet50 represents the direct push method based on RseNet50, DAN represents the DAN method based on MK-MMD, JAN represents the JAN method based on JMMD, DANN represents the DANN method based on domain discriminator, ASAN represents the ASAN method based on statistics, GVB represents the GVB method based on bridge connection, and Ours represents the method of the present invention; From the above results, it can be seen that the average F1 measure of the method of the present invention is 98.8%, which is improved compared with the existing methods, indicating that the method of the present invention has good generalization and accuracy for cross-scenario strip surface defect detection. Figure 5 The DAN method only aligns the feature distribution of the two domain data at one feature layer, so its high response area is small and easily disturbed by background noise, and the background noise is mistakenly responded to as a defect. The JAN method aligns the feature distribution of the two domain data at multiple feature layers, reducing the interference of background texture, but it is easy to have high response areas in the defect boundary area, reducing the similarity between the high response area and the defect structure. The DANN method uses a generative adversarial network to align the features of the two domains, and the high response area is more concentrated in the defect area, further reducing the interference of background noise. The ASAN method improves the response to the defect area and reduces the interference of background noise. The GVB method uses bridge connections to reduce the influence of domain-private features on domain-invariant features. The high response area is similar to the defect structure, but there is still interference from background noise. Finally, for different defects, the high response area of ​​the method of the present invention is concentrated in the defect area, the structure of the defect area is obvious, and the response of the background noise is low, which effectively avoids the interference of background noise. The existing domain adaptation method has a low response to the defect area and is easily disturbed by background texture, which further shows that the method of the present invention has good generalization performance for cross-scenario strip defect detection.

[0063] Any matters not described in the present invention are applicable to the prior art.

Claims

1. A cross-scenario strip steel surface defect detection method based on domain adaptation, characterized in that: The method comprises the following steps: Step 1: Obtain source domain and target domain data sets; the source domain data set consists of source domain images, which are defect images with labels; the target domain data set consists of target domain images, which are images to be detected; Step 2: construct a multi-level distribution alignment domain adaptation model, which includes a style expansion module, a feature extractor, a domain discriminator, and a classifier; The style expansion module includes multiple style change submodules and a style fusion module, each of which includes a convolution layer, an instance normalization layer, an affine transformation and a deconvolution layer. Given an original source domain image x s and the original target domain image x t , each style change submodule performs style changes on the original source domain image and the original target source image respectively, generates source domain images and target domain images with styles completely different from the original source domain images and target domain images, and realizes pixel-level distribution alignment of the two domain images; for the i-th style change submodule, firstly, the convolutional layer is used to extract the feature map f of the two domain images i s and f i t ; Then, the feature map f is normalized by the instance normalization layer i s and f i t Perform instance normalization to obtain the feature map f i s and f i t The style parameter of the instance normalization is: In the formula, μ i,c , Respectively represent the mean and variance of the feature map channel, H and W represent the height and width of the feature map, respectively. wh Represents the pixel value of the feature point (w,h); Then, using the learnable style parameter θ i =(μ i ,σ i ) for the feature map f i s and f i t The style is affine transformed to generate new style feature maps f i s' and f i t' ; The expression of affine transformation is: In the formula, g i (·) represents the i-th style change submodule g i The affine transformation operation, f i,c Represents the i-th style change submodule g i The feature map on channel c extracted by the convolutional layer, f′ i,c Represents the new style feature map on channel c; Finally, the new style feature map f i s' and f i t' The deconvolution layers are used to generate source and target images that are completely different in style from the original source and target images, respectively, to achieve pixel-level style shift. The style fusion module is used to perform weighted summation on the source domain images and target domain images generated by all style change submodules to obtain the source domain fusion image and the target domain fusion image; the expression of the weighted summation is: In the formula, ω i represents a learnable adaptive parameter whose initial value follows a normal distribution and takes a random value between (0,1); K represents the number of style change submodules, z i represents the output image of the i-th style change submodule, and z′ represents the fused image; The original source domain and the original target domain images, the generated source domain and target domain images, and the source domain and target domain fusion images are input into the feature extractor. After passing through the feature extractor, the feature maps of each image are obtained. After gradient inversion, each feature map extracted by the feature extractor is input into the domain discriminator for adversarial learning, and a domain label is assigned to each feature map to achieve feature-level distribution alignment of the two domain images. At the same time, each feature map extracted by the feature extractor is input into the classifier. The classifier votes for the defect category of each feature map based on the hard voting method, obtains the probability that each feature map belongs to a different defect category, and generates pseudo labels to achieve category-level distribution alignment of the two domain images; hard voting means that the defect category output by the classifier is the category that appears most frequently in all voting results; Step 3: adjust the size of the images in the source domain and target domain datasets, input the source domain images and the target domain images into the multi-level distribution alignment domain adaptation model in the form of small batches, train the multi-level distribution alignment domain adaptation model, and obtain the trained style expansion module, feature extractor, domain discriminator and classifier; Step 4: Use the trained feature extractor and classifier to build a defect detection model, input the image to be detected into the trained feature extractor to obtain a feature map, and output the prediction result after the feature map passes through the classifier; At this point, cross-scenario strip steel surface defect detection based on domain adaptation is completed.

2. The cross-scenario strip steel surface defect detection method based on domain adaptation according to claim 1 is characterized in that: The feature extractor is based on the VGG-16 network, including five groups of convolution operations, each group of convolution operations includes two or three convolution layers, and each convolution layer is connected to a batch normalization layer and a pooling layer; after five groups of convolution operations, a feature map of 512 channels with 32 times downsampling is finally output; after the third and fourth groups of convolution operations, a branch consisting of a convolution layer and a pooling layer is added respectively, then the feature extractor has a total of three branches, and the size of the feature map output by each branch is 4*4; the feature maps output by the three branches are stretched into one-dimensional vectors, and then spliced ​​together to form a 4*4*3 two-dimensional feature map, that is, the feature map extracted by the feature extractor.

3. The cross-scenario strip steel surface defect detection method based on domain adaptation according to claim 2 is characterized in that: All convolution kernel sizes of the VGG-16 network are 3×3, with a stride of 1, and the pooling window size is 2*2 with a stride of 2; the convolution kernel size of the branch after the third group of convolution operations is 3*3, with a stride of 2, and the pooling window size is 2*2 with a stride of 2; the convolution kernel size of the branch after the fourth group of convolution operations is 3*3, with a stride of 1, and the pooling window size is 2*2 with a stride of 2.

4. The cross-scenario strip steel surface defect detection method based on domain adaptation according to any one of claims 1 to 3, characterized in that: The domain discriminator and the classifier have the same structure, both consisting of three fully connected layers, the first two fully connected layers use the ReLU activation function, and the last fully connected layer uses the softmax activation function.