A steel rail defect three-dimensional generation reconstruction method based on ultrasonic sound field guidance

By using a recurrent generative adversarial network model guided by ultrasonic field, rail B-scan data is converted into defect cross-sectional images. The defect size is then calculated by combining the acoustic field information. This solves the problem of obtaining three-dimensional information in rail inspection in existing technologies, and achieves efficient and accurate three-dimensional reconstruction of rail defects.

CN116106429BActive Publication Date: 2026-05-01SICHUAN CHENGDIAN MULTIPHYSICAL INTELLIGENT PERCEPTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN CHENGDIAN MULTIPHYSICAL INTELLIGENT PERCEPTION TECH CO LTD
Filing Date
2023-03-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing 3D reconstruction methods are difficult to directly obtain 3D information of defects in rail inspection, especially ultrasonic non-destructive testing methods, which require multiple probes or mechanical scanning and are difficult to acquire data, thus failing to meet the needs of long-distance rail inspection.

Method used

An ultrasonic field-guided method for generating and reconstructing rail defects in three dimensions is adopted. B-scan data is collected by a flaw detection wheel, and a cyclic generative adversarial network model guided by the sound field is used to convert the data into a defect cross-sectional image. The defect size is calculated by combining the amplitude of the B-scan data, and a three-dimensional spatial transformation is performed. Finally, a three-dimensional model of the defect is output in the ultrasonic testing platform.

Benefits of technology

It enables 3D reconstruction of internal defects in rails without the need for multiple probes or mechanical scanning, reducing costs and improving detection efficiency and accuracy. It is suitable for non-destructive testing environments for rails, can run on Windows terminal devices, and simplifies the 3D reconstruction process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004150294070000021
    Figure BDA0004150294070000021
  • Figure BDA0004150294070000031
    Figure BDA0004150294070000031
  • Figure BDA0004150294070000032
    Figure BDA0004150294070000032
Patent Text Reader

Abstract

The application discloses a kind of steel rail defect three-dimensional generation reconstruction methods based on ultrasonic sound field guidance, the B scanning data of steel rail is converted into defect cross section drawing by the cyclic generation of the adversarial network of ultrasonic sound field guidance, then defect cross section aperture and distance and other information are extracted from defect cross section drawing, then the transverse size of defect is calculated in combination with the amplitude of B scanning data, and the position of steel rail defect is converted from B scanning coordinate system to steel rail coordinate system by three-dimensional space transformation, to obtain the spatial position of steel rail defect in steel rail;Finally, the aperture of defect, transverse size and spatial position are transmitted into ultrasonic detection three-dimensional platform, to output the three-dimensional model of steel rail defect, complete the three-dimensional reconstruction of steel rail defect.
Need to check novelty before this filing date? Find Prior Art

Description

A method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance Technical Field

[0001] This invention belongs to the field of nondestructive testing technology, and more specifically, relates to a method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance. Background Technology

[0002] Ultrasonic nondestructive testing methods have been widely used in industrial quality inspection. With the development of three-dimensional reconstruction technology, ultrasonic nondestructive testing methods have evolved from traditional two-dimensional imaging to three-dimensional imaging. Three-dimensional reconstruction of rail defects can intuitively restore the three-dimensional size and spatial location of the defects inside the rail, improving the efficiency of rail defect detection. This helps to detect rail problems early and repair them in a timely manner, avoiding accidents and safety issues caused by rail defects.

[0003] Currently, outdoor 3D reconstruction mainly relies on vision or laser methods, while ultrasonic-based 3D reconstruction is primarily used in laboratory settings, requiring multi-probe or mechanical scanning platforms, which is insufficient for non-destructive testing in rail scenarios. Furthermore, in long-distance rail inspection, ultrasonic non-destructive testing methods mainly involve guided wave and B-scan scanning, but these cannot directly obtain 3D information about defects, making it difficult to describe the 3D size and location distribution of defects within the rail.

