H-beam surface defect detection method and system

By constructing a visual receptive field recommendation network and a multi-scale attention model, and integrating the YOLOv3 detection model, the problems of low efficiency and high false negative rate in H-beam surface defect detection were solved, achieving high-precision and fast defect detection.

CN116167968BActive Publication Date: 2026-03-03TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211610922.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-12
Publication Date
2026-03-03
Estimated Expiration
2042-12-12

AI Technical Summary

Technical Problem

Traditional methods for detecting surface defects in H-beams are inefficient and have a high rate of missed detections, making it difficult to effectively detect various defects on the surface of H-beams.

Method used

A target region recommendation network based on the visual receptive field is constructed and integrated with the YOLOv3 target detection model. It combines depthwise separable convolution and multi-scale spatial and channel attention models to perform lightweight processing and multi-scale feature extraction, thereby improving detection accuracy and speed.

Benefits of technology

It improves the positioning accuracy and detection speed of defect targets, reduces the false negative rate, realizes rapid and accurate defect detection, and enhances the visualization and adjustability of the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116167968B_ABST
    Figure CN116167968B_ABST
Patent Text Reader

Abstract

The application provides a H-shaped steel surface defect detection method and system, and belongs to the technical field of profile steel detection. The detection method comprises the following steps: constructing a target area recommendation network based on a visual receptive field, and integrating a YOLOv3 target detection model; performing lightweight processing on the YOLOv3 target detection model by using a depth separable convolution; constructing a multi-scale spatial attention model and a multi-scale channel attention model based on a visual attention mechanism, cascading the multi-scale spatial attention model and the multi-scale channel attention model, and obtaining a double attention model based on the YOLOv3 target detection model; obtaining a surface image of the H-shaped steel, inputting the surface image into the YOLOv3 target detection model, and obtaining a defect detection result through lightweight processing and double attention model processing; and displaying the defect detection result, adjusting a running mode, and displaying a running state. In this way, the detection speed and the detection efficiency are improved, and multiple types of different scale defects can be quickly and accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of steel section inspection technology, specifically to a method and system for detecting surface defects in H-beams. Background Technology

[0002] H-beams possess advantages such as high bending resistance, simple construction, cost savings, and light structural weight, making them widely used in industrial fields due to their excellent comprehensive performance. However, during the production process, due to limitations in the production environment and technology, various defects such as scabs, chipping, and pits inevitably occur on the surface of H-beams. These defects severely affect the quality of the H-beams, reduce their service life, and cause safety hazards and economic losses.

[0003] In practical applications, a comprehensive and detailed inspection of the surface defects of H-beams is an important step before they are put into use. Traditional inspection methods mainly include manual inspection methods and automatic inspection methods based on eddy current or electromagnetic technologies. However, the above inspection methods have problems such as low inspection efficiency and high false negative rate. Summary of the Invention

[0004] This application provides a method and system for detecting surface defects in H-beams to solve the problems of low detection efficiency and high false negative rate in traditional detection methods.

[0005] Firstly, this application provides a method for detecting surface defects in H-beams, including:

[0006] Construct a target region recommendation network based on the visual receptive field and integrate the YOLOv3 target detection model;

[0007] The YOLOv3 object detection model is lightweighted using depthwise separable convolution.

[0008] A multi-scale spatial attention model and a multi-scale channel attention model based on the visual attention mechanism are constructed, and the multi-scale spatial attention model and the multi-scale channel attention model are cascaded to obtain a dual attention model based on the YOLOv3 object detection model.

[0009] A surface image of the H-beam is acquired and input into the YOLOv3 target detection model. After the lightweighting process and the dual attention model processing, the defect detection result is obtained.

[0010] Displays the defect detection results, adjusts the operating mode, and displays the operating status.

[0011] In conjunction with the first aspect, in some possible implementations, the construction of a target region recommendation network based on the visual receptive field and the integration of the YOLOv3 object detection model includes:

[0012] The visual receptive field region is obtained from the feature map. A sliding window is used to slide on the feature map to map the output features in the visual receptive field region into a multi-dimensional feature vector. The feature vector is subjected to non-linear transformation processing. The feature vector after the non-linear transformation processing is input into two parallel convolutional layers. The classification layer is used to determine whether there is a target of interest in the current region, and the regression layer is used to predict the specific coordinates of the target of interest relative to the center point of the visual receptive field region.

[0013] Based on the cross manifold structure, the target of interest is converted into manifold distance, which is used to measure the shortest path along the flow direction. If the shortest path is less than the radius of the visual receptive field region, the shortest path is regarded as a valid positive sample, and the minimum value is taken as the valid region.

[0014] In conjunction with the first aspect, in some possible implementations, the manifold distance is used to measure the shortest path along the manifold direction, including:

[0015] Preset curvature constraints for the target nodes;

[0016] If the target node consists of three consecutive nodes, then it is determined that all paths of the target node do not satisfy the curvature constraint condition, and the shortest path of the target node is determined to be infinity.

[0017] If the target node consists of three non-contiguous nodes, and there exists a node path among the target nodes that satisfies the curvature constraint condition, then the node path is determined to be the shortest path.

[0018] In conjunction with the first aspect, in some possible implementations, the lightweighting of the YOLOv3 object detection model using depthwise separable convolution includes:

[0019] In the channel-wise convolution stage, each channel of the input feature map is convolved with the corresponding single-channel convolution kernel. The number of parameters W in the channel-wise convolution stage is... d For: W d =C i ×k×k, computational complexity F d For: F d =C i ×k×k×H×W;

[0020] In the point-to-point convolution stage, a 1×1 convolution kernel is used to integrate the output feature maps of all channels. The point-to-point convolution parameter W1 is: W1 = C i ×C o The computational quantity F1 is: F1 = C i×1×1×H×W×C o ;

[0021] The total parameter compression ratio q of the depthwise separable convolution is:

[0022]

[0023] The total computational compression ratio r of the depthwise separable convolution is:

[0024]

[0025] Among them, C i Indicates the number of input channels, k represents the core size, and C represents the number of input channels. o H represents the number of output channels, H represents the height of the input feature map, and W represents the width of the input feature map.

[0026] In conjunction with the first aspect, in some possible implementations, the YOLOv3 object detection model after the depthwise separable convolutional processing uses the Leaky ReLU activation function instead of the ReLU activation function, and uses the h-swish activation function after the BN layer.

