Intelligent ground rail welding defect detection system based on deep learning

CN122597327APending Publication Date: 2026-08-18HENAN FALI IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610735013.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-26
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

现有方案在实施频域振幅衰减抑制周期性伪缺陷时,由于焊缝熔合线与热影响区交界处打磨削痕引发的疯狂噪声会令系统无法承受,且无法完全消除泄漏至重构特征中的残余伪缺陷能量;同时,对分离相位矩阵采取全量无差别保留策略,未能甄别真实裂纹沿应力传播方向具有相位梯度连续性而伪缺陷相位呈周期性跳变这一物理差异,导致含有无效相位信息的特征图在空间域产生与真实缺陷形态高度相似的虚假边缘响应

Benefits of technology

[0012] Compared with existing technologies, this application provides a deep learning-based intelligent rail welding defect detection system. It establishes a dual-parallel information representation channel through frequency-spatial multi-scale feature decoupling. In the cross-domain feature extraction stage, an adaptive wavelet phase attention module is introduced. While utilizing a learnable frequency mask to implement amplitude attenuation, based on the physical prior of continuous phase gradient during crack propagation along the stress direction, a phase continuity gating mechanism is used to perform secondary interception of residual invalid phases. Furthermore, a momentum comparison classifier widens the distance between true and false defect features in the latent space to achieve high-confidence discrimination. Through the synergistic effect of dual physical constraints—amplitude aperiodicity and phase direction continuity—this system effectively eliminates phase artifacts caused by frequency band aliasing, thereby significantly reducing the false detection rate in the boundary region and improving the system's discrimination accuracy and usability in industrial settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597327A_ABST
    Figure CN122597327A_ABST
Patent Text Reader

Abstract

The application discloses an intelligent ground rail welding defect detection system based on deep learning, which establishes a double-path parallel information representation channel through frequency-space domain multi-scale feature decoupling, introduces an adaptive wavelet phase attention module in the cross-domain feature extraction stage, implements amplitude attenuation by using a learnable frequency mask, based on the physical prior that the phase gradient of a crack is continuous when the crack propagates along the stress direction, implements secondary interception of residual invalid phase through a phase continuity gating mechanism, and enlarges the feature distance of true and false defects in the hidden space through a momentum comparison classifier to realize high-confidence discrimination. Through the synergistic effect of the dual physical constraints of amplitude aperiodicity and phase direction continuity, the system effectively eliminates the phase artifacts caused by frequency band aliasing, thereby significantly reducing the mis-detection rate of the boundary area and improving the discrimination accuracy and availability of the system in the industrial field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent inspection, and more specifically, to an intelligent rail welding defect detection system based on deep learning. Background Technology

[0002] As a critical track structure in industrial production lines that bears the reciprocating motion of heavy-duty equipment, the quality of the welded joints of the ground rail directly affects the operational safety and service life of the entire production line. Under the long-term coupling of alternating loads and vibration stress, ground rail welds are highly susceptible to defects such as cracks, porosity, and incomplete fusion at the fusion line and heat-affected zone. Failure to detect these defects in a timely manner can lead to major safety accidents such as track breakage. Traditional manual visual inspection methods are limited by low inspection efficiency, significant subjective judgment differences, and difficulty in covering inherent defects such as long-distance continuous welds. They can no longer meet the urgent needs of modern intelligent manufacturing for high-throughput and high-reliability online inspection. Therefore, the construction of an intelligent automatic detection system for welding defects in ground rails based on deep learning has significant engineering application value.

[0003] Existing deep learning-based defect detection schemes for rail welding typically employ convolutional neural networks for end-to-end feature extraction and defect identification from visible light images. Some schemes incorporate frequency domain analysis to assist in extracting weld texture features. However, these schemes face significant technical bottlenecks when dealing with the complex industrial surfaces of rail welds. Specifically, rail weld surfaces commonly exhibit composite interference textures such as fish-scale patterns, grinding marks, and oil stains. These pseudo-defect textures exhibit severe frequency band overlap with the high-frequency edge energy of real cracks in the frequency domain. When existing schemes implement frequency domain amplitude attenuation to suppress periodic pseudo-defects, the excessive noise caused by grinding marks at the interface between the weld fusion line and the heat-affected zone becomes unbearable for the system, and residual pseudo-defect energy leaked into the reconstructed features cannot be completely eliminated. Furthermore, the strategy of retaining the entire phase matrix without discrimination fails to recognize the physical difference between the continuous phase gradient of real cracks along the stress propagation direction and the periodic phase jumps of pseudo-defects. This results in feature maps containing invalid phase information generating false edge responses in the spatial domain that are highly similar to the morphology of real defects. Furthermore, traditional attention mechanisms only allocate channel weights in the spatial domain, which cannot truly solve this physical form and its corresponding confusion problem at the industry level. Ultimately, this leads to a high false detection rate at the junction of the weld fusion line and the heat-affected zone, severely restricting the actual usability of the detection system in industrial settings.

[0004] Therefore, an optimized intelligent rail welding defect detection system based on deep learning is needed. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides an intelligent rail welding defect detection system based on deep learning.

[0006] According to one aspect of this application, a deep learning-based intelligent rail welding defect detection system is provided, comprising:

[0007] The frequency-spatial domain multi-scale feature decoupling module is used to perform image normalization and two-dimensional discrete wavelet decomposition on the visible light image data of ground rail welding acquired by the industrial camera of the inspection terminal to obtain the spatial domain ground rail image tensor and the frequency domain wavelet coefficient matrix.

[0008] The cross-domain deep feature extraction module is used to extract spatial semantic features from the spatial domain ground orbit image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform amplitude and phase separation and periodic pseudo-defect frequency band suppression on the frequency domain wavelet coefficient matrix through an adaptive wavelet phase attention module to obtain a frequency domain phase-preserving feature map.

[0009] The frequency-space feature fusion module is used to perform frequency-space feature fusion on the spatial domain semantic feature map and the frequency domain phase-preserving feature map to obtain a joint decoupled feature vector.

[0010] The module for true and false defect boundary regression and classification is used to perform true and false defect boundary regression and classification on the joint decoupled feature vector based on momentum comparison space through momentum comparison classifier and regression detection head to obtain defect category confidence distribution and defect location candidate box set;

[0011] The rail welding defect detection module is used to remove redundant boxes from the candidate box set of defect locations and bind them to the defect category confidence distribution at the instance level. The binding results are then back-mapped to the spatial domain rail image tensor to obtain the rail welding defect detection report.

[0012] Compared with existing technologies, this application provides a deep learning-based intelligent rail welding defect detection system. It establishes a dual-parallel information representation channel through frequency-spatial multi-scale feature decoupling. In the cross-domain feature extraction stage, an adaptive wavelet phase attention module is introduced. While utilizing a learnable frequency mask to implement amplitude attenuation, based on the physical prior of continuous phase gradient during crack propagation along the stress direction, a phase continuity gating mechanism is used to perform secondary interception of residual invalid phases. Furthermore, a momentum comparison classifier widens the distance between true and false defect features in the latent space to achieve high-confidence discrimination. Through the synergistic effect of dual physical constraints—amplitude aperiodicity and phase direction continuity—this system effectively eliminates phase artifacts caused by frequency band aliasing, thereby significantly reducing the false detection rate in the boundary region and improving the system's discrimination accuracy and usability in industrial settings. Attached Figure Description

[0013] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0014] Figure 1 This is a block diagram of a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application;

[0015] Figure 2 This is a schematic diagram of the data flow of a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application;

[0016] Figure 3 This is a block diagram of the frequency-spatial domain multi-scale feature decoupling module in a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application.

[0017] Figure 4 This is a block diagram of the cross-domain deep feature extraction module in the deep learning-based intelligent rail welding defect detection system according to an embodiment of this application. Detailed Implementation

[0018] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0019] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0020] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.