[0004] Existing 3D reconstruction methods are mainly based on point clouds. The process of generating 3D data from low-dimensional data using point cloud generators requires a large amount of data to guide training. For nondestructive testing of rails, ultrasonic data is too sparse, while 3D reconstruction requires a large amount of data, making it difficult to collect enough 3D ultrasonic defect data to provide features for the generator network. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for generating and reconstructing three-dimensional rail defects based on ultrasonic field guidance. This method effectively reconstructs three-dimensional rail defects using B-scan data from flaw detector wheels, thereby achieving non-destructive testing of rail scenes.

[0006] To achieve the above-mentioned objectives, this invention provides a method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance, characterized by comprising the following steps:

[0007] (1) Collect B-scan data;

[0008] A flaw detection vehicle carrying flaw detection wheels is used to perform B-scan inspection on the rail under test to obtain B-scan data at the location of defects on the rail under test.

[0009] (2) Generation of two-dimensional defect cross sections guided by ultrasonic sound field;

[0010] (2.1) Establishing a sound pressure beam model of the flaw detection wheel incident on the interior of the rail to be tested:

[0011]

[0012] Where p(x,ω) represents the sound pressure of an ultrasonic probe with frequency ω at position x inside the rail, and the width of the ultrasonic probe is 2b, x t This represents the center position of the ultrasonic probe surface, where r1 is the x-axis position of the ultrasonic probe surface. t The incident point x along the direction of the sound wave to the rail surface i The distance, r2 is the incident point x i The distance to position x inside the rail; T p Let ρ1 be the plane wave propagation coefficient based on the sound pressure ratio, c1 be the density of the coupling fluid inside the flaw detection wheel, c2 be the propagation speed of the sound wave in the coupling fluid inside the flaw detection wheel, k1 and k2 be the wave number in the coupling fluid inside the flaw detection wheel and the rail, respectively, k1 = ω / c1, k2 = ω / c2, v0(ω) represents the Fourier transform of the vibration velocity on the probe surface at frequency ω, θ1 and θ2 are the incident angle and exit angle of the sound wave, respectively, and i represents the imaginary number;

[0013] (2.2) Obtain the sound field distribution map of the virtual probe;

[0014] A virtual probe is defined with its surface center at x2 and width at 2b. The incident angle θ1 of the sound wave, the medium densities ρ1 and ρ2, and the sound velocities c1 and c2 are set, thus determining the exit angle of the sound wave in the rail. By simulating the sound pressure beam model, the sound pressure value under the B-sweep section space inside the rail is calculated, thereby obtaining the sound field distribution map P inside the rail;

[0015] (2.3) Set the initial defect range;

[0016] Calculate the connected components of the B-scan data, and define a circle with the length of the connected components as its radius and tangent to the connected components. The area inside this circle is taken as the initial defect range.

[0017] (2.4) Set the error threshold η; set the maximum number of iterations T, initialize the current number of iterations t=1, and set an image with the same size as the B scan data and a pixel value of 0 as the mask image;

[0018] (2.5) Set each pixel on the horizontal axis of the simulated B-scan data as sampling point o, and the center of the sound beam on the horizontal axis of the sound field distribution map P corresponds to sampling point o; perform a simulated B-scan on the rail under test using a virtual probe, and obtain the A-scan signal S(o) at sampling point o as follows:

[0019]

[0020] Where C is the outer contour of the defect, c is a single contour point of the defect, P(c) is the sound field distribution map P of the virtual probe at sampling point o at the defect contour point c, and β em β is the coefficient of sound pressure received by the sound wave emitted onto the defect surface. re The coefficient representing the sound pressure level reflected back from the defect to the virtual probe.

[0021] (2.6) After the simulated B scan is completed, the A scan signal at each sampling point is used as a column vector to form the simulated B scan data;

[0022] (2.7) Compare the connected component data of the simulated B-scan data after processing with the connected component data, and calculate the difference index dissim:

[0023]

[0024] Among them, l fake and l real These are the lengths of the connected components in the simulated B-scan data and the lengths of the connected components in the B-scan data, respectively.

[0025] (2.8) Calculate the reverse correction gradient grad for the defect size:

[0026] grad=l fake -l real

[0027] (2.9) Correct the simulated defect radius according to the reverse correction gradient to keep the simulated defect location tangent to the connected components of the B-scan data:

[0028]

[0029] Where, α grad This is the gradient descent coefficient;

[0030] (2.10) Calculate the probability prob of the defect at the simulated defect location:

[0031] prob = 1 - a diss dissim

[0032] Among them, a diss The coefficient of variation;

[0033] (2.11) Assign the pixel value 100*prob to the pixel position of the simulated defect in the mask image to obtain the defect range mask;

[0034] (2.12) Determine whether the current iteration number t has reached the maximum iteration number T or the difference index dissim < η. If it is satisfied, the iteration stops and the defect range mask corresponding to the B scan data is obtained; otherwise, let t = t + 1, and then return to step (2.5) to carry out the next round of iteration.

[0035] (2.13) Input the B-scan data and the defect range mask into the trained recurrent generative adversarial network model to generate the rail defect cross-section diagram corresponding to the B-scan data;

[0036] (3) Three-dimensional reconstruction of defects;

[0037] (3.1) Extract the aperture d of the defect and the distance s from the defect to the ultrasonic probe from the cross-sectional diagram of the rail defect; at the same time, extract the peak of the defect signal from the B-scan data;

[0038] (3.2) Calculate the transverse dimension l of the defect perpendicular to the B-sweep section:

[0039]

[0040] Where a, b, c, and k are constant coefficients;

[0041] (3.3) Calculate the three-dimensional location of the defect

[0042] (3.3.1) Set the origin of the rail coordinate system at the midpoint of the rail bottom of the rail cross-section at the start of scan B; ignore the propagation of sound waves inside the probe, and set the origin of the probe coordinate system at the incident point x where the sound waves emitted by the probe in the flaw detection wheel reach the rail surface. i Place;

[0043] (3.3.2) The sound path location p of the defect in the B-scan data bscan =(0,s,0,1) T Transform to the probe coordinate system;

[0044] p dector =R y R z p bscan

[0045] Where, p dector R represents the position of the defect in the probe coordinate system in the B-scan data. z Indicates the sound path position p bscan Around the probe z dector The rotation matrix of the axis rotation, R y Indicates the sound path position p bscan Around the probe y dector Rotation matrix for axis rotation;

[0046] (3.3.3) Position p in the probe coordinate system dector Transform to the rail coordinate system;

[0047] p rail =T rail p dector

[0048] Where, p rail T represents the location of the defect in the rail coordinate system. rail This represents the transformation matrix from the probe coordinate system to the rail coordinate system;

[0049] (3.4) Three-dimensional reconstruction of rail defects;

[0050] The defect's aperture d, lateral dimension l, and location p rail The data is input into a 3D ultrasonic testing platform, which then outputs a 3D model of the rail defect.

[0051] The objective of this invention is achieved as follows:

[0052] This invention relates to a method for the three-dimensional generation and reconstruction of rail defects guided by ultrasonic sound field. It uses a recurrent generative adversarial network (GAN) guided by ultrasonic sound field to convert B-scan data of the rail into a defect cross-sectional image. Information such as the aperture and distance of the defect cross-section is then extracted from the image. The lateral dimensions of the defect are calculated by combining the amplitude of the B-scan data. The location of the rail defect is then transformed from the B-scan coordinate system to the rail coordinate system through a three-dimensional spatial transformation, yielding the spatial position of the defect within the rail. Finally, the aperture, lateral dimensions, and spatial position of the defect are input into an ultrasonic testing three-dimensional platform, thereby outputting a three-dimensional model of the rail defect and completing the three-dimensional reconstruction of the rail defect.

[0053] Meanwhile, the ultrasonic field-guided three-dimensional generation and reconstruction method for rail defects in this invention also has the following advantages:

[0054] Beneficial effects:

[0055] (1) By using ultrasonic B-scan data collected by a flaw detection vehicle carrying a flaw detection wheel, the internal defects of the rail can be reconstructed in three dimensions. This eliminates the need for the multi-probe or mechanical scanning device required by existing ultrasonic three-dimensional reconstruction technology, reducing the cost of three-dimensional reconstruction and making it suitable for operation in the rail non-destructive testing environment.