[0027] In conjunction with the first aspect, the multi-scale spatial attention model is constructed in several possible implementations, including:

[0028] The input feature map is encoded along the horizontal and vertical directions to obtain various single-scale spatial attention weight feature maps.

[0029] Multiple single-scale spatial attention weight feature maps are stacked to obtain a multi-scale spatial attention weight feature map.

[0030] The multi-scale spatial attention weight feature map is normalized to obtain a normalized feature map;

[0031] After convolving the normalized feature map with the coefficient matrix, a bias matrix is ​​added to obtain a multi-scale spatial adaptive attention feature map.

[0032] The sigmoid activation function is used to perform feature mapping on the multi-scale spatial adaptive attention feature map to obtain the feature weights of each branch;

[0033] The input feature map is convolved and multiplied with the corresponding feature weights to obtain the final output feature map.

[0034] In conjunction with the first aspect, the multi-scale channel attention model is constructed in several possible implementations, including:

[0035] The input feature map is divided into multiple groups of sub-feature maps, and global average pooling is performed on the multiple groups of sub-feature maps to obtain multiple groups of pooled feature maps.

[0036] Multiple pooling feature maps are fused to obtain a fused feature map;

[0037] The fused feature map is normalized to obtain a standardized feature map;

[0038] After convolving the standardized feature map with the coefficient matrix, a bias matrix is ​​added to obtain a multi-scale channel adaptive attention feature map.

[0039] The sigmoid activation function is used to perform feature mapping on the multi-scale channel adaptive attention feature map to obtain the modified multi-scale channel attention weight feature map.

[0040] The input feature map is convolved and multiplied with the corresponding modified multi-scale channel attention weight feature map to obtain the final output feature map.

[0041] Secondly, this application provides an H-beam surface defect detection system, including: an image acquisition module, an image detection module, a human-computer interaction module, and a central processing module;

[0042] The image acquisition module is used to: acquire multiple surface images of H-beams during the production process, and send the multiple surface images to the image detection module;

[0043] The image detection module is used to: construct a target region recommendation network based on the visual receptive field and integrate the YOLOv3 target detection model; perform lightweight processing on the YOLOv3 target detection model using depthwise separable convolution; construct a multi-scale spatial attention model and a multi-scale channel attention model based on the visual attention mechanism, and cascade the multi-scale spatial attention model and the multi-scale channel attention model to obtain a dual attention model based on the YOLOv3 target detection model; process the surface image to obtain defect detection results;

[0044] The human-computer interaction module is used to: display the defect detection results, adjust the operating mode, and display the operating status;

[0045] The central processing module is used to: receive operation instructions from the human-computer interaction module, send acquisition instructions to the image acquisition module, and send detection instructions to the image detection module.

[0046] In conjunction with the second aspect, in some possible implementations, the image acquisition module includes:

[0047] Circular image acquisition stand;

[0048] Multiple image acquisition units are disposed in the inner ring of the annular image acquisition bracket for acquiring surface images;

[0049] A position detection unit, located within the inner ring of the annular image acquisition bracket, is used to detect whether the H-beam has reached the target position; and

[0050] The motion control unit, in conjunction with the annular image acquisition bracket, is used to drive the annular image acquisition bracket to move to the optimal image acquisition position.

[0051] In conjunction with the second aspect, in some possible implementations, the human-computer interaction module includes:

[0052] The system menu bar provides options for parameter settings and searching historical data.

[0053] A real-time display screen shows the defect detection results and the surface image;

[0054] Optional operation unit for selecting online detection mode and offline detection mode; and

[0055] The status indicator unit is used to indicate the current operating status information of the system.

[0056] Thirdly, this application provides a control terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the detection method as described in the first aspect or any possible implementation of the first aspect.

[0057] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the detection method as described in the first aspect or any possible implementation of the first aspect.

[0058] The H-beam surface defect detection method, device, terminal, and medium provided in this application have at least the following technical effects: Compared with traditional technologies, by constructing a target region recommendation network based on the visual receptive field and integrating the YOLOv3 target detection model, the positioning accuracy of defect targets can be improved. By replacing the standard convolution in the backbone network of the YOLOv3 target detection model with depthwise separable convolution, the original YOLOv3 target detection model is lightweighted, improving the detection speed of defect targets. By constructing a multi-scale spatial attention model and a multi-scale channel attention model, the ability to represent small-scale target features is strengthened, the weight of small-scale target features is increased, and the interference of complex background features in the image is suppressed, thereby improving the accuracy of multi-scale target detection. Inputting the acquired surface image into the above model can quickly and accurately detect defect targets, improving detection speed and efficiency. At the same time, the detection results are displayed in a timely manner, and the operating mode and operating status are adjusted in a timely manner, improving the visualization and adjustability of the entire detection process, and has broad application prospects. Attached Figure Description

[0059] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0060] Figure 1 This is a flowchart of the H-beam surface defect detection method provided in the embodiments of this application;

[0061] Figure 2 This is a block diagram of the H-beam surface defect detection system provided in the embodiments of this application;

[0062] Figure 3 This is a schematic diagram illustrating a specific application of the H-beam surface defect detection system provided in this application embodiment;

[0063] Figure 4 This is a schematic diagram illustrating a specific application of the H-beam surface defect detection system provided in this application embodiment;

[0064] Figure 5 This is a schematic diagram of the human-computer interaction module interface in an embodiment of this application;

[0065] Figure 6 This is a schematic diagram of the structure of the control terminal provided in the embodiments of this application. Detailed Implementation

[0066] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.

[0068] Please see Figure 1 This application provides a method for detecting surface defects in H-beams, including:

[0069] S100. Construct a target region recommendation network based on the visual receptive field and integrate the YOLOv3 target detection model.

[0070] S200. The YOLOv3 object detection model is lightweighted using depthwise separable convolution.

[0071] S300. Construct a multi-scale spatial attention model and a multi-scale channel attention model based on the visual attention mechanism, and cascade the multi-scale spatial attention model and the multi-scale channel attention model to obtain a dual attention model based on the YOLOv3 object detection model.

[0072] S300. Obtain the surface image of the H-beam and input the surface image into the YOLOv3 target detection model. After lightweight processing and dual attention model processing, the defect detection result is obtained.

[0073] S500 displays defect detection results, adjusts the operating mode, and displays the operating status.

