A strip surface defect detection method and system based on adversarial learning network
Through the feature extraction module and extended convolutional layer of the adversarial learning network, combined with the comprehensive loss measurement, the efficiency and accuracy problems in strip surface defect detection are solved, and efficient and accurate defect detection is achieved.
Patent Information
- Application Number
- CN202210885378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-07-26
AI Technical Summary
The existing strip surface defect detection methods are inefficient and low in accuracy, making them difficult to meet the needs of modern industries. The existing deep learning methods lack generalization capabilities in steel surface defect detection, and they cannot accurately separate subtle defects and backgrounds, and the detection results are not accurate enough.
Using an adversarial learning network detection method, two feature extraction modules and extended convolutional layers with different expansion factors are used, combined with comprehensive loss metrics, the identification accuracy of defect areas is improved, and the finer-grained edge information segmentation is achieved.
It realizes efficient and accurate detection of strip surface defects, overcomes the problems of low detection efficiency, low accuracy and insufficient generalization capabilities of existing methods, and meets the real-time and efficient detection needs.
Smart Images

Figure CN115272225B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of strip steel surface detection, and in particular relates to a strip steel surface defect detection method and system based on an adversarial learning network. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Due to the influence of rolling processes and equipment, surface defects (such as cracks, scratches, pitting, plaques, flaws, and inclusions) on strip steel severely impact its performance, reducing the fatigue strength and corrosion stability of the final product. Traditional manual inspection methods, which assess the overall quality of strip steel surfaces based on individual prior knowledge, are inefficient, susceptible to subjective factors, and cannot meet the demands of modern industrial production.
[0004] With the demand for high-quality inspection, computer vision-based inspection methods have gradually become mainstream, replacing traditional manual inspection methods, which are characterized by low efficiency, low precision, and high labor intensity. Furthermore, due to the diversity of product surface features, designing an efficient, universal, and accurate defect detection method remains a pressing issue. By integrating many advanced technologies such as image processing, artificial intelligence, and pattern recognition, computer vision-based inspection methods have been successfully applied to defect detection on various material surfaces, achieving high accuracy and reliability. While these methods achieve excellent inspection results, their performance relies heavily on the operator's subjective experience and lacks universality.
[0005] In recent years, deep learning methods have been widely used in image segmentation, recognition, and target detection. Compared with computer vision-based image processing tasks, deep learning methods can automatically extract effective features from input samples without the need to manually design complex image features. Although many defect detection methods based on image recognition networks have achieved high detection accuracy, their detection results are only the bounding boxes where the defects are located, which cannot meet the requirements of high-precision industrial manufacturing. However, defect detection methods based on segmentation networks have attracted widespread attention due to their ability to obtain defect areas. At present, classic convolutional neural networks have become a powerful tool for various computer vision-based detection tasks. Therefore, some works have attempted to utilize carefully designed deep learning techniques for defect detection, but these methods also need to face the following huge challenges: 1) The appearance of steel surface defects is random, so it is difficult to obtain high-resolution defect images of various types in industrial scenarios; in addition, there are large differences in size and shape between defects within a class, which is not conducive to accurate labeling; therefore, with limited samples and inaccurate labels, the detection network cannot achieve good generalization ability; 2) When the grayscale difference between the surface defect of the material and its background is very small, the salient area can easily be submerged in the background; in addition, scattered defects are difficult to separate accurately; 3) Most existing deep learning methods are typically used for defect detection of specific materials, which means that the generalization ability is limited and it is difficult to extend it to other material surfaces. Summary of the Invention
[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a strip surface defect detection method and system based on an adversarial learning network, which utilizes two feature extraction modules and extended convolution layers with different expansion factors to improve the recognition of defect areas, and adopts a comprehensive loss metric to help the deep adversarial network infer finer-grained edge information, thereby achieving accurate segmentation of strip surface defects.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A first aspect of the present invention provides a method for detecting surface defects of steel strips based on an adversarial learning network, comprising:
[0009] Acquire an image of the steel strip to be inspected;
[0010] After the strip steel image to be inspected is binarized, it is input into the trained defect detection network model to perform defect area detection;
[0011] Among them, the defect detection network model includes a segmentation network and a discriminator network; the discriminator network constrains the segmentation network through a comprehensive loss function; the dilated convolution module of the segmentation network includes several dilated convolution layers connected in sequence, and different dilated convolution layers use different dilation factors.
[0012] Furthermore, when the defect detection network model is trained, the segmentation network is used to extract the defect area of the strip image after binarization processing; the defect area output by the segmentation network is input into the discriminator network together with the real defect area of the strip image to calculate the comprehensive loss function to constrain the segmentation network.
[0013] Furthermore, the method for obtaining the training set used in the defect detection network model training is:
[0014] Collect several images of steel strips with surface defects;
[0015] After the strip steel images are binarized and defect areas are marked, the initial training set is obtained;
[0016] The strip steel images in the initial training set are resized, rotated and expanded to obtain the training set for defect detection network model training.
[0017] Furthermore, the segmentation network also includes several convolutional layers, several deconvolutional layers and several feature extraction modules, and the convolutional layer in the encoding stage is also jump-connected to the deconvolutional layer in the decoding stage.
[0018] Furthermore, the feature extraction module uses filters with different convolution kernel sizes to perform parallel conversion operations on the input features to obtain features with different receptive fields; and after fusing the features with different receptive fields, convolution is performed, and the convolution results are fused with the input features to obtain an output feature map.
[0019] Furthermore, the comprehensive loss function is a weighted sum of adversarial loss, mean square error loss, feature matching loss and edge constraint loss.
[0020] Furthermore, the discriminator network includes several sequentially connected convolutional layers and a fully connected layer, and each convolutional layer is connected to a batch normalization layer and a rectified linear unit.
[0021] A second aspect of the present invention provides a strip surface defect detection system based on an adversarial learning network, comprising:
[0022] An image acquisition module is configured to: acquire an image of the steel strip to be inspected;
[0023] The defect detection module is configured to: perform binarization processing on the strip steel image to be inspected, input the trained defect detection network model, and perform defect area detection;
[0024] Among them, the defect detection network model includes a segmentation network and a discriminator network; the discriminator network constrains the segmentation network through a comprehensive loss function; the dilated convolution module of the segmentation network includes several dilated convolution layers connected in sequence, and different dilated convolution layers use different dilation factors.
[0025] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for detecting surface defects of strip steel based on an adversarial learning network.
[0026] The fourth aspect of the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for detecting surface defects of strip steel based on an adversarial learning network as described above are implemented.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The present invention provides a strip surface defect detection method based on an adversarial learning network, which utilizes two feature extraction modules and extended convolution layers with different expansion factors to improve the recognition of defect areas. It also designs a comprehensive loss metric to help the deep adversarial network infer finer-grained edge information, thereby achieving accurate segmentation. It overcomes the problems of low detection efficiency, few detection categories, low detection accuracy, and unfriendlyness to large intra-class defect differences in existing detection methods, and meets the needs of real-time and efficient strip surface defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0030] Figure 1 This is a flow chart of a strip steel surface defect detection method based on an adversarial learning network according to a first embodiment of the present invention;
[0031] Figure 2 This is a structural framework diagram of a defect detection network model according to the first embodiment of the present invention;
[0032] Figure 3 1 is a schematic diagram of a sample of a steel strip dataset according to the first embodiment of the present invention;
[0033] Figure 4 1 is a diagram showing the structure of a segmentation network and a structure of an extended convolution module according to the first embodiment of the present invention;
[0034] Figure 5 This is a structural diagram of a feature extraction module according to the first embodiment of the present invention;
[0035] Figure 6 This is a diagram of the discriminator network structure of Example 1 of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0037] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0038] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0039] Example 1
[0040] This embodiment provides a strip surface defect detection method based on an adversarial learning network. Figure 1 As shown, the following steps are included:
[0041] In step S1, a large number of strip steel images (original images) with complex surface defect morphologies are binarized and defect regions are marked to obtain an initial training set.
[0042] Among them, there are 6 types of surface defects in strip steel: cracks, scratches, pitting, plaques, defects and inclusions.
[0043] like Figure 2 As shown, before the strip image is binarized, two rotation operations can be performed on the image, one is +90 degrees and the other is -90 degrees, namely T R ={T0,T1}, where T R Represents the rotation transformation matrix, T0 represents a rotation of +90 degrees, and T1 represents a rotation of -90 degrees.
[0044] Among them, the Otsu segmentation algorithm is used for the binary processing of the strip image. Specifically, in order to achieve fine-grained segmentation and precise positioning of strip surface defects, image preprocessing is a key step to further improve the quality of strip surface defect images. Therefore, by decomposing the two-dimensional histogram of the Otsu segmentation algorithm and introducing weighting factors, the segmentation between the background and the significant feature area is achieved, such as Figure 3As shown. Given an image of size M×N, its grayscale range is [0, l]. The pixel grayscale value and the pixel neighborhood grayscale value form a two-dimensional grayscale histogram, represented as (i, j). Taking (s, t) as the threshold, the grayscale difference between the background and the salient feature area is constructed. That is, in the Otsu segmentation algorithm, the inter-class variance corresponding to the threshold (s, t) is expressed as:
[0045]
[0046] Among them, μ b 、μ o and μ w are the grayscale vectors of the background, target area (salient feature area) and the entire image, respectively. δ(s) and δ(t) are the mean square errors of the pixel grayscale value and the pixel neighborhood grayscale value, respectively.
[0047] In order to avoid searching for the threshold in a large two-dimensional space, the two-dimensional Otsu segmentation algorithm histogram is decomposed, and the threshold is solved on the image pixel grayscale histogram and the pixel neighborhood grayscale histogram respectively. Finally, the obtained threshold (s', t') is used as the optimal segmentation threshold of the Otsu segmentation algorithm. The inter-class variance corresponding to the optimal segmentation threshold is expressed as:
[0048]
[0049] The decomposition of the two-dimensional Otsu segmentation algorithm is completed, thereby achieving a complete separation of s and t. Finally, the threshold vector (s', t') is obtained by maximizing the between-class variance of the two one-dimensional histograms.
[0050] For each strip surface defect image, determine the grayscale average value of the image and the maximum pixel brightness frequency f, but using only the difference between them to balance the deviation is unstable. Therefore, in order to improve the influence of edges and noise that are ignored in the decomposition process, a weighting factor λ is added to the solution of the pixel neighborhood grayscale segmentation threshold to calculate the optimal threshold. That is, after selecting the threshold (s', t') by maximizing the inter-class variance, let s = s', t = t', and then calculate the optimal threshold of the Otsu segmentation algorithm by the following formula:
[0051]
[0052] Step S2: After resizing, rotating and expanding the strip steel images in the initial training set, a training set for training the defect detection network model is obtained.
[0053] Specifically, the cvResize function is used to uniformly resize the strip surface defect images in the initial training set to 256×256; each strip surface image with defects is rotated +90° and -90°, and the pix2pix network is used to generate an expanded strip image dataset to obtain the training set.
[0054] Step S3: Building an intelligent detection network model (defect detection network model) suitable for complex steel surface image defect area segmentation. Figure 2 As shown in Figure 1, the model mainly includes: a segmentation network that integrates a feature extraction module and extended convolutional layers with different expansion factors, a discriminator network, and a comprehensive loss measurement function.
[0055] The segmentation network consists of a feature extraction module and a dilated convolution module. These two functional modules are cascaded together to intelligently extract defect regions (defect regions in the binary strip image). During model training, these regions are input into the discriminator network along with the ground truth (the actual defect regions in the manually annotated strip image) for discrimination. A comprehensive loss function is used to constrain the segmentation network in real time during network training. The segmentation network adopts an encoder-decoder architecture, consisting of several standard convolutional layers, two feature extraction modules, and a dilated convolution module. The segmentation network consists of multiple layers, in which a set of filters is convolved with the input image to obtain feature information about defect regions on the strip surface. After each convolutional layer, except for the last one, a rectified linear unit function and a batch normalization layer are added, and the output layer contains a convolutional layer with a sigmoid function to normalize the output to the range [0, 1]. Unlike other convolutional networks that reduce image resolution through pooling operations, the proposed segmentation network uses two stepped (1 / 2) deconvolution operations to reduce the resolution by a factor of two, thus extracting defect features with precise boundaries on the strip surface. In addition, for the possible loss of structural information due to the lack of pooling layers, the low-level features are transferred to the decoding stage by using skip connections to enhance the structural information. Figure 4As shown in Figure 1, the segmentation network includes an expanded convolution module, several convolution layers, several deconvolution layers and several feature extraction modules, and the convolution layer in the encoding stage is also jump-connected to the deconvolution layer in the decoding stage. Specifically, the segmentation network includes the first convolution layer (64@256×256, where @ represents the number of channels and @ represents the size of the image), the second convolution layer (128@128×128), the third convolution layer (128@128×128), the fourth convolution layer (256@64×64), the fifth convolution layer (256@64×64), the first feature extraction module (256@64×64), the expanded convolution module, the second feature extraction module (256@64×64), the sixth convolution layer (256@64× 64), the first deconvolution layer (128@128×128), the seventh convolution layer (128@128×128), the second deconvolution layer (64@256×256), the eighth convolution layer (32@256×256) and the ninth convolution layer (3@256×256); the first convolution layer is also connected to the second deconvolution layer; the third convolution layer is also connected to the first deconvolution layer; the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer, the fifth convolution layer, the first feature extraction module, the second feature extraction module, the sixth convolution layer, the first deconvolution layer, the seventh convolution layer, the second deconvolution layer and the eighth convolution layer are all connected to a rectified linear unit and a batch normalization layer; the ninth convolution layer (output layer) is connected to a sigmoid function.
[0056] The feature extraction module extracts richer image features by using different convolution kernels. Specifically: First, the input feature map is transformed in parallel using filters with convolution kernel sizes of 1×1 and 3×3 to extract various abstract features of all receptive fields and obtain features of different receptive fields. Then, the features of different receptive fields are fused, and the fused (concatenation) feature map is convolved again. The convolution result is fused with the multi-scale result (input feature) to achieve residual connection, thereby preventing network degradation and obtaining the final output feature map after dimensionality reduction. Features of different levels are fused and spliced in the channel direction, so that the feature extraction module can capture more effective feature information, such as Figure 5 shown.
[0057] The extended convolution module, in addition to using standard convolution layers in the segmentation network, also utilizes the extended convolution module in the intermediate layer to ensure that the segmentation network can obtain more fine-grained features. Unlike skip connections, the extended convolution module connects the front-end feature map to the back-end layer in the channel direction. In addition, the extended convolution module captures various abstract features and expands the receptive field to achieve effective feature representation. In order to obtain more accurate feature information of the defect area without increasing the computational burden, different expansion factors (γ = 2, 4, 8, 16) are set to obtain a receptive field with a suitable scale. In addition, this connection allows each feature map to undergo four conversion operations under different expansion factors, thereby capturing a variety of fine features. The feature map of each convolution layer is integrated into the output of the last extended convolution operation so that the segmentation network can more effectively capture fine-grained defect features. As Figure 4 As shown in the figure, the dilated convolution module includes several sequentially connected dilated convolution layers, and different dilated convolution layers use different dilation factors. Specifically, the dilated convolution module includes a first dilated convolution layer, a second dilated convolution layer, a third dilated convolution layer, a fourth dilated convolution layer, and a fifth dilated convolution layer. The output of the first dilated convolution layer is input to the second dilated convolution layer, the third dilated convolution layer, the fourth dilated convolution layer, and the fifth dilated convolution layer respectively. The output of the second dilated convolution layer is input to the third dilated convolution layer, the fourth dilated convolution layer, and the fifth dilated convolution layer respectively. The output of the third dilated convolution layer and the fourth dilated convolution layer are both input to the fifth dilated convolution layer. The dilation factors γ of the first dilated convolution layer, the second dilated convolution layer, the third dilated convolution layer, the fourth dilated convolution layer, and the fifth dilated convolution layer are 1, 2, 4, 8, and 16, respectively.
[0058] To further understand the dilated convolution module, given the i-th channel input h of the dilated convolution layer i ×w i Image, the next layer is h of the i+1th channel input i +1×w i +1 image. For the input feature map f, the dilated convolution operators of the first dilated convolution layer, the second dilated convolution layer, the third dilated convolution layer, the fourth dilated convolution layer, and the fifth dilated convolution layer can be written as:
[0059]
[0060] Among them, x γi,γj Represents the input of the extended convolution layer, R represents the ReLU nonlinear function; kw and kh represent the width and height of the convolution kernel respectively; b represents the bias vector; f represents the kernel matrix between convolution layers.
[0061] Discriminator network, since the task of identifying two surface defect images is easier than segmenting images through a convolutional network model, the structure of the discriminator network is not as complicated as the segmentation network. The discriminator network includes several convolutional layers and a fully connected layer connected in sequence, and each convolutional layer is connected with a batch normalization layer and a rectified linear unit. Specifically, the discriminator network has seven layers, the first six unit blocks are convolutional layers, followed by batch normalization layers and rectified linear unit functions. In the sixth layer, the conversion filter with a size of 5×5 and the stride of the convolution layer are set to 2. The output result of the sixth layer is fed back to the fully connected layer with a sigmoid transfer layer to generate a scalar, which is used to estimate the probability that the input defect binary image is a binary image of the segmented defect image rather than a true value, such as Figure 6 Given a defect image x (original image) and its target image z (manually annotated real defect image), the objective function formula of adversarial learning is as follows:
[0062]
[0063] Among them, P data is the distribution of true values, is the expected operation, S is the segmentation network, and D is the discriminator.
[0064] The comprehensive loss function is used to assist the network training process to obtain more edge information by combining adversarial loss Mean squared error loss Feature matching loss and edge-constrained loss Construct the overall goal, which is the weighted sum of the comprehensive loss function adversarial loss, mean square error loss, feature matching loss and edge constraint loss:
[0065]
[0066] Among them, λ is the corresponding balance coefficient.
[0067] Mean Squared Error Loss,To improve training stability, the mean squared error (MSE) loss is used,taking into account the segmentation region mask.,MSE objectively quantifies the difference between the segmentation defect,image and its corresponding binary image at the pixel level to,evaluate the overall content consistency.
[0068]
[0069] Among them, S(x) is the segmented image, Z is the true value, and F represents the norm.
[0070] The feature matching loss further optimizes the adversarial loss function by introducing a feature matching loss based on a discriminator network. This feature matching loss uses a dynamically weighted discriminator network to extract features, so that the generated features and the target features form an adversarial pattern in the hidden layer of the discriminator network. Because the discriminator network cannot accurately distinguish true from false results based on high-dimensional abstract features, the standard deviation of the segmented defect image and its corresponding binary strip image is added to fine-tune the objective function. The feature matching loss for the defect area is recalculated as follows:
[0071]
[0072] Where T is the total number of convolutional layers in the discriminator network, m i is the number of elements in the i-th layer, and The output vectors representing the real image and the generated image are in D i The standard deviation on .
[0073] Edge Constraint Loss,Some research works have shown that image edge information can provide useful constraints to guide the extraction of salient features for segmentation.,Therefore, in order to explicitly model the salient edge features of the defect area on the strip surface, an additional edge constraint is added to monitor the salient edge features.,Specifically, the defect edge map S obtained by measuring the segmentation network, edge and the corresponding binary image B edge The difference between , and construct the constraint function based on the cross entropy loss:
[0074]
[0075] Among them, w represents the width of the image and h represents the height of the image.
[0076] Step S4, pre-training the constructed intelligent defect detection network using a strip surface defect detection dataset to obtain a pre-trained optimal defect detection model;
[0077] In step S5, the pre-trained optimal network model is used to mark the defect areas of the strip surface defect data, and the complex morphology of the defect areas is accurately output.
[0078] Specifically, the strip steel image to be inspected is obtained, binarized, and then input into the segmentation network in the trained defect detection network model to perform defect area detection, thereby obtaining a strip steel image with the defect area marked.
[0079] For the input strip surface defect image, the model first extracts the image features to obtain the location information of the defect area, and then further accurately locates the possible defect location to detect the accurate shape of the input sample data.
[0080] In the embodiment of the present invention, the obtained test set is used to perform network performance analysis, and the segmentation accuracy of the method of the present invention is compared with that of the existing generative adversarial method. The results show that the present invention has higher accuracy.
[0081] The present invention utilizes two feature extraction modules and extended convolution layers with different expansion factors to improve the recognition of defect areas; it also designs a comprehensive loss metric to help the deep adversarial network infer finer-grained edge information, thereby achieving accurate segmentation; it overcomes the problems of low detection efficiency, few detection categories, low detection accuracy, and unfriendlyness to large intra-class defect differences in existing detection methods, and realizes a strip surface defect detection method with high detection efficiency, high accuracy, and strong versatility, meeting the needs of real-time and efficient strip surface defect detection.
[0082] This example qualitatively and quantitatively evaluates the method of the present invention and compares it with the most advanced deep learning-based methods. Experimental results on three surface defect databases show that the proposed defect detection network has effective detection performance and good task generalization ability.
[0083] Example 2
[0084] This embodiment provides a strip surface defect detection system based on an adversarial learning network, which specifically includes the following modules:
[0085] An image acquisition module is configured to: acquire an image of the steel strip to be inspected;
[0086] The defect detection module is configured to: perform binarization processing on the strip steel image to be inspected, input the trained defect detection network model, and perform defect area detection;
[0087] Among them, the defect detection network model includes a segmentation network and a discriminator network; the discriminator network constrains the segmentation network through a comprehensive loss function; the dilated convolution module of the segmentation network includes several dilated convolution layers connected in sequence, and different dilated convolution layers use different dilation factors.
[0088] Among them, when the defect detection network model is trained, the segmentation network is used to extract the defect area of the strip image after binarization processing; the defect area output by the segmentation network and the real defect area of the strip image are input into the discriminator network together to calculate the comprehensive loss function to constrain the segmentation network.
[0089] Among them, the method for obtaining the training set used in defect detection network model training is:
[0090] Collect several images of steel strips with surface defects;
[0091] After the strip steel images are binarized and defect areas are marked, the initial training set is obtained;
[0092] The strip steel images in the initial training set are resized, rotated and expanded to obtain the training set for defect detection network model training.
[0093] Among them, the segmentation network also includes several convolutional layers, several deconvolutional layers and several feature extraction modules, and the convolutional layer in the encoding stage is also jump-connected to the deconvolutional layer in the decoding stage.
[0094] Among them, the feature extraction module uses filters with different convolution kernel sizes to perform parallel conversion operations on the input features to obtain features with different receptive fields; and after fusing the features with different receptive fields, convolution is performed, and the convolution results are fused with the input features to obtain the output feature map.
[0095] Among them, the comprehensive loss function is the weighted sum of adversarial loss, mean square error loss, feature matching loss and edge constraint loss.
[0096] Specifically, the discriminator network consists of several sequentially connected convolutional layers and a fully connected layer, and each convolutional layer is connected to a batch normalization layer and a rectified linear unit.
[0097] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation processes are the same, which will not be repeated here.
[0098] Example 3
[0099] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the strip surface defect detection method based on an adversarial learning network as described in the first embodiment above are implemented.
[0100] Example 4
[0101] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of a strip surface defect detection method based on an adversarial learning network as described in the first embodiment above are implemented.
[0102] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0106] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0107] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A strip surface defect detection method based on adversarial learning network, characterized in that: include: Acquire an image of the steel strip to be inspected; After the strip steel image to be inspected is binarized, it is input into the trained defect detection network model to perform defect area detection; The defect detection network model includes a segmentation network and a discriminator network; the discriminator network constrains the segmentation network through a comprehensive loss function; the dilated convolution module of the segmentation network includes several sequentially connected dilated convolution layers, and different dilated convolution layers use different dilation factors; The comprehensive loss function is a weighted sum of adversarial loss, mean square error loss, feature matching loss and edge constraint loss; the difference between the defect edge map obtained by the segmentation network and the corresponding binary image is measured, and the edge constraint loss is constructed based on the cross entropy loss.
2. The method for detecting surface defects of steel strips based on an adversarial learning network according to claim 1, wherein: When the defect detection network model is trained, the segmentation network is used to extract the defect area of the strip image after binarization processing; the defect area output by the segmentation network is input into the discriminator network together with the real defect area of the strip image to calculate the comprehensive loss function to constrain the segmentation network.
3. The method for detecting surface defects of steel strips based on an adversarial learning network according to claim 1, wherein: The method for obtaining the training set used in the defect detection network model training is: Collect several images of steel strips with surface defects; After the strip steel images are binarized and defect areas are marked, the initial training set is obtained; The strip steel images in the initial training set are resized, rotated and expanded to obtain the training set for defect detection network model training.
4. The method for detecting surface defects of steel strips based on an adversarial learning network according to claim 1, wherein: The segmentation network also includes several convolutional layers, several deconvolutional layers and several feature extraction modules, and the convolutional layer in the encoding stage is also jump-connected to the deconvolutional layer in the decoding stage.
5. The method for detecting surface defects of steel strips based on an adversarial learning network according to claim 4, wherein: The feature extraction module uses filters with different convolution kernel sizes to perform parallel conversion operations on input features to obtain features with different receptive fields; and after fusing the features with different receptive fields, convolution is performed, and the convolution results are fused with the input features to obtain an output feature map.
6. The method for detecting surface defects of steel strips based on adversarial learning networks according to claim 1, wherein: The discriminator network includes several sequentially connected convolutional layers and a fully connected layer, and each convolutional layer is connected to a batch normalization layer and a rectified linear unit.
7. A strip steel surface defect detection system based on adversarial learning network, characterized in that: include: An image acquisition module is configured to: acquire an image of the steel strip to be inspected; The defect detection module is configured to: perform binarization processing on the strip steel image to be inspected, input the trained defect detection network model, and perform defect area detection; The defect detection network model includes a segmentation network and a discriminator network; the discriminator network constrains the segmentation network through a comprehensive loss function; the dilated convolution module of the segmentation network includes several sequentially connected dilated convolution layers, and different dilated convolution layers use different dilation factors; The comprehensive loss function is a weighted sum of adversarial loss, mean square error loss, feature matching loss and edge constraint loss; the difference between the defect edge map obtained by the segmentation network and the corresponding binary image is measured, and the edge constraint loss is constructed based on the cross entropy loss.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of a strip surface defect detection method based on an adversarial learning network as described in any one of claims 1 to 6 are implemented.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the strip surface defect detection method based on the adversarial learning network as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Image Semantic Segmentation Method Based on Deep Full Convolutional Network and Conditional Random Field
AU2020103901A4
Industrial equipment surface crack detection method and system based on semi-supervised semantic segmentation
CN113436169A