[0021] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0022] The technical solution of this application proposes an intelligent rail welding defect detection system based on deep learning. Figure 1 This is a block diagram of a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application. Figure 2 This is a schematic diagram of the data flow of a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application. Figure 1 and Figure 2 As shown, the deep learning-based intelligent rail welding defect detection system 300 according to an embodiment of this application includes: a frequency-spatial domain multi-scale feature decoupling module 310, used to perform image normalization and two-dimensional discrete wavelet decomposition on visible light image data of rail welding acquired by an industrial camera of an inspection terminal to obtain a spatial domain rail image tensor and a frequency domain wavelet coefficient matrix; and a cross-domain deep feature extraction module 320, used to extract spatial semantic features from the spatial domain rail image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform amplitude-phase separation and periodic pseudo-defect frequency band suppression on the frequency domain wavelet coefficient matrix through an adaptive wavelet phase attention module to obtain a frequency domain phase-preserving feature map. The system includes: a spatial domain semantic feature map and a frequency domain phase-preserving feature map; a frequency-space feature fusion module 330, which performs frequency-space feature fusion on the spatial domain semantic feature map and the frequency domain phase-preserving feature map to obtain a joint decoupling feature vector; a true / false defect boundary regression and classification module 340, which performs true / false defect boundary regression and classification on the joint decoupling feature vector based on momentum contrast space using a momentum contrast classifier and a regression detection head to obtain a defect category confidence distribution and a set of candidate boxes for defect locations; and a rail welding defect detection module 350, which performs redundant box removal and instance-level binding with the defect category confidence distribution on the set of candidate boxes for defect locations, and maps the binding results back to the spatial domain ground rail image tensor to obtain a ground rail welding defect detection report.

[0023] Specifically, the frequency-spatial domain multi-scale feature decoupling module 310 is used to perform image normalization and two-dimensional discrete wavelet decomposition on the visible light image data of ground rail welding acquired by the industrial camera of the inspection terminal to obtain the spatial domain ground rail image tensor and the frequency domain wavelet coefficient matrix. The visible light image data of ground rail welding includes images of the weld fusion line region, the surface image of the heat-affected zone, and the reference image of the base metal transition zone. Specifically, the weld fusion line region image corresponds to the surface morphology of the central region where the base metal and filler metal are completely fused to form a metallurgical bond during the welding process; the heat-affected zone surface image corresponds to the surface state of the transition zone where, although not melted, the microstructure has undergone a phase change under the welding thermal cycle; and the base metal transition zone reference image corresponds to the original base metal surface reference area far from the weld center and not affected by heat. It should be understood that these images simultaneously carry edge information of real defects and periodic texture information of pseudo-defects such as grinding marks and fish-scale patterns. If the original multi-channel color image is directly fed into a subsequent deep learning network for feature extraction, on the one hand, the difference in grayscale between different regions of the image will lead to network training instability; on the other hand, feature representation of only a single path in the spatial domain cannot effectively separate the aliasing relationship between the high-frequency edge energy of real defects and the periodic frequency band energy of pseudo-defects. Therefore, in the technical solution of this application, the original image data is preprocessed and decomposed into two domains through a frequency-spatial domain multi-scale feature decoupling module, which simultaneously maps the image information to two complementary representation spaces in the spatial and frequency domains. This provides a structured dual-path input for the subsequent cross-domain deep feature extraction module, thereby establishing a decoupling foundation between spatial semantics and frequency domain energy distribution at the information source level.

[0024] Figure 3 This is a block diagram of the frequency-spatial domain multi-scale feature decoupling module in a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application. Figure 3 As shown, the frequency-spatial domain multi-scale feature decoupling module 310 includes: a gray-level linear combination unit 311, used to perform gray-level linear combination on the weld fusion line region image, heat-affected zone surface image, and base material transition zone reference image in the visible light image data of ground rail welding to obtain the gray-level matrix of the region of interest; a gray-level extreme value normalization unit 312, used to perform gray-level extreme value normalization on the gray-level values ​​of all pixels in the gray-level matrix of the region of interest to obtain the spatial domain ground rail image tensor; and a frequency-spatial domain multi-scale channel reconstruction unit 313, used to perform two-dimensional discrete wavelet decomposition on the spatial domain ground rail image tensor, and stack the decomposed low-frequency approximation component, horizontal high-frequency component, vertical high-frequency component, and diagonal high-frequency component in the channel dimension to obtain the frequency domain wavelet coefficient matrix.

[0025] Specifically, the grayscale linear combination unit 311 is used to perform grayscale linear combination on the weld fusion line region image, the heat-affected zone surface image, and the base metal transition zone reference image in the visible light image data of ground rail welding to obtain the grayscale matrix of the region of interest. Specifically, the weld fusion line region image in the visible light image data of ground rail welding reflects the surface morphology characteristics of the fusion transition zone between the weld and the base metal; the heat-affected zone surface image records the surface state of the base metal microstructure change area under the action of welding thermal cycling; and the base metal transition zone reference image provides the original base metal surface unaffected by welding heat as a reference. The grayscale linear combination weights and sums the above three types of region images according to a preset linear combination weight coefficient. That is, for any spatial coordinate position in the image, the pixel value of the weld fusion line region image at that position is multiplied by its corresponding weight coefficient, plus the pixel value of the heat-affected zone surface image at that position multiplied by its corresponding weight coefficient, plus the pixel value of the base metal transition zone reference image at that position multiplied by its corresponding weight coefficient. The sum of these three weighted values ​​is the grayscale value of the region of interest grayscale matrix at that coordinate position. By performing the weighted summation calculation on each spatial coordinate position in the image, the image information from multiple channels or regions is fused into a single two-dimensional grayscale matrix. Through this linear grayscale combination operation, the visual information of three different regions in the visible light image data of ground rail welding is unified and fused into a two-dimensional region of interest grayscale matrix, which comprehensively represents the overall grayscale distribution characteristics of the welding area.

[0026] Specifically, the gray-level extreme value normalization unit 312 is used to normalize the gray-level values ​​of all pixels in the gray-level matrix of the region of interest to obtain the spatial domain ground rail image tensor. Specifically, due to the influence of lighting conditions, camera exposure parameters, and differences in the reflectivity of the weld surface on the ground rail welding images acquired in different batches, the dynamic range of pixel gray-level values ​​in the gray-level matrix of the region of interest fluctuates significantly. This inconsistency in numerical scale severely affects the stability and convergence efficiency of feature extraction by the subsequent convolutional backbone network. The gray-level extreme value normalization unit traverses all pixel gray-level values ​​in the gray-level matrix of the region of interest, extracts the global maximum and global minimum gray-level values, and uses these as the upper and lower bounds for normalization, linearly mapping all pixel gray-level values ​​to a standardized numerical range of zero to one, generating the spatial domain ground rail image tensor. In this process, for any gray value at any coordinate position in the gray-level matrix of the region of interest, the global minimum gray value of all pixels in the entire matrix is ​​first subtracted from the gray value to obtain the offset relative to the minimum value. Then, this offset is divided by the difference between the global maximum and the global minimum, which is the span of the gray-level dynamic range. The final quotient is the normalized feature value of the spatial domain ground orbit image tensor at that coordinate position. When the original gray value is equal to the global minimum, the normalization result is zero; when the original gray value is equal to the global maximum, the normalization result is one; the remaining gray values ​​are linearly mapped to a continuous interval from zero to one according to their relative position between the minimum and the maximum value.