[0074] In step S100, based on the concentric antagonistic characteristics of the human eye's visual receptive field, which leads to a stronger visual perception as the distance between the target and the eye gradually decreases, a target region recommendation network uses the visual receptive field as a prior box instead of a fixed-scale anchor box to guide target localization during detection. In step S200, depthwise separable convolutions are used to replace the standard convolutions in the backbone network (DarkNet53), lightweighting the original YOLOv3 target detection model and improving target detection efficiency. In step S300, a multi-scale long-range contextual feature extraction layer is constructed, fusing multi-scale feature information from shallow and high-level networks to improve the detection accuracy of small-scale targets. By calculating adaptive spatial attention weights for feature maps at different scales, features at various scales are fused, strengthening the representation ability of small-scale target features in shallow feature maps; furthermore, channel attention of the multi-scale fused feature map is calculated to increase the weight of small-scale target features and suppress interference from complex background features in the image. For example, the multi-scale spatial attention model is MSAA, and the multi-scale channel attention model is MCAA. The two are cascaded to obtain DMSA. Combining DMSA with the YOLOv3 model yields the DMSA-YOLOv3 object detection model.

[0075] By combining the human brain's visual attention mechanism with deep learning based on convolutional neural networks, various types of defects with different shape features and sizes can be quickly and accurately identified. Compared with traditional automatic and manual inspection methods, deep learning does not require much human intervention, which can effectively reduce labor costs. At the same time, compared with other automatic inspection methods, deep learning has the advantages of high accuracy, strong real-time performance, and high degree of automation and intelligence. It can be widely used in the surface defect inspection of H-beams and other types of steel, significantly improving inspection efficiency and accuracy.

[0076] In step S300, by inputting the surface image of the H-beam into the aforementioned model, real-time acquisition and online detection of the surface image can be achieved. In step S500, during the detection process, the defect detection results, system operation mode, and system operation status can be displayed and adjusted, realizing a systematic detection process.

[0077] In actual testing, the above-mentioned testing method can be implemented through an image acquisition module, an image detection module, a human-computer interaction module, and a central processing module. For details, please refer to the following implementation example of the testing system. For example, ... Figures 3 to 5As shown, after the user selects the model of the H-beam in the operation interface, the detection system first initializes the relevant equipment and adjusts the image acquisition module to the optimal shooting position according to the parameters of the H-beam and the camera. When the H-beam moves to the target position, the position detection unit in the image acquisition module sends a signal that the H-beam has arrived to the central processing module. The camera starts to acquire the current image and sends it to the central processing module via the image acquisition card. The image detection module performs the detection and stores the defect detection results in the database. The human-computer interaction module visualizes the defect detection results in the database.

[0078] The H-beam surface defect detection method provided in this application has at least the following technical effects: Compared with traditional technologies, by constructing a target region recommendation network based on the visual receptive field and integrating the YOLOv3 target detection model, the positioning accuracy of defect targets can be improved. By replacing the standard convolution in the backbone network of the YOLOv3 target detection model with depthwise separable convolution, the original YOLOv3 target detection model is lightweighted, improving the detection speed of defect targets. By constructing a multi-scale spatial attention model and a multi-scale channel attention model, the representation ability of small-scale target features is strengthened, the feature weight of small-scale targets is increased, and the interference of complex background features in the image is suppressed, thereby improving the multi-scale target detection accuracy. By inputting the acquired surface image into the above model, defect targets can be detected quickly and accurately, improving the detection speed and efficiency. At the same time, the detection results are displayed in a timely manner, and the operating mode and operating status are adjusted in a timely manner, improving the visualization and adjustability of the entire detection process, which has broad prospects.

[0079] In some embodiments, a target region recommendation network based on the visual receptive field is constructed and integrated with the YOLOv3 target detection model, including: obtaining the visual receptive field region based on the feature map; using a sliding window to slide on the feature map to map the output features in the visual receptive field region into a multi-dimensional feature vector; performing non-linear transformation processing on the feature vector; inputting the non-linearly transformed feature vector into two parallel convolutional layers, wherein the classification layer is used to determine whether there is a target of interest in the current region, and the regression layer is used to predict the specific coordinates of the target of interest relative to the center point of the visual receptive field region; based on the cross manifold structure, the target of interest is transformed into manifold distance, which is used to measure the shortest path along the flow direction; if the shortest path is less than the radius of the visual receptive field region, the shortest path is regarded as a valid positive sample, and the minimum value is taken as the valid region.

[0080] Specifically, the target region recommendation network uses visual receptive field regions as prior boxes to replace fixed-scale anchor boxes to guide target localization during the detection process, thereby improving the accuracy of defect target localization. For each pixel p in the feature map F, its visual receptive field region is defined as:

[0081] Recp p =f(F;p;s),

[0082] Among them, Recp p Let f(p) represent the receptive field of pixel p in feature map F, i.e., the size of the region that can be perceived at position p; f() is the receptive field mapping function, and s represents the scaling factor during the upper and lower convolution processes. For a sliding window of size N×N, let its center point coordinates be (x, y, s). c ,y c If the coordinates of the center point of its receptive field are (x, y), then the coordinates of the center point of its recp_c ,y recp_c ) and its width and height (w recp ,h recp The receptive field mapping function f() can be used to obtain the receptive field mapping function:

[0083] x recp_c =sx c ,y recp_c =sy c ,w recp =sN,h recp =sN.

[0084] Therefore, for a feature map of size w×h, a maximum of w×h visual receptive field regions can be obtained. For example, by using a 5×5 sliding window to slide in the feature map F, the output features corresponding to each region are mapped to a 512-dimensional feature vector, and the ReLU activation function is used to perform non-linear transformation on the feature vector.

[0085] The feature vector, after nonlinear transformation, is then input into two parallel convolutional layers. These layers consist of a classification layer and a regression layer, used for classification and regression operations respectively. Each convolutional layer has a 1×1 kernel and a stride of 1. The classification layer contains one neuron; activation (output 1) indicates the presence of an object of interest within the current region, while activation (output 0) indicates an invalid bounding box. The regression layer predicts the specific coordinates (x, y) of the object of interest relative to the center of the receptive field. recp_c ,y recp_c ,w recp ,h recp ).

[0086] For example, the manifold distance is used to measure the shortest path along the manifold direction, including: pre-setting curvature constraints on the target node; if the target node consists of three consecutive nodes, it is determined that all paths of the target node do not satisfy the curvature constraints, and the shortest path of the target node is determined to be infinity; if the target node consists of three non-consecutive nodes, and there is a node path among the target nodes that satisfies the curvature constraints, then the node path is determined to be the shortest path.

