Railway track image abnormal region segmentation system combined with fractal dimension feature extraction

By combining the abnormal area segmentation system of railway track image extracted with fractal dimension features, the problems of noise interference and single feature extraction are solved, high-precision segmentation of railway track images is achieved, the robustness and adaptability of detection are improved, and the safety and stability of railway tracks are ensured.

CN120182308BActive Publication Date: 2025-08-19CHENGDU POLYTECHNIC +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510639855.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-19
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

The prior art has problems such as noise interference, single feature extraction and insufficient segmentation coherence in the detection of railway track image anomalies, resulting in frequent occurrence of false detection and missed detection, which is difficult to meet the needs of efficient and accurate detection.

Method used

The railway track image abnormal area segmentation system is adopted that combines fractal dimension feature extraction, including preprocessing units, multi-scale fractal feature processing units, abnormal area processing units and segmentation units. Through iterative smoothing of partial differential equations, multi-scale fractal dimension calculation, spectral clustering and morphological operations, high-precision segmentation of the track image is achieved.

Benefits of technology

Effectively identify abnormal areas such as cracks, erosion and debris in railway tracks, improve the robustness and adaptability of detection, significantly improve the detection efficiency and accuracy, and ensure the safety monitoring and maintenance of railway tracks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182308B_ABST
    Figure CN120182308B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of image analysis technology, and specifically relates to a railway track image abnormal region segmentation system combined with fractal dimension feature extraction. The system comprises: a preprocessing unit, a multi-scale fractal feature processing unit, an abnormal region processing unit, and a segmentation unit; the preprocessing unit is configured to suppress noise while retaining the main structure and output a denoising result; the multi-scale fractal feature processing unit is configured to obtain a fused fractal dimension based on the denoising result, and to form a feature vector by combining the fused fractal dimension and the gradient of the denoising result; the abnormal region processing unit is configured to obtain processed candidate abnormal regions using a spectral clustering method; and the segmentation unit is configured to perform an intersection operation on the processed candidate abnormal regions with a track mask to obtain the track abnormal region. The present invention achieves high-precision segmentation of abnormal regions in track images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image analysis, and in particular relates to a railway track image abnormal area segmentation system combined with fractal dimension feature extraction. Background Art

[0002] With the rapid development of the railway transportation industry, track safety and stability are receiving increasing attention. Railway tracks are critical infrastructure for train operation. Abnormalities such as cracks, wear, and debris accumulation on their surfaces can pose a direct threat to the safety of train operations. Therefore, how to quickly and accurately identify abnormal areas on the track surface and perform quantitative analysis and segmentation has become a critical technical issue in track maintenance. Traditional track inspection methods typically rely on manual inspection or low-automation equipment, which are inefficient and easily affected by subjective factors, making it difficult to meet the needs of modern railway transportation for efficient and accurate inspections.

[0003] In recent years, track anomaly detection methods based on image processing have become a research hotspot. These methods collect track images and combine them with image processing algorithms to automatically identify abnormal areas. Compared to traditional methods, they offer advantages such as non-contact, high efficiency, easy data storage, and repeatable analysis. However, currently available technologies still have limitations, primarily in the following areas: First, track images are typically collected in complex real-world scenarios. Factors such as ambient lighting, track surface contamination, and dust coverage can significantly affect image quality, resulting in a high level of noise. This noise often shares similarities with the characteristics of track anomalies. For example, surface texture noise can overlap with the texture characteristics of track cracks, significantly increasing the false detection rate of anomaly areas. Existing technologies often use simple smoothing or denoising algorithms, such as Gaussian filtering and median filtering, to address image noise. While these methods can eliminate noise to a certain extent, they inevitably weaken the boundary features of track anomaly areas, leading to missed detections. Second, some current segmentation methods lack the ability to analyze the multi-scale features of anomaly areas. Railway track anomalies are diverse, with spatial features ranging from subtle cracks to extensive erosion. Traditional methods often use a single scale for feature extraction and analysis. For example, fixed-window image gradient analysis or texture feature extraction methods struggle to simultaneously detect both small cracks and extensive erosion. This single-scale feature extraction approach is insufficient for complex track anomalies, resulting in incomplete identification of some anomaly areas. Summary of the Invention

[0004] In view of this, the main purpose of the present invention is to provide a railway track image abnormal region segmentation system that combines fractal dimension feature extraction, achieving high-precision segmentation of abnormal regions in track images. This invention effectively addresses the problems of false detection and missed detection caused by noise interference, single feature extraction, and insufficient segmentation coherence in the prior art, and has strong robustness and adaptability. Through this invention, abnormal regions such as track cracks, erosion, and debris can be efficiently identified, providing precise and reliable technical support for the safe monitoring and maintenance of railway tracks, significantly improving detection efficiency and accuracy.

[0005] The technical solution adopted in the present invention is as follows:

[0006] The railway track image abnormal region segmentation system combined with fractal dimension feature extraction includes: a preprocessing unit, a multi-scale fractal feature processing unit, an abnormal region processing unit and a segmentation unit; the preprocessing unit is used to receive the original railway track image, iteratively smooth it at multiple scales using partial differential equations, suppress noise and retain the main structure, and output a denoising result; the multi-scale fractal feature processing unit is used to calculate the local fractal dimension at multiple different window scales based on the denoising result, perform nonlinear fusion on the local fractal dimensions of different window scales, and use the Laplace regularization method to extract the abnormal region segmentation system. Noise points are suppressed to obtain a fused fractal dimension, and the fused fractal dimension and the gradient of the denoising result are combined into a feature vector; the abnormal region processing unit is used to cluster pixels into several categories based on the feature vector using a spectral clustering method, and determine one or several categories as candidate abnormal regions according to a threshold value, perform morphological operations of dilation and erosion on the candidate abnormal regions to remove isolated noise or fill gaps, and then perform connected domain screening to obtain processed candidate abnormal regions; the segmentation unit is used to perform an intersection operation on the processed candidate abnormal region and the track mask to obtain the track abnormal region.

[0007] Further, let Represents the original railway track image, which represents the original railway track image in The pixel value at is iteratively smoothed at multiple scales using partial differential equations using the following formula to suppress noise and retain the main structure, and the denoising result is output:

[0008] ;

[0009] in, The standard deviation is Gaussian kernel function, represents convolution; is the diffusion coefficient function, , determines the diffusion speed at the edge or smooth area, is the diffusion coefficient function variable, is the preset sensitivity value; is the time step variable; is the gradient operator; is the L2 norm operator; set ; The time step is Time The pixel value at ; Set the maximum time step to , the denoising result is , which characterizes the denoising results in Pixel value at:

[0010] ;

[0011] in, is the X-axis coordinate; is the Y-axis coordinate.

[0012] Furthermore, based on the denoising results, the local fractal dimension is calculated at multiple different window scales using the box counting method; let Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count is , at different box sizes The statistics are as follows:

[0013] ;

[0014] in, is the side length of the box; Indicates the current scale Next, cover the entire window The total number of boxes required; For the The coordinate position of each box in the denoising result; is an integer subscript index; For measuring window and Whether there is an intersection is defined as:

[0015] ;

[0016] in, is the discriminant function; when When it is greater than the set value, .

[0017] Furthermore, let the scale set be , at each scale The following were obtained ; is an integer subscript index, ranging from 1 to ; is the number of scales; the local fractal dimensions of different window scales are nonlinearly fused by the following formula, and the noise is suppressed by Laplace regularization to obtain the fused fractal dimension :

