Wheel-rail fatigue crack intelligent quantitative characterization method based on microscopic analysis image
By performing fractal enhancement and NLM noise reduction on microscopic images of wheels and rails, combined with an improved YOLOv8 model and image scale calibration, and Harris corner detection, intelligent quantitative characterization of wheel and rail fatigue cracks was achieved. This solved the problems of low detection efficiency and large error in existing technologies, and enabled accurate measurement of crack size characteristics.
Patent Information
- Application Number
- CN202511494183.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing technologies are insufficient for effectively segmenting images of microcracks in wheel-rail systems, and deep learning models fail to accurately locate and measure crack size characteristics, resulting in low detection efficiency and high false detection rates, which makes it difficult to meet the safety requirements of railway transportation.
Fractal enhancement and NLM noise reduction are used to improve image contrast, and CLAHE and Retinex algorithms are combined to suppress noise. The YOLOv8 model is optimized by embedding the CSSTAM module, and image scale is automatically calibrated and OCR is used. Harris corner detection and filtering are combined to achieve accurate measurement of crack size characteristics.
It significantly improves the accuracy and robustness of wheel-rail fatigue crack detection, and realizes accurate automatic measurement of crack length, width, depth and propagation angle, solving the problems of low efficiency and large error in traditional methods.
Smart Images