[0027] Specifically, the frequency-spatial domain multi-scale channel reconstruction unit 313 is used to perform two-dimensional discrete wavelet decomposition on the spatial domain ground orbit image tensor, and stack the decomposed low-frequency approximation component, horizontal high-frequency component, vertical high-frequency component, and diagonal high-frequency component in the channel dimension to obtain a frequency domain wavelet coefficient matrix. Specifically, firstly, the image is convolved with a low-pass filter and a high-pass filter in the horizontal direction and then downsampled by a factor of two to obtain two intermediate results: horizontal low-frequency component and horizontal high-frequency component; then, these two intermediate results are convolved with a low-pass filter and a high-pass filter in the vertical direction and downsampled by a factor of two again to finally obtain four frequency domain sub-band components. Among them, the low-frequency approximation component is the cascaded result of the horizontal and vertical low-pass filters, representing the overall brightness and low-frequency structural information of the image; the horizontal high-frequency component is the cascaded result of the horizontal low-pass filter and the vertical high-pass filter, capturing horizontal edge and texture details; the vertical high-frequency component is the cascaded result of the horizontal high-pass filter and the vertical low-pass filter, capturing vertical edge and texture details; and the diagonal high-frequency component is the cascaded result of the horizontal and vertical high-pass filters, capturing diagonal edge and texture details. Furthermore, these four frequency domain sub-band components are treated as four independent feature channels, stacked and concatenated along the channel dimension, ultimately yielding a frequency domain wavelet coefficient matrix with a four-channel structure.

[0028] Specifically, the cross-domain deep feature extraction module 320 is used to extract spatial semantic features from the spatial domain ground track image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform amplitude and phase separation and periodic pseudo-defect frequency band suppression on the frequency domain wavelet coefficient matrix through an adaptive wavelet phase attention module to obtain a frequency domain phase-preserving feature map. It should be understood that the pixel-level information in the spatial domain ground track image tensor has not undergone deep semantic abstraction and cannot be directly used for high-level semantic discrimination of defects; while the high-frequency subbands in the frequency domain wavelet coefficient matrix simultaneously contain the non-periodic high-frequency energy corresponding to the real defect edge and the periodic high-frequency energy corresponding to pseudo-defects such as grinding marks and fish-scale patterns, resulting in severe frequency band aliasing in the frequency domain. If the frequency domain information is not subjected to targeted amplitude attenuation and phase processing, the periodic energy of these pseudo-defects will be confused with the real defect signal in the subsequent feature fusion stage, causing the detection system to generate a large number of false detections at the junction of the weld fusion line and the heat-affected zone. Therefore, in the technical solution of this application, a cross-domain deep feature extraction module is used to perform deep feature extraction and purification processing on both the spatial domain and the frequency domain. On the one hand, a convolutional backbone network is used to perform multi-level spatial semantic feature abstraction on the spatial domain ground orbit image tensor. On the other hand, an adaptive wavelet phase attention module is used to perform amplitude and phase separation and periodic pseudo-defect frequency band suppression on the frequency domain wavelet coefficient matrix. This provides a dual-path feature representation with deep semantic extraction and frequency domain purification for the subsequent frequency-space feature fusion module.

[0029] Figure 4 This is a block diagram of a cross-domain deep feature extraction module in a deep learning-based intelligent rail welding defect detection system according to an embodiment of this application. Figure 4 As shown, in the first embodiment of this application, the cross-domain deep feature extraction module 320 includes: a spatial feature extraction and frequency domain orthogonal decomposition unit 321, used to extract spatial semantic features from the spatial domain ground orbit image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform frequency domain orthogonal separation of the horizontal high-frequency components and the vertical high-frequency components in the frequency domain wavelet coefficient matrix to obtain an initial amplitude matrix and a separated phase matrix; an adaptive frequency domain suppression unit 322, used to attenuate and suppress the grinding marks and fish scale pattern energy bands with periodic features in the initial amplitude matrix through a learnable adaptive frequency mask convolutional kernel to obtain an attenuated amplitude matrix; and a feature map reconstruction unit 323, used to couple and reconstruct the attenuated amplitude matrix and the separated phase matrix and perform a two-dimensional discrete wavelet inverse transform to obtain a frequency domain phase-preserving feature map.

[0030] Specifically, the spatial feature extraction and frequency domain orthogonal decomposition unit 321 is used to extract spatial semantic features from the spatial domain ground orbit image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform frequency domain orthogonal separation of the horizontal and vertical high-frequency components in the frequency domain wavelet coefficient matrix to obtain the initial amplitude matrix and the separation phase matrix. Specifically, along the spatial domain path, the convolutional backbone network receives the spatial domain ground orbit image tensor as input, and through a cascaded stack of multiple convolutional layers, batch normalization layers, and nonlinear activation functions, extracts multi-level spatial feature representations from low-level edge textures to high-level semantic structures layer by layer, ultimately outputting a spatial domain semantic feature map. In this process, for each spatial location of the input feature map, a local receptive field region of the same size as the convolutional kernel is extracted centered at that location. All elements within this region are multiplied element-wise with the weight parameters corresponding to the convolutional kernel positions, and the sum is obtained by adding the bias parameter to obtain the response value of the output feature map at that location. Through cascaded processing of multiple convolutional layers, the network gradually expands the receptive field and enhances the semantic abstraction level of features, ultimately generating a spatial domain semantic feature map containing rich spatial semantic information.

[0031] In the frequency domain path, the spatial feature extraction and frequency domain orthogonal decomposition unit performs frequency domain orthogonal separation on the horizontal and vertical high-frequency components in the frequency domain wavelet coefficient matrix to obtain the initial amplitude matrix and the separated phase matrix. The horizontal and vertical high-frequency components capture high-frequency edge details in the image in the horizontal and vertical directions, respectively. By treating the horizontal high-frequency component as the real part and the vertical high-frequency component as the imaginary part, polar coordinate transformation is used to convert this pair of orthogonal components into amplitude and phase representations, thereby achieving decoupling and separation of frequency domain energy magnitude information and frequency domain direction angle information. In this process, for any coordinate position in the frequency domain, the value of the horizontal high-frequency component at that position is squared, and the value of the vertical high-frequency component at that position is also squared. These two squared values ​​are then added together, and the square root of the sum is taken. The result is the amplitude value of the initial amplitude matrix at that coordinate position, which physically represents the total intensity of the high-frequency edge energy at that frequency domain coordinate point. For any coordinate position in the frequency domain, take the value of the vertical high-frequency component at that position as the vertical axis component and the value of the horizontal high-frequency component at that position as the horizontal axis component. Calculate the arctangent angle of the ratio of the vertical axis component to the horizontal axis component. The result is the phase angle value of the separated phase matrix at that coordinate position. Its physical meaning is the direction angle information of the high-frequency edge at that frequency domain coordinate point.

[0032] Specifically, the adaptive frequency domain suppression unit 322 is used to attenuate and suppress the grinding marks and fish-scale pattern energy bands with periodic characteristics in the initial amplitude matrix using a learnable adaptive frequency mask convolution kernel to obtain an attenuated amplitude matrix. Specifically, in the actual industrial scenario of rail welding, the weld surface is left with grinding marks with a fixed spatial period after mechanical grinding, and the fish-scale pattern formed by the solidification of the molten pool during welding also has a regular periodic repetition characteristic. These periodic pseudo-defect textures appear as energy bands concentrated in a specific frequency range in the frequency domain, and their amplitudes in the initial amplitude matrix exhibit a distribution pattern that differs from the non-periodic edge energy of real cracks. The adaptive frequency domain suppression unit uses a learnable adaptive frequency mask convolution kernel to convolve the initial amplitude matrix. The weight parameters of this convolution kernel are automatically learned and optimized through backpropagation during network training. It can adaptively identify and locate the frequency intervals of the periodic energy bands corresponding to grinding marks and fish scale patterns in the initial amplitude matrix, and apply attenuation coefficients to suppress the amplitude values ​​within these intervals, while preserving the amplitude values ​​of the non-periodic edge energy corresponding to the real defects. In this process, the adaptive frequency mask convolution kernel performs a sliding window convolution operation on the initial amplitude matrix. For each frequency domain coordinate position, the local amplitude region centered at that position is multiplied element-wise with the convolution kernel weights, summed, and a bias parameter is added. Then, the summation result is mapped to the interval between zero and one through the Sigmoid activation function to generate the adaptive frequency mask weight value at that coordinate position. Finally, the amplitude value at each coordinate position in the initial amplitude matrix is ​​multiplied element by element with the corresponding mask weight value. Regions where the mask weight value approaches zero correspond to the periodic pseudo-defect energy band, thus achieving the amplitude attenuation effect. Regions where the mask weight value approaches one correspond to the non-periodic edge energy of the real defect, thus preserving the amplitude. After element-wise multiplication, the attenuated amplitude matrix is ​​output.