[0018] ;

[0019] in, , is the scale weight; is the mean parameter, ranging from 3 to 6; Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count of the window; is the nonlinear fusion index, ranging from 2 to 5; is the Laplace operator; is the Laplace regularization coefficient, ranging from 0.3 to 0.7.

[0020] Furthermore, based on the eigenvectors, the spectral clustering method is used to cluster the pixels into several categories, and the process of judging one or several categories as candidate abnormal areas according to the threshold specifically includes: in order to measure the similarity between pixels in the feature space, the Gaussian kernel function is used to calculate the similarity between the eigenvectors corresponding to each two pixels; the similarity is recorded through a matrix, which is called the similarity matrix; each item in the matrix represents the similarity between two pixels; using the similarity matrix, a graph structure is constructed, in which each pixel is regarded as a node in the graph, and the similarity between the nodes is regarded as the weight of the edge; then, based on the degree matrix and the similarity matrix of the graph, the normalized graph Laplacian matrix is calculated; by calculating the eigenvalues and eigenvectors of the graph Laplacian matrix, the nodes in the original high-dimensional feature space are mapped to the low-dimensional space; the front is selected feature vectors, representing the data after dimensionality reduction; in the space after dimensionality reduction, the k-means clustering algorithm is used to group all pixels and divide them into Classes, each class represents a pixel area with similar characteristics; k-means clustering determines the category of each pixel and the center point of each class through iterative optimization; after clustering, each pixel has a category label; based on the clustering results, combined with prior knowledge or statistical features, one or more categories are selected as candidate abnormal areas; finally, a binary mask is generated, in which pixels in abnormal areas are marked as 1 and pixels in normal areas are marked as 0.

[0021] Furthermore, the category labels include: normal area, abnormal area, background area, edge transition area, debris area and shadow area.

[0022] Furthermore, the following formula is used to perform morphological operations of dilation, erosion, and closing on the candidate abnormal regions:

[0023] ;

[0024] in, is a binary mask; For expansion operation; For corrosion operations; is the expansion element, which is a circular structural element; is the corrosion element, which is a circular structural element; for The radius, for The radius, ; It is the intermediate morphological result.

[0025] Furthermore, the morphological intermediate results Perform connected domain screening to obtain processed candidate abnormal regions ;in, It is a connected domain screening operator, which means that only the connected domains with an area greater than connected area.

[0026] Furthermore, the processed candidate anomaly region is intersected with the track mask using the following formula to obtain the track anomaly region:

[0027] ;

[0028] in, It is the track anomaly area; is the track mask.

[0029] By employing the above technical solutions, the present invention achieves the following beneficial effects: It enables accurate identification of abnormal areas in track images. Fractal dimension is an effective tool for quantifying regional complexity, reflecting the differences in texture and geometric properties between normal and abnormal areas in track images. Normal track areas are typically regular and smooth, while abnormal areas such as cracks, erosion, or debris exhibit complex textures and irregular structures. The present invention uses fractal dimension to quantitatively describe these differences, enabling the clear distinction of abnormal track areas from normal areas. Compared to traditional detection methods that rely on pixel intensity or single texture features, the application of fractal dimension significantly improves the sensitivity and accuracy of abnormal area detection. Secondly, the present invention utilizes a multi-scale fusion approach to calculate the fractal dimension, fully accounting for the diversity and spatial distribution of abnormal track areas. Abnormal areas on railway tracks can manifest as either tiny cracks or large-scale erosion or debris, and single-scale feature extraction often fails to capture these different types of abnormal features simultaneously. The present invention calculates fractal dimension at multiple scales and nonlinearly fuses the features at each scale to generate a comprehensive fractal feature map. This multi-scale feature extraction method can not only effectively cover different types of abnormal areas, but also improve the stability of the features, making the detection results more comprehensive and accurate. In addition, the present invention further combines the spectral clustering method on the basis of fractal dimension to divide the pixels in the track image into several categories. This clustering method fully considers the complex characteristics of abnormal areas in the track image. By constructing a similarity matrix between pixels and using the ideas of graph theory for classification, it effectively solves the problem of nonlinear feature distribution in the track image. Compared with the traditional segmentation method based on pixel intensity threshold, spectral clustering can better adapt to the diverse scenes of track images, especially when the lighting conditions are complex or the background interference is large, the clustering algorithm of the present invention shows stronger robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the system structure of a railway track image abnormal region segmentation system combined with fractal dimension feature extraction provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] All features disclosed in this specification, or all steps in the disclosed methods or processes, except mutually exclusive features and / or steps, can be combined in any manner.

[0032] Any feature disclosed in this specification (including any appended claims and abstract), unless otherwise stated, may be replaced by other equivalent or similar features. In other words, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

[0033] Example 1: Reference Figure 1 The invention relates to a railway track image abnormal region segmentation system combined with fractal dimension feature extraction, the system comprising: a preprocessing unit, a multi-scale fractal feature processing unit, an abnormal region processing unit and a segmentation unit; the preprocessing unit is used to receive the original railway track image, iteratively smooth the image at multiple scales using partial differential equations, suppress noise and retain the main structure, and output a denoising result; the multi-scale fractal feature processing unit is used to calculate the local fractal dimension at multiple different window scales based on the denoising result, perform nonlinear fusion on the local fractal dimensions of different window scales, and perform Laplace canonical method on the abnormal region segmentation system; the system comprises ... The noise points are suppressed by the formula to obtain the fused fractal dimension, and the fused fractal dimension and the gradient of the denoising result are combined into a feature vector; the abnormal region processing unit is used to cluster the pixels into several categories based on the feature vector by using the spectral clustering method, and judge one or several categories as candidate abnormal regions according to the threshold value, perform morphological operations of dilation and erosion on the candidate abnormal regions to remove isolated noise or fill gaps, and then perform connected domain screening to obtain processed candidate abnormal regions; the segmentation unit is used to perform an intersection operation on the processed candidate abnormal region and the track mask to obtain the track abnormal region.

[0034] Specifically, the preprocessing unit's primary purpose is to suppress noise and smooth the input railway track image while preserving key structural features, such as track edges, cracks, and other important anomaly areas, as much as possible. This process employs a multi-scale iterative smoothing mechanism based on partial differential equations (PDEs), effectively addressing common complex environmental interference issues in railway track images, such as image distortion caused by insufficient lighting, track surface contamination, debris, and other unstructured noise. The effective operation of the preprocessing unit provides high-quality basic data input for subsequent fractal dimension feature extraction and anomaly area segmentation. This unit is based on an anisotropic diffusion model, dynamically adjusting the diffusion intensity in the spatial domain based on the gradient characteristics of local regions in the track image. Railway track images typically exhibit two typical characteristics: First, anomaly areas such as track edges and cracks exhibit high gradient characteristics, manifested by sharp changes in pixel intensity; second, the track surface and background areas typically exhibit low gradient characteristics, manifested by gentle changes in pixel intensity. The anisotropic diffusion model exploits this property by enhancing diffusion in flat areas of the track image (such as the track surface or background), making the intensity values between pixels more consistent and thus removing small-scale random noise. Meanwhile, it suppresses diffusion in edge regions to preserve important image details and boundary information. Specifically, the diffusion coefficient is dynamically adjusted based on the image gradient. When the gradient is small, the diffusion coefficient is large, allowing more pixel intensity to diffuse; when the gradient is large, the diffusion coefficient approaches zero, thereby preserving the characteristics of boundaries and abnormal areas.