[0056] (2) The original B-scan data is converted into a defect cross-section map by using a sound field-guided recurrent generative adversarial network model. Compared with the general recurrent generative network model, the range of defect cross-sections can be constrained by introducing sound field guidance, thereby improving the generation accuracy of defect cross-sections.

[0057] (3) A defect echo model is proposed and the three-dimensional dimensions of rail defects are calculated by generating defect cross sections. A simplified defect model is fitted. Compared with the existing point cloud-based three-dimensional reconstruction method, the amount of data required to calculate the three-dimensional information of defects is small, which improves the efficiency of three-dimensional reconstruction.

[0058] (4) The spatial location and size information of defects in the rail can be intuitively reconstructed in the ultrasonic testing 3D software platform. Compared with existing 3D reconstruction methods, there is no need to configure a complex library environment. The software can be installed and run on Windows terminal devices, improving the efficiency of non-destructive testing of rail environments. Attached Figure Description

[0059] Figure 1 is a flowchart of the three-dimensional generation and reconstruction method for rail defects based on ultrasonic field guidance of the present invention;

[0060] Figure 2 is a schematic diagram of the acoustic pressure beam model from the probe to the rail;

[0061] Figure 3 shows the sound field distribution inside the rail under test;

[0062] Figure 4 is a structural diagram of the recurrent generative adversarial network model;

[0063] Figure 5 is a schematic diagram of the transformation from the probe coordinate system to the rail coordinate system;

[0064] Figure 6 shows the effect of three-dimensional reconstruction of rail defects. Detailed Implementation

[0065] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.

[0066] Example

[0067] Figure 1 is a flowchart of the three-dimensional generation and reconstruction method for rail defects based on ultrasonic field guidance according to the present invention.

[0068] In this embodiment, as shown in Figure 1, the present invention provides a method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance, comprising the following steps:

[0069] S1. Collect B-scan data;

[0070] A flaw detection vehicle carrying flaw detection wheels is used to perform B-scan inspection on the rail under test to obtain B-scan data at the location of defects on the rail under test.

[0071] S2. Generation of two-dimensional defect cross sections guided by ultrasonic sound field;

[0072] S2.1 Establish a sound pressure beam model of the flaw detection wheel incident on the interior of the rail to be tested:

[0073]

[0074] Where p(x,ω) represents the sound pressure of an ultrasonic probe with frequency ω at position x inside the rail, and the width of the ultrasonic probe is 2b, x t This represents the center position of the ultrasonic probe surface, where r1 is the x-axis position of the ultrasonic probe surface. t The incident point x along the direction of the sound wave to the rail surface i The distance, r2 is the incident point x i The distance to position x inside the rail; T p Let ρ1 be the plane wave propagation coefficient based on the sound pressure ratio, c1 be the density of the coupling fluid inside the flaw detection wheel, c2 be the propagation speed of the sound wave in the coupling fluid inside the flaw detection wheel, k1 and k2 be the wave number in the coupling fluid inside the flaw detection wheel and the rail, respectively, k1 = ω / c1, k2 = ω / c2, v0(ω) represents the Fourier transform of the vibration velocity on the probe surface at frequency ω, θ1 and θ2 are the incident angle and exit angle of the sound wave, respectively, and i represents the imaginary number;

[0075] The two-dimensional sound field energy distribution of an ultrasonic probe under the B-scan section of a rail can be described by the sound pressure beam model.

[0076] S2.2 Obtain the sound field distribution map of the virtual probe;

[0077] In this embodiment, as shown in Figure 2, a virtual probe is set, with its surface center position at x. t Located at a height of 100mm, with a width of 2b = 10mm, and with the sound wave incident angle set at θ1 = 8.86° and the medium density ρ1 = 1000kg / m³. 3 ρ2=7900kg / m 3 The speeds of sound are c1 = 1480 m / s and c2 = 5900 m / s, thus the exit angle of the sound wave in the rail is... The probe vibration frequency is 5MHz; by simulating the sound pressure beam model, the sound pressure value under the B-sweep section space inside the rail is calculated, thus obtaining the sound field distribution map P inside the rail shown in Figure 3;