Figure CN120953294B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of wheel-rail tribology, and particularly relates to a wheel-rail fatigue crack intelligent quantitative characterization method based on micro-analysis images. BACKGROUND
[0002] Rolling contact fatigue crack is one of the most common and most harmful damage forms in the wheel-rail system, which seriously threatens the safety of railway transportation and causes huge economic losses. Rolling contact fatigue cracks usually originate from the rail head tread, are caused by repeated rolling contact stress, and gradually expand with the increase of train passing times, and finally may lead to rail fracture or peeling. If not detected and treated in time, it will cause sudden track failure and endanger the safety of train operation.
[0003] The traditional manual inspection method has problems of low detection efficiency, strong subjectivity and high risk, and is difficult to meet the maintenance needs of modern high-speed railways. In recent years, the automatic crack detection technology based on machine vision has developed rapidly, mainly using scanning electron microscopy (SEM) and optical microscopy to obtain the micro-morphology of the crack, and combining image processing algorithms to realize crack recognition and measurement. However, the existing methods generally have the following technical bottlenecks:
[0004] Firstly, in the image acquisition stage, SEM images often have problems of low contrast and high noise, especially the gray difference between micro-cracks and the matrix is weak, which is difficult to effectively segment. Optical microscope images are easily disturbed by speckle noise, resulting in blurred crack edges, and traditional threshold segmentation, edge detection and other algorithms are difficult to accurately locate the crack. Secondly, the existing deep learning detection model is usually directly used for crack recognition, without fully considering the features of wheel-rail contact fatigue cracks, and has problems of high missing detection rate for small cracks and high false detection rate for complex backgrounds. In addition, the existing methods are mostly focused on crack detection itself, and cannot realize the automatic measurement of crack size features (such as length, width, expansion angle, etc.), which is difficult to meet the needs of crack expansion trend evaluation in engineering practice.
[0005] In order to solve these problems, in recent years, some researches have tried to combine traditional image processing algorithms with deep learning. For example, CLAHE (Contrast Limited Adaptive Histogram Equalization) is used to enhance the contrast of SEM images, which improves the discrimination between cracks and matrix to some extent, but it may amplify noise or introduce artifacts; YOLO and other deep learning models are used to realize automatic crack detection, but the network structure is not optimized for crack features, resulting in large positioning accuracy and size measurement error. Some researches introduce attention mechanisms to enhance the feature extraction ability of the detection model, but they lack consideration of the fractal features and multi-scale characteristics of wheel-rail cracks, and the model generalization ability is limited.
[0006] In view of the above problems, a new wheel-rail rolling contact fatigue crack processing and analysis method is urgently needed, which can effectively enhance the quality of the microscope image, accurately locate the crack through the improved deep learning model, complete the automatic calibration of the image scale, and finally realize the accurate measurement of the crack size feature. This method will have important significance for preventing wheel-rail damage and ensuring railway transportation safety. SUMMARY
[0007] To solve the problems in the prior art, the present application provides a wheel-rail fatigue crack intelligent quantitative characterization method based on microscopic analysis images, which can realize automatic calibration of image scale, automatic positioning, feature extraction and automatic quantitative calculation of cracks, and solve the problems mentioned in the above background art.
[0008] To achieve the above purpose, the present application provides the following technical scheme: a wheel-rail fatigue crack intelligent quantitative characterization method based on microscopic analysis images, comprising the following steps:
[0009] S1, performing image enhancement and noise reduction preprocessing on scanning electron microscope and optical microscope images of wheel-rail rolling contact fatigue cracks;
[0010] S2, inputting the preprocessed image into a YOLOv8-CSSTAM model for target detection, and outputting image crack prediction frame and scale prediction frame;
[0011] S3, based on the automatic calibration algorithm of the image scale, calculating the widest connected region in the scale prediction frame and performing OCR (Optical Character Recognition) text recognition to obtain the image scale;
[0012] S4, performing median filtering, threshold segmentation, edge smoothing and small region filling processing on the crack image in the crack prediction frame;
[0013] S5, performing Harris corner point detection on the processed image to obtain candidate corner points;
[0014] S6, screening the corner points to obtain crack feature corner points and calculating the crack size feature according to the crack feature corner points.
[0015] Preferably, in step S1, the following steps are specifically included:
[0016] S11, according to the characteristics of high resolution but low contrast and noise sensitivity of the scanning electron microscope (SEM) image, through the cooperative processing of fractal enhancement and NLM (Non-Local Means) noise reduction, the contrast of the crack region is improved and the noise interference is suppressed, including the following: the fractal dimension (FD) of the SEM image is calculated by box-counting method; the contrast limited adaptive histogram equalization (CL) parameter is dynamically adjusted according to the FD value; the image is divided into 8x8 grid, and the local histogram of each grid is calculated; the histogram is truncated according to the CL limit histogram threshold to avoid noise amplification; the grid boundary artifacts are eliminated by bilinear interpolation; the fractal Brownian motion (FBM) model is introduced to constrain the enhancement intensity, and the high frequency details are preserved in the crack edge region; finally, the non-local mean (NLM) algorithm is used to reduce the noise of the enhanced image;
[0017] S12, according to the characteristics of low noise but limited resolution of the optical microscope (OM) image, through CLAHE (Contrast Limited Adaptive Histogram Equalization) enhancement details and suppression of speckle noise, while preserving global texture information, including the following: the image is divided into 16x16 grid, and the histogram of each grid is calculated, the fixed contrast limit parameter CL=2.5 is set to avoid excessive enhancement leading to artifacts, the logarithmic transformation enhances the dark details, and finally the two-channel Retinex algorithm is used for pre-processing and noise reduction.
[0018] Preferably, in step S2, the Labelimg is used to complete the data set labeling and train the model, which is divided into 7 categories: left expanding crack, right expanding crack, middle crack, scale, "cm", "mm", "μm", the SEM / OM image pre-processed in step S1 is input, the YOLOv8-CSSTAM model target detection is carried out, the non-maximum suppression (NMS) is used to eliminate the overlapping box, the prediction box with the highest confidence is reserved, the confidence threshold is set as θ conf =0.5, the NMS IoU threshold is set as θ IoU =0.45; finally, the crack prediction box and the scale prediction box are output.
[0019] The YOLOv8-CSSTAM model specifically comprises: an improved YOLOv8 target detection model, and a CSSTAM (Channel-Space-Scale Triple Attention Module) module composed of a channel-space-scale triple attention module; the CSSTAM module is a channel-space-scale triple attention module formed by adding scale attention SAM to CBAM.
[0020] Preferably, in step S3, an automatic calibration algorithm based on the image scale is developed for the scale prediction box output in step S2, an 8-neighborhood mode is adopted, seed point diffusion is used to mark all pixel points in the connected region, and finally a mark matrix bbox=(y min ,x min ,y max ,x max ) is generated, wherein y min , x min , y max , x max are the minimum and maximum values of the horizontal and vertical coordinates of each point in the connected region; the maximum connected region main_region is selected as:
[0021]
[0022] region.area is the area of the connected region, and regions is the connected region set;
[0023] The maximum width Width in the maximum connected region is calculated, and the maximum width Width is taken as the pixel length of the scale:
[0024] Width=x max -x min
[0025] The scale prediction box is morphologically enhanced, broken strokes are connected, OCR text recognition is performed on the scale prediction box using PyTesseract, and the image scale is calculated by extracting the numbers Num therein:
[0026]
[0027] Num represents the number recognized by OCR, and Scale represents the image scale;
[0028] Finally, the scale unit is added according to the category of the prediction box, for example, if the prediction box cls is 7, the unit is μm.
[0029] Preferably, in step S4, the crack prediction frame output in step S2 is subjected to median filtering, Ostu adaptive threshold segmentation processing to obtain a binary image; then edge smoothing is performed to eliminate the jagged artifacts of the crack edges after binarization; finally, by using the mode of 8-neighborhood, all pixel points in the connected region are marked by seed point diffusion, the area of each connected region is calculated, and if it is less than the set threshold (i.e. the number of pixel points in the connected region is less than 50), it is determined as noise and filled.
[0030] Preferably, in step S5, Harris corner detection is performed on the crack image processed in step S4 to extract the corner points of the crack region, which specifically includes:
[0031] The gray level change rate of the local region of the image is calculated to identify the points with significant gradient change, i.e. the corner points; for each pixel point (x, y) in the image, the gradients I x and I y in x and y directions are calculated, and the autocorrelation matrix M is constructed, which is expressed as follows:
[0032]
[0033] wherein w is a local window of 5x5;
[0034] The corner point response function R defined by Harris is used to measure the corner point response intensity of the pixel point:
[0035] R = det(M) - k · (trace(M)) 2
[0036] wherein det(M) = λ1λ2, trace(M) = λ1+ λ2, λ1 and λ2 are the eigenvalues of the matrix M, and k is an empirical constant, which is taken as 0.05; if R is greater than the set threshold τ, it is determined that the point is a corner point; through non-maximum suppression NMS and edge filtering, the corner point with the maximum response value in the local region is retained, the redundancy is eliminated, and the false corner points located on the strong edges are removed.
[0037] Preferably, in step S6, the corner points detected by Harris in step S5 are screened, and the size features of the crack are calculated, which specifically includes:
[0038] According to the different expansion directions of the crack, the crack is divided into leftward expanding crack and rightward expanding crack, and for the leftward expanding crack:
[0039] the leftmost corner point in the lower left corner of the crack prediction frame is determined as P1, and the rightmost corner point in the upper right corner of the crack prediction frame is determined as P2. P1(x, y) is the top-left corner of the crack prediction box, P2 is the rightmost corner of the crack prediction box, P3 is the first pixel value not equal to 0 from top to bottom in the y column of P1(x, y), w and h are the width and height of the crack prediction box respectively; the crack size feature calculation formula is as follows:
[0040] Crack width: W pixel = |x2-x1|;
[0041] Crack depth: D pixel = |y3-y1|;
[0042] Crack expansion angle:
[0043] The slope of the line segment The slope of the line segment
[0044] For the rightward expanding crack:
[0045] Determine the rightmost corner of the lower right corner of the crack prediction box P1, the upper left corner of the width and height of the 1 / 4 region P2 is the rightmost corner of the width and height of the 1 / 4 region, P3 is the first pixel value not equal to 0 from top to bottom in the y column of P1(x, y), w and h are the width and height of the crack prediction box respectively; the crack size feature calculation formula is as follows:
[0046] Crack pixel width: W pixel = |x2-x1|;
[0047] Crack pixel depth: D pixel = |y3-y1|;
[0048] Crack expansion angle:
[0049] The slope of the line segment The slope of the line segment
[0050] Where (x1, y1) is the coordinate of point P1, (x2, y2) is the coordinate of point P2, and (x3, y3) is the coordinate of point P3;
[0051] After obtaining the pixel size features of the crack, the actual size features of the crack are calculated:
[0052] Crack actual width: W = W pixel × Scale;
[0053] Crack actual depth: D = D pixel × Scale.
[0054] The beneficial effects of the present application are: the method of the present application provides an intelligent quantification characterization method of wheel-rail fatigue cracks based on microscopic analysis images, CLAHE enhancement and NLM noise reduction are used for image preprocessing for SEM and OM images respectively, which effectively improves the contrast of crack area and suppresses noise interference. By embedding the CSSTAM (Channel-Space-Scale Triple Attention Module) module composed of channel-space-scale triple attention module into the YOLOv8 network structure, the recognition ability of the model to micro cracks and crack features in complex background is enhanced, and the accuracy and robustness of crack detection are significantly improved. In the prediction frame post-processing stage, first, an image automatic calibration algorithm is developed based on the image scale, the width of the maximum connected region of the scale prediction frame is calculated, combined with the OCR text recognition technology to identify the length of the scale, and then the image scale is calculated for calibration, which is convenient for subsequent characterization of crack size features, second, innovatively combined with Otsu dynamic threshold segmentation, morphological small area filling and Harris corner detection and screening technology, the precise automatic measurement of crack length, crack depth and width expansion angle is realized, and the problems of low efficiency, strong subjectivity and large error of traditional manual measurement are solved. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 Figure 1 is a schematic flow chart of the method of intelligent quantification characterization of wheel-rail fatigue cracks based on microscopic analysis images;
[0056] Figure 2 Figure 2 is a schematic diagram of image enhancement and noise reduction in the embodiment;
[0057] Figure 3 Figure 3 is a schematic diagram of YOLOv8-CSSTAM model indicators in the embodiment;
[0058] Figure 4 Figure 4 is a structure diagram of the CSSTAM module in the embodiment;
[0059] Figure 5 Figure 5 is a scale prediction result graph in the embodiment;
[0060] Figure 6 Figure 6 is a crack prediction result graph in the embodiment, wherein (a) is a crack prediction frame original graph, and (b) is a crack image after post-processing;
[0061] Figure 7 Figure 7 is a post-processing comparison schematic diagram in the embodiment;
[0062] Figure 8 Figure 8 is a schematic diagram of crack size measurement in the embodiment. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0064] The present application provides a technical solution: a wheel-rail fatigue crack intelligent quantitative characterization method based on microscopic analysis images, as shown in Figure 1 The method comprises the following steps:
[0065] S1, performing image enhancement and noise reduction preprocessing on scanning electron microscope (SEM) and optical microscope (OM) images of wheel-rail rolling contact fatigue cracks;
[0066] In S1, for the characteristics of high resolution but low contrast and noise sensitivity of the SEM image, fractal enhancement and NLM noise reduction are cooperatively processed to improve the contrast of the crack area and suppress noise interference. For the characteristics of low noise but limited resolution of the OM image, CLAHE is used to enhance details and suppress speckle noise while retaining global texture information, as shown in Figure 2 The specific steps include:
[0067] S11, scanning electron microscope (SEM) image enhancement and noise reduction:
[0068] Fractal enhancement (CLAHE-FBM):
[0069] Fractal dimension calculation: the fractal dimension (FD) of the SEM image is calculated by using the box-counting method, and the formula is as follows:
[0070]
[0071] N(∈) is the number of boxes with side length of ∈ required to cover the image. Through multi-scale grid division (such as ∈=2 k , k=1, 2,..., 8), N(∈) at different scales is counted, and the FD value is fitted.
[0072] Dynamic contrast enhancement: the parameters of the contrast limited adaptive histogram equalization (CLAHE) are dynamically adjusted according to the FD value:
[0073]
[0074] The image is divided into an 8x8 grid, and a local histogram is calculated for each grid; the histogram is truncated according to the CL limit to avoid noise amplification; and the grid boundary artifacts are eliminated by bilinear interpolation.
[0075] FBM constraint enhancement, introduce the fractal Brownian motion (FBM) model constraint enhancement strength, keep high frequency details in the crack edge area, the formula is as follows:
[0076]
[0077] Where α is the enhancement coefficient (0.1-0.3), β is the fractal adjustment factor (0.5-1.0).
[0078] NLM denoising:
[0079] The enhanced image is further denoised by non-local mean (NLM) algorithm:
[0080]
[0081] Where P(x) is the pixel block in the search window centered at x,
[0082] h is the smoothing parameter, which is adaptively determined by Otsu algorithm (SEM image suggests h = 10-15). The search window is set to 21x21, and the pixel block size is 7x7.
[0083] S12 optical microscope (OM) image enhancement and denoising:
[0084] CLAHE enhancement:
[0085] The image is divided into a 16x16 grid (finer granularity than SEM), the histogram of each grid is calculated, the fixed contrast limit parameter CL = 2.5 is set to avoid artifacts caused by excessive enhancement, and the logarithmic transformation enhances the dark details:
[0086] I'(x) = γ·log(1+I(x)), γ = 0.5 (5)
[0087] NLM denoising:
[0088] Combined with the double-channel Retinex algorithm preprocessing:
[0089] R(x) = I(x)-L(x)+γL(x), γ = 0.8 (6)
[0090] L(x) is the low-frequency light component (extracted by Gaussian blur).
[0091] S2, input the preprocessed image into the YOLOv8-CBAM model for target detection, as shown in Figure 3 The output image crack prediction frame and scale prediction frame are shown in
[0092] In S2, the improved YOLOv8 target detection model is used, and the CSSTAM (Channel-Space-Scale Triple Attention Module) module composed of channel-space-scale triple attention modules is embedded, as shown in Figure 4 The specific steps include:
[0093] Based on CBAM, scale attention (Scale Attention Module, SAM) is added to form triple attention (channel, space, scale), and scale information containing crack features is preferentially retained:
[0094] Channel attention:
[0095] A variant using the SE (Squeeze-and-Excitation) mechanism generates weights for each channel:
[0096] Squeeze: Global average pooling (GAP) compresses the spatial dimension to obtain channel descriptors.
[0097] Excitation: Two fully connected layers (with ReLU in between) learn the relationship between channels and output attention weights.
[0098] W C =σ(W2·δ(W1·GAP(X))) (7)
[0099] Where σ is the Sigmoid function, δ is the ReLU, and W1 and W2 are the weights of the fully connected layers.
[0100] Spatial attention:
[0101] Focus on the spatial position of the crack, apply average pooling and max pooling along the channel dimension to obtain two feature maps. After concatenating the two feature maps, generate a spatial weight map through a 7×7 convolution.
[0102] W S =σ(Conv 7×7 (Concat[AvgPool(X),MaxPool(X)])) (8)
[0103] Scale attention (Scale Attention Module, SAM):
[0104] Multi-scale input: feature maps (F1, F2, F3) from different depths of the network.
[0105] Weight generation: After global average pooling (GAP) is performed on each scale feature map, weight coefficients are generated through a fully connected layer and Softmax to measure the importance of each scale.
[0106] Weighted fusion: After each scale feature map is multiplied by its weight, the enhanced multi-scale features are obtained by summation.
[0107] W scale = Softmax(W·GAP(F i )) (9)
[0108]
[0109] where N is the number of scales 3, and W is a learnable parameter.
[0110] The dataset is labeled using labelimg and the model is trained, which is divided into 7 categories: left expanding crack, right expanding crack, middle crack, scale, "cm", "mm", and "μm". The preprocessed SEM / light microscope images of S1 are input into the YOLOv8-CSSTAM model for target detection. Non-Maximum Suppression (NMS) is used to eliminate overlapping boxes, and the prediction box with the highest confidence is retained. The confidence threshold is set to θ conf = 0.5, and the NMS IoU threshold is set to θ IoU = 0.45.
[0111] S3, the scale prediction box is predicted, and an automatic calibration algorithm based on the image scale is developed. The connected maximum width is calculated and the scale number is extracted. The image scale is calculated as shown in Figure 5
[0112] In S3, the scale prediction box output in step S2 is processed, and an automatic calibration algorithm based on the image scale is developed. An 8-neighborhood mode is adopted, and all pixel points in the connected region are labeled by seed point diffusion. Finally, a label matrix bbox=(y min ,x min ,y max ,x max ) is generated, where y min , x min , y max , x max are the minimum and maximum values of the horizontal and vertical coordinates of each point in the connected region. The maximum connected region main_region is selected as:
[0113]
[0114] where region.area is the area of the connected region, and regions is the set of connected regions.
[0115] Calculate the maximum width Width in the maximum connected region, and take the pixel length of the maximum width Width as the scale:
[0116] Width = x max -x min (12)
[0117] Perform morphological enhancement on the scale prediction box, connect broken strokes, perform OCR text recognition on the scale prediction box using PyTesseract, and extract the number Num in the scale prediction box to calculate the image scale:
[0118]
[0119] Where Num represents the number recognized by OCR, and Scale represents the image scale.
[0120] Finally, add the scale unit according to the category of the prediction box, for example, if the prediction box cls is 7, then the unit is pm.
[0121] S4, median filtering, threshold segmentation, edge smoothing, and small region filling processing are performed on the crack image in the prediction box;
[0122] In S4, the crack prediction box output in step S2 is subjected to median filtering and Ostu adaptive threshold segmentation to obtain a binary image. Then, edge smoothing is performed to eliminate the jagged artifacts of the crack edges after binarization. Finally, using an 8-neighborhood mode, all pixel points in the connected region are marked by seed point diffusion, and the area of each connected region is calculated. If it is less than a set threshold (i.e., the number of pixel points in the connected region is less than 50), it is determined as noise and the color is filled in reverse. The processing result is shown in Figure 6 , where (a) is the original crack prediction box image, and (b) is the crack image after post-processing.
[0123] S5, Harris corner point detection is performed on the processed image to obtain candidate corner points;
[0124] In S5, Harris corner point detection is performed on the crack image processed in S3 to extract the geometric feature points (corner points) of the crack region, providing key positioning points for subsequent crack size measurement, as shown in Figure 7 , the specific steps include:
[0125] Calculate the gray level change rate of the local region of the image to identify points with significant gradient changes (i.e., corner points), and the core formula is as follows:
[0126] For each pixel point (x, y) in the image, calculate its gradient I x and I yAnd construct the autocorrelation matrix M.
[0127]
[0128] Where w is a 5×5 local window.
[0129] The corner response function R is defined using Harris to measure the corner response intensity of a pixel:
[0130] R = det(M) - k·(trace(M)) 2 (15)
[0131] Where: det(M) = λ1λ2, trace(M) = λ1 + λ2, λ1 and λ2 are the eigenvalues of matrix M, and k is an empirical constant, taken as 0.05. If R is greater than the set threshold τ, then the point is determined to be a corner point.
[0132] By using nonmaximum suppression (NMS) and edge filtering, corner points with the largest response values are retained in local regions to eliminate redundancy, and pseudo-corner points located on strong edges are removed.
[0133] S6. Filter the corner points to obtain the crack feature corner points and calculate the crack size characteristics based on the crack feature corner points;
[0134] In S6, the corner points detected by Harris in step S4 are filtered, and the size characteristics of the crack are calculated. The specific steps include:
[0135] Based on their different propagation directions, cracks are classified into left-propagating cracks and right-propagating cracks. For left-propagating cracks:
[0136] Define the area in the lower left corner of the crack prediction frame, which is 1 / 4 of the width and height. The leftmost corner point is P1, and the upper right corner is a 1 / 4 width and height area. The rightmost corner point is P2, and the first non-zero pixel value below D2 is P3. w and h are the width and height of the crack prediction box, respectively. Figure 8 As shown. The formula for calculating crack size characteristics is as follows:
[0137] Crack width: W pixel =|x2-x1|;
[0138] Crack depth: D pixel =|y3-y2|;
[0139] Crack propagation angle:
[0140] line segment slope line segment slope
[0141] For the crack extending to the right:
[0142] Determine the lower right corner of the crack prediction frame 1 / 4 area The most right corner point in the middle is P1, and the most right corner point in the upper left 1 / 4 area is P2. The first pixel value from top to bottom in the y column of P1(x, y) point is P3. W and h are the width and height of the crack prediction frame respectively. The crack size feature calculation formula is as follows: Crack pixel width: W pixel = |x2-x1|;
[0143] Crack pixel depth: D pixel = |y3-y1|;
[0144] Crack extension angle:
[0145] Slope of line segment
[0146] Slope of line segment
[0147] Where (x1, y1) is the coordinate of point P1, (x2, y2) is the coordinate of point P2, and (x3, y3) is the coordinate of point P3.
[0148] After obtaining the pixel size features of the crack, the actual size features of the crack are calculated:
[0149] Crack actual width: W = W pixel × Scale;
[0150] Crack actual depth: D = D pixel × Scale.
[0151] Through the present application, the crack information in the wheel-rail rolling contact fatigue crack image can be quickly and accurately obtained, including crack depth, crack width and crack extension angle.
[0152] It should be noted that in this article, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0153] The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0154] It should be understood that, the term "and / or" used herein is merely an association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " herein generally represents that the front and rear associated objects are in an "or" relationship.
[0155] Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if determined" or "if detecting (a stated condition or event)" can be interpreted to mean "when determined" or "in response to determining" or "when detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)," depending on the context.
[0156] Although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art can modify the technical solutions recorded in the foregoing embodiments or make equivalent replacements to some of the technical features, and any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A method for intelligent quantification and characterization of wheel-rail fatigue cracks based on microanalysis images, characterized by, It comprises the following steps: S1, scanning electron microscope, optical microscope images of wheel rail rolling contact fatigue crack are preprocessed by image enhancement and noise reduction; S2, input the pretreated image into the YOLOv8-CSSTAM model for target detection, and output image crack prediction frame and scale prediction frame; specifically comprising: completing data set labeling and training the model using Labelimg, which is divided into 7 categories: left expanding crack, right expanding crack, middle crack, scale, "cm", "mm", and "μm"; input the SEM / OM image pretreated in step S1, and perform target detection on the YOLOv8-CSSTAM model, eliminate overlapping frames using non-maximum suppression NMS, retain the prediction frame with the highest confidence, set the confidence threshold to θ conf =0.5, and set the NMS IoU threshold to θ IoU =0.45; finally output the image crack prediction frame and the scale prediction frame; The YOLOv8-CSSTAM model specifically comprises: an improved YOLOv8 target detection model, and a CSSTAM module embedded by a channel-space-scale triple attention module; the CSSTAM module is a channel-space-scale triple attention module formed by adding a scale attention SAM to the CBAM; S3, based on the automatic calibration algorithm of the image scale, the widest connected region in the image in the scale prediction box is calculated, and the image scale is obtained by OCR text recognition; S4, the crack image in the crack prediction box is processed by median filtering, threshold segmentation, edge smoothing and small region filling; S5, Harris corner detection is performed on the processed image to obtain candidate corner points; S6, the crack feature corner points are obtained by screening the corner points, and the crack size feature is calculated according to the crack feature corner points.
2. The method for intelligent quantification characterization of wheel-rail fatigue cracks based on micro-analysis images according to claim 1, characterized in that: In step S1, the following steps are specifically included: S11, according to the characteristics of high resolution but low contrast and noise sensitivity of the scanning electron microscope SEM image, the crack region contrast is improved and the noise interference is suppressed by fractal enhancement and NLM noise reduction cooperative processing, including the following: the fractal dimension FD of the SEM image is calculated by box-counting; the contrast limited adaptive histogram equalization CL parameter is dynamically adjusted according to the FD value; the image is divided into 8*8 grid, and the local histogram of each grid is calculated; the histogram is truncated according to the CL limit threshold to avoid noise amplification; the grid boundary artifacts are eliminated by bilinear interpolation; the fractal Brownian motion FBM model is introduced to constrain the enhancement intensity, and the high frequency details are preserved in the crack edge region; finally, the enhanced image is denoised by non-local mean NLM algorithm; S12, according to the characteristics of low noise but limited resolution of the optical microscope OM image, the details are enhanced and the speckle noise is suppressed by CLAHE, while the global texture information is preserved, including the following: the image is divided into 16*16 grid, and the histogram of each grid is calculated, the fixed contrast limit parameter CL=2.5 is set to avoid excessive enhancement leading to artifacts, the logarithmic transformation is used to enhance the dark details, and finally the double-channel Retinex algorithm is used for preprocessing and denoising.
3. The method for intelligent quantification characterization of wheel-rail fatigue cracks based on micro-analysis images according to claim 1, characterized in that: In step S3, the scale prediction frame output in step S2 is developed, an automatic calibration algorithm based on image scale is developed, an 8-neighbor mode is adopted, all pixel points in the connected region are marked by seed point diffusion, and finally a marked matrix bbox=(y min ,x min ,y max ,x max ),y min , x min , y max , x max is generated, where x and y are the minimum and maximum values of the horizontal and vertical coordinates of each point in the connected region, and the maximum connected region is selected: Wherein, region.area is the area of the connected region, and regions is the connected region set; The maximum width Width in the maximum connected region is calculated, and the maximum width Width is taken as the pixel length of the scale: Width = x max - x min The scale prediction box is morphologically enhanced, the broken strokes are connected, OCR text recognition is performed on the scale prediction box using PyTesseract, and the image scale is calculated by extracting the number Num therein: Wherein, Num represents the number recognized by OCR, and Scale represents the image scale.
4. The method for intelligent quantification characterization of wheel-rail fatigue cracks based on micro-analysis images according to claim 1, characterized in that: In step S4, the crack prediction frame output in step S2 is subjected to median filtering, Ostu adaptive threshold segmentation processing to obtain a binary image; then edge smoothing is performed to eliminate the jagged artifacts of the crack edges after binarization; finally, using an 8-neighbor mode, all pixel points of the connected region are marked by seed point diffusion, the area of each connected region is calculated, and if it is less than a set threshold, it is determined to be noise and filled.
5. The method for micrograph image-based intelligent quantification and characterization of wheel-rail fatigue cracks according to claim 1, characterized in that: In step S5, the crack image processed in step S4 is subjected to Harris corner point detection to extract the corner points of the crack region, specifically including: The gray scale change rate of the local area of the image is calculated, and the point with significant gradient change, i.e. the corner point, is identified; for each pixel point (x, y) in the image, the gradients I x and I y , and the autocorrelation matrix M is constructed, and the formula is expressed as follows: wherein w is a local window of 5*5; The Harris-defined corner point response function R is used to measure the corner point response intensity of the pixel point: R = det(M) - k • (trace(M)) 2 wherein det(M) = λ1λ2, trace(M) = λ1+ λ2, λ1 and λ2 are eigenvalues of matrix M, k is an empirical constant, and is taken as 0.05; if R is greater than a set threshold τ, it is determined that the point is a corner point; through non-maximum suppression NMS and edge filtering, the corner point with the maximum response value in the local region is reserved, the redundancy is eliminated, and the false corner points located on the strong edge are removed.
6. The method for micrograph-based wheel-rail fatigue crack intelligent quantification characterization according to claim 1, characterized in that: In step S6, the corner points detected by Harris in step S5 are screened, and the size characteristics of the crack are calculated, specifically including: According to the different expansion directions of the crack, the crack is divided into leftward expansion crack and rightward expansion crack, for the leftward expansion crack: The left lower corner of the crack prediction frame is determined as a 1 / 4 region of width and height The leftmost corner point in the middle is P1, and the rightmost corner point in the upper 1 / 4 region of width and height is P2 The first pixel value in the y-th column from top to bottom is not 0 at the P1(x, y) point, and P3 is the point, w and h are the width and height of the crack prediction frame respectively; the crack size feature calculation formula is as follows: Crack width: W pixel = |x2 - xi |; Crack depth: D pixel = |y3 - y1|; Crack propagation angle: line segment slope of the line segment line segment slope of the line segment For the rightward expansion crack: The right lower corner of the crack prediction frame is determined as a 1 / 4 region in width and height The rightmost corner point of the middle is P1, and the upper left corner of the 1 / 4 region in width and height is P2 The rightmost corner point of the middle is P1, and the upper left corner of the 1 / 4 region in width and height is P2 The first pixel value from top to bottom in the yth column of the P1(x, y) point is P3, and w and h are the width and height of the crack prediction frame respectively; the crack size feature calculation formula is as follows: Crack pixel width: W pixel = |x2 - x1|; Crack pixel depth: D pixel = |y3 - y1|; Crack propagation angle: line segment slope of the line segment line segment slope of the line segment wherein (x1, y1) is the coordinate of point P1, (x2, y2) is the coordinate of point P2, and (x3, y3) is the coordinate of point P3; After obtaining the pixel size characteristics of the crack, the actual size characteristics of the crack are calculated: Crack actual width: W = W pixel x Scale; Crack Actual Depth: D = D pixel x Scale; wherein Scale represents the image scale.
Citation Information
Patent Citations
Deep learning concrete bridge crack real-time detection method based on domain adaptation
CN114693615A
Nuclear power plant concrete defect identification method based on YOLO algorithm
CN117152073A