[0033] Specifically, the feature map reconstruction unit 323 is used to couple and reconstruct the attenuation amplitude matrix and the separation phase matrix, and perform a two-dimensional discrete wavelet inverse transform to obtain a frequency domain phase-preserving feature map. Specifically, a full phase-indiscriminate preservation reconstruction strategy is adopted, that is, after completing the adaptive amplitude attenuation, the attenuation amplitude matrix and the separation phase matrix are directly coupled unconditionally through a polar coordinate inverse transform, and then restored to the spatial domain through a two-dimensional discrete wavelet inverse transform. In this process, for any coordinate position in the frequency domain, the amplitude value of the attenuation amplitude matrix and the phase angle value of the separation phase matrix at that position are inversely transformed from polar coordinates to rectangular coordinates. Specifically, the reconstructed horizontal high-frequency coefficient at that coordinate position is obtained by multiplying the attenuated amplitude value by the cosine of the phase angle at that position; the reconstructed vertical high-frequency coefficient at that coordinate position is obtained by multiplying the attenuated amplitude value by the sine of the phase angle at that position. Through this unconditional coupling method, all phase information in the separated phase matrix is ​​preserved without discrimination and participates in reconstruction. The amplitude information in the attenuated amplitude matrix, after periodic energy suppression, is recombined with the complete phase direction information to form orthogonal high-frequency coefficient pairs. Subsequently, the reconstructed horizontal and vertical high-frequency coefficients are combined with the low-frequency approximation components and diagonal high-frequency components that have not been modified throughout the frequency domain processing, and a two-dimensional discrete wavelet inverse transform operation is performed. Specifically, the coefficients of the four frequency domain sub-bands are upsampled by a factor of two to restore the spatial dimensions. Then, in the vertical direction, convolution operations are performed through the corresponding reconstruction low-pass and reconstruction high-pass filters, and the results are summed. Then, in the horizontal direction, convolution operations are performed through the corresponding reconstruction low-pass and reconstruction high-pass filters, and the results are summed. Finally, the four frequency domain sub-band coefficients are restored to the feature map representation in the spatial domain, resulting in a frequency domain phase-preserving feature map.

[0034] Specifically, as described above, the feature map reconstruction unit 323 in the first embodiment adopts a reconstruction strategy that preserves all phases without difference. That is, after completing the adaptive amplitude attenuation, the attenuated amplitude matrix and the separated phase matrix are directly coupled unconditionally through inverse polar coordinate transformation, and then restored to the spatial domain through two-dimensional discrete wavelet inverse transformation. This processing logic implies an unverified premise: after the amplitude attenuation operation of the adaptive frequency domain suppression unit 322, all the phase information remaining in the separated phase matrix is ​​a valid phase, that is, all correspond to the edge direction information of the real crack.

[0035] However, in actual industrial scenarios of ground rail welding, a neglected physical relationship exists at the boundary between the weld fusion line and the heat-affected zone—the phase of the real crack exhibits directional continuity in its spatial neighborhood. This is because as the crack propagates along the stress concentration direction, its edge topology displays a smooth and consistent geometric orientation in the local space; while the residual phase of grinding marks and fish-scale patterns exhibits periodic repetition or random jump characteristics in its spatial neighborhood, determined by the reciprocating motion trajectory of machining. The first embodiment failed to utilize this prior knowledge of the physical continuity of the crack stress propagation path to determine the validity of the phase, leading to the following specific defects.

[0036] First, the adaptive frequency mask in the adaptive frequency domain suppression unit 322 is based on the convolution kernel parameters learned from global statistical features. At the junction of the weld fusion line and the heat-affected zone, there is a frequency band aliasing phenomenon between the high-frequency edge energy of the real microcrack and the periodic energy of the grinding marks. Some pseudo-defect energy is not completely attenuated and leaks into the attenuation amplitude matrix, resulting in incomplete amplitude attenuation.

[0037] Secondly, the separation phase matrix adopts a full retention strategy, which fails to distinguish between the effective phase with directional continuity along the crack propagation path and the periodic jump phase of the corresponding residual pseudo-defects, resulting in invalid phase information being indiscriminately introduced into the subsequent reconstruction stage.

[0038] Ultimately, when the amplitude containing residual pseudo-defect energy is directly coupled with the matrix containing invalid periodic phase and an inverse wavelet transform is performed, the reconstructed frequency domain phase-preserving feature map will carry phase artifacts—false edge responses that are similar to the real crack morphology in the spatial domain but are physically meaningless. These false responses will directly lead to an increase in the false detection rate at the junction of the weld fusion line and the heat-affected zone in the subsequent fusion and classification steps.

[0039] To address the aforementioned deficiencies, this application further proposes a second embodiment.

[0040] Specifically, firstly, the continuity of crack stress propagation direction is scored for each frequency domain coordinate point in the separated phase matrix to obtain a phase continuity gating map. Since the real crack propagates continuously along the stress concentration direction of the weld, the phase value corresponding to its edge changes smoothly and in the same direction in the local spatial neighborhood. However, the residual phase of grinding marks and fish scale patterns exhibits drastic jumps in the neighborhood due to the reciprocating periodicity of machining. Therefore, the two can be distinguished by quantifying the gradient consistency of the phase in the local neighborhood.

[0041] Specifically, for each frequency domain coordinate point in the separated phase matrix, the phase gradient difference between it and all adjacent coordinate points within a preset neighborhood window is calculated. The variance of this difference is then mapped negatively to normalize the result to a continuous interval between zero and one, generating a phase continuity gating map. In this gating map, regions with scores approaching one indicate that the phase at that point has high directional continuity, corresponding to the smooth edge direction formed when a real crack propagates along a stress concentration path in the ground rail welding scenario; regions with scores approaching zero indicate that the phase at that point exhibits abrupt changes, corresponding to the periodic interference residues caused by mechanical grinding or welding shrinkage.

[0042] This scoring mechanism transforms the continuity of crack propagation direction in materials mechanics into a calculable frequency domain phase gradient variance metric, providing a physically-based weight allocation basis for subsequent gating modulation.

[0043] The calculation process for the gate control score is as follows:

[0044]

[0045] in, Represents the phase continuity gated graph in the frequency domain discrete coordinates The gate control score value at the location ranges from zero to one, within the opening and closing interval; Indicates the separation phase matrix in coordinates The phase angle value at that location; Represents the coordinates of the separated phase matrix in the neighborhood. The phase angle value at that location; Represented by coordinates The set of all adjacent coordinate points within a preset local neighborhood window centered on the target; This represents the total number of adjacent coordinate points within the neighborhood window; This represents the preset phase variance normalization temperature parameter, used to control the sensitivity of the gating score to phase transitions. This indicates exponentiation.

[0046] It should be noted that when the phase of each point in the neighborhood is highly consistent with the phase of the center point, the summation term approaches zero, and the score after negative exponent mapping approaches one; when the phase in the neighborhood changes drastically, the value of the summation term increases, and the score after negative exponent mapping decreases sharply and approaches zero. This mathematical characteristic corresponds precisely to the physical law of continuous phase at the crack edge and phase jump in pseudo-defects.

[0047] Next, using the phase continuity gating map as element-wise modulation weights, the horizontal and vertical high-frequency coefficients after coupling the attenuated amplitude matrix and the separated phase matrix through inverse polar coordinate transformation are gated and weighted to obtain the gated coupled horizontal high-frequency coefficients and the gated coupled vertical high-frequency coefficients. These are then used as the criterion for determining physical validity and are incorporated into the amplitude and phase coupling reconstruction process.