[0087] Specifically, using a cross-manifold structure based on manifold distance, by transforming the target category of interest into manifold distance, can be used to correct information bias in anchor boxes of targets at extremely large or small scales. Let... It is a low-dimensional manifold, where f: X→R d Let f be a smooth embedding in the manifold space, and D > d, where D and d represent the dimensions of the original high-dimensional objective and the reduced objective, respectively. Then, for any two points x on f... i and x j The length L(x) of the line segment between i ,x j ) is defined as:

[0088]

[0089] Where, dist(x) i ,x j ) is x i and x j The Euclidean distance between them, where ρ>1 represents the scaling factor. The embedded manifold can be quantized as having data points as vertices V, and each pair of data points (x...) as... i ,x j The length of the manifold segments between ) is the set of edges E = {W} ij The undirected weighted graph G = (V, E) is defined as p ∈ V. l This represents a connection point p1 and p2 on the graph with length l = |p| - 1. |p| The path, where the edge is (p k ,x k+1 ), 1≤k≤|p|. Define p ij Represents a pair of data points (x i ,x j The set of all paths between x and y, then x i With x j The manifold distance between them is:

[0090]

[0091] Where L(a,b) represents the length of the manifold segment between pairs of data points. Clearly, manifold distance follows the metric triangle inequality: Therefore, manifold distance can effectively measure the shortest path along the manifold direction. In this way, target points on the same manifold curve can be connected by multiple shorter paths, while target points on different manifold curves can be connected by longer edges, thereby increasing the distance between target points on different manifold curves and shortening the distance between two target points on the same manifold curve.

[0092] For R DGiven three ordered target points (x, y, z) in space, the angles and curvatures of these three target points are defined as follows:

[0093]

[0094]

[0095] Assume the curvature constraint of the manifold curve is curv(x) i-1 ,x i ,x i+1 )≤k. To solve for the value of k, assume (x,y,z) are the three vertices of a triangle in d-dimensional space, then its circumcircle is defined as:

[0096]

[0097] Where R(x,y,z) is the radius of the circle passing through the point (x,y,z). Simplifying the above equation, we get:

[0098]

[0099] Ultimately, we can obtain:

[0100]

[0101] As shown in the above equation, R(x,y,z) = ∞ if and only if the three points (x,y,z) are collinear, and the curvature is defined as follows:

[0102]

[0103] If the three target points (x, y, z) are not collinear, assuming x is the source node of a triangle in d-dimensional space, then y and z are the nearest points to the source node. Apply the curvature constraint condition... Substituting into the above equation, we can deduce:

[0104]

[0105] Assume ||x t-1 -x t ||∨||x t+1 -x t Substituting the equation and the value of k into the special case above, we can obtain the general expression for the curvature constraint condition:

[0106] ∠(x t-1 ,x t ,x t+1 )≤θ:=2cos -1 (kε).

[0107] Based on the curvature constraints, a proximity graph is constructed by calculating the shortest path distance under the constraints, thus completing the curvature distance calculation. The specific algorithm is as follows:

[0108] Algorithm Start

[0109]

[0110]

[0111] Algorithm ends

[0112] Combining the above algorithm for calculating the shortest manifold distance under curvature constraints, for three consecutive points (x, y, z), since the path between the three points violates the curvature constraint, the shortest path between the source node and all other nodes in the neighboring graph is set to positive infinity, indicating that there is no path from the source node to the current node.

[0113] For three discontinuous points, assume the current node is x, and y and z are x's only two nearest neighbors that have not yet been visited by x's Dijkstra process, and the path weight weight(x→y) from node x to node y is less than the path weight weight(x→z) from node x to node z. If a path containing nodes (parent[x],x,y) (where parent[x] represents the node with node x as its nearest neighbor) violates the curvature constraint, but a path containing nodes (parent[x],x,z) satisfies the curvature constraint, then the latter is considered the shortest path. For a set of N nodes, the shortest path calculation under curvature constraints is as shown in the algorithm above.

[0114] If the path distance is less than the receptive field radius, it is considered a valid positive sample, and the minimum value is taken as the valid region.

[0115] Of course, the above method is only one embodiment involved in constructing a target region recommendation network based on visual receptive field. Other embodiments can be used in practical applications, and it is not limited to this.

[0116] In some embodiments, the YOLOv3 object detection model is lightweighted using depthwise separable convolution, including: in the channel-wise convolution stage, each channel of the input feature map is convolved with the corresponding single-channel convolution kernel, wherein the number of channel-wise convolution parameters W d For: W d =C i ×k×k, computational complexity F d For: F d =C i×k×k×H×W; In the point-to-point convolution stage, a 1×1 convolution kernel is used to integrate the output feature maps of all channels. The point-to-point convolution parameter W1 is: W1=C i ×C o The computational quantity F1 is: F1 = C i ×1×1×H×W×C o .

[0117] The total parameter compression ratio q of depthwise separable convolution is:

[0118]

[0119] The total computational compression ratio r of depthwise separable convolution is:

[0120]

[0121] Among them, C i Indicates the number of input channels, k represents the core size, and C represents the number of input channels. o H represents the number of output channels, H represents the height of the input feature map, and W represents the width of the input feature map.

[0122] Specifically, depthwise separable convolution breaks down the feature extraction process into a channel-wise convolution stage and a point-wise convolution stage. In the channel-wise convolution stage, each channel in the input feature map no longer performs convolution operations with all convolution kernels, but only with its corresponding single-channel convolution kernel. Each input channel is independent, eliminating feature fusion between channels and maintaining the number of channels in the output feature map after convolution. In the point-wise convolution stage, standard convolution is used, employing a 1×1 convolution kernel to integrate the output feature maps of all channels, thereby changing the number of channels in the output feature map.

[0123] Compared to the computational cost of ordinary convolution, the compression ratio of total parameters and total computational cost of depthwise separable convolution is shown in the formulas above.

[0124] For example, in the YOLOv3 object detection model after depthwise separable convolution processing, the LeakyReLU activation function is used instead of the ReLU activation function, and the h-swish activation function is used after the BN layer. It is understandable that replacing standard convolution with depthwise separable convolution results in a depthwise separable convolution module, but because the ReLU activation function takes zero for negative values, it can lead to the loss of some feature information. Therefore, Leaky ReLU is chosen to replace the ReLU activation function after the depthwise separable convolution layer, and the h-swish activation function is used after the BN layer to address the gradient vanishing problem caused by the increase in the number of network layers.