[0078] S2.3, Set the initial defect range;

[0079] Calculate the connected components of the B-scan data, and define a circle with the length of the connected components as its radius and tangent to the connected components. The area inside this circle is taken as the initial defect range.

[0080] S2.4 Set the error threshold η = 0.01; set the maximum number of iterations T = 30, initialize the current number of iterations t = 1, and set an image with the same size as the B-scan data and a pixel value of 0 as the mask image;

[0081] S2.5. Set each pixel on the horizontal axis of the simulated B-scan data as a sampling point o, and the center of the sound beam on the horizontal axis of the sound field distribution map P corresponds to sampling point o; perform a simulated B-scan on the rail under test using a virtual probe, and obtain the A-scan signal S(o) at sampling point o as follows:

[0082]

[0083] Where C is the outer contour of the defect, c is a single contour point of the defect, P(c) is the sound field distribution map P of the virtual probe at sampling point o at the defect contour point c, and β em β is the coefficient of sound pressure received by the sound wave emitted onto the defect surface. re The coefficient representing the sound pressure level reflected back from the defect to the virtual probe.

[0084] S2.6 After the simulated B scan is completed, the A scan signal at each sampling point is used as a column vector to form the simulated B scan data;

[0085] S2.7. After processing the connected components of the simulated B-scan data, compare the connected components with those of the actual B-scan data and calculate the difference index dissim.

[0086]

[0087] Among them, l fake and l real These are the lengths of the connected components in the simulated B-scan data and the lengths of the connected components in the B-scan data, respectively.

[0088] S2.8 Calculate the reverse correction gradient grad for the defect size:

[0089] grad=l fake -l real

[0090] S2.9. Correct the simulated defect radius according to the reverse correction gradient to keep the simulated defect location tangent to the connected components of the B-scan data:

[0091]

[0092] Where, α grad The gradient descent coefficient is set to 0.05.

[0093] S2.10 Calculate the probability prob of the defect at the simulated defect location:

[0094] prob=1-α diss dissim

[0095] Where, α diss The coefficient of variation is set to 3.0;

[0096] S2.11. Assign the pixel value 100*prob to the pixel position of the simulated defect in the mask image to obtain the defect range mask;

[0097] S2.12. Determine whether the current iteration number t has reached the maximum iteration number T or the difference index dissim < η. If it is satisfied, the iteration stops and the defect range mask corresponding to the B scan data is obtained; otherwise, let t = t + 1, and then return to step S2.5 for the next round of iteration.

[0098] S2.13. Input the B-scan data and defect range mask into the trained recurrent generative adversarial network model to generate the rail defect cross-section diagram corresponding to the B-scan data. The recurrent generative adversarial network model is a traditional network model, as shown in Figure 4, which includes the generator and discriminator of the cross-section generation model. The specific training process will not be described in detail here.

[0099] S3, 3D reconstruction of defects;

[0100] S3.1. Extract the aperture d of two defects from the rail defect cross-sectional diagram as 4.714 mm and 3.808 mm, and the distance s from the defect to the ultrasonic probe as 202.404 and 202.857; at the same time, extract the peak amplitude of the defect signal from the B-scan data as 35.746 and 27.181.

[0101] S3.2, The calculated transverse dimensions l of the defect perpendicular to the B-sweep section are 5.819 mm and 4.397 mm:

[0102]

[0103] Where a = 4.246, b = 2.713, c = -0.170, and k = 32.696 are the constant coefficients of the current model;

[0104] S3.3 Calculate the three-dimensional location of the defect;

[0105] S3.3.1 Set the origin of the rail coordinate system at the midpoint of the rail bottom of the rail cross-section at the start of scan B; ignore the propagation of sound waves inside the probe, and set the origin of the probe coordinate system at the incident point x of the sound wave emitted by the probe from the flaw detection wheel to the rail surface. i Place;

[0106] S3.3.2, As shown in Figure 5, the acoustic path position p of the defect in the B-scan data is... bscan =(0,s,0,1) T Transform to the probe coordinate system;

[0107] p dector =R y R z p bscan