[0035] The preprocessing unit also employs a multi-scale processing mechanism, allowing the system to account for feature details at different spatial scales in railway track images. For example, the characteristics of track cracks, edges, and noise may exhibit distinct patterns at different pixel levels. By iteratively evolving the image at multiple diffusion scales, the unit not only eliminates fine noise but also smoothes local variations within the region at larger scales, while still preserving detailed structures such as track cracks and damage. The essence of multi-scale processing is to gradually update image pixel values at different time steps, thereby enhancing low-frequency components and gradually attenuating high-frequency noise components. This mechanism not only improves the accuracy of fractal dimension calculations but also ensures the detectability of abnormal regions in subsequent steps. In railway track scenes, noise comes from complex and diverse sources, such as dust, gravel, debris, and fluctuating lighting conditions. These factors can interfere with the segmentation results of track anomalies. If fractal dimension feature extraction is directly performed on unprocessed images, the presence of noise will lead to instability in the fractal dimension, which in turn affects the system's identification of abnormal regions. The preprocessing unit effectively reduces the interference of noise on fractal dimension calculation by performing pixel-by-pixel, multi-scale smoothing iterations on the image, thereby making the feature extraction stage more robust. Furthermore, this unit's processing preserves the boundary features of abnormal regions. For example, at track edges or cracks, thanks to the dynamic adjustment of the diffusion coefficient, boundary information is preserved with high accuracy, providing high-quality input for subsequent segmentation tasks. Furthermore, the edge characteristics and geometric structure of abnormal regions in railway track images are often highly localized, requiring the preprocessing unit to be region-adaptive when denoising the image. The greatest advantage of the anisotropic diffusion model is its ability to differentiate different regions based on image gradient information. This adaptive diffusion strategy is crucial for fractal dimension extraction. Fractal dimension is essentially a quantitative measure of the complexity of local regions in an image. If the local structural characteristics of the image are destroyed during the preprocessing stage, the accuracy of the fractal dimension calculation will be directly affected. By implementing gradient-adaptive smoothing in the preprocessing stage, the unit not only provides more stable image features for fractal dimension extraction but also enhances the reliability of subsequent abnormal region segmentation. Another key design feature of the preprocessing unit lies in its multi-scale time step selection. In real-world railway track images, the scales of noise and anomaly regions can vary significantly, and single-scale diffusion processing may not strike a balance between denoising and structure preservation. By introducing the time step as an evolution parameter, the preprocessing unit can gradually adjust the diffusion intensity at different time scales, thereby suppressing noise at larger scales while preserving details of anomaly regions at smaller scales. This multi-scale feature ensures that the preprocessing unit can adapt to the diverse feature patterns in complex scenes, laying a solid foundation for the stable extraction of fractal dimensions.

[0036] The multi-scale fractal feature processing unit is a key component of the railway track image abnormal region segmentation system that combines fractal dimension feature extraction. Its core function is to extract characteristic information about regional complexity within the image by calculating and fusing the fractal dimension of multi-scale local regions in the track image. These features are then used to identify abnormal track regions. Fractal dimension is a mathematical tool used to quantify regional complexity. It can well characterize the texture, edges, and detail variations of different regions in a track image. In railway track images, normal track regions typically have a relatively regular structure and exhibit low fractal dimension, while abnormal regions (such as cracks, erosion, and foreign objects) often have higher fractal dimensions due to the irregularities of their texture and geometry. By extracting fractal dimensions at different scales, the multi-scale fractal feature processing unit can capture the characteristics of abnormal regions at different spatial resolutions, thereby improving the accuracy and robustness of abnormal region segmentation.

[0037] The first key task of the multi-scale fractal feature processing unit is to calculate the fractal dimension within a local window based on the preprocessed, denoised image. In railway track images, due to the complex and ever-changing environment, anomalies such as cracks, wear, and foreign matter may appear at different scales. To comprehensively cover these features, the unit segments the track image at multiple window scales and calculates the fractal dimension of each local region. The calculation of local fractal dimension is essentially a statistical process that measures the complexity of different regions in the track image. For example, on a smooth and flat track surface, pixel value variations tend to be stable, resulting in a low local fractal dimension. However, in areas with anomalies such as cracks and debris, pixel value variations exhibit more complex fluctuations, resulting in a significantly higher fractal dimension. Therefore, by calculating the fractal dimension at each block, the local complexity of the track image can be accurately quantified, providing basic data for subsequent segmentation. In addition to calculating fractal dimension at a single scale, the unit also expands feature extraction capabilities through multi-scale analysis. In actual railway track inspection, the morphological characteristics of abnormal areas may span multiple spatial scales. For example, a tiny crack may only appear abnormal within a small window, while a larger area of erosion may require a larger window to fully cover it. Therefore, the multi-scale fractal feature processing unit sets multiple window sizes, gradually expanding the analysis scope from small to large, enabling the system to capture both local and global abnormal characteristics. The fractal dimensions calculated at different window scales are not directly used for subsequent segmentation, but are instead integrated through nonlinear fusion. This fusion process is based on multi-scale weight allocation, and the weights can be dynamically adjusted based on the characteristics of the actual track image. For example, it can prioritize features at certain intermediate scales to avoid feature loss caused by overly large or undersized windows. The fused multi-scale fractal dimension feature map exhibits greater spatial robustness and stability, clearly reflecting the comprehensive complexity of abnormal areas in track images. To further improve the quality of the feature map, the multi-scale fractal feature processing unit also introduces Laplace regularization to suppress the influence of noise on the fractal dimension map. In railway track images, some abnormal areas may be obscured by small areas of high fractal noise, which can arise from illumination variations or surface texture interference. Directly passing these noise features to subsequent segmentation units would significantly reduce anomaly detection accuracy. Laplace regularization smoothes local variations in the feature map, reducing isolated high-fractal noise points to background values, thereby highlighting the fractal differences between abnormal and normal areas. This operation effectively improves the system's ability to identify track anomalies while reducing the likelihood of false detections and missed detections. The regularization strength can also be adjusted based on the complexity of the track image to ensure that the smoothing process does not excessively damage the true features of the anomaly areas.In addition to calculating and fusing fractal dimension features, the unit also combines these fractal features with the gradient features of the denoised image to further enhance the system's sensitivity to abnormal areas. Abnormal areas in railway track images often have not only high fractal dimensions but also significant gradient changes. Abnormal phenomena such as cracks and edges usually manifest as sharp changes in pixel intensity, which can be captured through gradient operations. Therefore, the unit constructs a high-dimensional feature vector at output, which includes the fused fractal dimension features and the gradient features of the denoised image. This high-dimensional feature vector can fully reflect the multi-dimensional information of each pixel in the track image, thereby providing more accurate data support for subsequent abnormal area segmentation.

[0038] The abnormal region processing unit is responsible for initially identifying abnormal regions within the track and optimizing them through morphological and connectivity analysis. The segmentation unit further constrains the segmentation results based on the track mask, ensuring that the final output abnormal regions are strictly confined to the track area. This processing flow not only effectively copes with complex interference in track images, but also ensures high accuracy and robustness in abnormal region detection, providing reliable technical support for track safety inspection and maintenance. The first step of the abnormal region processing unit is to classify the input high-dimensional feature vector using spectral clustering. This high-dimensional feature vector is composed of multi-scale fractal dimension features and gradient features of the denoised image, which comprehensively characterizes the complexity and variability of each pixel in the track image. Spectral clustering is a clustering method based on graph theory. Its core concept is to map pixels into a low-dimensional manifold space by constructing a similarity matrix between pixels, thereby achieving efficient clustering of nonlinearly distributed data. In track images, pixels in different regions naturally form several relatively independent clusters in the feature space due to differences in fractal dimension and gradient features. Spectral clustering calculates the similarity between these points and decomposes and reduces the dimensionality of the global structure of data points based on the similarity matrix. It can divide the pixels in the track image into several categories, including normal track areas, abnormal areas, and background areas.