[0125] In some embodiments, constructing the multi-scale spatial attention model includes: encoding the input feature map along the horizontal and vertical directions to obtain multiple single-scale spatial attention weight feature maps; stacking the multiple single-scale spatial attention weight feature maps to obtain a multi-scale spatial attention weight feature map; normalizing the multi-scale spatial attention weight feature map to obtain a normalized feature map; convolving the normalized feature map with a coefficient matrix and then adding a bias matrix to obtain a multi-scale spatial adaptive attention feature map; using a sigmoid activation function to perform feature mapping on the multi-scale spatial adaptive attention feature map to obtain the feature weights of each branch; and convolving the input feature map with the corresponding feature weights to obtain the final output feature map.

[0126] Specifically, the multi-scale spatial attention model can be called the MSAA model, with a size w×h×c. in For the feature map F input As input, w and h are equal, representing the four output feature map scales of the YOLOv3 model: 16, 32, 64, and 128, respectively. For the input feature map x... i ∈R H×W For any pixel (h, w), the MSAA model encodes its position information along both the horizontal and vertical directions, and the assigned single-scale spatial attention weights are: Att row (h) and Att col (w) represent the spatial attention weights assigned to the pixel in the h-th row and w-th column, respectively, and are calculated using the following formula:

[0127]

[0128]

[0129] Where x(i,j) represents the pixel value at coordinate (i,j) in the feature map; s(x , y) is the similarity evaluation function, and the MSAA model uses the cross-entropy loss function.

[0130] The obtained single-scale spatial attention weight feature maps F spa_input Each feature map is divided into four sub-feature maps, namely:

[0131]

[0132] in, This represents the sub-feature map assigned to the i-th branch, and the size of each sub-feature map is w×h×(c in / 4). The four single-scale spatial attention weight feature maps obtained from each branch are concatenated along the channel dimension. The feature maps of different scales are upsampled, or scaled to the other three feature map scales through one or more convolution operations with a kernel size of 3×3 and a stride of 2, and then stacked to obtain the multi-scale spatial attention weight feature map F. spa_concat The calculation process is shown in the following formula:

[0133]

[0134] For multi-scale spatial attention weight feature map F spa_concat Adaptive adjustments are then performed. To ensure standardized output features, a normalization operation is first performed, as shown below:

[0135]

[0136] F spa_std =f std (F spa_concat -F spa_mean ),

[0137] F spa_std =f std (F spa_concat -F spa_mean ),

[0138] Where w, h, i, and j represent the width, height, and feature point in the i-th row and j-th column of the input feature map, respectively, and r represents the input feature map provided by the r-th branch. By analyzing the fused feature map F... spa_concat Global average pooling is performed along the channel dimension to obtain the multi-scale spatial global average attention weight feature map F. spa_mean Use F spa_concat Subtract the mean-normalized feature F spa_mean f, as a function for calculating standard deviation std The input of () yields the standardized features F. spa_std And then with F spa_concat The division yields the final normalized feature map F. spa_norm .

[0139] An adaptive feature layer is used to adaptively adjust the normalized features. The feature transformation process is shown in the following equation:

[0140]

[0141] Among them, w spa Let b be the coefficient matrix. spa The bias matrices are all 1×1×1024 in size. This represents the convolution operation, which transforms the normalized feature map F... spa_normAs input for adaptive adjustment, and the coefficient matrix w spa After performing convolution operations and adding a bias matrix, we obtain the multi-scale spatial adaptive attention feature map F. spa_adaptive .

[0142] Use the sigmoid activation function on F spa_adaptive Perform feature mapping to map the eigenvalues ​​to the (0,1) interval, and obtain the feature weight F for each branch. spa_sig The transformation process is shown in the following equation:

[0143] F spa_sig =f sigmoid (F spa_adaptive ).

[0144] Input feature map F input The corresponding feature weights are convolved and multiplied to obtain the final output F of the multi-scale spatial adaptive attention model. spa_output :

[0145]

[0146] Of course, the above method is only one embodiment involved in constructing a multi-scale spatial attention model. Other embodiments can be used in practical applications, and it is not limited to this.

[0147] In some embodiments, constructing the multi-scale channel attention model includes: dividing the input feature map into multiple groups of sub-feature maps; performing global average pooling on the multiple groups of sub-feature maps to obtain multiple pooled feature maps; fusing the multiple pooled feature maps to obtain a fused feature map; normalizing the fused feature map to obtain a standardized feature map; convolving the standardized feature map with a coefficient matrix and then adding a bias matrix to obtain a multi-scale channel adaptive attention feature map; performing feature mapping on the multi-scale channel adaptive attention feature map using a sigmoid activation function to obtain a modified multi-scale channel attention weight feature map; and convolving the input feature map with the corresponding modified multi-scale channel attention weight feature map to obtain the final output feature map.

[0148] Specifically, the multi-scale channel attention model can be called the MCAA model. The MCAA model includes two paths: the feature transformation path includes seven feature transformation processes to obtain various sub-feature maps. The appropriate weights should be assigned; multi-scale features are transmitted in the feature transport path and convolved with the feature weights. Spatial attention feature maps at multiple scales are fused using dense connections to obtain the final output feature map.

[0149] First, let the size be h×w×c inInput feature map F ch_input Divided into 4 groups of sub-feature maps:

[0150]

[0151] in, This indicates a size of h×w×(c) in The i-th sub-feature map of / 4). The feature transformation path first processes the sub-feature map. Global average pooling is performed separately along the spatial dimension, and the calculation process is shown in the following formula:

[0152]

[0153] Where i and j represent feature maps respectively. The i-th row and j-th column, k represents The k-th dimension, In the feature map The feature map is obtained by performing global average pooling on the feature point at the i-th row and j-th column in the k-th dimension.

[0154] Then, the features generated by each group are transformed. Feature fusion is performed to obtain a multi-scale channel fusion feature map F. ch_concat :

[0155]

[0156] The average pooling algorithm is used to process the fused feature map F. ch_concat Normalization is performed: First, the mean value F of the eigenvalues ​​in each channel is calculated. ch_mean Then, using the standard deviation formula, the fused feature F is obtained. ch_concat and mean characteristic F ch_mean The feature standard deviation F is obtained as input to obtain the fused features. ch_std The formula is as follows:

[0157]

[0158]

[0159] Where c represents the number of channels in the fused feature map, k represents the k-th channel of the feature map, and finally the fused feature F is used. ch_concat The standardized feature F is obtained by dividing by the feature standard deviation of the fused feature. ch_norm :

[0160] F ch_norm =F ch_concat / F ch_std .

[0161] Adaptive adjustment is performed on the normalized feature results. The adaptive adjustment process includes two sets of trainable parameter matrices, namely the coefficient matrix w. ch and bias matrix b ch The feature adaptive adjustment process is shown in the following equation, with standardized features F ch_norm As input, it is first compared with the coefficient matrix w. ch Perform a convolution operation, and then combine the resulting features with the bias matrix b. ch Accumulate the data to obtain the adaptive feature map F. ch_adaptive By adding an adaptive process, the model can adaptively adjust the feature weights based on different training data. The formula is as follows:

[0162]

[0163] The adaptive feature map is adjusted using sigmoid feature mapping. As shown in the following equation, i represents the i-th feature map. Each feature value in the feature map is sequentially mapped to the range (0,1), ultimately yielding the corrected multi-scale channel attention weight feature map F. ch_sig :

[0164]

[0165] Input feature map F ch_input With the corresponding modified multi-scale channel attention weight feature map F ch_sig Perform convolutional multiplication to obtain the final output F of the multi-scale channel adaptive attention model. ch_output :

[0166]

[0167] Of course, the above method is only one embodiment involved in constructing a multi-scale channel attention model. Other embodiments can be used in practical applications, and it is not limited to this.

[0168] Based on the construction methods of the aforementioned multi-scale spatial attention model and multi-scale channel attention model, the adaptive attention models of multi-scale spatial and multi-scale channel are cascaded to obtain the dual multi-scale attention model DMSA. By decomposing spatial attention into two parallel one-dimensional feature codes, horizontal and vertical, the DMSA model efficiently integrates spatial coordinate information, establishes long-range dependencies between pixels globally, and thus obtains the spatial attention weight of each pixel in a single feature map. This avoids the loss of some positional information caused by convolution operations in ordinary spatial attention models and can improve the accuracy of attention weight calculation for small-scale targets.

[0169] By drawing inspiration from the DenseNet design philosophy, the DMSA model employs dense connections to fuse multi-scale feature maps. This effectively combines the contour features of small-scale defects in shallow feature maps with the semantic features of various defect types in deep feature maps, thereby improving the localization capability of small-scale defects on the surface of H-beams. Through global location information encoding and multi-channel attention integration, the DMSA model strengthens the attention weights for small-scale defects extracted by the YOLOv3 model while weakening the interference from extracted complex background features, thus effectively improving the model's detection accuracy for small-scale defect targets.

[0170] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0171] The following are system embodiments of this application. For details not described in detail, please refer to the corresponding method embodiments described above.

[0172] Figure 2 A schematic diagram of an H-beam surface defect detection system provided in an embodiment of this application is shown. For ease of explanation, only the parts relevant to the embodiment of this application are shown, and are described in detail below:

[0173] This application provides an H-beam surface defect detection system 2, including: an image acquisition module 21, an image detection module 22, a human-computer interaction module 23, and a central processing module 24.

[0174] Image acquisition module 21 is used to: acquire multiple surface images of H-beams during the production process and send these images to image detection module 22. Image detection module 22 is used to: construct a target region recommendation network based on the visual receptive field and integrate the YOLOv3 target detection model; perform lightweight processing on the YOLOv3 target detection model using depthwise separable convolution; construct a multi-scale spatial attention model and a multi-scale channel attention model based on the visual attention mechanism, cascading the multi-scale spatial attention model and the multi-scale channel attention model to obtain a dual attention model based on the YOLOv3 target detection model; and process the surface images to obtain defect detection results. Human-computer interaction module 23 is used to: display defect detection results, adjust the operating mode, and display the operating status. Central processing module 24 is used to: receive operation commands from human-computer interaction module 23, send acquisition commands to image acquisition module 21, and send detection commands to image detection module 22.

[0175] It is understandable that the image acquisition module 21, image detection module 22, and human-computer interaction module 23 can exchange and interact via the central processing module 24; of course, they can also exchange and interact directly. In practical applications, please refer to... Figures 3 to 5 The settings method.

[0176] Specifically, the image acquisition module 21 is used to completely acquire images of each surface during the production process of H-beams and can save them as grayscale bmp images of size 1024×512. After the acquisition of a single H-beam is completed, the acquired image data is transmitted to the data storage module for storage, or it can be transmitted to the image detection module 22, or it can be transmitted to the central processing module 24, etc., for detection.

[0177] The image detection module 22 is used to receive the detection instructions from the central processing module 24, receive the surface image, detect the surface image, and store the defect detection result information into the database for the human-computer interaction module 23 to obtain and display.

[0178] The human-computer interaction module 23 is used for information interaction with the user. It first receives instructions from the user and then transmits them to the central processing module 24. The central processing module 24 operates the image acquisition module 21 according to the instructions to complete the acquisition and subsequent processing of surface images, and displays the defect detection results in a visual manner on the image interface. In addition, it can select and display the operating mode and operating status, and promptly remind the user of the current detection process. For example, the human-computer interaction module 23 can be based on Java Web programming, using Vue as the visualization page tool. Specifically, it is used to receive and forward user instructions, such as H-beam selection and detection mode switching, and display the surface defect detection results of the H-beam in a graphical visualization interface for the user to view in a timely manner.

[0179] It should be noted that the parts not described in the system embodiments of this application are the same as those in the method embodiments described above, and will not be repeated here. The technical effects of the system embodiments of this application are the same as those of the method embodiments described above, and will not be repeated here.

[0180] Please see Figure 3 and Figure 4 In some embodiments, the image acquisition module 21 includes: a ring-shaped image acquisition bracket; a plurality of image acquisition units disposed in the inner ring of the ring-shaped image acquisition bracket for acquiring surface images; a position detection unit disposed in the inner ring of the ring-shaped image acquisition bracket for detecting whether the H-beam has reached the target position; and a motion control unit, which cooperates with the ring-shaped image acquisition bracket for driving the ring-shaped image acquisition bracket to move to the optimal image acquisition position.