[0108] Where, p dector R represents the position of the defect in the probe coordinate system in the B-scan data. z Indicates the sound path position p bscan Around the probe z dector The rotation matrix of the axis rotation, R y Indicates the sound path position p bscan Around the probe y dector Rotation matrix for axis rotation;

[0109] In this embodiment, The matrix form of the above transformation process can then be expressed as:

[0110]

[0111] Where, θ y Let x be the deflection angle of the rotating probe. dector ,y dector ,z dector ) represents p dector The three-dimensional coordinates of the defect were calculated; the probe system coordinates of the defect were (121.442, 161.923, 0.000) and (121.714, 162.286, 0.000).

[0112] S3.3.3 As shown in Figure 5, the position p in the probe coordinate system dector Transform to the rail coordinate system;

[0113] p rail =T rail p dector

[0114] Where, p rail T represents the location of the defect in the rail coordinate system. rail This represents the transformation matrix from the probe coordinate system to the rail coordinate system;

[0115] In this embodiment, The matrix form of the above transformation process can then be expressed as:

[0116]

[0117] Among them, h rail =176mm is the height of the rail, and odom is the distance of the detected defect relative to the rail coordinate system, which is 72.877mm and 216.224mm. The location of the defect in the rail coordinate system is (194.319, 14.442, 0.000) and (337.938, 16.797, 0.000).

[0118] S3.4, Three-dimensional reconstruction of rail defects;

[0119] The defect's aperture d [4.714, 3.808], lateral dimension l [5.819, 4.397], and location p are considered. rail The data is input into a 3D ultrasonic testing platform, which then outputs a 3D model of the rail defect.

[0120] In this embodiment, the ultrasonic testing 3D platform is shown in Figure 6. The left window is the 3D display interface, which reconstructs and restores the rail model and the defect model in the rail. The right window is the interactive interface of the ultrasonic testing 3D platform. In the software operation section, different workpiece environments can be simulated. The "Add Probe" button can add a probe to simulate the propagation of the sound beam in the workpiece, and the "Display Defect" button can read defect information from the file and reconstruct the defect in 3D. The 3D information of the defect will be displayed in the information bar below.

[0121] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.

Claims