[0048] Specifically, the horizontal and vertical high-frequency coefficients are calculated by standard coupling of the attenuation amplitude matrix and the separation phase matrix using the inverse polar coordinate transformation formula. Simultaneously, a phase continuity gating map is applied as an element-wise multiplication weight to the coupling result: in regions with high gating scores, the high-frequency coefficients are fully preserved, corresponding to the lossless passage of real crack edge information; in regions with low gating scores, the high-frequency coefficients are further suppressed to near zero, corresponding to secondary interception of residual pseudo-defect information. The final output is the gated coupling horizontal high-frequency coefficient and the gated coupling vertical high-frequency coefficient, both verified by physical validity.

[0049] This gated modulation mechanism ensures that even if the amplitude attenuation of the adaptive frequency domain suppression unit 322 has incomplete leakage due to frequency band aliasing, a second fine-tuning filter can still be implemented in the phase dimension based on the prior constraint of the continuity of crack physical propagation. Only edge information that simultaneously satisfies the dual physical constraints of amplitude non-periodicity and phase direction continuity can enter the subsequent reconstruction.

[0050] The gating mechanism is represented as follows:

[0051]

[0052]

[0053] in, Represents the high-frequency coefficients of the gated coupling level in the frequency domain coordinates The value at; Represents the frequency domain coordinates of the gated coupling vertical high-frequency coefficients. The value at; This indicates that the phase continuity gated graph is in coordinates The gating weight value at the location; Indicates the attenuation amplitude matrix in coordinates The attenuated amplitude value at the location; Indicates the separation phase matrix in coordinates The phase angle value at that location.

[0054] It should be noted that As a multiplication factor, it directly acts on the output of the inverse polar coordinate transformation. When its value is one, it is equivalent to the unconditional coupling of the first embodiment. When its value is less than one, the high-frequency contribution of the coordinate point is proportionally attenuated. This continuously differentiable modulation method not only ensures the trainability of gradient backpropagation, but also avoids the edge break artifacts that may be introduced by hard threshold truncation.

[0055] Furthermore, by combining the unchanged low-frequency approximation components and the diagonal high-frequency components, a two-dimensional discrete wavelet inverse transform is performed on the gated coupling horizontal high-frequency coefficients and the gated coupling vertical high-frequency coefficients to reconstruct the spatial scale and obtain a frequency domain phase-preserving feature map. After completing the gated modulation, the gated coupling horizontal high-frequency coefficients and the gated coupling vertical high-frequency coefficients are combined with the low-frequency approximation components and the diagonal high-frequency components that have not been modified throughout the frequency domain processing, and a two-dimensional discrete wavelet inverse transform is performed to reconstruct the frequency domain phase-preserving feature map on a spatial scale after double purification. Since the high-frequency coefficients entering the inverse transform have undergone dual screening of amplitude adaptive attenuation and phase continuity gating, the final reconstructed feature map only retains the true crack topology information that accurately corresponds to the direction of stress concentration along the weld fusion line in the ground rail welding scenario, fundamentally eliminating the phase artifact problem caused by frequency band aliasing.

[0056] The process of reconstructing the gated high-frequency coefficients using inverse wavelet transform is represented as follows:

[0057]

[0058] in, Represents the frequency domain phase-preserving feature map in spatial coordinates Eigenvalues ​​at; This represents the two-dimensional discrete wavelet inverse transform operation function; This represents the low-frequency approximate component that has not been modified throughout the entire frequency domain processing flow; Indicates the high-frequency coefficient of the gating coupling level; Indicates the vertical high-frequency coefficient of the gated coupling; This represents the diagonal high-frequency components that were not modified throughout the entire frequency domain processing flow.

[0059] By introducing a phase gradient continuity gating mechanism, the physical identification of phase validity during frequency domain reconstruction is achieved at the pure algorithm level without adding additional sensor hardware. In the actual inspection scenario of ground rail welding, the boundary between the weld fusion line and the heat-affected zone is the area where the frequency bands of real microcracks and grinding marks are most severely mixed. Due to the incompleteness of amplitude attenuation and the lack of difference in phase preservation, the first embodiment generates a large number of phase artifacts in this area, leading to a high false detection rate.

[0060] Specifically, the second embodiment utilizes the material mechanics prior that the phase gradient is smooth and continuous when the crack propagates along the stress concentration direction to construct a frequency domain coordinate-level gated weight allocation. This ensures that only edge information that passes both the amplitude aperiodic constraint and the phase direction continuity constraint can participate in wavelet inverse transform reconstruction. This achieves secondary refined interception of residual pseudo-defects in the boundary region where frequency band aliasing is most severe, significantly reducing the residual amount of false edge responses in the frequency domain phase-preserving feature map. Ultimately, this improves the discrimination accuracy of distinguishing between real cracks and grinding marks at the boundary between the weld fusion line and the heat-affected zone in the subsequent fusion classification stage, effectively suppressing the problem of decreased system availability caused by high false alarm rates in industrial settings.

[0061] Specifically, the frequency-space feature fusion module 330 is used to perform frequency-space feature fusion on the spatial domain semantic feature map and the frequency domain phase-preserving feature map to obtain a joint decoupled feature vector. It should be understood that after the parallel processing of the cross-domain deep feature extraction module, the spatial domain semantic feature map carries high-level spatial semantic information after multi-layer abstraction by the convolutional backbone network, while the frequency domain phase-preserving feature map carries frequency-purified edge information after amplitude attenuation and phase preservation reconstruction. However, these two features reside in different representation spaces. The spatial domain semantic feature map encodes pixel-level topological structure and semantic category information, while the frequency domain phase-preserving feature map encodes edge direction and energy distribution information purified by the frequency domain. They differ significantly in feature dimension, numerical distribution, and semantic level. If these two heterogeneous features are directly fed into the subsequent classification and regression modules, the misalignment of the feature spaces will prevent the classifier from effectively utilizing the complementary information of the two domains for joint discrimination. Therefore, in the technical solution of this application, the spatial domain semantic feature map and the frequency domain phase-preserving feature map are fused across modalities through the frequency-space feature fusion module, and the heterogeneous features of the two domains are uniformly mapped to the compact vector representation in the same latent space, so as to provide the subsequent true and false defect boundary regression and classification module with a joint decoupled feature vector that integrates the dual information of spatial semantics and frequency domain edge.

[0062] In practice, the spatial domain semantic feature map and the frequency domain phase-preserving feature map are first aligned across modal feature spaces and concatenated through channels to obtain a concatenated multimodal feature tensor. Specifically, since the spatial domain semantic feature map and the frequency domain phase-preserving feature map originate from the spatial domain processing path of the convolutional backbone network and the frequency domain processing path of the inverse wavelet transform, respectively, they may differ in spatial resolution and number of channels. In this process, the spatial dimensions of the two feature maps are first uniformly adjusted to ensure they have the same spatial resolution in both height and width dimensions, thus ensuring that feature vectors at the same spatial coordinate position correspond to the same physical region in the original image. After spatial alignment, the spatial domain semantic feature map and the frequency domain phase-preserving feature map are concatenated along the channel dimension, forming a concatenated multimodal feature tensor with the number of channels equal to the sum of the number of channels in both maps. Specifically, for any spatial coordinate position in the aligned feature map, all channel feature values ​​of the spatial domain semantic feature map at that position and all channel feature values ​​of the frequency domain phase-preserving feature map at that position are sequentially arranged and concatenated to form a longer feature vector as the channel feature representation of the cascaded multimode feature tensor at that position. Through this channel concatenation method, the feature vector at each spatial position simultaneously contains the semantic description from the spatial domain and the edge description from the frequency domain, realizing the juxtaposition and fusion of dual-domain information in a unified spatial coordinate system.