[0039] Specifically, the similarity matrix is constructed using a Gaussian kernel function, which quantifies the degree of similarity between pixel feature vectors based on the Euclidean distance between them. In track images, adjacent pixels have high similarity due to similar fractal dimensions and gradient features, while pixels across regions have significantly lower similarity due to significant feature differences. This quantification mechanism based on feature similarity ensures that the spectral clustering method effectively captures the regional distribution characteristics of track images. By normalizing the similarity matrix, constructing a graph Laplacian matrix, and performing eigenvalue decomposition on it, the high-dimensional features in the track image can be mapped to a low-dimensional space. In this low-dimensional space, the relationships between pixels are more clearly defined, enabling the subsequent clustering process to more accurately identify abnormal track areas. After clustering is complete, the abnormal area processing unit analyzes the categorical characteristics of the clustering results and selects one or more pixel categories as candidate abnormal areas. Threshold determination is a key step in this process, and the judgment criteria can be set based on the statistical properties of the fractal dimension or gradient features. For example, abnormal regions such as track cracks or foreign objects typically exhibit high fractal dimensions or dramatic gradient changes, while the fractal dimensions and gradient characteristics of background and normal track regions are relatively smooth. Therefore, the selection of candidate abnormal regions can eliminate interfering points in normal and background regions through a comprehensive analysis of fractal dimension distribution and gradient changes, preliminarily identifying a set of pixels that may contain abnormalities. However, these initially identified candidate abnormal regions are not directly output as the final result, as railway track images may contain noise interference or incomplete features. To optimize the quality of the candidate abnormal regions, the abnormal region processing unit corrects them through morphological operations. Morphological operations are classic methods in image processing that can adjust the morphological characteristics of a region through operations such as dilation, erosion, opening, and closing. In the present invention, the dilation operation is used to fill small holes in the candidate abnormal region, making the region more coherent; the erosion operation is used to remove isolated noise points, thereby reducing the possibility of misjudgment. The closing operation combined with dilation and erosion can further smooth the boundaries of the abnormal region, making the final output region more regular. Track anomaly areas often have a certain degree of spatial continuity, and morphological operations can enhance this connectivity feature, making the candidate anomaly areas more consistent with the actual anomaly distribution of the track.

[0040] In addition, the abnormal region processing unit further screens abnormal regions through connected component analysis. Noise points in railway track images typically appear as small, disconnected, isolated areas, while true abnormal regions have larger spatial scales and greater connectivity. Connected component analysis calculates the area and shape characteristics of each connected block within candidate abnormal regions, thereby filtering out isolated noise blocks that do not conform to abnormal region characteristics. Through this process, the system significantly improves the accuracy of abnormal region detection, reduces false detection rates, and provides high-quality input for the subsequent segmentation unit. After the abnormal region processing unit completes, the segmentation unit constrains the candidate abnormal regions to the track range. In railway track images, abnormal regions should be strictly confined to the track range. Even if identified as abnormal, areas outside the track range are not considered by the system. The segmentation unit achieves this range constraint by intersecting the candidate abnormal regions with a track mask. The generation of the track mask typically relies on prior track geometry information or edge detection results. For example, using the Hough transform to detect two parallel track boundaries and generate a closed track region mask. In practical applications, the accuracy of the track mask is crucial to the quality of the segmentation results. If the track mask accurately covers the actual track area, the segmentation unit can strictly confine the anomaly area to the track range. However, if the track mask is less accurate, it may lead to missed or misidentified anomalies. The intersection operation between the track mask and the candidate anomaly area is a simple and efficient logical operation. Anomalous pixels within the track range are retained, while those outside the track range are filtered out, resulting in the final track anomaly area segmentation result. This result not only accurately reflects the distribution of anomaly areas on the track but can also be directly used for subsequent track maintenance and safety assessments.

[0041] Example 2: Let Represents the original railway track image, which represents the original railway track image in The pixel value at is iteratively smoothed at multiple scales using partial differential equations using the following formula to suppress noise and retain the main structure, and the denoising result is output:

[0042] ;

[0043] in, The standard deviation is Gaussian kernel function, represents convolution; is the diffusion coefficient function, , determines the diffusion speed at the edge or smooth area, is the diffusion coefficient function variable, is the preset sensitivity value; is the time step variable; is the gradient operator; is the L2 norm operator; set ; Set the maximum time step to , the denoising result is , which characterizes the denoising results in Pixel value at:

[0044] ;

[0045] in, is the X-axis coordinate; is the Y-axis coordinate.

[0046] Specifically, the core idea of the formula is based on the diffusion control of image gradient, by introducing the diffusion coefficient function , dynamically adjust the diffusion intensity, so that the image processing in different areas has a high degree of localization and adaptability. In flat areas, such as the uniform texture part of the track surface, the gradient of the pixels changes little, and the value of the diffusion coefficient function approaches 1. At this time, the diffusion speed is fast, the intensity between pixels gradually tends to be consistent, and the noise is effectively suppressed. In edge areas, such as abnormal areas such as track cracks and wear, the gradient changes greatly, and the value of the diffusion coefficient function is close to 0, thereby suppressing diffusion and protecting the boundary information from being blurred. This diffusion mechanism based on gradient control is clearly reflected in the formula. Norm calculation captures the gradient amplitude at different positions in the image and uses it as the input variable of the diffusion coefficient function to achieve dynamic adjustment of the diffusion intensity. In order to further improve the effect of diffusion processing, the formula also introduces a Gaussian smoothing kernel , used to perform preliminary smoothing of the image in each iteration. The standard deviation of the Gaussian kernel function The smoothing scale determines the smoothing effect, which reduces the discreteness of local pixel gradients, making the calculation of the diffusion coefficient more stable while suppressing small high-frequency noise. Preprocessing with the Gaussian smoothing kernel significantly reduces the fine granular noise and random texture interference in the background, which are common in railway track images. While the larger gradient features at the track boundaries are well preserved, the Gaussian kernel also effectively preserves them. This multi-scale Gaussian smoothing not only enhances the robustness of the diffusion process but also provides flexibility for global smoothing of track images.

[0047] Time variables in formulas It is a key control parameter of the multi-scale iterative process, and its physical meaning can be understood as the time step of the diffusion process. In practical applications, as the time step increases, the diffusion process will gradually become stable, the image noise will be gradually suppressed, and the main structure of the track area will be preserved. The corresponding image is the original image without processing, which contains a lot of noise and texture details; and the final moment Corresponding image The denoised result shows clear track boundary features and significant abnormal areas. This design of controlling the diffusion degree by time step enables the system to flexibly adjust the denoising intensity according to the specific characteristics of the track image, thereby adapting to different track image scenarios. The form of the diffusion coefficient function is also an important part of this formula, which is specifically expressed as ,in is the variable of the diffusion coefficient function, which is determined by the image gradient amplitude. It is a preset sensitivity value used to adjust the effect of gradient on diffusion intensity. Abnormal areas such as cracks and edges in track images are usually accompanied by significant gradient changes. When the diffusion coefficient is large, will decrease rapidly, resulting in the diffusion process being strongly suppressed in these areas, thereby effectively protecting the structural characteristics of the abnormal area. Small, the diffusion coefficient is close to 1, the diffusion process can proceed smoothly, and the smoothing effect is more obvious. By adjusting the sensitivity parameter , can further optimize the system's adaptability to different types of track images. For example, in a scene with strong noise, a larger value to increase the diffusion intensity, thereby achieving a more significant denoising effect; in scenes where the abnormal area features are more prominent, a smaller value to strengthen border protection.