[0181] Specifically, the ring-shaped image acquisition bracket can support multiple image acquisition units to acquire images of various surfaces of the H-beam. Each image acquisition unit can be a CCD industrial camera used to acquire real-time images of the entire surface of the H-beam during production. Furthermore, it can use a USB 3.0 interface or a Type-C interface to store the acquired images in a disk array with fixed names.

[0182] The position detection unit can use grating sensors, distance sensors, etc., to sense whether the H-beam has reached the target position, and can interrupt signal transmission to notify the central processing module 24, triggering the central processing module 24 to send an acquisition command to the image acquisition module 21.

[0183] The motion control unit can use stepper motors, hydraulic drives, etc. When the human-machine interaction module 23 receives the H-beam specifications specified by the user, it adjusts the stepper motors, etc., according to the specification information to drive the ring image acquisition bracket to the optimal image acquisition position, thereby improving the image acquisition quality.

[0184] In this embodiment, the optimal shooting distance can be automatically calculated and adjusted based on the selected H-beam type and camera characteristics, thereby obtaining more effective surface images. This embodiment fully integrates motion control and deep learning, effectively acquiring images from the best shooting angle, thus enabling rapid and accurate detection of various types of defects at different scales, and has broad application prospects.

[0185] Please see Figure 5 In some embodiments, the human-computer interaction module 23 includes: a system menu bar for providing parameter setting options and historical data search options; a real-time display screen for displaying defect detection results and surface images; an optional operation unit for selecting online detection mode and offline detection mode; and a status indicator unit for indicating the current operating status information of the system.

[0186] Specifically, the system menu bar includes two main parts: system parameter settings and historical data search. The system parameter settings option allows for the selection of H-beam parameters and the setting of defect types. When searching for historical data, users can search based on combinations of H-beam production time, specific defect types, and the surface to which the defects are located, thus completing the query of inspection records.

[0187] The real-time display screen can show the most recent defect detection images of a specific surface in the eight surface inspection stations of the H-beam. For example, if there is no defect image on the current surface, the inspection station will display the word "normal" in green; otherwise, it will dynamically display the latest defect image and mark the defect area and the type of defect in the image.

[0188] The optional operation unit allows selection of the system operating mode, and includes a settings button. The system operating modes include online detection mode and offline detection mode, enabling online and offline detection of surface images of H-beams, respectively. The offline detection mode offers four operating settings and two selection settings: the model switching option allows selection of any trained model to replace the current model and return to the main interface; the model training option allows training a new model based on the currently selected offline image library and automatically saving the results. The four operating settings are "Start," "Stop," "Continuous Detection," and "Single Image Detection," controlling the system's local start and stop operation, as well as the two detection modes within the offline mode, respectively.

[0189] The status indicator unit displays the current operating status information of the system, which mainly includes three parts: the current operating status of the equipment, the type of equipment fault, and related fault prompts. The equipment operating status is displayed using indicator lights of different colors and alarms, including three types: normal, stopped, and fault. The cause of the fault and fault information are displayed through indicator lights and text, respectively. In online mode, it can provide prompts for erroneous system operations.

[0190] For the detection model of the image detection module in the above system embodiments, please refer to the above method embodiments, which will not be repeated here.

[0191] This application also provides a computer program product having program code that, when run in a corresponding processor, controller, computing device, or control terminal, executes the steps in any of the above-described detection method embodiments, for example... Figure 1 Steps S100 to S500 are shown. Those skilled in the art will understand that the methods and apparatus proposed in the embodiments of this application can be implemented in various forms, including hardware, software, firmware, dedicated processors, or combinations thereof. Dedicated processors may include application-specific integrated circuits (ASICs), reduced instruction set computers (RISCs), and / or field-programmable gate arrays (FPGAs). The proposed methods and apparatus are preferably implemented as a combination of hardware and software. The software is preferably installed as an application program on a program storage device. This is typically based on a computer platform with hardware such as one or more central processing units (CPUs), random access memory (RAM), and one or more input / output (I / O) interfaces. An operating system is also typically installed on the computer platform. The various processes and functions described herein may be part of an application program, or a portion thereof may be executed by an operating system.

[0192] Figure 6 This is a schematic diagram of the control terminal provided in an embodiment of this application. Figure 6As shown, the control terminal 3 in this embodiment may include: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and capable of running on the processor 30.

[0193] When processor 30 executes computer program 32, it implements the steps in the above-described detection method embodiments, for example... Figure 1 Steps S100 to S500 are shown. Alternatively, when processor 30 executes computer program 32, it implements the functions of each unit in the above-described linkage control system embodiment, for example... Figure 2 The functions of units 21 to 24 shown.

[0194] For example, computer program 32 can be divided into one or more units, which are stored in memory 31 and executed by processor 30 to complete / implement the solution provided in this application. The one or more units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 32 in control terminal 3. For example, computer program 32 can be divided into... Figure 2 Units 21 to 24 are shown.

[0195] The control terminal 3 may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will understand that... Figure 6 This is merely an example of control terminal 3 and does not constitute a limitation on control terminal 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, a vehicle may also include input / output devices, network access devices, buses, etc.

[0196] The processor 30 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0197] The memory 31 can be an internal storage unit of the control terminal 3, a hard disk, or RAM, or it can be a storage unit of the processor 30. The memory 31 can also be an external storage device of the control terminal 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital card (SD), or a flash card. Furthermore, the memory 31 can include both internal storage units and external storage devices of the control terminal 3. The memory 31 is used to store computer programs and other programs and data required by the control terminal. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0198] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0199] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0200] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0201] In the embodiments provided in this application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0202] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0203] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0204] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0205] Furthermore, the features of the embodiments shown in the accompanying drawings or the various embodiments mentioned in this specification should not be construed as independent embodiments. Rather, each feature described in one example of an embodiment can be combined with one or more other desired features from other embodiments to produce other embodiments not described in words or with reference to the accompanying drawings.

