Steel surface defect detection method, electronic device, and storage medium
By introducing the SE module, the upsampling and feature fusion process of steel surface defect detection models is simplified, and the problem of low detection efficiency in the prior art is solved, and efficient and accurate defect detection is achieved.
Patent Information
- Application Number
- CN202210092453.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-01-26
AI Technical Summary
In the prior art, the surface defect detection efficiency of steel is low, the traditional detection algorithm such as CenterNet model has complex structure, and the number of parameters and calculations is large, making it difficult to meet the needs of real-time and reliability.
A steel surface defect detection method is proposed. By introducing the SE module, the number of upsampling operations and feature fusion is reduced, the network structure is simplified, and the number of parameters and calculations is reduced. The method includes inputting the image to be detected to the defect detection model, performing downsampling and convolution operations, using the SE module to perform feature fusion until the same number of upsampling as the downsampling is completed, and finally outputting the fusion feature map to predict defect information.
While maintaining a high detection accuracy, it significantly improves the defect detection efficiency, reduces the calculation amount and parameter amount, and simplifies the network structure.
Smart Images

Figure CN114463300B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of steel structure manufacturing, and in particular to a steel surface defect detection method, electronic equipment, and storage medium. Background Art
[0002] Steel production is widely used in manufacturing, construction, aviation and other industries, and is an important part of the national economy. In the actual production process, defects are inevitably generated due to factors such as processing equipment and production environment. Traditional surface defect detection methods include human eye screening and models based on traditional detection algorithms. Among them, the human eye screening method is not only highly subjective, but also difficult to work for a long time, and it is difficult to meet the real-time and reliability requirements of the production line. Most of the current traditional detection algorithms use the CenterNet model, and the CenterNet model has a complex structure, a large number of parameters and a large amount of calculation, resulting in low defect detection efficiency. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a steel surface defect detection method, electronic device, and storage medium, which can improve the defect detection efficiency.
[0004] The first aspect of the present application provides a method for detecting surface defects of steel, the method comprising:
[0005] The image to be detected is input into the defect detection model, which is used to:
[0006] Acquire a plurality of first down-sampled feature maps of different scales corresponding to the image to be detected;
[0007] Processing the plurality of first down-sampled feature maps through a convolutional layer to obtain a plurality of second down-sampled feature maps having a uniform number of channels;
[0008] Using the second downsampled feature map of the smallest scale as the feature map to be sampled;
[0009] Execute a loop process on the feature map to be sampled until a preset condition is met to obtain a fused feature map;
[0010] Predicting defect information of the fused feature map obtained at the end of the cycle process;
[0011] The cycle process includes:
[0012] Upsampling the feature map to be sampled to obtain an upsampled feature map;
[0013] Performing feature fusion on the up-sampled feature map and the second down-sampled feature map of the same scale through the SE module to obtain the fused feature map;
[0014] Compare the current upsampling times with the target upsampling times;
[0015] Using the fused feature map as the new feature map to be sampled;
[0016] Wherein, the preset condition is that the upsampling times are the same as the target upsampling times.
[0017] The first aspect of the present application provides a steel surface defect detection method, which has at least the following beneficial effects: after downsampling the image to be detected, the present application performs a convolution operation on the extracted first downsampling feature map to obtain a second downsampling feature map with a uniform number of channels, and performs upsampling based on the second downsampling feature map with the minimum multiple, and after upsampling, the SE module is used to fuse the second downsampling feature map of the same scale to obtain a new feature map for upsampling, and so on until the upsampling is completed the same number of times as the downsampling, and finally outputs the fused feature map, so that the defect information can be predicted according to the fused feature map finally output; compared with the prior art, Center Net model is equipped with two Hourglass network blocks. Each Hourglass network block downsamples the input feature map multiple times and then upsamples it. After each upsampling is completed, the current upsampled feature map is fused with the downsampled feature map of the same scale to obtain the next upsampled feature map. The output of one Hourglass network block is the input of another Hourglass network block. This method is computationally intensive and complex. The SE module is introduced in this application to greatly reduce the number of upsampling, downsampling and fusion times, thereby reducing the number of parameters and calculations while ensuring the prediction accuracy, thereby improving the efficiency of defect detection.
[0018] According to some embodiments of the first aspect of the present application, the predicting the final defect information of the fused feature map includes:
[0019] Compare the response point value of each response point in the fusion feature map with the response point values of its eight adjacent response points, and select a number of peak points according to the comparison results;
[0020] The response point value of each peak point is compared with a preset threshold value, and the peak point whose response point value is greater than the preset threshold value is determined as the key point of the fusion feature map.
[0021] According to some embodiments of the first aspect of the present application, the predicted defect information of the final fused feature map also includes: predicting the offset of the key point and the bounding box size of the key point based on the key point.
[0022] According to some embodiments of the first aspect of the present application, the method further includes: in each feature fusion, modifying the channel weight information of the second down-sampled feature map through an attention module.
[0023] According to some embodiments of the first aspect of the present application, before inputting the image to be detected into the defect detection model, the method further includes: performing a convolution operation on the image to be detected to obtain the image to be detected reduced to a preset size.
[0024] According to some embodiments of the first aspect of the present application, the method further includes:
[0025] Constructing the defect detection model;
[0026] The defect detection model is trained multiple times using the defect image dataset until the defect detection accuracy rate corresponding to the defect image dataset meets a preset training standard.
[0027] According to some embodiments of the first aspect of the present application, the defect image dataset includes: at least one of a burn image dataset, a polished image dataset, a scratch image dataset, a step image dataset, a pitting image dataset, and a dense rust image dataset.
[0028] A second aspect of the present application provides an electronic device, including:
[0029] at least one memory;
[0030] at least one processor;
[0031] at least one program;
[0032] The program is stored in the memory, and the processor executes at least one of the programs to implement the steel surface defect detection method as described in any embodiment of the first aspect of the present application.
[0033] The third aspect of the present application provides a computer-readable storage medium, which stores a computer-executable signal, and the computer-executable signal is used to execute the steel surface defect detection method as described in any embodiment of the first aspect of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0035] Figure 1 A schematic diagram of the structure of a CenterNet model in the prior art provided for some embodiments of the present application;
[0036] Figure 2A structural diagram of a defect detection model provided in some embodiments of the present application;
[0037] Figure 3 A flowchart of a defect detection method provided in some embodiments of the present application;
[0038] Figure 4 A schematic diagram of the structure of an improved CenterNet model provided in some embodiments of the present application;
[0039] Figure 5 A schematic diagram of a feature fusion process provided for some embodiments of the present application;
[0040] Figure 6 A defect detection accuracy comparison table provided for some embodiments of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than in the flowchart. Terms in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0043] In the description of this application, if there is a description of first or second, it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0044] In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0045] The existing CenterNet model uses four backbone networks: ResNet-18, ResNet-101, DLA-34 and Hourglass. Under the backbone network of the existing model, the final detection performance of the model is significantly different and shows a certain polarization, that is, the network with high detection accuracy has a slow detection speed, while the network with fast detection speed has a low detection accuracy, which is not conducive to actual production applications.
[0046] like Figure 1As shown in the figure, the existing CenterNet model using the Hourglass network requires at least two Hourglass network blocks. Each Hourglass network block downsamples the input feature map multiple times and then upsamples it. After each upsampling, the current upsampled feature map is fused with the downsampled feature map of the same scale to obtain the next upsampled feature map. After the first Hourglass block is completed, it enters the connection part. The connection part consists of several residual blocks, and the output result is added to the original feature map. Then the feature map enters the second Hourglass block, and finally the final feature map is output. In this way, the calculation is large and complex.
[0047] Based on this, the embodiment of the present application proposes an improved defect detection method, device and storage medium based on CenterNet. By introducing the SE module, the number of upsampling operations and feature fusion is reduced, thereby reducing the number of parameters and calculations, simplifying the network structure, and improving the detection efficiency while maintaining a high detection accuracy.
[0048] Reference Figure 2 The embodiment of the present application proposes a defect detection model, including a downsampling module 210, an upsampling module 220, an SE module 230, and an attention module 240. The downsampling module 210 is used to extract a downsampling feature map, the upsampling module 220 is used to extract an upsampling feature map, the SE module 230 is used to fuse two or more feature maps, and the attention module 240 is used to modify the weight information of the image channel. The downsampling module 210, the upsampling module 220, the SE module 230, and the attention module 240 cooperate to predict the defect information of the feature map to be sampled to complete the steel surface defect detection process.
[0049] It can be understood by those skilled in the art that Figure 2 The system structure diagram shown in the figure does not constitute a limitation on the embodiments of the present application, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0050] Reference Figure 3 According to the first aspect of the present application, a method for detecting surface defects of steel is provided, comprising the following steps:
[0051] The image to be inspected is input into the defect detection model, which is used to:
[0052] Step S310: Obtain multiple first down-sampled feature maps of different scales corresponding to the image to be detected.
[0053] It should be noted that, refer to Figure 4 and Figure 5In the defect detection model of the embodiment shown, the image to be detected is downsampled in the downsampling module 210. For example, the image to be detected undergoes five downsampling processes, and each downsampling process reduces the width and height of the image to be detected. The first down-sampling feature maps of 2 times, 4 times, 8 times, 16 times and 32 times of the image to be detected can be obtained in turn.
[0054] Step S320: Process the multiple first down-sampled feature maps through a convolutional layer to obtain multiple second down-sampled feature maps with a uniform number of channels.
[0055] It should be noted that the downsampling operation includes a convolution operation. Therefore, the number of channels of the multiple first downsampling feature maps obtained are not the same, and the subsequent feature fusion process cannot be performed. After the downsampling operation is completed, it is necessary to perform a convolution operation on each of the first downsampling feature maps obtained to unify them to the preset number of channels. In some embodiments, the preset number of channels is the minimum number of channels of the multiple first downsampling feature maps. For example, after downsampling, the number of channels of the five first downsampling feature maps obtained are 256, 384, 384, 384, and 512, respectively. Unifying the number of channels of the five first downsampling feature maps to the minimum number of channels of 256 can, on the one hand, reduce the amount of parameters and calculations in the entire defect detection process, thereby improving the detection efficiency. On the other hand, it helps to reduce the weight of the channels of unimportant features in the image and improve the accuracy of defect detection, wherein the channels of unimportant features include the channels of non-defect features in the image.
[0056] It should be noted that, exemplarily, after the first downsampling feature maps of 2 times, 4 times, 8 times, 16 times, and 32 times have a unified channel number of 256, the second downsampling feature maps of 2 times, 4 times, 8 times, 16 times, and 32 times with a channel number of 256 are obtained respectively.
[0057] Step S330: Use the second downsampled feature map with the smallest scale as the feature map to be sampled.
[0058] It should be noted that, exemplarily, the 32-fold second down-sampling feature map among the above-mentioned 2-fold, 4-fold, 8-fold, 16-fold, and 32-fold first down-sampling feature maps is used as the feature map to be sampled.
[0059] The loop process is performed on the sampled feature map until the preset conditions are met to obtain the final fused feature map. The loop process includes:
[0060] Step S341, upsample the feature map to be sampled to obtain an upsampled feature map.
[0061] Step S342: perform feature fusion on the upsampled feature map and the second downsampled feature map of the same scale through the SE module to obtain a fused feature map.
[0062] Step S343: Compare the current upsampling times with the target upsampling times.
[0063] Step S344: Use the fused feature map as a new feature map to be sampled.
[0064] The preset condition is that the upsampling times are the same as the target upsampling times.
[0065] It should be noted that the preset conditions can be adjusted according to the defect detection process and defect detection requirements.
[0066] Step S350: predict the defect information of the final fused feature map.
[0067] It should be noted that the goal of CenterNet is to generate a heat map. At the end of the cycle, the output fusion feature map of the present invention is a defect heat map, and defect information is predicted based on the defect heat map.
[0068] It should be noted that the following is an example of the cycle process, referring to Figure 4 and Figure 5 In this embodiment, the preset target upsampling times is 5 times, referring to Figure 2 In the defect detection model of the embodiment shown, the image to be detected is upsampled, and the image to be detected needs to go through 5 upsampling processes, and each upsampling process magnifies the width and height of the feature map to be sampled by 2 times. For the 32-fold second downsampled feature map, a 16-fold upsampled feature map is obtained after one upsampling operation; the 16-fold upsampled feature map and the 16-fold second downsampled feature map are feature fused through step S342 to obtain a 16-fold fused feature map; at this time, the number of upsampling times is 1, which is less than the target upsampling times, and step S344 is executed to use the 16-fold fused feature map as the new feature map to be sampled for a new round of fusion processing until the number of upsampling times is equal to 5, and the cycle ends. At this time, the size of the obtained fused feature map is the same as the size of the image to be detected.
[0069] It should be noted that, after downsampling the image to be detected, the present application performs a convolution operation on the extracted first downsampled feature map to obtain a second downsampled feature map with a uniform number of channels, and performs upsampling based on the second downsampled feature map with the minimum multiple, and after upsampling, the second downsampled feature map of the same scale is fused through the SE module to obtain a new feature map for upsampling, and so on until the upsampling is completed the same number of times as the downsampling, and finally outputs the fused feature map, so that the defect information can be predicted according to the final output fused feature map; compared with the prior art, the CenterNet model is provided with two Hourglass network blocks, each Hourglass network block downsamples the input feature map multiple times and then upsamples it, and after each upsampling is completed, the current upsampled feature map is fused with the downsampled feature map of the same scale to obtain the next upsampled feature map, and the output of one Hourglass network block is the input of another Hourglass network block. This method is computationally intensive and complex, refer to Figure 4 ,This application introduces the SE module to greatly reduce the ,number of upsampling, downsampling and fusion, thereby reducing the number of ,parameters and computation while ensuring the prediction accuracy, ,therefore improving the defect detection efficiency.
[0070] It can be understood that step S350, predicting the defect information of the final fused feature map, includes: comparing the response point value of each response point in the fused feature map with the response point values of its eight adjacent response points, and selecting peak points corresponding to several response points based on the comparison results; comparing the response point value of each peak point with a preset threshold, and determining the peak point whose response point value is greater than the preset threshold as the key point of the fused feature map.
[0071] It should be noted that the core idea of CenterNet is to regard the target object as a key point, which is used as the center point of the detection box. The goal of CenterNet is to generate the key points of the heat map. Where C represents the number of defect points in the image; correspondingly, in this application, the goal of CenterNet is to generate key points of the fused feature map. Before predicting the key points, the center points of the real frame are first dispersed into the heat map by formula (1), the corresponding response points are generated, and the response point value of each response point is calculated according to formula (1).
[0072]
[0073] It should be noted that, in some embodiments, the response point value of each response point is compared with the response point values of its eight adjacent response points; when the response point value of the response point is greater than or equal to the maximum response point value of its eight adjacent response points, the response point is determined as a peak point.
[0074] It should be noted that, in some embodiments, when the peak value Y xyc When it is greater than the set threshold (such as the threshold is set to 0.3), the peak point is determined as the key point of the fusion feature map. The key point represents the target defect identified by the defect detection model. It should be noted that the threshold size can be adjusted according to the defect detection process and defect detection requirements.
[0075] It is understandable that the defect information of predicting the final fusion feature map also includes: predicting the offset of the key point and the size of the bounding box of the key point based on the key point.
[0076] It should be noted that during the convolution process, due to the influence of factors such as step size and padding, quantization deviation will inevitably occur, resulting in deviations between the final predicted key points and the actual points. Therefore, it is also necessary to predict the offset to refine the hotspot map and improve the positioning accuracy. In order to mark the defect location, after predicting the key points, it is also necessary to predict the size of the bounding box centered on the key points. The offset and width and height can be obtained by referring to the offset loss function using formula (2), the boundary box size loss function using formula (3) and the weighted sum of the loss functions using formula (4). The specific formulas are as follows;
[0077]
[0078]
[0079] L det =L k +L off +λ size L size (4)
[0080] Where R represents the downsampling multiple, P represents the actual position of the key point, represents the predicted value of the offset of the key point, Represents the predicted position of the key point. All categories use the same L off .in represents the predicted size of the bounding box, S k represents the actual size of the bounding box. size The value is 0.1.
[0081] It can be understood that the defect detection method also includes: in each feature fusion, modifying the channel weight information of the second down-sampled feature map through the attention module.
[0082] It should be noted that the defect detection model focuses on capturing features in high-weight channels. For example, refer to Figure 2In the defect detection model of the embodiment shown, in each feature fusion, the second down-sampled feature map enters the attention module 240, and the attention module 240 increases the weight of the channel with defect features in the second down-sampled feature map, and reduces the weight of the channel without defect features, so that the defect detection model focuses on capturing the channels with defect features, which helps to improve the accuracy of defect detection.
[0083] It is understandable that, before inputting the image to be detected into the defect detection model, the method further includes: a step of performing a convolution operation on the image to be detected to obtain the image to be detected reduced to a preset size.
[0084] It should be noted that reducing the size of the image to be detected and expanding the receptive field can help improve the accuracy of defect detection. For example, the preset size is Input image to be detected I∈R W×H×3 First, it passes through a 7×7 convolution with a step size of 2 and 2 residual blocks, and the output size is the original image. Feature map according to Perform subsequent operations. At this time, the first down-sampled feature map is for the image to be detected. Feature map Perform downsampling at different scales.
[0085] It is understandable that the defect detection method also includes: constructing a defect detection model; and training the defect detection model multiple times using the defect image data set until the defect detection accuracy corresponding to the defect image data set meets a preset training standard.
[0086] It should be noted that when the center points of the ground truth boxes are dispersed into the hotspot map by using formula (1), the loss function used is expressed by formula (5), where N represents the number of key points on each image, Represents the predicted value of the key point, Y xyc Represents the true value of the key point, which is the hyperparameter of the focal loss function, and takes values of 2 and 4. The main purpose of introducing hyperparameters is to change the loss weights of easy samples and difficult samples, reduce the loss of high-confidence samples, and make the model pay more attention to the classification of difficult samples.
[0087]
[0088] When Y xyc =1, It plays a corrective role. If it is close to 1, it means that this is a point that is easier to detect. is relatively low; When it is close to 0, it means that the center point has not been learned yet, so we need to increase the proportion of its training.
[0089] It should be noted that, for example, a large number of steel defect image data sets collected in this application are used to train the defect detection model multiple times according to steps S310 to S350 described above, increasing the proportion of its training, and at the same time, reference can be made to Figure 6 The accuracy of the CenterNet model with different network main structures was improved before, and the CenterNet model was repeatedly trained several times until Figure 6 From the accuracy of the improved CenterNet model, it can be seen that the improved CenterNet model uses a lightweight method to reduce the number of parameters and computation while maintaining a high accuracy value.
[0090] It can be understood that the defect image data set includes at least one of: a burn image data set, a polished image data set, a scratch image data set, a step image data set, a pitting image data set, and a dense rust image data set.
[0091] It should be noted that, exemplarily, after using the burn image dataset to train the defect detection model, when the defect detection model is enabled to predict defects on the steel surface, the defect detection model can obtain a steel surface defect detection result map marked with a burn category, wherein the burn category represents the burn category.
[0092] A second aspect of the present application provides an electronic device, including:
[0093] at least one memory;
[0094] at least one processor;
[0095] at least one program;
[0096] The program is stored in the memory, and the processor executes at least one program to implement the steel surface defect detection method as described in any embodiment of the first aspect of the present application.
[0097] The processor and the memory may be connected via a bus or other means.
[0098] The memory, as a non-transitory readable storage medium, can be used to store non-transitory software instructions and non-transitory instructables. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. It is understood that the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network, and examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0099] The processor executes various functional applications and data processing by running non-transient software instructions, commands and signals stored in the memory, that is, the steel surface defect detection method of the first embodiment.
[0100] The non-transient software instructions and instructions required to implement the steel surface defect detection method of the first embodiment are stored in the memory, and when executed by the processor, the above-mentioned steel surface defect detection method is executed, for example, the above-described Figure 3 The method comprises steps S310 to S350.
[0101] Since the electronic device of the second aspect can execute the steel surface defect detection method of the first aspect embodiment of the present application, it has all the beneficial effects of the first aspect embodiment of the present application.
[0102] The third aspect of the present application provides a computer-readable storage medium, which stores a computer-executable signal. The computer-executable signal is used to execute a steel surface defect detection method as described in any one of the embodiments of the first aspect of the present application.
[0103] Execute the above description Figure 3 Method steps S310 to S350.
[0104] Since the computer storage medium of the third aspect can execute the steel surface defect detection method of the embodiment of the first aspect of the present application, it has all the beneficial effects of the first aspect of the present application.
[0105] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] Through the description of the above embodiments, it will be appreciated by those skilled in the art that all or some steps and systems in the disclosed methods above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a readable medium, and the readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as a computer-readable signal, a data structure, an instruction module or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally include computer readable signals, data structures, instruction modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0107] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present application.
Claims
1. A method for detecting surface defects of steel, characterized in that: The method comprises: The image to be detected is input into the defect detection model, which is used to: Acquire a plurality of first down-sampled feature maps of different scales corresponding to the image to be detected; Processing the plurality of first down-sampled feature maps through a convolutional layer to obtain a plurality of second down-sampled feature maps having a uniform number of channels; Using the second downsampled feature map of the smallest scale as the feature map to be sampled; Execute a loop process on the feature map to be sampled until a preset condition is met to obtain a final fused feature map; Predicting defect information of the final fused feature map; The cycle process includes: Upsampling the feature map to be sampled to obtain an upsampled feature map; Performing feature fusion on the up-sampled feature map and the second down-sampled feature map of the same scale through the SE module to obtain a fused feature map; Compare the current upsampling times with the target upsampling times; Using the fused feature map as the new feature map to be sampled; Wherein, the preset condition is that the upsampling number is the same as the target upsampling number; The defect information of the final predicted fusion feature map includes: Compare the response point value of each response point in the fusion feature map with the response point values of the eight adjacent response points, and select peak points corresponding to several response points according to the comparison results; The response point value of each peak point is compared with a preset threshold value, and the peak point whose response point value is greater than the preset threshold value is determined as the key point of the fusion feature map, and the key point represents the target defect identified by the defect detection model.
2. The method according to claim 1, characterized in that The predicted final defect information of the fused feature map also includes: predicting the offset of the key point and the size of the bounding box of the key point based on the key point.
3. The method according to claim 1, characterized in that The method also includes: in each feature fusion, modifying the channel weight information of the second down-sampled feature map through an attention module.
4. The method according to claim 1, characterized in that: Before inputting the image to be detected into the defect detection model, the method further includes: performing a convolution operation on the image to be detected to obtain the image to be detected reduced to a preset size.
5. The method according to claim 1, characterized in that Also includes: Constructing the defect detection model; The defect detection model is trained multiple times using the defect image dataset until the defect detection accuracy rate corresponding to the defect image dataset meets a preset training standard.
6. The method according to claim 5, characterized in that The defect image data set includes at least one of a burn image data set, a polished image data set, a scratch image data set, a step image data set, a pitting image data set, and a dense rust image data set.
7. An electronic device, characterized in that: include: at least one memory; at least one processor; at least one program; The programs are stored in the memory, and the processor executes at least one of the programs to implement the steel surface defect detection method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer-executable signal, and the computer-executable signal is used to execute the steel surface defect detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Steel rail surface defect detection method and device based on few-sample learning
CN112330591A
Defect detection method and device, model construction method and computer equipment
CN112598657A