[0048] Example 3: Based on the denoising results, the local fractal dimension is calculated at multiple different window scales using a box counting method; let Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count is , at different box sizes The statistics are as follows:

[0049] ;

[0050] in, is the side length of the box; Indicates the current scale Next, cover the entire window The total number of boxes required; For the The coordinate position of each box in the denoising result; is an integer subscript index; For measuring window and Whether there is an intersection is defined as:

[0051] ;

[0052] in, is the discriminant function; when When it is greater than the set value, .

[0053] The core of the formula is based on the box counting method, which is a method to calculate the fractal dimension by covering the target area with grids of different scales. In order to realize the local fractal dimension analysis of the track image, a coordinate Centered on Local window This design allows the system to independently calculate the fractal dimension for each local area of the image, thereby accurately capturing the spatial variation characteristics of the track. In the track image, the normal area usually has a smooth structure and a low fractal dimension; while the abnormal area exhibits a high fractal dimension due to the presence of cracks or foreign matter. This difference provides a clear basis for the segmentation of the track image. In the formula, the fractal dimension is covered by the statistical window The number of boxes required is calculated. The side length of the box Defines the scale of the grid, as Gradually reduce the number of boxes covering the target area It will increase in a certain pattern. This increasing pattern reflects the geometric complexity of the region, and the calculation of the fractal dimension quantifies the growth rate of this pattern. When the structure of the region is more complex, as the box size decreases, the number of boxes The faster the growth rate, the smaller the fractal dimension To ensure the accuracy and robustness of the calculation, the formula has a strict mathematical definition of the intersection between the box and the area. Specifically, the judgment box Whether part of the window area is covered depends on the intersection discriminant function The core of this function is to integrate the intersection area to measure the validity of the pixels in the box. If the intersection is non-empty and meets certain conditions (such as the pixel value exceeds a set threshold), the contribution of the intersection is included in the box statistics; otherwise, the contribution of the box is zero. This design quantifies the intersection area through integration, allowing the calculation results to more accurately reflect the actual characteristics of different regions in the track image.

[0054] The discriminant function in the formula It is another key part of the whole calculation process. It divides the pixels into two categories: qualified and unqualified by thresholding the pixel values of the denoised image. Specifically, when the pixel value When a certain set value is exceeded, , indicating that the pixel may belong to an abnormal area; otherwise , indicating that the pixel is a background or normal area. By introducing the discriminant function, the system can exclude the interference of irrelevant background pixels, thereby focusing on the fractal characteristics analysis of the track and abnormal areas. In the track image abnormal area segmentation system, the multi-scale calculation of the fractal dimension is a very important step. The abnormal area on the track may appear as a small crack, or it may be a large-scale erosion or debris, and the spatial scales of these abnormalities may vary significantly. To this end, the system adjusts the side length of the box and window size Statistical analysis of fractal dimensions is performed at different scales. Small-scale boxes and windows help capture subtle anomaly features, while large-scale boxes and windows can reflect the global characteristics of large-scale anomaly regions. This multi-scale analysis approach enables the fractal dimension calculation to comprehensively cover various features in track images, thereby improving the system's detection capabilities. Anomalous regions in track images typically have high fractal dimensions, a characteristic that stems from the complexity of their textures and irregular boundaries. For example, the edges of track cracks exhibit refinement and fracture at different scales, causing the number of boxes to grow much faster than that of flat track surfaces. Foreign objects also experience an increase in fractal dimension due to high-frequency texture variations on their surfaces. By analyzing the fractal dimension of denoised images, the system can accurately identify anomaly regions in track images while avoiding false detections caused by background noise or local details in normal areas. Furthermore, the introduction of a logarithmic relationship in the definition of fractal dimension makes the calculation more robust and adaptable. In railway track images, the distribution of noise and anomaly regions often exhibits significant local variation. The logarithmic relationship can, to a certain extent, compress the range of these variations, thereby enhancing the stability of the fractal dimension calculation. Combined with the denoising results, this formula further improves the system's ability to detect abnormal areas in complex environments.

[0055] Example 4: Assume that the scale set is , at each scale The following were obtained ; is an integer subscript index, ranging from 1 to ; is the number of scales; the local fractal dimensions of different window scales are nonlinearly fused by the following formula, and the noise is suppressed by Laplace regularization to obtain the fused fractal dimension :

[0056] ;

[0057] in, , is the scale weight; is the mean parameter, ranging from 3 to 6; Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count of the window; is the nonlinear fusion index, ranging from 2 to 5; is the Laplace operator; is the Laplace regularization coefficient, ranging from 0.3 to 0.7.

[0058] Specifically, suppose the fractal dimensions of the orbital image at different scales have been calculated and are denoted as ,in Indicates the The size of the window, is the spatial coordinate of the pixel. The fractal dimension essentially describes the complexity of the local area of the track. It can quantify the degree of variation in the distribution of pixel grayscale values. For example, the fractal dimension of the smooth area of the track surface is low, while the fractal dimension of abnormal areas (such as cracks, wear or debris) is high, and its distribution varies with the window size. In order to integrate these multi-scale features, this embodiment designs a weighted fusion formula, in which the fractal dimension of each scale is assigned a weight The weight setting takes into account the characteristics of the track image to ensure that the influence of features of different scales on the fusion results meets the actual needs. The expression is ,in It is an adjustable parameter, usually with a value of 3 to 6, which is used to adjust the relative importance of scales. corresponds to the contribution of small features (such as cracks or texture details), while larger scale It reflects the abnormal distribution characteristics of a wider range. Through the dynamic adjustment of weights, the system can achieve a balance between detailed features and global features. For example, in a scene where track cracks need to be highlighted, the details can be made more prominent by increasing the small-scale weights; and when identifying anomalies in larger areas (such as erosion or large areas of debris), the proportion of large-scale weights can be increased. This flexible weight distribution mechanism makes the fusion process both global and retains local characteristics. Nonlinear fusion index is another key parameter in the formula, with a value range of 2 to 5, which controls the nonlinear superposition of fractal dimensions at different scales during the fusion process. When is small, the formula tends to be more averaging, and the fusion result is less sensitive to each scale; When the value is larger, the fusion result is more sensitive to features of certain scales. This nonlinear design can effectively deal with the uneven distribution of complexity of abnormal areas in track images. For example, in crack-concentrated areas, the fractal dimension of a certain scale may be abnormally prominent. The value will increase the proportion of these significant features in the fusion results, thereby improving the accuracy of anomaly detection.