[0206] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for detecting surface defects of an H-shaped steel, characterized by, The application relates to a visual receptive field-based target area recommendation network and a YOLOv3 target detection model. The YOLOv3 target detection model is subjected to lightweight processing by using a depth separable convolution. A multi-scale spatial attention model and a multi-scale channel attention model based on a visual attention mechanism are constructed, the multi-scale spatial attention model and the multi-scale channel attention model are cascaded, and a double-attention model based on the YOLOv3 target detection model is obtained. A surface image of a H-shaped steel is obtained, the surface image is input into the YOLOv3 target detection model, and a defect detection result is obtained through the lightweight processing and the double-attention model processing. The defect detection result is displayed, the operation mode is adjusted, and the operation state is displayed. The visual receptive field-based target area recommendation network and the YOLOv3 target detection model are constructed, and the construction comprises the following steps. A visual receptive field area is obtained according to a feature map, an output feature in the visual receptive field area is mapped into a multi-dimensional feature vector by using a sliding window to slide in the feature map, the feature vector is subjected to nonlinear change processing, and the feature vector subjected to the nonlinear change processing is input into two parallel convolution layers. The interested target is converted into a manifold distance according to a cross-manifold structure, the manifold distance is used to measure a shortest path along a manifold direction, if the shortest path is smaller than a radius of the visual receptive field area, the shortest path is regarded as an effective positive sample, and a minimum value is taken as an effective area. The manifold distance is used to measure a shortest path along a manifold direction, and the construction comprises the following steps.

2. The detection method according to claim 1, characterized in that, A curvature constraint condition is preset for a target node. If the target node is three continuous nodes, it is determined that all paths of the target node do not satisfy the curvature constraint condition, and a shortest path of the target node is determined to be infinite. If the target node is three discontinuous nodes, and a node path satisfying the curvature constraint condition exists in the target node, the node path is determined to be the shortest path. The YOLOv3 target detection model is subjected to lightweight processing by using a depth separable convolution.

3. The method of claim 1, wherein After the depth separable convolution processing, a Leaky ReLU activation function is used to replace a RELU activation function in the YOLOv3 target detection model, and an h-swish activation function is used after a BN layer. In the per-channel convolution stage, each channel in the input feature map is convolved with a corresponding single-channel convolution kernel, wherein the per-channel convolution parameter quantity is , and the calculation quantity is ; In the point-wise convolution stage, a 1*1 size convolution kernel is used to integrate the output feature maps of all channels, wherein the parameter quantity of the point-wise convolution is , , the calculation amount is , ; The total parameter quantity compression ratio of the depth separable convolution is: ; The total computation amount compression ratio of the depth separable convolution Is: ; wherein, C i denotes the number of input channels, k denotes the kernel size, C o denotes the number of output channels, H denotes the height of the input feature map, W denotes the width of the input feature map.

4. The detection method according to claim 1 or 3, characterized in that, The multi-scale spatial attention model is constructed, and the construction comprises the following steps.

5. The method of claim 1, wherein Input feature maps are encoded along horizontal and vertical directions to obtain a plurality of single-scale spatial attention weight feature maps. The plurality of single-scale spatial attention weight feature maps are stacked to obtain a multi-scale spatial attention weight feature map. The multi-scale spatial attention weight feature map is subjected to normalization processing to obtain a normalized feature map. ​ The normalized feature map is subjected to convolution operation with a coefficient matrix and then added with a bias matrix to obtain a multi-scale spatial adaptive attention feature map; The multi-scale spatial adaptive attention feature map is subjected to feature mapping by using a sigmoid activation function to obtain feature weights of each branch; The input feature map is subjected to convolution multiplication with the corresponding feature weights to obtain a final output feature map.

6. The detection method according to claim 1 or 5, characterized in that, The multi-scale channel attention model is constructed, including: The input feature map is divided into multiple groups of sub-feature maps, and global average pooling operation is performed on the multiple groups of sub-feature maps to obtain multiple groups of pooled feature maps; The multiple groups of pooled feature maps are subjected to feature fusion to obtain a fused feature map; The fused feature map is subjected to normalization processing to obtain a standardized feature map; The standardized feature map is subjected to convolution operation with a coefficient matrix and then added with a bias matrix to obtain a multi-scale channel adaptive attention feature map; The multi-scale channel adaptive attention feature map is subjected to feature mapping by using a sigmoid activation function to obtain a corrected multi-scale channel attention weight feature map; The input feature map is subjected to convolution multiplication with the corresponding corrected multi-scale channel attention weight feature map to obtain a final output feature map.

7. A H-beam steel surface defect detection system, characterized by, It includes: An image acquisition module, an image detection module, a human-computer interaction module and a central processing module; The image acquisition module is used to acquire multiple surface images of H-shaped steel in the production process, and send the multiple surface images to the image detection module; The image detection module is used to construct a target region recommendation network based on a visual receptive field, and integrate a YOLOv3 target detection model; the YOLOv3 target detection model is subjected to lightweight processing by using a depth separable convolution; a multi-scale spatial attention model and a multi-scale channel attention model based on a visual attention mechanism are constructed, the multi-scale spatial attention model and the multi-scale channel attention model are cascaded to obtain a dual attention model based on the YOLOv3 target detection model; The surface images are processed to obtain a defect detection result; The human-computer interaction module is used to display the defect detection result, adjust the running mode, and display the running state; The central processing module is used to receive operation instructions of the human-computer interaction module, send acquisition instructions to the image acquisition module, and send detection instructions to the image detection module; The construction of the target region recommendation network based on the visual receptive field and the integration of the YOLOv3 target detection model include: According to the feature map, a visual receptive field region is obtained, a sliding window is used to slide in the feature map, the output features in the visual receptive field region are mapped into a multi-dimensional feature vector, the feature vector is subjected to nonlinear change processing, and the feature vector subjected to the nonlinear change processing is input into two parallel convolution layers, wherein the classification layer is used to determine whether there is an interesting target in the current region, and the regression layer is used to predict the specific coordinates of the interesting target relative to the center point of the visual receptive field region; According to the cross-manifold structure, the target of interest is converted into a manifold distance, the manifold distance is used to measure a shortest path along a flow direction, if the shortest path is less than a radius of the visual receptive field area, the shortest path is considered as a valid positive sample, and a minimum value is taken as a valid area.

8. The detection system of claim 7, wherein, The image acquisition module comprises: a ring-shaped image acquisition support; a plurality of image acquisition units arranged at an inner ring of the ring-shaped image acquisition support and configured to acquire the surface image; a position detection unit arranged at the inner ring of the ring-shaped image acquisition support and configured to detect whether the H-shaped steel reaches a target position; and a motion control unit configured to drive the ring-shaped image acquisition support to move to an optimal image acquisition position.

9. The detection system of claim 7, wherein, The human-computer interaction module comprises: a system menu bar configured to provide a parameter setting option and a historical data searching option; a real-time display screen configured to display the defect detection result and the surface image; a selectable operation unit configured to select an online detection mode and an offline detection mode; and a state indication unit configured to indicate running state information of the current system.