Disease detection image recognition method and system for beam-column structure of lightweight rail transit system
By introducing the SFDE module into the lightweight rail transit system, combined with Scharr edge detection and fast Fourier transform, the accuracy and real-time performance of beam and column structure defect detection are improved. This solves the detection difficulties of traditional models in low contrast and complex backgrounds, and achieves efficient defect identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CRRC TANGSHAN CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies are insufficient for high-precision, real-time detection of structural defects in beams and columns in lightweight rail transit systems, especially in situations with low contrast, complex backgrounds, and dense small targets. Traditional models are ineffective in these conditions and cannot meet the requirements for safety monitoring.
The SFDE module, which embeds a spatial domain feature extraction branch and a frequency domain feature extraction module, is used to improve the recognition ability of local details and global features through the Scharr edge detection operator and fast Fourier transform. Combined with lightweight convolution to compress feature dimensions, an adapted beam and column defect detection model is constructed.
It improves the accuracy of identifying and locating small-target diseases, enhances the model's resistance to interference from complex backgrounds, reduces computational complexity, meets the needs of real-time detection, and achieves accurate and efficient detection of multiple types of diseases.
Smart Images

Figure CN121962094A_ABST
Abstract
Description
A method and system for image recognition of structural defects in beams and columns of lightweight rail transit systems Technical Field
[0001] This application relates to the field of rail transit technology, specifically to an image recognition method and system for detecting defects in beam and column structures of lightweight rail transit systems. Background Technology
[0002] The ultra-lightweight composite beams and columns of lightweight rail transit systems consist of an internal steel structure and an external structural protective layer, which differs significantly from traditional steel-concrete composite materials. Because strain sensors cannot be embedded internally, internal deformation is transmitted to the outer surface of the ultra-lightweight composite beams and columns through an external coating. The condition of the external protective layer can directly infer the condition of the internal steel structure. Therefore, defects in the external protective layer (such as cracks) are a core hidden danger to the structural safety of the rail beams and columns in lightweight rail transit systems and must be identified promptly through regular inspections.
[0003] However, beam and column defect detection scenarios have characteristics such as low contrast (cracks are similar in color to the background), dense small targets (fine cracks are only 0.1-2mm wide), a lot of background interference (complex textures on the inner walls of beams and columns), and not meeting the requirements for real-time detection at high speeds. As a result, the existing YOLOv10 model does not perform well when directly applied, and it is difficult to meet the accuracy and real-time requirements of beam and column safety monitoring.
[0004] Therefore, there is an urgent need for an image recognition method for detecting structural defects in lightweight rail transit systems, specifically targeting lightweight rail beams and columns. Summary of the Invention
[0005] This application provides a method and system for image recognition of beam and column structural defects in a lightweight rail transit system.
[0006] The first aspect of this application provides an image recognition method for detecting defects in beam-column structures of a lightweight rail transit system. This method is applied to a target defect detection model, where the C2f module of the target defect detection model includes an embedded SFDE module. The SFDE module includes a spatial domain feature extraction branch and a frequency domain feature extraction module. The method comprises: acquiring a sampled image of the target object and inputting the sampled image into the pre-trained target defect detection model; identifying and detecting local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module, obtaining a local detail feature output result; identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module, obtaining a global feature output result; and fusing and processing the local detail feature output result and the global feature output result to output the defect detection result of the sampled image.
[0007] In one optional embodiment of this application, the spatial domain feature extraction branch is configured with a Schar edge detection operator. The step of identifying and detecting local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module to obtain the local detail feature output result includes: using the Schar edge detection operator in the spatial domain feature extraction module to perform non-learning edge recognition detection on the local detail features in the sampled image according to a fixed first convolution kernel to obtain the local detail feature output result.
[0008] In an optional embodiment of this application, the step of performing non-learning edge detection on local detail features in the sampled image using the Schar edge detection operator in the spatial domain feature extraction module with a fixed first convolution kernel to obtain the local detail feature output result includes: using the Schar edge detection operator to calculate the horizontal gradient features and vertical gradient features in the sampled image with a fixed first convolution kernel; fusing the horizontal gradient features and the vertical gradient features and inputting them into the next layer of the network of the target disease detection model for feature extraction; and constructing a structured spatial branch to characterize the local detail feature output result using all feature extraction results.
[0009] In an optional embodiment of this application, the structured spatial branch used to characterize the output result of the local detail features includes:
[0010] Where Magnitude represents the structured spatial branch used to characterize the output of the local detail features, grad x The horizontal gradient feature, grad yThis represents the vertical gradient feature.
[0011] In an optional embodiment of this application, the step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module to convert the sampled image from the spatial domain to the frequency domain based on the Fast Fourier Transform to obtain frequency domain features; separating the real and imaginary parts in the frequency domain features, and extracting low-frequency and high-frequency information of the image from the real and imaginary parts respectively through a second convolution kernel; restoring the low-frequency and high-frequency information to the spatial domain through an inverse Fourier transform to obtain the global feature output result.
[0012] In one optional embodiment of this application, the low-frequency information of the real part includes at least one of global feature information and illumination change information; and / or, the high-frequency information of the imaginary part includes at least one of edge information, texture information, and noise information.
[0013] In an optional embodiment of this application, the conversion formulas for converting the sampled image from the spatial domain to the frequency domain based on Fast Fourier Transform, and for restoring the low-frequency information and the high-frequency information to the spatial domain via Inverse Fourier Transform, include:
[0014]
[0015] Where u and v represent frequency domain coordinates; x and y represent spatial domain coordinates; F(x,y) represents the spatial domain image; F(u,v) represents the frequency domain image; and M and N represent the width and height of the sampled image.
[0016] In one optional embodiment of this application, the step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module, identifying and detecting global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result.
[0017] In an optional embodiment of this application, the step of calling the frequency domain feature extraction module in the SFDE module to identify and detect global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result, includes: calling the frequency domain feature extraction module in the SFDE module to perform directional decomposition on the input frequency domain features in the sampled image through a mean operation to obtain a horizontal mean vector and a vertical mean vector respectively; using global average pooling to replace the fully connected layer to obtain global features for characterizing global dependencies; combining the global features with the horizontal mean vector and the vertical mean vector respectively to form a horizontal feature vector and a vertical feature vector; and fusing the horizontal feature vector and the vertical feature vector after convolution processing to obtain the global feature output result.
[0018] In an optional embodiment of this application, the step of fusing the horizontal feature vector and the vertical feature vector after convolution processing to obtain the global feature output result includes: inputting the horizontal feature vector and the vertical feature vector into a third convolutional layer and a fourth convolutional layer respectively for feature extraction; wherein the third convolutional layer and the fourth convolutional layer are asymmetric convolutional layers; and adding the output results of the third convolutional layer and the fourth convolutional layer to obtain the global feature output result.
[0019] In an optional embodiment of this application, the step of combining the global features with the horizontal mean vector and the vertical mean vector to form a horizontal feature vector and a vertical feature vector, respectively, includes:
[0020]
[0021] Among them, X H X represents the horizontal feature vector. V Let GAP represent the vertical feature vector, GAP represent the global average pooling operation, and GAP(X) represent the global feature obtained after the global average pooling operation. Indicates broadcast addition; M H (X) represents the mean vector in the horizontal direction; M H (Y) represents the mean vector in the vertical direction.
[0022] In an optional embodiment of this application, the third convolutional layer is 3. One convolutional layer; and / or, the fourth convolutional layer is 1. 3 convolutional layers.
[0023] In an optional embodiment of this application, the step of fusing and processing the local detail feature output result and the global feature output result to output the disease detection result of the sampled image includes: fusing the local detail feature output result and the global feature output result to obtain the fused image feature output result; and performing a lightweight convolution to compress the feature dimension of the image feature output result to obtain the disease detection result of the sampled image.
[0024] In an optional embodiment of this application, after obtaining a sampled image of the target object and inputting the sampled image into the pre-trained target disease detection model, the method further includes: upsampling the sampled image based on a dynamic upsampling method to obtain image features.
[0025] In an optional embodiment of this application, the upsampling of the sampled image based on the dynamic upsampling method to obtain image features includes: resampling the first feature map of the initial sample set in the sampled image into a second feature map using the position in the preset sampling scale factor based on the preset grid sampling function; generating an offset using a first linear layer and reshaping it into a third offset through pixel transformation; wherein the third offset and the initial sample set constitute a new sample set.
[0026] In one optional embodiment of this application, the target object is a beam or column in a lightweight rail transit system.
[0027] A second aspect of this application provides a disease detection model training method for training a target disease detection model as described in any of the preceding claims. The target disease detection model training method includes: acquiring historical disease images of a target object; upsampling the historical disease images based on a dynamic upsampling method to obtain a training sample set; performing Gaussian distribution modeling on each anchor box in the training sample set to obtain a Gaussian-processed training sample set; and training an initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thereby obtaining a target disease detection model.
[0028] In one optional embodiment of this application, the step of modeling each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set includes: calculating the probability density function of the two-dimensional Gaussian distribution in the training sample set; converting the similarity between two anchor boxes into a distribution distance between two Gaussian distributions based on the probability density function; exponentially normalizing the distribution distance to obtain the Gaussian-processed Wasserstein distance; and redistributing the training sample set based on the Wasserstein distance to obtain the Gaussian-processed training sample set.
[0029] In one optional embodiment of this application, training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function to obtain a new disease detection model; calculating the model precision and model recall of the new disease detection model; and if both the model precision and the model recall meet the corresponding target thresholds, then the new disease detection model is determined as the target disease detection model.
[0030] In one optional embodiment of this application, training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function to obtain a new disease detection model; comparing the historical disease sample data in the historical disease images with the detection results output by the new disease detection model; if the error of the comparison result is less than a preset error, then the new disease detection model is determined as the target disease detection model.
[0031] In one optional embodiment of this application, the target disease detection model structure includes: a yolov10 model structure in which C2f is replaced with the SFDE module; a dynamic upsampling module for implementing the dynamic upsampling method; and / or, a preset loss function and a loss function module for implementing Gaussian distribution modeling.
[0032] A third aspect of this application provides a defect detection system for performing the image recognition method for detecting defects in beam-column structures of a lightweight rail transit system as described in any of the preceding claims.
[0033] A fourth aspect of the embodiments of this application provides a disease detection device, which is configured with the disease detection system described above.
[0034] A fifth aspect of the embodiments of this application provides a traffic operation vehicle, including: a vehicle body; a defect detection system as described above; and / or, a defect detection device as described above.
[0035] A fifth aspect of this application provides an image recognition system for detecting defects in beam-column structures of a lightweight rail transit system. This system is applied to a target defect detection model, where the C2f module of the target defect detection model includes an embedded SFDE module. The SFDE module includes a spatial domain feature extraction branch and a frequency domain feature extraction module. The lightweight rail transit system image recognition system for detecting defects in beam-column structures includes: a preprocessing module for acquiring a sampled image of the target object and inputting the sampled image into the pre-trained target defect detection model; a first extraction module for identifying and detecting local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module, obtaining a local detail feature output result; a second extraction module for identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module, obtaining a global feature output result; and an inspection module for fusing and processing the local detail feature output result and the global feature output result, and then outputting the defect detection result of the sampled image.
[0036] A sixth aspect of this application provides a disease detection model training device for training a target disease detection model as described in any of the preceding claims. The target disease detection model training device includes: an acquisition module for acquiring historical disease images of a target object; a sampling module for upsampling the historical disease images based on a dynamic upsampling method to obtain a training sample set; a modeling module for performing Gaussian distribution modeling on each anchor box in the training sample set to obtain a Gaussian-processed training sample set; and a training module for training an initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thereby obtaining the target disease detection model.
[0037] A seventh aspect of this application provides a computer device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the preceding claims.
[0038] An eighth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0039] Firstly, addressing the pain points of low resolution, limited usable features, and easy feature loss during multiple downsampling for small targets such as surface cracks (e.g., hairline cracks) on ultra-lightweight composite beams and columns, traditional detection models are prone to missed detections and location misalignments. By optimizing the detection of target objects from both local and global perspectives, the perception ability of small target edge details and global structure is enhanced, thereby improving the accuracy of small target defect identification and location precision. Secondly, addressing the complex background of uneven lighting such as strong and weak light on beam and column surfaces, and the low contrast characteristics often present in crack areas, traditional models struggle to distinguish defects from background noise, easily leading to false detections or missed detections. The embodiments of this application can use the spatial domain feature extraction module in the SFDE module to identify and detect local detail features in the sampled image to obtain local detail feature output results. Local detail features can enhance the model's resistance to interference from complex backgrounds and improve the feature response in low-contrast areas, thereby enhancing the robustness of defect detection in specific scenarios. Thirdly, existing target detection models often improve accuracy by deepening the network or adding convolutional layers, leading to increased computational complexity and model size, making it difficult to adapt to the real-time and hardware compatibility requirements of ultra-lightweight composite beam and column detection equipment (such as equipment mounted on operating vehicles). This application's embodiment, through lightweight module design and computational logic optimization, improves detection accuracy while embedding only the SFDE module, controlling the size and inference latency of the target defect detection model to meet real-time detection needs in driving environments. Fourthly, general-purpose YOLO series models are not customized for the changing characteristics of ultra-lightweight composite beam and column surfaces, making it difficult to achieve detection performance that meets engineering application standards. This application's embodiment constructs a target defect detection model adapted to beam and column defect scenarios, achieving accurate and efficient detection of multiple types of defects, providing technical support for structural safety monitoring. Attached Figure Description
[0040] The accompanying drawings, which are included to provide a further understanding of this application and constitute a part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 is a schematic diagram of the structure of a traditional YOLOv10 model; Figure 2 is a schematic diagram of the structure of a target defect detection model in an embodiment of this application; Figure 3 is a schematic diagram of the structure of an SFDE module in an embodiment of this application; Figure 4 is a flowchart of an image recognition method for defect detection in beam-column structures of a lightweight rail transit system in an embodiment of this application; Figure 5 is a schematic diagram of separable frequency domain convolution in an image recognition method for defect detection in beam-column structures of a lightweight rail transit system in an embodiment of this application; Figure 6 is a result diagram of defect detection using a target defect inspection model in an embodiment of this application; Figure 7 is a flowchart of the training process for a target defect detection model in an embodiment of this application; Figure 8 is a traditional Io... U calculation method; Figure 9 is a schematic diagram of the sampling process in one embodiment of this application; Figure 10 is a schematic diagram of the sampling process in one embodiment of this application; Figure 11 is a diagram of the result of disease detection using the target disease inspection model in an embodiment of this application; Figure 12 is a comparison diagram of the result of disease detection using the target disease inspection model in an embodiment of this application with the result of detection by other methods; Figure 13 is a schematic diagram of the structure of the image recognition system for disease detection of beam and column structures in a lightweight rail transit system provided in an embodiment of this application; Figure 14 is a schematic diagram of the structure of the disease detection model training device provided in an embodiment of this application; Figure 15 is a schematic diagram of the structure of the computer equipment provided in an embodiment of this application. Detailed Implementation
[0041] In the process of developing this application, the inventors discovered an urgent need for an image recognition method for detecting structural defects in lightweight rail transit systems' beams and columns. To address this issue, this application provides an image recognition method and system for detecting structural defects in lightweight rail transit systems' beams and columns.
[0042] The solutions in this application embodiment can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0043] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.
[0044] The lightweight rail transit system beam and column structure defect detection image recognition method provided in this application embodiment is applied to a target defect detection model. The C2f module of the target defect detection model includes an embedded SFDE module. The SFDE (Spatial and Frequency Domain Enhancer) module includes a spatial domain feature extraction branch and a frequency domain feature extraction module. As shown in Figure 1, it is a schematic diagram of the structure of a traditional YOLOv10 model. The YOLO series of algorithms are the most commonly used typical algorithms in one-stage target detection algorithms. After continuous iteration and upgrades, they have significant advantages in detection accuracy and real-time performance compared to other target detection frameworks. Among them, the YOLOv10 algorithm is widely used in the industrial field. This model is a new breakthrough in the field of real-time end-to-end target detection, and has achieved significant progress in optimizing the post-processing process and model architecture. The YOLO series of algorithms proposes a dual-task consistency assignment training method that does not require non-maximum suppression (NMS), which not only improves detection performance but also significantly reduces inference latency. However, considering the high precision, complex background, and different detection scales required for beam and column surface defect detection, YOLOv10 needs to be optimized to improve the accuracy and efficiency of detection in beam and column surface defect detection scenarios.
[0045] Figure 2 is a schematic diagram of the target disease detection model provided in the embodiment of this application, and Figure 3 is a schematic diagram of the SFDE module in the target disease detection model in the embodiment of this application.
[0046] Traditional YOLOv10 models employ numerous C2f (double convolutional feature fusion) modules, primarily relying on regular convolutions to extract features and fusing the extracted local and global features. This approach achieves good detection results in most object detection tasks; however, it performs poorly for small objects and objects against complex backgrounds. Because small objects lack sufficient edge information and texture, the C2f module gradually loses feature information during multiple downsampling extractions, leading to subsequent detection difficulties. The challenge in detecting objects against complex backgrounds lies in the high similarity between background texture, color, or shape and the target. The C2f module faces a balance between processing local features and preserving global context, resulting in difficulty in model differentiation. Furthermore, the C2f module uses a deep network structure, leading to high computational complexity and impacting model efficiency.
[0047] Please refer to Figures 2 and 3. Based on the shortcomings of the C2f module, this embodiment adds an SFDE module to the target disease detection model. The SFDE module is embedded into the original C2f module using a structured design. This SFDE module mainly consists of two innovative branches: spatial domain feature extraction and frequency domain feature extraction. In this embodiment, the spatial domain feature extraction branch introduces the Scharr edge operator (Scharr edge detection operator), achieving non-learning edge detection through a fixed convolution kernel, improving attention to salient structural regions, and effectively enhancing detail preservation. The frequency domain feature extraction branch uses Fast Fourier Transform to map the input features to the frequency domain, separating the real and imaginary parts, and then extracting high-frequency and low-frequency information from the image through convolution, followed by inverse transformation to restore it to the time domain, achieving modeling of periodic textures and global structures. Finally, by fusing the outputs of the two branches and compressing the feature dimensions through lightweight convolution, a feature representation with both local edge sensitivity (corresponding to the spatial domain) and global frequency response (frequency domain, global) is constructed. By employing skip connections to fuse spatial domain and input features, we can simultaneously enhance both local and global image features while reducing the gradient vanishing problem, thereby improving the model's expressive power.
[0048] In an optional embodiment of this application, the above-described SFDE module structure can be described as follows:
[0049]
[0050]
[0051] In the above formula, X represents the input feature; Extract features for the spatial domain; Extract features in the frequency domain; For Scharr operator operations; For Fast Fourier Transform; This is the inverse Fourier transform.
[0052] Existing mainstream network models often neglect the joint modeling of frequency domain structure and edge information when processing images. The SFDE module in this embodiment fully integrates the spatial and frequency domain features of the image, effectively improving the model's ability to perceive local details and global structure. The improved target disease detection model structure in this embodiment is shown in Figure 2, with the improved parts highlighted by color. In this embodiment, the backbone network C2f structure of the YOLOv10 model in Figure 1 is optimized, and a loss function and dynamic upsampling replacement are introduced. The optimized model structure is shown in Figure 2.
[0053] Please refer to Figure 4. The lightweight rail transit system beam-column structure defect detection image recognition method provided in this application embodiment includes the following steps 401-404: Step 401: Obtain a sampled image of the target object and input the sampled image into the pre-trained target defect detection model; the sampled image refers to an image containing the whole or part of the target object, which may contain some defects or may be defect-free. In this application embodiment, the sampled image can be obtained by a camera, video camera, or other equipment. As described above, the C2f module of the target defect detection model in this application embodiment includes an embedded SFDE module, which includes a spatial domain feature extraction branch and a frequency domain feature extraction module.
[0054] Step 402: Based on the spatial domain feature extraction module in the SFDE module, identify and detect local detail features in the sampled image to obtain local detail feature output results; Step 403: Based on the frequency domain feature extraction module in the SFDE module, identify and detect global features in the sampled image to obtain global feature output results; Step 404: After fusing and processing the local detail feature output results and the global feature output results, output the disease detection results of the sampled image.
[0055] Firstly, addressing the pain points of low resolution, limited usable features, and easy feature loss during multiple downsampling for small targets such as surface cracks (e.g., hairline cracks) on ultra-lightweight composite beams and columns, traditional detection models are prone to missed detections and location misalignments. By optimizing the detection of target objects from both local and global perspectives, the perception ability of small target edge details and global structure is enhanced, thereby improving the accuracy of small target defect identification and location precision. Secondly, addressing the complex background of uneven lighting such as strong and weak light on beam and column surfaces, and the low contrast characteristics often present in crack areas, traditional models struggle to distinguish defects from background noise, easily leading to false detections or missed detections. The embodiments of this application can use the spatial domain feature extraction module in the SFDE module to identify and detect local detail features in the sampled image to obtain local detail feature output results. Local detail features can enhance the model's resistance to interference from complex backgrounds and improve the feature response in low-contrast areas, thereby enhancing the robustness of defect detection in specific scenarios. Thirdly, existing target detection models often improve accuracy by deepening the network or adding convolutional layers, leading to increased computational complexity and model size, making it difficult to adapt to the real-time and hardware compatibility requirements of ultra-lightweight composite beam and column detection equipment (such as equipment mounted on operating vehicles). This application's embodiment, through lightweight module design and computational logic optimization, improves detection accuracy while embedding only the SFDE module, controlling the size and inference latency of the target defect detection model to meet real-time detection needs in driving environments. Fourthly, general-purpose YOLO series models are not customized for the changing characteristics of ultra-lightweight composite beam and column surfaces, making it difficult to achieve detection performance that meets engineering application standards. This application's embodiment constructs a target defect detection model adapted to beam and column defect scenarios, achieving accurate and efficient detection of multiple types of defects, providing technical support for structural safety monitoring.
[0056] In one optional embodiment of this application, the BottleNeck module can be replaced by the local convolutional inversion cross-fusion module, thereby improving the feature extraction capability of the model.
[0057] In one optional embodiment of this application, the embedded SFDE module can be configured with a spatial domain Scharr operator branch and an enhanced Sobel operator. Through the spatial domain Scharr operator branch, the enhanced Sobel operator is used to extract edge information of small-sized cracks (such as hairline cracks) in beams and columns more accurately, with higher noise resistance and direction sensitivity, effectively preserving the detailed gradient features of small targets. The frequency domain branch separates the real part (low-frequency global information) and the imaginary part (high-frequency edge texture information) through fast Fourier transform, and then extracts direction-sensitive features through separable frequency domain convolution SFCC. The spatial domain and frequency domain features are fused to accurately capture the details of small targets, realize the joint perception of local details and global structure of small targets, solve the problem of losing small target features in multiple downsampling of traditional C2f modules, and significantly reduce the false negative rate of small targets. Meanwhile, in response to the low contrast of the dye outflow area in the beam and column cracks, the spatial domain Scharr operator branch of the SFDE module can highlight edge details, and the frequency domain branch can enhance the fusion of low-frequency global information and high-frequency texture information, making the feature response of the fuel area more obvious and reducing the false detection rate caused by low contrast. In addition, the separable frequency domain convolution has a stronger anti-interference ability against complex backgrounds (such as texture and uneven lighting) and can effectively distinguish the fracture area from background noise.
[0058] In an optional embodiment of this application, the spatial domain feature extraction branch is configured with a Scharr edge detection operator. The above step 402, which involves the spatial domain feature extraction module in the SFDE module identifying and detecting local detail features in the sampled image to obtain the local detail feature output result, includes the following steps: using the Scharr edge detection operator in the spatial domain feature extraction module, the local detail features in the sampled image are subjected to non-learning edge recognition detection according to a fixed first convolution kernel to obtain the local detail feature output result.
[0059] To address the insufficient edge extraction capability of traditional C2f modules for small targets, this application introduces a fixed-parameter Scharr operator as an edge guidance module, embedded in the shallow feature extraction stage. The Scharr operator is a discrete differential operator for edge detection, essentially an enhanced version of the Sobel operator. It provides a more accurate approximation when calculating the horizontal and vertical gradients of an image, especially exhibiting more stable responses in high-frequency regions (such as edges). Compared to traditional convolutional layers, the Scharr operator has higher noise resistance and direction sensitivity, effectively highlighting detailed gradient features in the image.
[0060] Compared to traditional convolutional structures, this application's embodiments introduce a Scharr operator with fixed parameters as the edge guidance module of the target disease detection model. The edge guidance module uses non-learned gradient priors as structural guidance, providing clearer edge information for feature extraction and helping to improve the network's ability to resolve complex texture regions.
[0061] In an optional embodiment of this application, the Schar edge detection operator in the spatial domain feature extraction module performs non-learning edge recognition detection on the local detail features in the sampled image according to a fixed first convolution kernel to obtain the local detail feature output result, including the following steps 501-503: Step 501: Using the Schar edge detection operator, calculate the horizontal gradient features and vertical gradient features in the sampled image according to a fixed first convolution kernel; Step 502: Fuse the horizontal gradient features and the vertical gradient features and input them into the next layer of the network of the target disease detection model for feature extraction; Step 503: Construct a structured spatial branch to characterize the local detail feature output result using all feature extraction results.
[0062] In an optional embodiment of this application, the structured spatial branch used to characterize the output result of the local detail features includes:
[0063] Where Magnitude represents the structured spatial branch used to characterize the output of the local detail features, grad x The horizontal gradient feature, grad y This represents the vertical gradient feature.
[0064] For example, the Scharr Conv operator can use two 3 Three convolutional kernels are used to calculate the horizontal gradient (grad_x) and vertical gradient (grad_y) of the image respectively. The calculated gradients are then fused and input into the next layer of the network for further feature extraction, thereby constructing a spatial branch that combines structure awareness and efficient representation.
[0065] In an optional embodiment of this application, step 403 above, the identification and detection of global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain the global feature output result, includes the following steps 601-603: Step 601, calling the frequency domain feature extraction module in the SFDE module to convert the sampled image from the spatial domain to the frequency domain based on the Fast Fourier Transform to obtain frequency domain features; Step 602, separating the real and imaginary parts in the frequency domain features, and extracting low-frequency and high-frequency information of the image from the real and imaginary parts respectively through the second convolution kernel; the complex number calculation formula of the frequency domain image can be:
[0066] in, For complex numbers in the frequency domain image; For the real part of a complex number; It represents the imaginary part of a complex number.
[0067] After a spatial image is Fourier transformed into a frequency domain feature image, its complex real part contains low-frequency information (global features, illumination changes, etc.) of the original image, while its imaginary part contains high-frequency information (edges, textures, noise, etc.). Performing convolution operations on the real and imaginary parts separately can preserve high-frequency information, making edge and detail features more prominent; enhance low-frequency information to preserve the overall image structure, and suppress high-frequency noise.
[0068] Step 603: Restore the low-frequency information and the high-frequency information to the spatial domain through inverse Fourier transform to obtain the global feature output result.
[0069] In one optional embodiment of this application, the low-frequency information of the real part includes at least one of global feature information and illumination change information; and / or, the high-frequency information of the imaginary part includes at least one of edge information, texture information, and noise information.
[0070] In one optional embodiment of this application, complex numbers have a stronger representational ability than real numbers. The Fast Fourier Transform converts the image from the spatial domain to the frequency domain. This embodiment adds a frequency domain feature extraction module, and the frequency domain Fourier information can enhance the model's global expressive power, generalization ability, and noise reduction performance. The Inverse Fourier Transform converts the image back from the frequency domain to the spatial domain.
[0071] In an optional embodiment of this application, the conversion formulas for converting the sampled image from the spatial domain to the frequency domain based on Fast Fourier Transform, and for restoring the low-frequency information and the high-frequency information to the spatial domain via Inverse Fourier Transform, include:
[0072]
[0073] Where u and v represent frequency domain coordinates; x and y represent spatial domain coordinates; F(x,y) represents the spatial domain image; F(u,v) represents the frequency domain image; and M and N represent the width and height of the sampled image.
[0074] In an optional embodiment of this application, step 403 above, the step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result, includes: calling the frequency domain feature extraction module in the SFDE module, identifying and detecting global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result.
[0075] In an optional embodiment of this application, the step of calling the frequency domain feature extraction module in the SFDE module to identify and detect global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result, includes the following steps 701-704: Step 701: Call the frequency domain feature extraction module in the SFDE module to perform directional decomposition on the input frequency domain features in the sampled image through a mean operation to obtain a horizontal mean vector and a vertical mean vector respectively; Step 702: Use global average pooling to replace the fully connected layer to obtain global features used to characterize global dependencies; Step 703: Combine the global features with the horizontal mean vector and the vertical mean vector respectively to form a horizontal feature vector and a vertical feature vector; Step 704: Perform convolution processing on the horizontal feature vector and the vertical feature vector and then fuse them to obtain the global feature output result.
[0076] While the aforementioned frequency domain feature extraction module can obtain richer feature information, traditional convolution processing of frequency domain information uses two convolution kernels to extract high-frequency and low-frequency features separately, and then directly concatenates the extracted features for information fusion. To avoid the problem of a sharp increase in computational load reducing model efficiency in some cases, and the neglect of the independent features of complex signals in the horizontal and vertical directions in the first stage, this application's embodiment uses SFDC (Separable Frequency Domain Convolution) to replace traditional convolution for extracting frequency domain features.
[0077] Figure 5 shows a schematic diagram of the SFDC convolutional structure. Assume the input frequency domain feature matrix is X and the feature dimension is C. H W, where C, H, and W represent the number of channels, height, and width, respectively. To reduce computational complexity, the separable frequency domain convolution first performs a directional decomposition of the input frequency domain features through a mean operation, obtaining the mean vectors in the horizontal and vertical directions. Next, global average pooling (GAP) is used instead of the fully connected layer to obtain the global feature XG(C). 1 1) The GAP operation can extract global dependencies between channels in the frequency domain space and enhance the spatial robustness of features.
[0078] In an optional embodiment of this application, step 704 above, which involves convolving the horizontal feature vector and the vertical feature vector and then fusing them to obtain the global feature output result, includes the following steps 801-802: Step 801, inputting the horizontal feature vector and the vertical feature vector into the third convolutional layer and the fourth convolutional layer respectively for feature extraction; wherein, the third convolutional layer and the fourth convolutional layer are asymmetric convolutional layers; Step 802, adding the output results of the third convolutional layer and the fourth convolutional layer to obtain the global feature output result.
[0079] In an optional embodiment of this application, the global feature XG is combined with the mean vectors in the horizontal and vertical directions to form a horizontal feature vector XH (C H 1) and vertical eigenvector XV (C 1 W). Correspondingly, the step of combining the global features with the horizontal mean vector and the vertical mean vector to form a horizontal feature vector and a vertical feature vector, respectively, includes:
[0080]
[0081] Among them, X H X represents the horizontal feature vector. V Let GAP represent the vertical feature vector, GAP represent the global average pooling operation, and GAP(X) represent the global feature obtained after the global average pooling operation. Indicates broadcast addition; M H (X) represents the mean vector in the horizontal direction; M H (Y) represents the mean vector in the vertical direction. In an optional embodiment of this application, the third convolutional layer is 3. One convolutional layer; and / or, the fourth convolutional layer is 1. 3 convolutional layers.
[0082] The combination method used in this application's embodiments can capture the nonlinear relationships and directional spatial information between channels, enhancing the robustness of the model. The fused horizontal and vertical feature vectors are then input into 3... 1, 1 3. Asymmetric convolutional layers are used for feature extraction, and the results are finally summed to obtain the output feature X'(C). H W).
[0083]
[0084] This application embodiment employs a separable frequency domain convolutional structure design to broadcast and add the global features extracted by global average pooling to the average features in local directions (i.e., horizontal and vertical directions), and then extracts direction-sensitive features through separable convolutional layers. This approach offers the following advantages over traditional convolution: it introduces global context to enhance the expressive power of local features; it avoids the limitations of the local receptive field of the convolutional kernel, resulting in better direction awareness. Specifically, the computational cost of standard 3×3 convolutional frequency domain feature extraction is:
[0085] The computational cost of SFCC frequency domain feature extraction is:
[0086]
[0087]
[0088] The ratio of computational workload is:
[0089] In the above formula, H and W are the height and width of the feature map, respectively; Input the number of channels; This represents the number of output channels. As shown in the formula above, separable frequency domain convolution (SFDC) reduces computational cost by approximately 33% compared to standard convolution. While significantly reducing computational cost, it also enhances the model's feature representation capabilities.
[0090] In an optional embodiment of this application, step 404 above, which involves fusing and processing the local detail feature output result and the global feature output result to output the disease detection result of the sampled image, includes the following steps 901-902: Step 901, fusing the local detail feature output result and the global feature output result to obtain the fused image feature output result; Step 902, performing a lightweight convolution on the image feature output result to compress the feature dimension to obtain the disease detection result of the sampled image.
[0091] In an optional embodiment of this application, after obtaining a sampled image of the target object and inputting the sampled image into the pre-trained target disease detection model, the method further includes the following step: upsampling the sampled image based on a dynamic upsampling method to obtain image features.
[0092] In an optional embodiment of this application, the upsampling of the sampled image based on the dynamic upsampling method to obtain image features includes the following steps 1001-1002: Step 1001: Based on a preset grid sampling function, using the position in the preset sampling scaling factor, the first feature map of the initial sampling set in the sampled image is resampled into a second feature map; Step 1002: An offset is generated using a first linear layer, and reshaped into a third offset through pixel transformation; wherein, the third offset and the initial sampling set constitute a new sampling set.
[0093] In one optional embodiment of this application, the target object is a beam or column in a lightweight rail transit system.
[0094] One embodiment of this application provides a method for training a disease detection model, used to train the target disease detection model as described in any of the preceding claims. The target disease detection model in this embodiment is based on the YOLOv10 architecture. Targeting the characteristics of beam-column visual detection scenarios, structural improvements are made from three dimensions: integrating a dual attention mechanism in the backbone layer, optimizing the PAN layer, and reconstructing anchor frames. Simultaneously, it is trained and validated using a beam-column disease dataset. Experiments were conducted on beam-column surface disease information using the YOLOv10 algorithm network, obtaining model training results at different scales. The detection performance of the model trained based on the YOLOv10n algorithm is 61.3% at an IoU threshold of 0.5, with an accuracy of 71.6%. Its model size is 5.2M, and the detection results are shown in Figure 6. As can be seen from Figure 6, after using the YOLOv10 algorithm to detect the surface of laboratory beam-column specimens, when detecting cracks at different scales, the detection effect for small targets is poor due to the large difference in target size. Therefore, optimization and improvement are performed based on existing open-source models.
[0095] Please refer to Figure 7. The target disease detection model training method includes the following steps 1101-1104: Step 1101: Obtain historical disease images of the target object; Step 1102: Upsample the historical disease images based on a dynamic upsampling method to obtain a training sample set; Step 1103: Model each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set; Step 1104: Train the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thus obtaining the target disease detection model.
[0096] In an optional embodiment of this application, step 1103, which involves modeling each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set, includes the following steps 1201 and 1204: Step 1201: Calculate the probability density function of the two-dimensional Gaussian distribution in the training sample set; Step 1202: Convert the similarity between two anchor boxes into a distribution distance between two Gaussian distributions based on the probability density function; Step 1203: Normalize the distribution distance exponentially to obtain the Gaussian-processed Wasserstein distance; Step 1204: Redistribute the training sample set based on the Wasserstein distance to obtain the Gaussian-processed training sample set.
[0097] As shown in Figure 8, the traditional IoU calculation method shows that small targets occupy fewer pixels, while large targets occupy more pixels. Therefore, the detection performance of small targets will be greatly reduced during model training.
[0098] To address the limitation in small target detection capabilities, this study introduces a loss calculation method based on normalized Wasserstein distance, using the YOLOv10 object detection algorithm. First, a Gaussian distribution model is applied to each anchor box in the dataset. To better describe the weights of different pixels within the bounding box, pixel importance is generally reduced from the center to the boundary. The size of each anchor box can be represented as R = (Cx, Cy, W, H), where Cx and Cy are the coordinates of the anchor box's center point, and W and H are the width and height of the anchor box, respectively. The equation of the inscribed ellipse of the anchor box is as follows:
[0099] in,( , Let be the coordinates of the center point of the anchor frame, and let the width and height of the anchor frame be the major and minor axes of the inscribed ellipse, respectively. Therefore:
[0100] The probability density function of the two-dimensional Gaussian distribution is:
[0101] Where x, µ, and Σ represent the coordinates (x, y), mean vector, and covariance matrix of the Gaussian distribution, respectively.
[0102]
[0103] In the equation, ellipse 2 will be a density profile of a two-dimensional Gaussian distribution. Therefore, the horizontal bounding box R = (Cx, Cy, W, H) can be modeled as a two-dimensional Gaussian distribution N(µ, Σ), where:
[0104] Therefore, the similarity between two anchor frames can be transformed into the distribution distance between two Gaussian distributions. Then, the Wasserstein distance is used to calculate the distribution distance for each anchor frame, for two Gaussian distributions... and The Wasserstein distance is defined as:
[0105] in, This represents the Frobenius norm distance. Furthermore, for and Gaussian distribution, and After inputting the data for the two types of anchor boxes, the above formula can be simplified to the following formula:
[0106] For the above formula and By performing exponential normalization on the distance values, we can obtain the normalized Wasserstein distance values. .
[0107] In an optional embodiment of this application, step 1104 above, which involves training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met to obtain the target disease detection model, includes the following steps 1301-1303: Step 1301: Training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function to obtain a new disease detection model; Step 1302: Calculating the model precision and model recall of the new disease detection model; Step 1303: If both the model precision and the model recall meet the corresponding target threshold, then the new disease detection model is determined as the target disease detection model.
[0108] YOLOv10 retains the Upsample layer in the neck of the YOLOv8 network structure. Although it uses nearest-neighbor interpolation for upsampling—that is, enlarging the image size by filling in adjacent pixel values—this method may cause discontinuities in pixel changes, making it difficult to capture subtle changes in the image and resulting in jagged edges and blurring in the upsampled image. This application replaces the upsampled layer with a dynamic upsampling method based on sampling points (Dysample). The DySample module, from a "point sampling" perspective, introduces a learnable dynamic offset mechanism, which can more finely recover spatial feature details and effectively improve the target recognition capability for edge detection.
[0109] That is, in an optional embodiment of this application, dynamic upsampling (i.e., point sampling) can be used when training the initial disease detection model. The upsampling process includes the following steps: 1) Perform grid sampling: Please refer to Figures 8-10, given a size of C H1 The feature map X of W1, and the feature map of size 2 H2 The upsampling scaling factor S of W2, where the first dimension's X and Y coordinates, and the grid sample function use the positions in S to resample the assumed bilinear interpolation X to a size of C. H2 W2's X', this process is defined as:
[0110] 2) Implementation: Given an upsampling scaling factor S and a value of C H The feature map X' of W is generated using a linear layer with input and output channel numbers of C and 2s2, respectively. H The offset of W is O, and then it is reshaped to 2 through pixel transformation. H2 W2. Then the sample set S is the sum of the offset O and the original sample grid g, that is:
[0111]
[0112] The dynamic upsampling method is based on sampling and its module design. Input features, upsam-pled features, generated offsets, and the original grid are represented by X, X', O, and g, respectively. As shown in Figure 9, the sample set is generated by a sampling point generator, and the input features are resampled using a grid sampling function. As shown in Figures 9 and 10, in the generator, the sample set is the sum of the generated offsets and the original grid positions. Figure 10(a) is a block diagram with a "static range factor," where the offsets are generated using a linear layer. Figure 10(b) is a block diagram with a "dynamic range factor," where a range factor is first generated and then used to modulate the offsets. The static range factor represents a fixed sampling range, while the dynamic range factor adaptively adjusts the sampling offset based on the input feature map to improve flexibility and sampling accuracy. "σ" represents the Sigmoid function. The integer operation is omitted. Finally, a sample set of size C is generated. sH The upsampling feature map X' of sW, where sH represents the resampling scaling factor in the height direction and sW represents the resampling scaling factor in the width direction.
[0113] This application's embodiments are based on the YOLOv10 object detection algorithm, with improvements and optimizations. The experiment uses mAP@0.5 as the evaluation metric. The model's prediction results are compared with the actual labeled information; results greater than the threshold are marked as true positives (TP), otherwise as false positives (FP). The model's precision and recall are calculated using the following formulas:
[0114]
[0115] Wherein, FN represents a false negative, indicating a true positive sample that the model failed to identify; recognition represents the model's precision; and recall represents the model's recall rate. In an optional embodiment of this application, the overall performance of the YOLO algorithm can be evaluated during model training. For example, the YOLOv10 algorithm can be compared with the traditional YOLO model. The comparison results are shown in Table 1 and Figure 11, displaying the recognition performance of each object. The results show that YOLOv5 achieved an mAP of 0.814, a precision of 0.754, and a recall rate of 0.804. This model has strong detection accuracy and recall capabilities, but it has a relatively high number of false positives. The model has 18.5M parameters, a computational complexity of 23.8 GFLOPs, and a processing speed of 47.62 FPS, indicating slightly insufficient online processing capability. The various indicators and detection results of the YOLOv7 and YOLOv8 models show that this model is not suitable for this study. The YOLOv10 algorithm achieved a model training mAP of 0.813, and the model has the fewest parameters, the best detection performance, the strongest online processing capability, and an FPS of 68.1. Therefore, this application embodiment is based on the YOLOv10 object detection algorithm.
[0116] Table 1
[0117] In an optional embodiment of this application, step 1104 above, training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function until the training objective is met to obtain the target disease detection model, includes the following steps 1401-1403: Step 1401, training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function to obtain a new disease detection model; Step 1402, comparing the historical disease sample data in the historical disease images with the detection results output by the new disease detection model; Step 1403, if the error of the comparison result is less than the preset error, then the new disease detection model is determined as the target disease detection model.
[0118] This application's embodiments optimize and verify the loss function to validate the effectiveness of NWD Loss. For example, experiments were conducted based on a real beam-column surface dataset. Using the YOLOv10 algorithm as a foundation, and under the same training strategy, models at different scales of the YOLOv10 detection algorithm were trained. NWD Loss was introduced into the original algorithm. Taking the YOLOv10n algorithm as an example, the model's AP value for cracks increased by 24.7%, the overall mAP value increased by 2.8%, and the number of model parameters increased by only 0.2M. The average online processing frame rate of this model on the experimental equipment decreased from 68.1 for the baseline model to 66.3, incurring only a 4.3% additional computational overhead. Table 2 and Figure 12 show that, for models at different scales, although the model inference efficiency slightly decreased after introducing NWD Loss, the model accuracy was significantly improved. This trade-off strategy between accuracy and speed is remarkably reasonable.
[0119] Table 2
[0120] The detection results of different mainstream detection models in Table 3 and Figure 12, and the optimized algorithm proposed in this application, were compared for cracks, water leakage, pipelines, distribution boxes, and bolt holes, as well as their performance on various indicators. Experimental results show that the algorithm proposed in this application demonstrates superior performance across all indicators: mAP reached 82.4%, the model size is only 4.83M, and it processes 81.4 images per second, exhibiting the strongest overall online processing capability.
[0121] Table 3
[0122] In this embodiment, the SFDE module utilizes the characteristics of its enhanced Sobel operator through the spatial domain Scharr operator branch. This allows for more accurate extraction of edge information from small-sized cracks in beams and columns (such as hairline cracks), with higher noise resistance and direction sensitivity, effectively preserving the detailed gradient features of small targets. The frequency domain branch separates the real part (low-frequency global information) and the imaginary part (high-frequency edge texture information) through Fast Fourier Transform, and then extracts direction-sensitive features through separable frequency domain convolution SFCC. This achieves joint perception of local details and global structure of small targets, solving the problem of losing small target features in multiple downsampling in the traditional C2f module and significantly reducing the false negative rate of small targets.
[0123] In an optional embodiment of this application, please refer to Figure 2. The target disease detection model structure includes at least one of the following: a YOLOv10 model structure, a dynamic upsampling module, and a loss function module. The YOLOv10 model structure is a model structure in which C2f in the traditional YOLOv10 model in Figure 1 is replaced with the SFDE module. The dynamic upsampling module is used to implement the dynamic upsampling method. The loss function module is used to store the preset loss function and implement Gaussian distribution modeling.
[0124] The target defect detection model in this embodiment adopts a lightweight design and significantly reduces the inference latency of a single frame image by introducing a dynamic upsampling method. In beam and column detection equipment mounted on operating vehicles, it can meet the real-time image processing requirements in high-speed moving scenarios, ensuring that defect information is captured and fed back in a timely manner, providing efficient response support for beam and column safety monitoring. Simultaneously, the lightweight model and optimized real-time detection speed: after embedding the SFDE module into the original C2f module, it maintains feature representation capabilities while avoiding the high computational complexity problems caused by deep network structures. This allows the improved model to improve detection accuracy without affecting operational efficiency, making it suitable for the real-time requirements of beam and column detection equipment.
[0125] One embodiment of this application provides a defect detection system for performing the image recognition method for detecting defects in beam and column structures of a lightweight rail transit system as described in any of the preceding claims.
[0126] The beneficial effects of this image recognition method for detecting defects in beam and column structures of lightweight rail transit systems have been described in detail in the above embodiments and will not be repeated here.
[0127] One embodiment of this application provides a disease detection device, characterized in that it is equipped with the disease detection system described above.
[0128] The beneficial effects of this disease detection system have been described in detail in the above embodiments and will not be repeated here.
[0129] One embodiment of this application provides a traffic operation vehicle, including: a vehicle body; a defect detection system as described above; and / or, a defect detection device as described above.
[0130] The beneficial effects of this disease detection equipment have been described in detail in the above embodiments and will not be repeated here.
[0131] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in the embodiments of this application, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0132] Please refer to Figure 13. One embodiment of this application provides a lightweight rail transit system beam-column structure defect detection image recognition system 1300, applied to a target defect detection model. The C2f module of the target defect detection model includes an embedded SFDE module, which includes a spatial domain feature extraction branch and a frequency domain feature extraction module. The lightweight rail transit system beam-column structure defect detection image recognition system 1300 includes: a preprocessing module 1310, used to acquire a sampled image of the target object and input the sampled image into the pre-trained target defect detection model; a first extraction module 1320, used to identify and detect local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module, and obtain a local detail feature output result; a second extraction module 1330, used to identify and detect global features in the sampled image based on the frequency domain feature extraction module in the SFDE module, and obtain a global feature output result; and an inspection module 1340, used to fuse and process the local detail feature output result and the global feature output result, and output the defect detection result of the sampled image.
[0133] In one optional embodiment of this application, the spatial domain feature extraction branch is configured with a Schar edge detection operator. The step of identifying and detecting local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module to obtain the local detail feature output result includes: using the Schar edge detection operator in the spatial domain feature extraction module to perform non-learning edge recognition detection on the local detail features in the sampled image according to a fixed first convolution kernel to obtain the local detail feature output result.
[0134] In an optional embodiment of this application, the step of performing non-learning edge detection on local detail features in the sampled image using the Schar edge detection operator in the spatial domain feature extraction module with a fixed first convolution kernel to obtain the local detail feature output result includes: using the Schar edge detection operator to calculate the horizontal gradient features and vertical gradient features in the sampled image with a fixed first convolution kernel; fusing the horizontal gradient features and the vertical gradient features and inputting them into the next layer of the network of the target disease detection model for feature extraction; and constructing a structured spatial branch to characterize the local detail feature output result using all feature extraction results.
[0135] In an optional embodiment of this application, the structured spatial branch used to characterize the output result of the local detail features includes:
[0136] Where Magnitude represents the structured spatial branch used to characterize the output of the local detail features, grad x The horizontal gradient feature, grad y This represents the vertical gradient feature.
[0137] In an optional embodiment of this application, the step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module to convert the sampled image from the spatial domain to the frequency domain based on the Fast Fourier Transform to obtain frequency domain features; separating the real and imaginary parts in the frequency domain features, and extracting low-frequency and high-frequency information of the image from the real and imaginary parts respectively through a second convolution kernel; restoring the low-frequency and high-frequency information to the spatial domain through an inverse Fourier transform to obtain the global feature output result.
[0138] In one optional embodiment of this application, the low-frequency information of the real part includes at least one of global feature information and illumination change information; and / or, the high-frequency information of the imaginary part includes at least one of edge information, texture information, and noise information.
[0139] In an optional embodiment of this application, the conversion formulas for converting the sampled image from the spatial domain to the frequency domain based on Fast Fourier Transform, and for restoring the low-frequency information and the high-frequency information to the spatial domain via Inverse Fourier Transform, include:
[0140]
[0141] Where u and v represent frequency domain coordinates; x and y represent spatial domain coordinates; F(x,y) represents the spatial domain image; F(u,v) represents the frequency domain image; and M and N represent the width and height of the sampled image.
[0142] In one optional embodiment of this application, the step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module, identifying and detecting global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result.
[0143] In an optional embodiment of this application, the step of calling the frequency domain feature extraction module in the SFDE module to identify and detect global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result, includes: calling the frequency domain feature extraction module in the SFDE module to perform directional decomposition on the input frequency domain features in the sampled image through a mean operation to obtain a horizontal mean vector and a vertical mean vector respectively; using global average pooling to replace the fully connected layer to obtain global features for characterizing global dependencies; combining the global features with the horizontal mean vector and the vertical mean vector respectively to form a horizontal feature vector and a vertical feature vector; and fusing the horizontal feature vector and the vertical feature vector after convolution processing to obtain the global feature output result.
[0144] In an optional embodiment of this application, the step of fusing the horizontal feature vector and the vertical feature vector after convolution processing to obtain the global feature output result includes: inputting the horizontal feature vector and the vertical feature vector into a third convolutional layer and a fourth convolutional layer respectively for feature extraction; wherein the third convolutional layer and the fourth convolutional layer are asymmetric convolutional layers; and adding the output results of the third convolutional layer and the fourth convolutional layer to obtain the global feature output result.
[0145] In an optional embodiment of this application, the step of combining the global features with the horizontal mean vector and the vertical mean vector to form a horizontal feature vector and a vertical feature vector, respectively, includes:
[0146]
[0147] Among them, X H X represents the horizontal feature vector. VLet GAP represent the vertical feature vector, GAP represent the global average pooling operation, and GAP(X) represent the global feature obtained after the global average pooling operation. Indicates broadcast addition; M H (X) represents the mean vector in the horizontal direction; M H (Y) represents the mean vector in the vertical direction.
[0148] In an optional embodiment of this application, the third convolutional layer is 3. One convolutional layer; and / or, the fourth convolutional layer is 1. 3 convolutional layers.
[0149] In an optional embodiment of this application, the step of fusing and processing the local detail feature output result and the global feature output result to output the disease detection result of the sampled image includes: fusing the local detail feature output result and the global feature output result to obtain the fused image feature output result; and performing a lightweight convolution to compress the feature dimension of the image feature output result to obtain the disease detection result of the sampled image.
[0150] In an optional embodiment of this application, after obtaining a sampled image of the target object and inputting the sampled image into the pre-trained target disease detection model, the method further includes: upsampling the sampled image based on a dynamic upsampling method to obtain image features.
[0151] In an optional embodiment of this application, the upsampling of the sampled image based on the dynamic upsampling method to obtain image features includes: resampling the first feature map of the initial sample set in the sampled image into a second feature map using the position in the preset sampling scale factor based on the preset grid sampling function; generating an offset using a first linear layer and reshaping it into a third offset through pixel transformation; wherein the third offset and the initial sample set constitute a new sample set.
[0152] In one optional embodiment of this application, the target object is a beam or column in a lightweight rail transit system.
[0153] Please refer to Figure 14. One embodiment of this application provides a disease detection model training device 1400 for training a target disease detection model as described above. The target disease detection model training device 1400 includes: an acquisition module 1410 for acquiring historical disease images of the target object; a sampling module 1420 for upsampling the historical disease images based on a dynamic upsampling method to obtain a training sample set; a modeling module 1430 for performing Gaussian distribution modeling on each anchor box in the training sample set to obtain a Gaussian-processed training sample set; and a training module 1440 for training an initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thereby obtaining the target disease detection model.
[0154] In one optional embodiment of this application, the step of modeling each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set includes: calculating the probability density function of the two-dimensional Gaussian distribution in the training sample set; converting the similarity between two anchor boxes into a distribution distance between two Gaussian distributions based on the probability density function; exponentially normalizing the distribution distance to obtain the Gaussian-processed Wasserstein distance; and redistributing the training sample set based on the Wasserstein distance to obtain the Gaussian-processed training sample set.
[0155] In one optional embodiment of this application, training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function to obtain a new disease detection model; calculating the model precision and model recall of the new disease detection model; and if both the model precision and the model recall meet the corresponding target thresholds, then the new disease detection model is determined as the target disease detection model.
[0156] In one optional embodiment of this application, training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and a preset loss function to obtain a new disease detection model; comparing the historical disease sample data in the historical disease images with the detection results output by the new disease detection model; if the error of the comparison result is less than a preset error, then the new disease detection model is determined as the target disease detection model.
[0157] In one optional embodiment of this application, the target disease detection model structure includes: a yolov10 model structure in which C2f is replaced with the SFDE module; a dynamic upsampling module for implementing the dynamic upsampling method; and / or, a preset loss function and a loss function module for implementing Gaussian distribution modeling.
[0158] Specific limitations regarding the aforementioned lightweight rail transit system beam-column structure defect detection image recognition system 1300 and defect detection model training device 1400 can be found in the limitations regarding the lightweight rail transit system beam-column structure defect detection image recognition method and defect detection model training method described above, and will not be repeated here. Each module in the aforementioned lightweight rail transit system beam-column structure defect detection image recognition system 1300 and defect detection model training device 1400 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0159] In one embodiment, a computer device is provided, the internal structure of which can be shown in Figure 15. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described image recognition method and defect detection model training method for beam-column structures in a lightweight rail transit system. The method includes a memory and a processor; the memory stores a computer program; and the processor executes the computer program to implement any step of the above-described image recognition method and defect detection model training method for beam-column structures in a lightweight rail transit system.
[0160] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, can perform any step of the above-described image recognition method and defect detection model training method for beam-column structures in lightweight rail transit systems.
[0161] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0165] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0166] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for image recognition of structural defects in beams and columns of a lightweight rail transit system, characterized in that, Applied to a target disease detection model, the C2f module of the target disease detection model includes an embedded SFDE module, the SFDE module including a spatial domain feature extraction branch and a frequency domain feature extraction module; The image recognition method for detecting defects in beam-column structures of a lightweight rail transit system includes: acquiring a sampled image of the target object and inputting the sampled image into a pre-trained target defect detection model; identifying and detecting local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module to obtain a local detail feature output result; identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result; and fusing and processing the local detail feature output result and the global feature output result to output the defect detection result of the sampled image.
2. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 1, characterized in that, The spatial domain feature extraction branch is configured with a Schar edge detection operator. The spatial domain feature extraction module in the SFDE module identifies and detects local detail features in the sampled image to obtain local detail feature output results. This includes: using the Schar edge detection operator in the spatial domain feature extraction module, performing non-learning edge recognition detection on the local detail features in the sampled image according to a fixed first convolution kernel to obtain the local detail feature output results.
3. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 2, characterized in that, The step of using the Schar edge detection operator in the spatial domain feature extraction module to perform non-learned edge recognition detection on local detail features in the sampled image according to a fixed first convolution kernel to obtain the local detail feature output result includes: using the Schar edge detection operator to calculate the horizontal gradient features and vertical gradient features in the sampled image according to a fixed first convolution kernel; fusing the horizontal gradient features and the vertical gradient features and inputting them into the next layer of the network of the target disease detection model for feature extraction; and constructing a structured spatial branch to represent the local detail feature output result using all feature extraction results.
4. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 3, characterized in that, The structured space branch used to characterize the output of the local detail features includes: Where Magnitude represents the structured spatial branch used to characterize the output of the local detail features, and grad x The horizontal gradient feature, grad y This represents the vertical gradient feature.
5. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 1, characterized in that, The step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module to convert the sampled image from the spatial domain to the frequency domain based on the fast Fourier transform to obtain frequency domain features; separating the real and imaginary parts in the frequency domain features, and extracting low-frequency and high-frequency information of the image from the real and imaginary parts respectively through a second convolution kernel; restoring the low-frequency and high-frequency information to the spatial domain through inverse Fourier transform to obtain the global feature output result.
6. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 5, characterized in that, The low-frequency information of the real part includes at least one of global feature information and illumination change information; and / or, the high-frequency information of the imaginary part includes at least one of edge information, texture information, and noise information.
7. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 5, characterized in that, The conversion formulas for transforming the sampled image from the spatial domain to the frequency domain based on Fast Fourier Transform, and for restoring the low-frequency and high-frequency information to the spatial domain through Inverse Fourier Transform, include: ; Where u and v represent frequency domain coordinates; x and y represent spatial domain coordinates; F(x,y) represents the spatial domain image; F(u,v) represents the frequency domain image; and M and N represent the width and height of the sampled image.
8. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 1, characterized in that, The step of identifying and detecting global features in the sampled image based on the frequency domain feature extraction module in the SFDE module to obtain a global feature output result includes: calling the frequency domain feature extraction module in the SFDE module, identifying and detecting global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result.
9. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 8, characterized in that, The step of calling the frequency domain feature extraction module in the SFDE module to identify and detect global features in the sampled image based on the separable frequency domain convolution method in the frequency domain feature extraction module, and obtaining a global feature output result, includes: calling the frequency domain feature extraction module in the SFDE module to perform directional decomposition on the input frequency domain features in the sampled image through a mean operation to obtain a horizontal mean vector and a vertical mean vector respectively; using global average pooling to replace the fully connected layer to obtain global features for representing global dependencies; combining the global features with the horizontal mean vector and the vertical mean vector respectively to form a horizontal feature vector and a vertical feature vector; and fusing the horizontal feature vector and the vertical feature vector after convolution processing to obtain the global feature output result.
10. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 9, characterized in that, The step of fusing the horizontal and vertical feature vectors after convolution processing to obtain the global feature output result includes: inputting the horizontal and vertical feature vectors into a third and a fourth convolutional layer respectively for feature extraction; wherein the third and fourth convolutional layers are asymmetric convolutional layers; and adding the output results of the third and fourth convolutional layers to obtain the global feature output result.
11. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 9, characterized in that, The step of combining the global features with the horizontal mean vector and the vertical mean vector to form a horizontal feature vector and a vertical feature vector, respectively, includes: ; ; where X H X represents the horizontal feature vector. V Let GAP represent the vertical feature vector, GAP represent the global average pooling operation, and GAP(X) represent the global feature obtained after the global average pooling operation. Indicates broadcast addition; M H (X) represents the mean vector in the horizontal direction; M H (Y) represents the mean vector in the vertical direction.
12. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 10, characterized in that, The third convolutional layer is 3. One convolutional layer; and / or, the fourth convolutional layer is 1. 3 convolutional layers.
13. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 1, characterized in that, The step of fusing and processing the local detail feature output result and the global feature output result to output the disease detection result of the sampled image includes: fusing the local detail feature output result and the global feature output result to obtain the fused image feature output result; and performing a lightweight convolution to compress the feature dimension of the image feature output result to obtain the disease detection result of the sampled image.
14. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 1, characterized in that, After acquiring a sampled image of the target object and inputting the sampled image into the pre-trained target disease detection model, the method further includes: upsampling the sampled image based on a dynamic upsampling method to obtain image features.
15. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to claim 14, characterized in that, The method of upsampling the sampled image based on dynamic upsampling to obtain image features includes: resampling the first feature map of the initial sample set in the sampled image into a second feature map based on a preset grid sampling function and using the position in the preset sampling scaling factor; generating an offset using a first linear layer and reshaping it into a third offset through pixel transformation; wherein the third offset and the initial sample set constitute a new sample set.
16. The image recognition method for detecting defects in beam-column structures of lightweight rail transit systems according to any one of claims 1-15, characterized in that, The target objects are beams and columns in lightweight rail transit systems.
17. A method for training a disease detection model, characterized in that, The method for training a target disease detection model as described in any one of claims 1-16 includes: acquiring historical disease images of a target object; upsampling the historical disease images using a dynamic upsampling method to obtain a training sample set; modeling each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set; and training an initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thereby obtaining a target disease detection model.
18. The disease detection model training method according to claim 17, characterized in that, The step of modeling each anchor box in the training sample set using a Gaussian distribution to obtain a Gaussian-processed training sample set includes: calculating the probability density function of a two-dimensional Gaussian distribution in the training sample set; converting the similarity between two anchor boxes into a distribution distance between two Gaussian distributions based on the probability density function; exponentially normalizing the distribution distance to obtain the Gaussian-processed Wasserstein distance; and redistributing the training sample set based on the Wasserstein distance to obtain the Gaussian-processed training sample set.
19. The disease detection model training method according to claim 17, characterized in that, The step of training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function to obtain a new disease detection model; calculating the model precision and model recall of the new disease detection model; and if both the model precision and the model recall meet the corresponding target threshold, then the new disease detection model is determined as the target disease detection model.
20. The disease detection model training method according to claim 19, characterized in that, The step of training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function until the training objective is met to obtain the target disease detection model includes: training the initial disease detection model based on the Gaussian-processed training sample set and the preset loss function to obtain a new disease detection model; comparing the historical disease sample data in the historical disease images with the detection results output by the new disease detection model; if the error of the comparison result is less than the preset error, then the new disease detection model is determined as the target disease detection model.
21. The disease detection model training method according to claim 17, characterized in that, The target disease detection model structure includes: a yolov10 model structure in which C2f is replaced with the SFDE module; a dynamic upsampling module for implementing the dynamic upsampling method; and / or, a loss function module that presets the loss function and implements Gaussian distribution modeling.
22. A disease detection system, characterized in that, Used to perform the image recognition method for detecting defects in beam and column structures of lightweight rail transit systems as described in any one of claims 1-16.
23. A disease detection device, characterized in that, It is equipped with the disease detection system as described in claim 22.
24. A transportation operating vehicle, characterized in that, include: Vehicle body; the defect detection system as described in claim 22; And / or, the disease detection device as described in claim 23.
25. A lightweight rail transit system beam and column structure defect detection image recognition system, characterized in that, Applied to a target disease detection model, the C2f module of the target disease detection model includes an embedded SFDE module, the SFDE module including a spatial domain feature extraction branch and a frequency domain feature extraction module; The lightweight rail transit system beam and column structure defect detection image recognition system includes: a preprocessing module, used to acquire a sampled image of the target object and input the sampled image into the pre-trained target defect detection model; The first extraction module is used to identify and detect local detail features in the sampled image based on the spatial domain feature extraction module in the SFDE module, and obtain a local detail feature output result; the second extraction module is used to identify and detect global features in the sampled image based on the frequency domain feature extraction module in the SFDE module, and obtain a global feature output result; the inspection module is used to fuse and process the local detail feature output result and the global feature output result, and output the disease detection result of the sampled image.
26. A disease detection model training device, characterized in that, The target disease detection model training device for training the target disease detection model according to any one of claims 1-16 comprises: an acquisition module for acquiring historical disease images of the target object; a sampling module for upsampling the historical disease images based on a dynamic upsampling method to obtain a training sample set; a modeling module for performing Gaussian distribution modeling on each anchor box in the training sample set to obtain a Gaussian-processed training sample set; and a training module for training an initial disease detection model based on the Gaussian-processed training sample set and a preset loss function until the training objective is met, thereby obtaining the target disease detection model.
27. A computer device, comprising: A memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 21.
28. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 21.