[0059] In addition to the nonlinear fusion part, the formula further optimizes the fusion result through Laplace regularization. There are often some high-frequency noise or isolated local features in the track image. These noises may come from uneven illumination or background interference during the acquisition process. If these high-frequency features are directly transferred to the final result, it may cause errors in the detection of abnormal areas. To solve this problem, this embodiment introduces the Laplace operator in the fusion result. By constraining the second-order derivative of the feature map, noise points are suppressed. The role of Laplace regularization is similar to a spatial smoothing process, which can weaken the mutation of local features and make the distribution of abnormal areas more coherent. For example, in the boundary area around the track crack, regularization can make these boundaries smoother, thereby avoiding discontinuity or incompleteness in the detection results. The strength of Laplace regularization is determined by the regularization coefficient Control, the value range is 0.3 to 0.7. A value of indicates a weaker regularization effect, which is suitable for scenes with less noise; a larger value indicates a weaker regularization effect, which is suitable for scenes with less noise; A value of 0 will significantly smooth the feature map and is suitable for scenes with strong noise. For example, in the case of poor lighting conditions and complex track surface textures, it is appropriate to increase The value can effectively improve the quality of the segmentation results. In addition, the Laplace operator can also weaken the isolated noise points in the abnormal area. These noise points are usually caused by accidental light intensity fluctuations and do not have the characteristics of the track abnormal area. Under the action of regularization, the influence of these noise points will be greatly weakened, making the final feature map more real and reliable. Through the combination of nonlinear fusion and Laplace regularization, the formula of Example 4 realizes the comprehensive characterization and optimization of the complex characteristics of the abnormal area of the track image. The fusion process finds a balance between the global and the local through the adjustment of scale weights and nonlinear exponents, ensuring the multi-scale comprehensive perception of the abnormal area; and the regularization process makes the final fractal feature map have higher robustness and accuracy by smoothing high-frequency noise and isolated points.

[0060] Example 5: Based on the feature vector, the spectral clustering method is used to cluster the pixels into several categories, and the process of judging one or several categories as candidate abnormal areas according to the threshold value specifically includes: in order to measure the similarity between pixels in the feature space, the similarity between the feature vectors corresponding to each two pixels is calculated using the Gaussian kernel function; the similarity is recorded through a matrix, which is called the similarity matrix; each item in the matrix represents the similarity between two pixels; using the similarity matrix, a graph structure is constructed, in which each pixel is used as a node in the graph, and the similarity between the nodes is used as the weight of the edge; then, based on the degree matrix and the similarity matrix of the graph, a normalized graph Laplacian matrix is calculated; by calculating the eigenvalues and eigenvectors of the graph Laplacian matrix, the nodes in the original high-dimensional feature space are mapped to the low-dimensional space; the front is selected feature vectors, representing the data after dimensionality reduction; in the space after dimensionality reduction, the k-means clustering algorithm is used to group all pixels and divide them into Classes, each class represents a pixel area with similar characteristics; k-means clustering determines the category of each pixel and the center point of each class through iterative optimization; after clustering, each pixel has a category label; based on the clustering results, combined with prior knowledge or statistical features, one or more categories are selected as candidate abnormal areas; finally, a binary mask is generated, in which pixels in abnormal areas are marked as 1 and pixels in normal areas are marked as 0.

[0061] Specifically, let the eigenvector be In order to measure the similarity between different points in the feature space, a similarity matrix between feature points is constructed. Similarity is usually defined by a Gaussian kernel, and the formula is as follows:

[0062] ;

[0063] in, , respectively represent pixel points and Eigenvectors in the feature space. is the Euclidean distance, which is used to measure the feature difference between two points. is the Gaussian kernel width parameter, which is used to control the rate of decrease of similarity; The smaller the value, the more the similarity is limited to the local neighborhood. After calculating the similarity of all pixels, we get the similarity matrix ,in Is the total number of all pixels in the image. Based on the similarity matrix , construct the graph Laplacian matrix, which is used for the core operation of spectral clustering. It is divided into the following steps: construct the degree matrix : Degree matrix It is a diagonal matrix whose diagonal elements are the "degree" of each point, that is:

[0064] ;

[0065] Calculate the normalized Laplacian matrix : Graph Laplacian matrix Defined as:

[0066] ;

[0067] in is the identity matrix. By solving the normalized Laplace matrix Before eigenvectors (corresponding to the smallest eigenvalues, ignoring the first zero eigenvalue), reduce the high-dimensional feature data to Dimension. The formula is as follows:

[0068] ;

[0069] in: is the normalized Laplace matrix No. feature vectors. For all pixels in Dimensionality reduction results in dimensional space. In the eigenvector matrix Use on -means clustering algorithm, Pixels are divided into Class. The formula is as follows:

[0070] Define the objective function and find Cluster centers :

[0071] ;

[0072] in, It is The dimension-reduced feature vector of pixels. It is The category labels of pixels (from 1 to ). It is The cluster centers of the categories.

[0073] -means is optimized by iterating the following two steps:

[0074] Classification: Assign each point to the nearest cluster center:

[0075] ;

[0076] Update: Recalculate each cluster center:

[0077] ;

[0078] In the clustering results, one or more categories are selected as "candidate abnormal regions" based on prior knowledge or statistical characteristics. For example, if the fractal feature value of the abnormal region is large, these categories can be marked as abnormal categories. Define the abnormal category mask as :

[0079] ;

[0080] It's a pixel The clustering result label. is the set of categories that are judged to be abnormal. It is the candidate abnormal region mask, marking whether the pixel belongs to the abnormal region (1 indicates abnormality and 0 indicates normality). It will be used as the input for the next morphological processing to further optimize the abnormal area.

[0081] Example 6: The category labels include: normal area, abnormal area, background area, edge transition area, debris area and shadow area.

[0082] Specifically, normal regions are the majority of track images, typically exhibiting uniform texture and intensity distribution, low fractal dimensions, and small gradient values. These regions represent intact track surfaces, are the most stable components of the track image, and serve as the baseline for the system's detection. By labeling normal regions, the system can quickly exclude a large number of irrelevant pixels, allowing it to focus resources on truly abnormal regions. Abnormal regions are the focus of detection and typically include physical defects such as cracks, wear, and erosion on the track. Abnormal regions have significantly higher fractal dimensions than normal regions, exhibiting complex texture characteristics, and exhibit large fluctuations in gradient values and intensity distribution. These regions require sophisticated feature extraction and clustering algorithms for identification. In this invention, through a comprehensive analysis of fractal dimensions and gradients, these regions can be effectively labeled and marked as "1" when generating the mask. Background regions refer to areas outside the track, such as ballast, soil, and vegetation. Because the texture and intensity distribution of background regions are typically significantly different from those of the track, their fractal dimensions and gradient characteristics also exhibit significant deviations. Detecting and removing background regions is crucial for improving system accuracy, as misclassifying these pixels as anomalies can lead to a high false detection rate. During spectral clustering, background regions are typically classified as a separate class, allowing their class labels to be quickly identified and eliminated. Edge transition regions lie between the track and background, typically exhibiting a fuzzy transition texture. These regions may include track edges or track fasteners, and while their texture and intensity characteristics differ from those of the main track area, they remain associated with the track. These pixels serve as a bridge between the background and track in track images. By independently labeling these regions, the system can prevent track edges from being mistakenly identified as anomalies and more clearly define the actual extent of the track. Debris regions refer to foreign objects on the track surface, such as fallen leaves, rocks, or human remains. These regions typically have higher texture complexity and gradient values than normal regions, but they behave differently from track anomalies such as cracks. Separating these debris regions effectively prevents these non-structural anomalies from interfering with detection results. By combining fractal dimension, gradient value, and intensity distribution characteristics, the system can independently label and exclude debris regions from anomaly detection. The labeling of shadow regions accounts for the impact of varying lighting conditions during image acquisition. Shadow regions typically exhibit lower intensity values and smaller gradient variations. While shadows do not directly affect track structure, if left unaddressed, they can be misidentified as anomalies, reducing detection accuracy. By assigning independent labels to shadow regions and incorporating prior knowledge to exclude them, the robustness of the system can be significantly improved.