1. A method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance, characterized in that, Includes the following steps: (1) Acquire B-scan data; use a flaw detection vehicle carrying a flaw detection wheel to perform B-scan inspection on the rail under test to obtain B-scan data at the location of defects on the rail under test; (2) Generate two-dimensional cross-section of defects based on ultrasonic field guidance; (2.1) Establish a sound pressure beam model of the flaw detection wheel incident on the interior of the rail under test: Where p(x,ω) represents the sound pressure of an ultrasonic probe with frequency ω at position x inside the rail, and the width of the ultrasonic probe is 2b, x t This represents the center position of the ultrasonic probe surface, where r1 is the x-axis position of the ultrasonic probe surface. t The incident point x along the direction of the sound wave to the rail surface i The distance, r2 is the incident point x i The distance to position x inside the rail; T p For the plane wave propagation coefficient based on sound pressure ratio, ρ1 is the density of the coupling fluid inside the flaw detection wheel, c1 is the propagation speed of the sound wave in the coupling fluid inside the flaw detection wheel, c2 is the propagation speed of the sound wave in the rail, k1 and k2 are the wave numbers in the coupling fluid inside the flaw detection wheel and the rail, respectively, k1=ω / c1, k2=ω / c2, v0(ω) represents the Fourier transform of the vibration velocity of the probe surface at frequency ω, θ1 and θ2 are the incident angle and exit angle of the sound wave, respectively, i represents the imaginary number; (2.2) Obtain the sound field distribution map of the virtual probe; Set a virtual probe with the center position of its surface at x2 and the width at 2b, set the incident angle of the sound wave θ1 and the medium density ρ1, ρ2, the sound velocity c1, c2, so that the exit angle of the sound wave in the rail is obtained. By simulating the sound pressure beam model, the sound pressure value under the B-scan section space inside the rail is calculated, thus obtaining the sound field distribution map P inside the rail; (2.3) Set the initial defect range; calculate the connected domain of the B-scan data, set a circle with the length of the connected domain as the radius and tangent to the connected domain, and take this circle as the initial defect range; (2.4) Set the error threshold η; set the maximum number of iterations T, initialize the current number of iterations t=1, and set an image with the same size as the B-scan data and a pixel value of 0 as the mask image; (2.5) Set each pixel on the horizontal axis of the simulated B-scan data as the sampling point o, and the center of the horizontal beam of the sound field distribution map P corresponds to the sampling point o; simulate the B-scan of the rail under test by using a virtual probe, and obtain the A-scan signal S(o) at the sampling point o as: Where C is the outer contour of the defect, c is a single contour point of the defect, P(c) is the sound field distribution map P of the virtual probe at sampling point o at the defect contour point c, and β em β is the coefficient of sound pressure received by the sound wave emitted onto the defect surface. re (2.6) The coefficient of sound pressure reflected from the defect back to the virtual probe; (2.7) After the simulated B scan is completed, the A scan signal at each sampling point is used as a column vector to form the simulated B scan data; (2.8) The simulated B scan data is processed by connected component analysis and compared with the connected component of the B scan data to calculate the difference index dissim: Among them, l fake and l real These are the lengths of the connected components of the simulated B-scan data and the lengths of the connected components of the B-scan data, respectively; (2.8) Calculate the reverse correction gradient grad of the defect size: grad = l fake -l real (2.9) Correct the simulated defect radius according to the reverse correction gradient to keep the simulated defect location tangent to the connected components of the B-scan data: Where, α grad Let be the gradient descent coefficient; (2.10) Calculate the probability prob of the defect at the simulated defect location: prob = 1 - a diss dissim, where a diss (2.11) Assign pixel value 100*prob to the pixel position of the simulated defect in the mask image to obtain the defect range mask; (2.12) Determine whether the current iteration number t reaches the maximum iteration number T or the difference index dissim < η. If it is satisfied, the iteration stops and the defect range mask corresponding to the B-scan data is obtained; otherwise, let t = t + 1, and then return to step (2.5) for the next iteration; (2.13) Input the B-scan data and the defect range mask into the trained recurrent generative adversarial network model to generate the rail defect cross-section image corresponding to the B-scan data; (3) 3D reconstruction of the defect; (3.1) Extract the aperture d of the defect and the distance s from the defect to the ultrasonic probe from the rail defect cross-section image; at the same time, extract the amplitude peak of the defect signal from the B-scan data; (3.2) Calculate the transverse dimension l of the defect perpendicular to the B-scan cross-section: Where a, b, c, and k are constant coefficients; (3.3) Calculate the three-dimensional position of the defect (3.3.1) Set the origin of the rail coordinate system at the midpoint of the bottom of the rail cross section at the start of the B scan; Ignore the propagation of the sound wave inside the probe, and set the origin of the probe coordinate system at the incident point x of the sound wave emitted by the probe from the flaw detection wheel to the surface of the rail. i (3.3.2) The acoustic path location p of the defect in the B-scan data. bscan =(0,s,0,1) T Transform to the probe coordinate system; p dector =R y R z p bscan Where, p dector R represents the position of the defect in the probe coordinate system in the B-scan data. z Indicates the sound path position p bscan Around the probe z dector The rotation matrix of the axis rotation, R y Indicates the sound path position p bscan Around the probe y dector The rotation matrix of the axis rotation; (3.3.3), the position p in the probe coordinate system dector Transform to the rail coordinate system; p rail =T rail p dector Where, p rail T represents the location of the defect in the rail coordinate system. rail The transformation matrix from the probe coordinate system to the rail coordinate system is represented; (3.4) Three-dimensional reconstruction of rail defects; the aperture d, lateral dimension l, and position p of the defect are represented. rail The data is input into a 3D ultrasonic testing platform, which then outputs a 3D model of the rail defect.

2. The method for three-dimensional generation and reconstruction of rail defects based on ultrasonic field guidance according to claim 1, characterized in that, The R z R y T rail satisfy: Where, θ y h is the deflection angle of the rotating probe. rail denoted as the height of the rail, and odom as the distance between the probe coordinate system and the rail coordinate system.