[0063] Next, global pooling and spatial dimension compression are performed on the cascaded multimodal feature tensor to obtain a global one-dimensional feature vector. Specifically, the cascaded multimodal feature tensor is a three-dimensional tensor structure containing information along three axes: channel dimension, height dimension, and width dimension. The height and width dimensions carry the spatial distribution information of the features. However, the subsequent momentum contrast classifier and regression detector head require a fixed-length one-dimensional vector as input. Therefore, the spatial dimension information in the cascaded multimodal feature tensor is further compressed and aggregated. In this process, the global pooling operation is performed independently on each channel of the cascaded multimodal feature tensor, performing a global average operation on the feature values ​​at all spatial locations in each channel. This involves summing the feature values ​​at all spatial locations in that channel, and then dividing this sum by the total number of spatial locations (i.e., the product of the height and width dimensions) to obtain the global average statistic for that channel as a scalar value. After performing the global averaging operation on all channels, the global average statistics of each channel are arranged sequentially according to channel order, forming a one-dimensional vector with a length equal to the number of channels in the cascaded multimodal feature tensor, i.e., a global one-dimensional feature vector. Through this global pooling and spatial dimension compression operation, the spatial distribution information of each channel in the cascaded multimodal feature tensor is aggregated into a global statistical descriptor, realizing the dimensionality transformation from a two-dimensional spatial feature map to a one-dimensional compact vector.

[0064] Furthermore, a nonlinear projection head containing two fully connected layers and linear rectified activation is used to perform nonlinear projection and latent space feature normalization on the global one-dimensional feature vector to obtain a joint decoupled feature vector. Specifically, although the global one-dimensional feature vector has compressed the dual-domain features into a compact one-dimensional representation, its dimensionality is still high, and the feature coupling relationship between each dimension has not yet been decoupled and reorganized through nonlinear transformation. In this process, the nonlinear projection head adopts a two-layer fully connected network structure. The first fully connected layer receives the global one-dimensional feature vector as input, and performs matrix multiplication operation between the weight matrix of the first fully connected layer and the global one-dimensional feature vector. That is, each row of the weight matrix is ​​multiplied element-wise with the global one-dimensional feature vector and then summed to obtain the linear transformation result at the corresponding output position. Then, the linear transformation result is added to the bias value at the corresponding position in the bias vector of the first fully connected layer to complete the affine transformation operation, mapping the input vector from the original dimensional space to the intermediate hidden layer space. Subsequently, a nonlinear transformation is applied to the intermediate hidden layer representation using a linearly rectified activation function. Specifically, each element in the affine transformation output vector is independently evaluated: if the element's value is negative, it is truncated to zero; otherwise, it remains unchanged. This introduces nonlinear expressive power and achieves sparse activation of the features. The second fully connected layer receives the linearly rectified activated intermediate hidden layer representation as input. A matrix multiplication operation is performed between the weight matrix of the second fully connected layer and the intermediate hidden layer representation, followed by the addition of the bias vector from the second fully connected layer. An affine transformation is then used to further map the intermediate hidden layer representation to the target dimension output space, resulting in a projected output vector. Furthermore, latent space feature normalization is performed on the projected output vector. Specifically, the L2 norm of the projected output vector is first calculated by squaring the value of each element in the vector, summing the squares of all elements, and then taking the square root of the sum to obtain the L2 norm value of the vector. Subsequently, each element in the projected output vector is divided by this L2 norm value, so that the sum of the squares of the elements of the normalized vector equals one, that is, the vector lies on the unit hypersphere, thereby eliminating the interference of the difference in the magnitude of the feature vector on the subsequent momentum comparison distance metric. After the cascaded processing of the above two-layer fully connected, linear rectified activation and latent space normalization, the joint decoupled feature vector is finally output.

[0065] Specifically, the true / false defect boundary regression and classification module 340 is used to perform true / false defect boundary regression and classification based on momentum contrast space on the joint decoupled feature vector through a momentum contrast classifier and a regression detection head to obtain the defect category confidence distribution and the defect location candidate box set. It should be understood that the joint decoupled feature vector is only a compact numerical representation and has not yet established a correspondence with specific defect category labels and defect spatial locations. In the actual industrial scenario of rail welding defect detection, the system not only needs to determine whether a defect exists within the detection area and what category the defect belongs to, but also needs to accurately locate the spatial location and geometric range of the defect in the original image. Traditional softmax classifier-based schemes struggle to achieve reliable true / false discrimination when faced with highly similar feature distributions between real and false defects on the rail weld surface due to insufficient inter-class distance. Therefore, in the technical solution of this application, the true and false defect boundary regression and classification module uses the momentum comparison classifier to increase the feature distance between true and false defects in the latent space to achieve high confidence in category discrimination. At the same time, the regression detection head is used to perform accurate bounding box regression prediction on the spatial location of the defect, thereby simultaneously outputting the defect category confidence distribution and the defect location candidate box set.

[0066] In practice, firstly, the cluster center vectors of each category in the momentum update dictionary are used to measure the latent space distance and classify the joint decoupled feature vectors to obtain the confidence distribution of the defect categories. Specifically, the momentum update dictionary stores the cluster center vectors corresponding to each defect category, and each cluster center vector represents the prototype representation of that category of defect in the latent space. During training, the cluster center vectors of each category are iteratively optimized through the momentum update mechanism. That is, in each training iteration, the gradient of the current batch is not directly used to update the cluster center vector. Instead, the new cluster center estimate calculated in the current batch is weighted and averaged with the old cluster center vector of the previous iteration according to a preset momentum coefficient. This makes the update process of the cluster center vector smoother and more stable, avoiding drastic jumps in cluster centers due to noise fluctuations in a single batch of samples. Specifically, for the cluster center vector of any category in the dictionary, the old cluster center vector of the previous iteration is multiplied by the momentum coefficient, and the difference between the new cluster center estimate calculated in the current batch and the momentum coefficient is added. The weighted sum of the two is the updated cluster center vector. The momentum coefficient is usually set to a value close to one, so that the update of the cluster center vector is dominated by the old value and only slowly absorbs new information, thereby ensuring the temporal consistency and stability of the prototype representations of each category in the dictionary.

[0067] After updating the momentum of the dictionary, the joint decoupled feature vector is subjected to momentum comparison latent space distance measurement and classification. Specifically, the cosine similarity between the joint decoupled feature vector and the cluster center vector of each category in the dictionary is calculated. This is done by multiplying the joint decoupled feature vector element-wise with the cluster center vector of a certain category and then summing the results. Since both have been normalized by the L2 norm and lie on the unit hypersphere, the inner product result is the cosine similarity value between them. Then, the cosine similarity values ​​between the joint decoupled feature vector and the cluster center vectors of all categories are divided by a preset temperature scaling parameter to obtain the temperature-scaled similarity score. Then, the softmax normalization function is used to convert all the temperature-scaled similarity scores into a probability distribution. The vector composed of the confidence probability values ​​of all categories is the defect category confidence distribution, where each component represents the confidence probability value of the input sample belonging to the corresponding defect category, and the sum of all components is one. It is worth mentioning that the temperature scaling parameter is used to control the sharpness of the confidence distribution. When the temperature parameter is small, the distribution is sharper and concentrated on the category with the highest similarity; when the temperature parameter is large, the distribution is smoother and more uniform.

[0068] Next, an affine transformation is performed on the joint decoupled feature vector through a multi-layered densely connected regression detection head to obtain the bounding box geometric offset, which includes the center coordinate offset and the logarithmic scaling of width and height. Specifically, the regression detection head adopts a multi-layered densely connected fully connected network structure, where the input of each layer not only includes the output of the previous layer, but also receives the output of earlier layers as supplementary input through dense connections, thereby enhancing gradient flow and preserving multi-layered feature information. Specifically, the regression detection head receives the joint decoupled feature vector as input. The first component of this four-dimensional vector represents the horizontal coordinate offset of the defect bounding box center point relative to the preset prior anchor box center point; the second component represents the vertical coordinate offset of the defect bounding box center point relative to the preset prior anchor box center point; the third component represents the logarithmic scaling of the defect bounding box width relative to the preset prior anchor box width; and the fourth component represents the logarithmic scaling of the defect bounding box height relative to the preset prior anchor box height.