[0083] Example 7: Perform morphological operations of dilation, erosion, and closing on the candidate abnormal region using the following formula:

[0084] ;

[0085] in, is a binary mask; For expansion operation; For corrosion operations; is the expansion element, which is a circular structural element; is the corrosion element, which is a circular structural element; for The radius, for The radius, ; It is the intermediate morphological result.

[0086] Specifically, the core idea of the formula is to first perform a dilation operation on the candidate abnormal region, expanding the boundaries of the local region outward, thereby filling the gaps or small fractures that may exist inside the abnormal region. In railway track images, abnormal regions usually appear as irregular cracks, erosion or debris, and the boundaries of these regions may be incomplete due to image resolution limitations or noise interference. Through the dilation operation, the formula can fill the gaps between adjacent pixels without affecting the overall shape of the abnormal region, thereby enhancing the connectivity of the abnormal region. The dilation operation relies on a circular structuring element , its radius Determines the extent of expansion. For slender structures such as railway track cracks, choose the appropriate It can ensure that the expansion effect will not overly blur the boundaries, but also fully fill the tiny cracks and breakpoints. After the expansion is completed, the formula further introduces the corrosion operation to perform fine repair on the expanded area. The purpose of corrosion is to shrink the boundary inward to eliminate the pseudo features that may be introduced by the expansion, and at the same time remove the isolated noise points that may exist on the boundary of the abnormal area. In the railway track image, such isolated points may be caused by uneven lighting or local anomalies in the surface texture. If they are directly retained in the segmentation result, it may lead to misjudgment. The corrosion operation uses the structural element The constraints of , effectively remove these isolated points and make the boundaries of abnormal areas smoother and more natural. Structural elements in the erosion operation With a smaller radius , and satisfies , which creates a good balance between expansion and erosion, that is, expansion is responsible for connection and filling, and erosion is responsible for repair and refinement.

[0087] The process of combining dilation and erosion operations in the formula is actually the implementation of a closing operation. The closing operation smoothes the boundaries of the abnormal area while maintaining the connectivity of the area through the order of dilation first and then erosion. In the detection of track cracks, the closing operation can effectively remove small holes in the area and eliminate local irregular features on the boundary, so that the segmentation results are more in line with the actual form of the track anomaly. This processing method is particularly suitable for scenarios where there are many textures or noise interferences on the track surface. It can enhance the integrity of the area while suppressing the influence of interference factors. In addition, in order to balance the different effects of dilation and erosion on the final result, the formula introduces a normalization coefficient , used to adjust the relative weights of dilation and erosion. This design is very important because the scale and shape of abnormal areas in track images may vary greatly. In areas with finer cracks, the effect of dilation may be more significant, while in areas with larger abnormal areas, the refinement of erosion is more important. By dynamically adjusting the normalization coefficient, the formula can adapt to the characteristics of different abnormal areas, so that the effects of dilation and erosion are optimally balanced. The final result of the morphological operation It is an optimized binary mask that marks the pixel distribution of abnormal areas in the track image. Compared with the candidate abnormal area mask The result is smoother and more coherent, and most isolated noise points and pseudo-anomaly areas are removed. This optimization is of great significance for the practical application of track anomaly detection systems. On the one hand, the detection accuracy of track cracks and wear is improved because the closing operation enhances the connectivity of these anomaly areas, allowing them to be detected in their complete form. On the other hand, the suppression of noise and pseudo-features reduces the possibility of false detection, thereby improving the robustness and reliability of the system.

[0088] Example 8: Morphological intermediate results Perform connected domain screening to obtain processed candidate abnormal regions ;in, It is a connected domain screening operator, which means that only the connected domains with an area greater than connected area.

[0089] Specifically, Example 8 uses the connected domain screening operator to filter the morphological intermediate results Perform optimization processing to generate the final candidate abnormal area . The core of this step is to use the geometric characteristics of the connected domain to screen out connected areas with a large enough area, thereby removing isolated noise points or pseudo-abnormal areas that may remain after morphological processing. This process is crucial in the track image abnormal area segmentation system, because the abnormal areas in the track image usually appear as structures with large spatial coherence, such as cracks, wear or debris, while isolated high-brightness noise points or small-area pseudo-areas often come from background interference or calculation errors and lack practical significance. If the connected domain screening is not performed, these pseudo-features may interfere with the accuracy of the segmentation results, thereby reducing the system's ability to detect track anomalies. In the morphological processing intermediate results In the example, the abnormal regions have been optimized for their connectivity and boundary characteristics through morphological operations such as dilation, erosion, and closing. However, since there may be isolated high-noise points or discontinuous feature areas in the track image, these irregular small areas may still appear in the segmentation results. In order to further clean up these interference areas, Example 8 proposes a connected domain screening method using the operator Realize The connected domain screening operator is based on geometric constraints and selects those areas smaller than the set threshold. The connected regions with an area greater than In this way, the system can effectively remove isolated small areas and ensure that the segmentation results only contain abnormal areas with physical significance. The key to connected domain screening lies in the detection and area calculation of connected areas in binary images. In the example, each pixel value of 1 represents a possible abnormal area. The system forms a connected domain by connecting all adjacent pixels and calculates the area of each connected domain. If the area of a connected domain is greater than the threshold , then the connected domain is considered to have practical significance and can be retained as a candidate abnormal region; otherwise, the connected domain is regarded as a noise or pseudo abnormal region and is removed. The setting is usually adjusted according to the resolution of the track image and the minimum size of the abnormal area in the actual scene. For example, for abnormal areas such as track cracks, the minimum connected area may correspond to a few pixels to dozens of pixels, depending on the resolution of the image acquisition; and isolated highlight noise points usually only occupy one or a few pixels, which can be effectively excluded by setting a reasonable area threshold. This screening process not only improves the accuracy of the segmentation results, but also enhances the robustness of the system. In railway track images, the spatial distribution of abnormal areas often has a certain degree of coherence. For example, cracks usually extend linearly along the direction of the track, while erosion or debris may cover a larger continuous area. Connected domain screening further verifies the rationality of the candidate abnormal area by analyzing the regional coherence, thereby effectively avoiding the influence of noise on the segmentation results. At the same time, this process can also optimize the boundaries of the abnormal area to make it closer to the shape characteristics of the actual track anomaly. Finally, through the connected domain screening operator , morphological intermediate results was further optimized to .exist In the image, each pixel marked as 1 represents a filtered abnormal region whose connectivity and area characteristics match the characteristics of actual track anomalies, while all isolated small regions or pseudo-regions are excluded. This final abnormal region mask not only provides high-quality segmentation results for track anomaly detection, but also significantly reduces the possibility of false detection and missed detection, providing reliable data support for track safety monitoring and maintenance.

[0090] Example 9: The processed candidate anomaly region is intersected with the track mask using the following formula to obtain the track anomaly region:

[0091] ;

[0092] in, It is the track anomaly area; is the orbital mask.