[0069] Furthermore, based on the absolute spatial coordinate parameters of the preset prior anchor boxes, the geometric offset of the bounding boxes is reverse-decoded by linear translation of the center and exponential scaling of width and height to obtain a set of candidate boxes for defect locations. Specifically, the preset prior anchor boxes are reference bounding boxes uniformly placed at various spatial positions in the image space according to a predefined size ratio and aspect ratio. Each prior anchor box has definite absolute spatial coordinate parameters, including the horizontal coordinate of the center point, the vertical coordinate of the center point, the width of the anchor box, and the height of the anchor box. The reverse decoding operation converts the relative offset output by the regression detection head into absolute spatial coordinates, which is specifically divided into two parts: center coordinate decoding and width and height dimension decoding. The center coordinate decoding process includes: first, multiplying the horizontal coordinate offset by the width of the prior anchor box to obtain the absolute pixel offset distance in the horizontal direction; then, adding the absolute pixel offset distance to the horizontal coordinate of the center point of the prior anchor box; the result of the sum is the absolute horizontal coordinate of the center point of the defect bounding box. Similarly, multiplying the vertical coordinate offset by the height of the prior anchor box yields the absolute pixel offset distance in the vertical direction. Then, adding this absolute pixel offset distance to the vertical coordinates of the prior anchor box center point gives the absolute vertical coordinates of the defect bounding box center point. The decoding process for width and height includes: taking the natural exponent of the logarithmic scaling of the width (i.e., exponentiating with a natural constant as the base and the logarithmic scaling of the width as the exponent) to obtain the width scaling factor. This scaling factor is then multiplied by the width of the prior anchor box, and the result is the absolute width of the defect bounding box. Similarly, taking the natural exponent of the logarithmic scaling of the height yields the height scaling factor, which is then multiplied by the height of the prior anchor box, and the result is the absolute height of the defect bounding box. Through the reverse decoding operations of linear translation of the center and exponential scaling of width and height described above, the geometric offset of the bounding box corresponding to each prior anchor box is converted into a defect bounding box with absolute spatial coordinates. All decoded defect bounding boxes form a set of defect location candidate boxes.

[0070] Specifically, the rail welding defect detection module 350 is used to remove redundant boxes from the defect location candidate box set and bind them to the defect category confidence distribution at the instance level. The binding result is then mapped back to the spatial domain rail image tensor to obtain a rail welding defect detection report. It should be understood that the defect location candidate box set contains a large number of redundant bounding boxes with highly overlapping spatial locations. This is because the regression detection head may respond to the same real defect target at multiple prior anchor box locations and output similar bounding box prediction results. Directly outputting all candidate boxes as detection results would cause the same defect to be repeatedly labeled, severely affecting the accuracy and readability of the detection report. Furthermore, the defect category confidence distribution and the defect location candidate box set currently exist as independent data structures, without an instance-by-instance binding relationship, nor are they mapped back to the original image space to form a visually interpretable detection result for engineers. Therefore, in the technical solution of this application, the candidate box set of defect locations is redundantly eliminated and bound to the defect category confidence distribution at the instance level by the rail welding defect detection module, and the binding result is back-mapped to the spatial domain rail image tensor to obtain the rail welding defect detection report, thereby converting the numerical output of the deep learning network into a structured inspection report that can be directly used in the industrial field.

[0071] In practice, firstly, redundant boxes in the defect location candidate box set whose spatial overlap exceeds a set threshold are suppressed and removed to obtain the optimal defect bounding box set. Specifically, all candidate bounding boxes in the defect location candidate box set are sorted in descending order according to the highest confidence value in the confidence distribution of their corresponding defect categories. In this process, a non-maximum suppression strategy is adopted. First, the candidate box with the highest confidence is selected as the current optimal box and added to the optimal defect bounding box set. Then, the spatial overlap between this optimal box and all remaining candidate boxes is calculated. Specifically, for any two bounding boxes, firstly, calculate the area of ​​their spatial intersection region, which is the length of the horizontal overlap region multiplied by the length of the vertical overlap region. The horizontal overlap region is the larger of the smaller of the right boundaries of the two boxes minus the larger of the left boundaries of the two boxes, and zero. The vertical overlap region is the larger of the smaller of the lower boundaries of the two boxes minus the larger of the upper boundaries of the two boxes, and zero. Next, calculate the area of ​​their spatial union region, which is the area of ​​the first box plus the area of ​​the second box minus the area of ​​the intersection region. Finally, divide the area of ​​the intersection region by the area of ​​the union region; the quotient is the spatial overlap degree, ranging from zero to one. A spatial overlap degree closer to one indicates a high degree of spatial overlap between the two bounding boxes; a spatial overlap degree of zero indicates no spatial overlap between the two bounding boxes.

[0072] After calculating the spatial overlap between the current optimal bounding box and all remaining candidate boxes, candidate boxes with spatial overlap exceeding a set threshold are identified as redundant boxes pointing to the same defect target as the current optimal bounding box, and these redundant boxes are suppressed and removed from the candidate box set. Subsequently, the candidate box with the highest confidence score is selected from the remaining candidate boxes that have not been eliminated and added to the optimal defect bounding box set. The above process of spatial overlap calculation and redundant box removal is repeated until the remaining candidate box set is empty or all remaining candidate boxes have been processed. Through this iterative non-maximum suppression operation, each bounding box in the final optimal defect bounding box set corresponds to an independent defect target instance, eliminating the redundancy problem of the same defect being repeatedly labeled by multiple candidate boxes.

[0073] Next, based on a preset warning confidence threshold, instance-level binding and filtering are performed on the optimal defect bounding box set and the defect category confidence distribution. Valid results are then back-mapped and superimposed onto the spatial domain ground-orbit image tensor to obtain visualized enhanced detection images and structured defect feature data. Specifically, each bounding box in the optimal defect bounding box set is processed individually, binding it to its corresponding defect category confidence distribution to form a complete instance description containing spatial location information and category probability information. Subsequently, the bound instances are filtered based on the preset warning confidence threshold. Specifically, for each bound instance, it is checked whether the highest confidence probability value in its defect category confidence distribution is greater than or equal to the preset warning confidence threshold. If the condition is met, the instance is determined to be a valid detection result and retained; otherwise, it is determined that the instance has insufficient confidence and is filtered out. Through the filtering using the warning confidence threshold, only defect detection results with high system confidence are retained, eliminating unreliable predictions with low confidence.

[0074] After completing instance-level binding and filtering, the valid detection results are back-mapped and superimposed onto the spatial domain ground-track image tensor to generate a visually enhanced detection image and structured defect feature data. Specifically, for each valid detection result instance, a rectangular bounding box is drawn on the spatial domain ground-track image tensor according to the absolute spatial coordinate parameters of its bounding box. The defect category name and the highest confidence probability value of the instance are labeled near the bounding box, and different categories of defect labels are distinguished by color coding. The bounding box labels and category labels of all valid detection result instances are superimposed on the spatial domain ground-track image tensor to form a visually enhanced detection image, allowing engineers to intuitively observe the location, extent, and category information of defects on the original image. At the same time, the structured feature description of each valid detection result instance is extracted, including numerical information such as the center coordinates, width, height, defect category label, and corresponding confidence probability value of the defect bounding box. The structured feature descriptions of all valid instances are organized in sequence to form structured defect feature data.

[0075] Furthermore, the enhanced visualization inspection image undergoes image encoding conversion and is then fused with structured defect feature data to obtain a rail welding defect inspection report. Specifically, the enhanced visualization inspection image currently exists as a pixel matrix in memory and needs to be converted into standard image file format data through image encoding conversion. Specifically, the pixel matrix of the enhanced visualization inspection image is compressed and encoded according to a preset image encoding format, converting the pixel-level numerical matrix into an encoded data stream conforming to standard image format specifications for easy storage, transmission, and display. After image encoding conversion, the encoded enhanced visualization inspection image data is fused with the structured defect feature data. Specifically, the encoded image data serves as the visualization display part of the inspection report, and the structured defect feature data serves as the numerical analysis part of the inspection report. The two are organized and spliced ​​according to a predefined report format template to form a complete rail welding defect inspection report containing both image visualization results and numerical defect information. This inspection report simultaneously provides intuitive visual image information for manual interpretation and structured data information for automated system scheduling, meeting the application needs of multi-dimensional output of inspection results in industrial settings.

[0076] As described above, the deep learning-based intelligent rail welding defect detection system 300 according to the embodiments of this application can be implemented in various wireless terminals, such as servers with a deep learning-based intelligent rail welding defect detection algorithm. In one possible implementation, the deep learning-based intelligent rail welding defect detection system 300 according to the embodiments of this application can be integrated into the wireless terminal as a software module and / or hardware module. For example, the deep learning-based intelligent rail welding defect detection system 300 can be a software module in the operating system of the wireless terminal, or it can be an application developed for the wireless terminal; of course, the deep learning-based intelligent rail welding defect detection system 300 can also be one of many hardware modules of the wireless terminal.

[0077] Alternatively, in another example, the deep learning-based intelligent rail welding defect detection system 300 and the wireless terminal can also be separate devices, and the deep learning-based intelligent rail welding defect detection system 300 can be connected to the wireless terminal via wired and / or wireless networks, and transmit interactive information in accordance with an agreed data format.

[0078] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A deep learning-based intelligent rail welding defect detection system, characterized in that, include: The frequency-spatial domain multi-scale feature decoupling module is used to perform image normalization and two-dimensional discrete wavelet decomposition on the visible light image data of ground rail welding acquired by the industrial camera of the inspection terminal to obtain the spatial domain ground rail image tensor and the frequency domain wavelet coefficient matrix. The cross-domain deep feature extraction module is used to extract spatial semantic features from the spatial domain ground orbit image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform amplitude and phase separation and periodic pseudo-defect frequency band suppression on the frequency domain wavelet coefficient matrix through an adaptive wavelet phase attention module to obtain a frequency domain phase-preserving feature map. The frequency-space feature fusion module is used to perform frequency-space feature fusion on the spatial domain semantic feature map and the frequency domain phase-preserving feature map to obtain a joint decoupled feature vector. The module for true and false defect boundary regression and classification is used to perform true and false defect boundary regression and classification on the joint decoupled feature vector based on momentum comparison space through momentum comparison classifier and regression detection head to obtain defect category confidence distribution and defect location candidate box set; The rail welding defect detection module is used to remove redundant boxes from the candidate box set of defect locations and bind them to the defect category confidence distribution at the instance level. The binding results are then back-mapped to the spatial domain rail image tensor to obtain the rail welding defect detection report.

2. The intelligent rail welding defect detection system based on deep learning according to claim 1, characterized in that, The visible light image data of ground rail welding includes images of the weld fusion line area, surface images of the heat-affected zone, and reference images of the base material transition zone.

3. The intelligent rail welding defect detection system based on deep learning according to claim 2, characterized in that, The frequency-spatial domain multi-scale feature decoupling module includes: The grayscale linear combination unit is used to perform grayscale linear combination on the weld fusion line region image, heat-affected zone surface image and base material transition zone reference image in the visible light image data of ground rail welding to obtain the grayscale matrix of the region of interest. The gray-level extreme value normalization unit is used to normalize the gray-level values ​​of all pixels in the gray-level matrix of the region of interest to obtain the spatial domain ground orbit image tensor. The frequency-space multi-scale channel reconstruction unit is used to perform two-dimensional discrete wavelet decomposition on the spatial domain ground orbit image tensor, and stack the decomposed low-frequency approximate components, horizontal high-frequency components, vertical high-frequency components and diagonal high-frequency components in the channel dimension to obtain the frequency domain wavelet coefficient matrix.

4. The intelligent rail welding defect detection system based on deep learning according to claim 1, characterized in that, The cross-domain deep feature extraction module includes: The spatial feature extraction and frequency domain orthogonal decomposition unit is used to extract spatial semantic features from the spatial domain ground orbit image tensor through a convolutional backbone network to obtain a spatial domain semantic feature map, and to perform frequency domain orthogonal separation of the horizontal high-frequency components and the vertical high-frequency components in the frequency domain wavelet coefficient matrix to obtain the initial amplitude matrix and the separation phase matrix. An adaptive frequency domain suppression unit is used to attenuate and suppress the energy bands of the grinding marks and fish scale patterns with periodic characteristics in the initial amplitude matrix through a learnable adaptive frequency mask convolution kernel to obtain an attenuated amplitude matrix. The feature map reconstruction unit is used to couple and reconstruct the attenuation amplitude matrix and the separation phase matrix and perform a two-dimensional discrete wavelet inverse transform to obtain a frequency domain phase-preserving feature map.

5. The intelligent rail welding defect detection system based on deep learning according to claim 1, characterized in that, The frequency-space feature fusion module is used for: Cross-modal feature space alignment and channel concatenation are performed on the spatial domain semantic feature map and the frequency domain phase-preserving feature map to obtain a concatenated multimodal feature tensor. Global pooling and spatial dimension compression are performed on the cascaded multimodal feature tensor to obtain a global one-dimensional feature vector; By using a nonlinear projection head that incorporates two fully connected layers and linear rectified activation, the global one-dimensional feature vector is nonlinearly projected and the latent space features are normalized to obtain a joint decoupled feature vector.

6. The intelligent rail welding defect detection system based on deep learning according to claim 1, characterized in that, The True / False Defect Boundary Regression and Classification module is used for: By updating the cluster center vectors of each category in the dictionary with momentum, the joint decoupled feature vectors are subjected to momentum comparison latent space distance measurement and classification to obtain the confidence distribution of defect categories. A multi-layered densely connected regression detection head is used to perform an affine transformation mapping on the joint decoupled feature vector to obtain the bounding box geometric offset, which includes the center coordinate offset and the logarithmic scaling of width and height. Based on the absolute spatial coordinate parameters of the preset prior anchor frame, the geometric offset of the bounding box is decoded by linear translation of the center and exponential scaling of width and height to obtain a set of candidate boxes for defect locations.

7. The intelligent rail welding defect detection system based on deep learning according to claim 1, characterized in that, The rail welding defect detection module is used for: Redundant boxes with spatial overlap exceeding a set threshold in the candidate box set for defect locations are suppressed and removed to obtain the optimal set of defect bounding boxes. Based on a preset warning confidence threshold, the optimal defect bounding box set and the defect category confidence distribution are subjected to instance-level binding and filtering, and the effective results are back-mapped and superimposed onto the spatial domain ground orbit image tensor to obtain visualized enhanced detection images and structured defect feature data. The enhanced visual inspection images are converted into images and then stitched together with structured defect feature data to obtain a ground rail welding defect inspection report.

8. The intelligent rail welding defect detection system based on deep learning according to claim 4, characterized in that, Feature map reconstruction unit, used for: The continuity of crack stress propagation direction is scored for each frequency domain coordinate point in the separated phase matrix to obtain the phase continuity gating diagram; Using the phase continuity gating map as element-wise modulation weights, the horizontal and vertical high-frequency coefficients after coupling the attenuation amplitude matrix and the separated phase matrix through inverse polar coordinate transformation are gated and weighted to obtain the gated coupled horizontal high-frequency coefficients and the gated coupled vertical high-frequency coefficients. By combining the unchanged low-frequency approximation components and the diagonal high-frequency components, the spatial scale restoration and reconstruction of the gated coupling horizontal high-frequency coefficients and the gated coupling vertical high-frequency coefficients are performed by two-dimensional discrete wavelet inverse transform to obtain the frequency domain phase-preserving feature map.