[0093] Specifically, The calculation process is as follows: for the denoised image Calculate the gradient magnitude and compare it with the threshold If the gradient exceeds the threshold, it is marked as 1, otherwise it is marked as 0.

[0094] ;

[0095] in, Indicates that the image is The gradient at (which can be calculated using Sobel, Prewitt, etc.) represents the gradient magnitude (Euclidean norm). is the gradient threshold. The binary edge map obtained is 1, which indicates that it may belong to the track edge or other high-contrast structures, and 0 indicates non-edge areas.

[0096] The two rails of the track are usually two roughly parallel straight lines in the image. By performing Hough line transform on the edge map, we can Cumulative voting is performed to find the two most significant parallel lines. A line can be represented in polar coordinate form as:

[0097] ;

[0098] in is the distance from the line to the origin of the coordinate system, is the normal and The angle between the axes. Iterate over each pixel ,like , then in Accumulate within range:

[0099] ;

[0100] in, The width and height of the image. Represents a discrete or continuous Dirac function (often discretized in implementation). is the cumulative matrix of the Hough parameter space. Find the first several local maxima To simplify, let’s find the two most obvious parallel lines. . Here is the requirement , indicating that the two edges of the track are almost parallel. is the corresponding polar coordinate distance, we can let . With the parameters of two approximately parallel lines After that, we can use geometric conditions to define the area between the two lines as the "track area". For parallel lines, it satisfies:

[0101] ;

[0102] Then the "orbital area" can be regarded as the coordinate satisfy:

[0103] ;

[0104] ;

[0105] in, is the polar coordinate distance of two parallel lines obtained by Hough detection, and . is the normal direction of these two parallel lines. It is the binary mask of the track ROI, 1 represents the area between the two edge lines of the track, and 0 represents the area outside the track.

[0106] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these specific embodiments are merely illustrative, and that those skilled in the art may omit, substitute, and modify the details of the methods and systems described above without departing from the principles and spirit of the present invention. For example, combining the above method steps to perform substantially the same functions in substantially the same manner to achieve substantially the same results falls within the scope of the present invention. Accordingly, the scope of the present invention is limited solely by the appended claims.

Claims

1. The railway track image abnormal area segmentation system combined with fractal dimension feature extraction is characterized by: The system includes: a preprocessing unit, a multi-scale fractal feature processing unit, an abnormal region processing unit, and a segmentation unit; the preprocessing unit is used to receive the original railway track image, use partial differential equations to perform iterative smoothing at multiple scales, suppress noise and retain the main structure, and output a denoising result; the multi-scale fractal feature processing unit is used to calculate the local fractal dimension at multiple different window scales based on the denoising result, perform nonlinear fusion on the local fractal dimensions of different window scales, and suppress noise points through Laplace regularization to obtain a fused fractal dimension, and form a feature vector by combining the fused fractal dimension and the gradient of the denoising result; the abnormal region processing unit is used to cluster pixels into several categories based on the feature vector using a spectral clustering method, determine one or more of the categories as candidate abnormal regions based on a threshold, perform morphological operations of dilation and erosion on the candidate abnormal regions to remove isolated noise or fill gaps, and then perform connected domain screening to obtain processed candidate abnormal regions; the segmentation unit is used to perform an intersection operation on the processed candidate abnormal regions with a track mask to obtain the track abnormal region; Based on the denoising results, the local fractal dimension is calculated using the box counting method at multiple different window scales; Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count is , at different box sizes The statistics are as follows: ; in, is the side length of the box; Indicates the current scale Next, cover the entire window The total number of boxes required; For the The coordinate position of each box in the denoising result; is an integer subscript index; For measuring window and Whether there is an intersection is defined as: ; in, is the discriminant function; when When it is greater than the set value, ; is the X-axis coordinate; is the Y-axis coordinate; Let the scale set be , at each scale The following were obtained ; is an integer subscript index, ranging from 1 to ; is the number of scales; the local fractal dimensions of different window scales are nonlinearly fused by the following formula, and the noise is suppressed by Laplace regularization to obtain the fused fractal dimension : ; in, , is the scale weight; is the mean parameter, ranging from 3 to 6; Indicates the coordinates on the denoising result Centered at , the size is The local fractal dimension of the box count of the window; is the nonlinear fusion index, ranging from 2 to 5; is the Laplace operator; is the Laplace regularization coefficient, ranging from 0.3 to 0.

7.

2. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 1 is characterized in that: make Represents the original railway track image, which represents the original railway track image in The pixel value at is iteratively smoothed at multiple scales using partial differential equations using the following formula to suppress noise and retain the main structure, and the denoising result is output: ; in, The standard deviation is Gaussian kernel function, represents convolution; is the diffusion coefficient function, , determines the diffusion speed at the edge or smooth area, is the diffusion coefficient function variable, is the preset sensitivity value; is the time step variable; is the gradient operator; is the L2 norm operator; set ; The time step is Time The pixel value at ; Set the maximum time step to , the denoising result is , which characterizes the denoising results in Pixel value at: 。 3. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 2 is characterized in that: Based on the feature vector, the spectral clustering method is used to cluster pixels into several categories, and the process of judging one or several categories as candidate abnormal areas according to the threshold includes: in order to measure the similarity between pixels in the feature space, the Gaussian kernel function is used to calculate the similarity between the feature vectors corresponding to each two pixels; the similarity is recorded through a matrix, which is called the similarity matrix; each item in the matrix represents the similarity between two pixels; using the similarity matrix, a graph structure is constructed, in which each pixel is a node in the graph, and the similarity between nodes is used as the weight of the edge; then, based on the degree matrix and the similarity matrix of the graph, the normalized graph Laplacian matrix is calculated; by calculating the eigenvalues and eigenvectors of the graph Laplacian matrix, the nodes in the original high-dimensional feature space are mapped to the low-dimensional space; the front is selected feature vectors, representing the data after dimensionality reduction; in the space after dimensionality reduction, the k-means clustering algorithm is used to group all pixels and divide them into Classes, each class represents a pixel area with similar characteristics; k-means clustering determines the category of each pixel and the center point of each class through iterative optimization; after clustering, each pixel has a category label; based on the clustering results, combined with prior knowledge or statistical features, one or more categories are selected as candidate abnormal areas; finally, a binary mask is generated, in which pixels in abnormal areas are marked as 1 and pixels in normal areas are marked as 0.

4. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 3 is characterized in that: The category labels include: normal area, abnormal area, background area, edge transition area, debris area and shadow area.

5. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 4 is characterized in that: The following formula is used to perform morphological operations of dilation, erosion, and closing on the candidate abnormal regions: ; in, is a binary mask; For expansion operation; For corrosion operations; is the expansion element, which is a circular structural element; is the corrosion element, which is a circular structural element; for The radius, for The radius, ; It is the intermediate morphological result.

6. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 5 is characterized in that: Then the morphological intermediate results Perform connected domain screening to obtain processed candidate abnormal regions ;in, It is a connected domain screening operator, which means that only the connected domains with an area greater than connected area.

7. The railway track image abnormal region segmentation system combined with fractal dimension feature extraction according to claim 6 is characterized in that: The processed candidate anomaly region is intersected with the track mask using the following formula to obtain the track anomaly region: ; in, It is the track anomaly area; is the orbital mask.

Citation Information

Patent Citations

  • Liquid crystal display screen defect detection method, system, equipment and medium

    CN119722672A

  • Information processing method, medical image diagnostic apparatus, and information processing system

    US20220031274A1