Rail transit unmanned aerial vehicle inspection image crack detection method and system based on generation enhancement

By constructing a crack skeleton model and a TF-IDG generation model, crack enhancement samples that conform to real-world scenarios are generated, solving the problem of insufficient crack detection samples in UAV inspection of rail transit and improving the recognition performance and scenario adaptability of the detection model.

CN123181965APending Publication Date: 2026-11-27BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611482331.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-22
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, crack detection in images inspected by UAVs for rail transit suffers from problems such as insufficient sample quantity, inability of traditional data augmentation methods to generate effective new samples, and insufficient authenticity of generated samples, which limits the generalization ability of the detection model.

Method used

By constructing a crack skeleton model, the TF-IDG generative model is used to generate candidate enhanced samples with realistic background texture and crack features under the constraint of the desired crack mask. The quality is evaluated, unqualified samples are removed, an enhanced training set is constructed, and the crack target detection model is trained.

Benefits of technology

It improves the crack detection model's recognition performance and scene adaptability under small sample conditions, and the generated samples are consistent with real inspection scenarios, enhancing the diversity and effectiveness of training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181965A_ABST
    Figure CN123181965A_ABST
Patent Text Reader

Abstract

The application provides a kind of based on generating enhanced rail transit unmanned aerial vehicle inspection image crack detection method and system, belongs to target identification technical field, obtains the image to be detected for inspection;The pre-trained crack target detection model is used to process the image to be detected for inspection, and the position and category information of crack target are outputted.The application effectively overcomes the deficiencies in the prior art, such as insufficient number of real crack samples, inability of traditional data enhancement methods to generate effective new samples, and insufficient authenticity of generated samples, and provides a complete data enhancement and identification solution for small sample crack intelligent detection in the rail transit unmanned aerial vehicle inspection scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target recognition technology, specifically to a method and system for crack detection in rail transit UAV inspection images based on generative enhancement. Background Technology

[0002] With the continuous expansion of rail transit construction and the increasing years of operation, infrastructure such as bridges are constantly affected by factors such as vehicle loads, environmental erosion, and material aging, making them prone to surface defects such as cracks. Currently, existing inspection methods, such as manual inspections and other auxiliary detection technologies, can typically inspect infrastructure defects within a certain range. However, for rapid inspections in high-altitude, large-scale areas and areas difficult for manual access, traditional inspection methods have limitations in terms of efficiency and operational safety. Unmanned aerial vehicles (UAVs) can be used for efficient and flexible image data acquisition. Based on this, combined with computer vision methods such as target detection and semantic segmentation, automatic defect identification in inspection images can be further achieved. Currently, research has applied deep learning methods to track slab crack detection, UAV bridge structural deterioration detection, bridge steel component defect detection, and railway tunnel crack and surface defect detection, providing a technical foundation for automated defect identification in UAV inspection images.

[0003] However, cracks in real-world drone inspection images are typically long, thin, small-scale, and have weak texture, and are easily affected by factors such as seams, shadows, water stains, dirt, and complex concrete textures. More importantly, the acquisition and manual annotation of real crack samples are costly, and different cracks vary significantly in terms of direction, width, branching patterns, and background conditions, making it difficult for limited training samples to fully cover crack morphology in real-world scenarios. To address the insufficient sample problem, existing methods typically increase the number of samples through image transformations such as rotation, flipping, cropping, and brightness adjustment, and can also use data augmentation methods such as Cutout, Mixup, and CutMix to expand the training data. These methods can increase the variation of existing samples in terms of pose, occlusion, and combination, but they still essentially rely on existing samples for transformation, making it difficult to generate new crack directions, branches, and network structures. Furthermore, while directly introducing externally available crack data can expand the training sample size, the differences in shooting conditions, background texture, and crack distribution among different data sources make it difficult to ensure that external samples have consistent data characteristics with actual drone inspection scenarios.

[0004] Furthermore, the generative model-based defect sample construction method can synthesize new defect regions in normal background images using existing defect information. TF-IDG is a training-free industrial defect generation method based on a diffusion model. It takes a normal background image, a reference defect image, a reference defect mask, and a target mask as input. Through mechanisms such as feature alignment, adaptive anomaly masking, and texture preservation, it generates new defect samples within the region defined by the target mask. The target mask defines the location and shape of the defect, the reference defect image and its corresponding mask provide the defect's appearance features, and the normal image provides background texture information. Existing TF-IDG methods mainly target general industrial defects, and their target masks are primarily based on existing real defect masks for position adjustment and enhancement. They lack specific morphology construction methods for unique structures such as continuous, slender, multi-branched, and mesh-like concrete cracks. Additionally, the generated candidate samples may still suffer from unclear targets, unnatural boundaries, local artifacts, or excessive darkness and distortion. Directly using these samples for subsequent detection training may affect the effectiveness of the enhanced samples. Therefore, it is necessary to further constrain the crack generation area and structure by combining the real concrete background and crack morphology characteristics in the actual inspection scenario, and to screen the generated samples for quality.

[0005] Current deep learning-based methods for detecting infrastructure defects typically rely on large amounts of high-quality training data. However, cracks in rail transit infrastructure are low-frequency defects, and the actual number of large-scale real crack samples obtained is limited by the location of the defects, the on-site data collection environment, and inspection costs. Furthermore, crack image annotation usually requires manual work, especially the detailed annotation process, which is time-consuming. This makes it difficult to meet the model's learning needs with sufficient training data, thus affecting the recognition performance of intelligent detection models.

[0006] Existing data augmentation methods cannot effectively improve the diversity and scene adaptability of crack samples. Current crack detection tasks often use traditional image augmentation methods such as rotation, flipping, cropping, and brightness adjustment to expand training data, or increase the number of samples by introducing public crack datasets. However, traditional image augmentation methods mainly perform simple transformations based on existing images and cannot generate new crack structures and morphologies. Public datasets usually differ from actual rail transit drone inspection scenarios, exhibiting inconsistencies in background texture, shooting environment, and image features. This results in insufficient matching between training data and actual application scenarios, limiting the generalization ability of the detection model.

[0007] Existing data augmentation methods based on generative models struggle to guarantee the realism and effectiveness of generated crack samples. With the development of generative adversarial networks and diffusion models, some methods utilize generative models to generate new defect images to alleviate the problem of insufficient real samples. However, existing generative methods typically focus primarily on the overall visual effect of the image, lacking effective constraints on the slender structure, spatial location, and morphological features of cracks. This easily leads to problems such as crack structures not conforming to actual disease patterns and insufficient fusion between the generated target and the real background, making it difficult to directly use the generated samples for training UAV-based crack detection models. Summary of the Invention

[0008] The purpose of this invention is to provide a method and system for crack detection in rail transit UAV inspection images based on generative enhancement, so as to solve at least one of the technical problems existing in the background art.

[0009] To achieve the above objectives, the present invention adopts the following technical solution:

[0010] In a first aspect, the present invention provides a crack detection method based on generatively enhanced UAV inspection images of rail transit, comprising:

[0011] Acquire the inspection image to be detected;

[0012] A pre-trained crack target detection model is used to process the inspection images to be detected, outputting the location and category information of the crack targets. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining expected crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using the real background image, expected crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the expected crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0013] As a further limitation of the first aspect of the present invention, the collected real inspection images are sliced ​​using a sliding window method, and the edges of areas with insufficient full size are padded to obtain local images of uniform size; the images are classified and organized according to their content to obtain real crack samples and clean concrete background images, wherein the real crack samples are used to provide reference crack texture information and subsequent detection model training, and the clean concrete background images are used for subsequent crack image generation; crack regions are extracted from the real crack samples to generate reference crack masks corresponding to the reference crack images, which are used to determine the reference crack regions in the subsequent crack image generation process.

[0014] As a further limitation of the first aspect of the present invention, a crack skeleton model is established based on the morphological and structural characteristics of real crack samples, and desired crack masks with different positions, shapes, and scales are obtained through crack skeleton generation, width expansion, and morphological perturbation, including:

[0015] For narrow cracks, the crack initiation position and initial growth direction are determined within the image area, and the direction and step size are perturbed during the growth process to gradually generate a continuous crack skeleton.

[0016] For network-like cracks, a fast expanding random tree method is used to simulate the multi-branch expansion process of cracks. The crack growth starting point is randomly selected, random sampling is performed within the image region, and the node closest to the sampling point is selected from the existing nodes for expansion.

[0017] As a further limitation of the first aspect of the present invention, after obtaining the crack skeleton, the crack region is widened according to the distribution of the skeleton nodes, and the single-pixel skeleton is converted into a crack mask region with a certain area; for narrow cracks, the width is assigned according to the main path direction of the crack, so that the generated mask has a continuous and slender structure; for mesh cracks, different expansion widths are set according to different branch levels and local positions, so that there are hierarchical differences between the main crack and the secondary branches, thereby better conforming to the actual crack morphology.

[0018] The expanded crack region is subjected to morphological perturbation to induce certain bending, width variation and boundary irregularity characteristics.

[0019] The disturbed crack region is then binarized, its boundaries corrected, and abnormal regions removed to obtain the final desired crack mask.

[0020] As a further limitation of the first aspect of the present invention, the real background image, the desired crack mask, the reference crack image, and the reference crack mask are used as multi-source conditional inputs to a TF-IDG-based crack image generation model. Under the constraint of the desired crack mask, candidate enhancement samples with real background texture and crack features are generated, including:

[0021] The generated desired crack mask is input into the constructed crack image generation model, and a multi-source conditional input consisting of a generated background image, a desired crack mask, a reference crack image, and a reference crack mask is constructed. The generated background image is sourced from a real background image library to provide realistic concrete surface texture and environmental information. The desired crack mask is used to define the crack generation location and spatial structure. The reference crack image is sourced from a real crack sample library to provide crack texture, grayscale variations, and edge features. The reference crack mask is used to determine the crack region in the reference image, reducing the influence of irrelevant background textures on the generation process.

[0022] Background images are selected from a real background image library, and corresponding desired crack masks are selected to form a combination of background and target regions; reference crack images and their corresponding reference crack masks are selected, and the four types of data are input into the TF-IDG model; the model determines the crack generation area based on the desired crack mask, and combines the texture information in the reference crack image to complete local crack synthesis in the real background image, so that the generated cracks form a natural transition with the surrounding concrete background.

[0023] The candidate enhancement sample generation process is organized in rounds. In each round of generation, a reference crack image and its corresponding mask are determined, and a background image and the desired crack mask are selected to form an input combination. After each round of generation is completed, the reference crack image, background image or desired crack mask is replaced to enter the next round of generation, thereby obtaining candidate crack enhancement samples with different crack morphology, texture features and background conditions.

[0024] As a further limitation of the first aspect of the present invention, to address the problem that the generated crack target may have insufficient contrast and be unclear, the visibility of the generated crack target is evaluated by calculating the gray-level difference between the crack region and the surrounding background region; the average gray-level change within the expected crack region is further calculated to determine whether the generated crack has sufficient visual response; when the gray-level change in the crack region is too small, it indicates that the generated crack target is not clear, and the sample is judged as a low-quality sample; a neighborhood ring of the expected crack mask is constructed, and the gray-level changes inside the crack region and the surrounding background region are compared. When the region contrast index is lower than a set threshold, it is determined that the crack region is not sufficiently distinguishable from the background, and the sample is judged as an unqualified sample; a crack boundary band is constructed based on the expected crack mask, and the gradient intensity of the generated image inside and outside the boundary is calculated using the Sobel operator, and the gradient ratio is used to evaluate whether the crack boundary is too abrupt.

[0025] Secondly, the present invention provides a crack detection system based on generatively enhanced UAV inspection images of rail transit, comprising:

[0026] The acquisition module is used to acquire the inspection image to be detected.

[0027] The processing module is used to process the inspection images to be detected using a pre-trained crack target detection model, and output the location and category information of the crack targets. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining expected crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; inputting the real background image, expected crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model, and generating candidate enhancement samples with real background texture and crack features under the constraint of the expected crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0028] Thirdly, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the crack detection method for UAV inspection images of rail transit as described in the first aspect.

[0029] Fourthly, the present invention provides a computer device including a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor invokes the program instructions to execute the crack detection method for UAV inspection images of rail transit as described in the first aspect.

[0030] Fifthly, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the crack detection method based on generative enhancement of rail transit UAV inspection images as described in the first aspect.

[0031] Terminology Explanation:

[0032] (1) TF-IDG: Training-Free Industrial Defect Generation, is a defect image generation method based on a diffusion model. It can generate new defect images in a specified area based on background images, reference defect images and mask information.

[0033] (2) Real background image: Concrete surface image without obvious cracks obtained from real UAV inspection images, used to provide a real background carrier for crack image generation.

[0034] (3) Expected crack mask: A binary mask used to limit the location, spatial range and morphological structure of crack generation, including narrow crack mask and mesh crack mask, used to control the location, scale, direction and spatial structure of generated cracks.

[0035] (4) Reference crack image: An image containing the real crack target, used to provide crack texture, grayscale variation and edge features during crack generation.

[0036] (5) Reference crack mask: a mask corresponding to the reference crack image, used to identify the crack area in the reference image, to clarify the crack area to be used in the generation process, and to reduce the influence of irrelevant background texture on the crack generation process.

[0037] The beneficial effects of this invention are that it effectively overcomes the shortcomings of existing technologies, such as insufficient number of real crack samples, inability of traditional data augmentation methods to generate effective new samples, and insufficient authenticity of generated samples. It provides a complete data augmentation and recognition solution for intelligent detection of small-sample cracks in the scenario of UAV inspection of rail transit.

[0038] The advantages of additional aspects of the invention will be set forth more clearly in the following description or will be learned by practice of the invention. Attached Figure Description

[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart of the crack detection method for rail transit UAV inspection images based on generative enhancement, as described in an embodiment of the present invention.

[0041] Figure 2 This is a schematic diagram of crack expectation mask generation according to an embodiment of the present invention.

[0042] Figure 3 This is a schematic diagram of the crack image generation structure of the multi-source conditional input and improved TF-IDG model described in an embodiment of the present invention.

[0043] Figure 4 This is a schematic diagram of the crack texture migration and local synthesis process described in an embodiment of the present invention.

[0044] Figure 5 This is a schematic diagram comparing the automatic screening results of crack enhancement samples according to an embodiment of the present invention.

[0045] Figure 6 This is a schematic diagram of the crack target detection result in a real inspection image as described in an embodiment of the present invention. Detailed Implementation

[0046] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0047] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0048] It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as here.

[0049] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.

[0050] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0051] To facilitate understanding of the present invention, the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments, and the specific embodiments do not constitute a limitation on the embodiments of the present invention.

[0052] Those skilled in the art should understand that the accompanying drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily essential for implementing the present invention.

[0053] This invention aims to propose a generative enhancement-based method for crack detection in UAV inspection images of rail transit. It effectively overcomes the shortcomings of existing technologies, such as insufficient real crack samples, the inability of traditional data augmentation methods to generate effective new samples, and insufficient realism of generated samples. It provides a complete data augmentation and recognition solution for intelligent crack detection with small sample sizes in rail transit UAV inspection scenarios. The invention has the following objectives and advantages: It addresses the problem of insufficient training data for crack detection models under small sample conditions by constructing generative enhancement samples to expand effective training data, providing the crack detection model with richer crack morphology and background conditions. It addresses the problem that existing data augmentation methods cannot effectively improve the diversity and scene adaptability of crack samples. It addresses the problem of insufficient realism and difficulty in guaranteeing the effectiveness of generated crack samples by improving the consistency between generated samples and real inspection scenes through crack structure constraints and generation quality screening. It achieves effective expansion of crack detection data under small sample conditions. By constructing a real inspection background image library and a crack sample library, it uses generative enhancement methods to generate crack image samples with actual scene characteristics, increasing the scale and diversity of training data and reducing the impact of insufficient real crack samples on the training effect of the detection model. It achieves crack image generation that conforms to the real-world disease patterns. By incorporating crack structure information to constrain the generation process, the generated cracks are made more consistent with the characteristics of actual infrastructure defects in terms of spatial location, morphological features, and background fusion effects, thus improving the consistency between generated samples and real inspection images. This approach combines generated sample screening with an intelligent detection model. Through quality screening of generated samples and validation of the enhanced data using a target detection model, effective samples that meet detection requirements are selected, improving the crack detection model's recognition performance and scene adaptability under complex backgrounds and small sample conditions.

[0054] Example 1

[0055] Combination Figure 1 As shown in Embodiment 1, a crack detection system for rail transit UAV inspection images based on generative enhancement is first provided, including: an acquisition module for acquiring the inspection image to be detected; and a processing module for processing the inspection image to be detected using a pre-trained crack target detection model and outputting the location and category information of the crack target.

[0056] Using the above system, a method for crack detection in rail transit UAV inspection images based on generative enhancement was implemented, including: acquiring the inspection image to be detected using an acquisition module; and processing the inspection image using a pre-trained crack target detection model using a processing module to output the location and category information of the crack target.

[0057] In this embodiment, the training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining desired crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using the real background image, desired crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the desired crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0058] Specifically, the training of the crack target detection model described in this embodiment includes the following steps:

[0059] Step 1, Real Inspection Image Acquisition and Data Preprocessing: Using a drone equipped with a visible light camera, inspection images of rail transit infrastructure are acquired. The acquired images are cropped, filtered, and classified to construct a real background image library and a real crack sample library, providing a data foundation for subsequent crack mask generation and crack image generation.

[0060] Step 2, generating expected crack masks based on crack structure priors: establish a crack skeleton model based on the morphological and structural features of real crack samples, and obtain expected crack masks with different positions, shapes and scales through crack skeleton generation, width expansion and morphological perturbation.

[0061] Step 3, Crack Image Generation Based on Multi-Source Constraints: Input the real background image, desired crack mask, reference crack image and reference crack mask as multi-source conditions into the TF-IDG-based crack image generation model, and generate candidate enhancement samples with real background texture and crack features under the constraint of the desired crack mask.

[0062] Step 4, Quality Evaluation and Automatic Screening of Crack Enhancement Samples: The generated candidate enhancement samples are evaluated in terms of crack target salience, regional contrast, boundary naturalness, and excessive darkness anomalies. Low-quality samples with unclear crack targets, abnormal boundaries, or unnatural background blending are eliminated to obtain high-quality crack enhancement samples.

[0063] Step 5, Crack Target Detection Based on Enhanced Data: High-quality enhanced crack samples are fused with real crack training samples to construct an enhanced crack target detection training set. The crack target detection model is trained using the training set. The model is validated and tested using real inspection crack samples. The inspection image to be detected is input into the trained model, and the location and category information of the crack target are output.

[0064] In step 1, the collected real inspection images are sliced ​​using a sliding window method, and edges of areas with insufficient dimensions are padded to obtain local images of uniform size. The images are then categorized and organized according to their content to obtain real crack samples and clean concrete background images. The real crack samples provide reference crack texture information and are used for subsequent detection model training, while the clean concrete background images are used for subsequent crack image generation. Crack regions are extracted from the real crack samples to generate a reference crack mask corresponding to the reference crack image, which is used to determine the reference crack region during subsequent crack image generation. Specifically, step 1 includes:

[0065] (1) Images of rail transit infrastructure inspections were collected by drones, and the original images were sliced ​​using a sliding window method. The slice size was 640×640 pixels, and a 128-pixel overlap area was set between slices. Edges of areas with insufficient size were filled to obtain local images of uniform size. (2) The sliced ​​images were automatically coarsely screened to remove large areas of sky or blank areas, overly bright or dark areas, solid color areas, and image blocks with insufficient texture information and effective structural information. Subsequently, the images were classified and sorted according to their content to obtain real crack samples and clean concrete background images. The real crack samples were used to provide reference crack texture information and subsequent detection model training, while the clean concrete background images were used for subsequent crack image generation. At the same time, crack regions in the real crack samples were extracted by a preset image processing program to generate reference crack masks corresponding to the reference crack images, which were used to determine the reference crack regions in the subsequent crack image generation process.

[0066] In step 2, a crack skeleton model is established based on the morphological and structural features of real crack samples. Desired crack masks with different locations, shapes, and scales are obtained through crack skeleton generation, width expansion, and morphological perturbation. This includes: for narrow cracks, determining the crack's starting position and initial growth direction within the image region, and perturbing the direction and step size during growth to gradually generate a continuous crack skeleton; for mesh cracks, a fast-expanding random tree method is used to simulate the multi-branch expansion process of the crack. The crack growth starting point is randomly selected, random sampling is performed within the image region, and the node closest to the sampling point is selected from existing nodes for expansion. After obtaining the crack skeleton, the crack region is widened according to the distribution of skeleton nodes, converting the single-pixel skeleton into a crack mask region with a certain area. For narrow cracks, the width is assigned according to the main path direction of the crack, so that the generated mask has a continuous and slender structure. For mesh cracks, different expansion widths are set according to different branch levels and local locations, so that there are hierarchical differences between the main crack and the secondary branches, thus better conforming to the actual crack shape. The expanded crack region is perturbed to produce certain bending, width variation and irregular boundary features. Then, the perturbed crack region is binarized, the boundary is corrected and the abnormal region is removed to obtain the final desired crack mask.

[0067] Step 2 specifically involves: based on the morphology and structure of the real crack sample, dividing the crack into narrow cracks and network cracks, and establishing crack skeleton generation methods for each.

[0068] For a narrow crack, the crack's starting position and initial growth direction are determined within the image region. During the growth process, the direction and step size are perturbed to gradually generate a continuous crack skeleton. Let the t-th skeleton point be... The current growth direction is Step size is Then the next skeleton point can be represented as:

[0069]

[0070] in, This indicates the current crack propagation step size. This indicates the local growth direction of the crack. By constraining the step size and direction, the generated skeleton maintains continuous extension characteristics while exhibiting a certain degree of random bending variation.

[0071] For network-like cracks, the Rapidly-exploring Random Tree (RRT) method is used to simulate the multi-branch propagation process of the cracks. The crack growth starting point is randomly selected, random sampling is performed within the image region, and the node closest to the sampling point is selected from the existing nodes for expansion. The new node is represented as:

[0072]

[0073] in, For random sampling points, s represents the existing node closest to the random sampling point, and s is the expansion step size. A crack skeleton with a multi-directional branching structure is formed through repeated sampling and expansion.

[0074] (2) After obtaining the crack skeleton, the crack area is widened according to the distribution of skeleton nodes, and the single-pixel skeleton is converted into a crack mask area with a certain area. For narrow cracks, the width is assigned according to the main path direction of the crack, so that the generated mask has a continuous and slender structure; for mesh cracks, different expansion widths are set according to different branch levels and local positions, so that there are hierarchical differences between the main crack and the secondary branches, which is more in line with the actual crack morphology.

[0075] (3) Morphological perturbation is applied to the expanded crack region to induce certain curvature, width variation, and irregular boundary features, thereby preserving the morphological differences of different crack types and improving the diversity of generated masks. The perturbated crack region is then binarized, its boundaries corrected, and abnormal regions removed to obtain the final desired crack mask. The desired crack mask is used to define the target location, spatial range, and crack morphology in subsequent crack image generation processes. The generation process of desired crack masks for narrow cracks and mesh cracks is as follows: Figure 2 As shown.

[0076] In step 3, the real background image, the desired crack mask, the reference crack image, and the reference crack mask are used as multi-source conditional inputs to the TF-IDG-based crack image generation model. Under the constraint of the desired crack mask, candidate enhancement samples with realistic background texture and crack features are generated, including:

[0077] The generated desired crack mask is input into the constructed crack image generation model, and a multi-source conditional input consisting of a generated background image, a desired crack mask, a reference crack image, and a reference crack mask is constructed. The generated background image is sourced from a real background image library to provide realistic concrete surface texture and environmental information. The desired crack mask is used to define the crack generation location and spatial structure. The reference crack image is sourced from a real crack sample library to provide crack texture, grayscale variations, and edge features. The reference crack mask is used to determine the crack region in the reference image, reducing the influence of irrelevant background textures on the generation process.

[0078] Background images are selected from a real background image library, and corresponding desired crack masks are selected to form a combination of background and target regions; reference crack images and their corresponding reference crack masks are selected, and the four types of data are input into the TF-IDG model; the model determines the crack generation area based on the desired crack mask, and combines the texture information in the reference crack image to complete local crack synthesis in the real background image, so that the generated cracks form a natural transition with the surrounding concrete background.

[0079] The candidate enhancement sample generation process is organized in rounds. In each round of generation, a reference crack image and its corresponding mask are determined, and a background image and the desired crack mask are selected to form an input combination. After each round of generation is completed, the reference crack image, background image or desired crack mask is replaced to enter the next round of generation, thereby obtaining candidate crack enhancement samples with different crack morphology, texture features and background conditions.

[0080] Step 3 specifically involves:

[0081] (1) The desired crack mask generated in step 2 is input into the crack image generation model constructed based on the Training-Free Industrial Defect Generation (TF-IDG) model, and a multi-source conditional input consisting of a generated background image, a desired crack mask, a reference crack image, and a reference crack mask is constructed. The generated background image is sourced from a real background image library to provide realistic concrete surface texture and environmental information; the desired crack mask is used to limit the crack generation location and spatial structure; the reference crack image is sourced from a real crack sample library to provide crack texture, grayscale variations, and edge features; and the reference crack mask is used to determine the crack region in the reference image, reducing the influence of irrelevant background textures on the generation process. The crack image generation structure of the above multi-source conditional input and the improved TF-IDG model is as follows: Figure 3 As shown.

[0082] (2) Select a background image from the real background image library and select the corresponding type of desired crack mask to form a combination of background and target area; then select a reference crack image and its corresponding reference crack mask, and input the four types of data into the TF-IDG model. The model determines the crack generation area according to the desired crack mask, and combines the texture information in the reference crack image to complete the local crack synthesis in the real background image, so that the generated crack forms a natural transition with the surrounding concrete background. The crack texture transfer and local synthesis process is as follows: Figure 4 As shown.

[0083] The process of generating crack images is represented as follows:

[0084]

[0085] in, This indicates the generation of a crack image; Indicates the generation of a background image; Indicates the desired crack mask; Indicates a reference crack image; Indicates the reference crack mask; This describes the crack image generation process based on improved TF-IDG.

[0086] (3) The candidate enhancement sample generation process is organized in a round-by-round manner. In the single-round generation process, the reference crack image and its corresponding mask are determined, and the background image and the desired crack mask are selected to form the input combination. After the single-round generation is completed, the reference crack image, background image or desired crack mask is replaced to enter the next round of generation, thereby obtaining candidate crack enhancement samples with different crack morphology, texture features and background conditions.

[0087] In step 4, to address the potential issues of insufficient contrast and unclear target in the generated crack target, the visibility of the generated crack target is evaluated by calculating the grayscale difference between the crack region and the surrounding background region. Further, the average grayscale change within the expected crack region is calculated to determine if the generated crack has sufficient visual response. If the grayscale change in the crack region is too small, it indicates that the generated crack target is not clear, and the sample is classified as a low-quality sample. A neighborhood ring of the expected crack mask is constructed, and the grayscale changes inside the crack region and the surrounding background region are compared. When the region contrast index is below a set threshold, it is determined that the crack region is not sufficiently distinguishable from the background, and the sample is classified as an unqualified sample. A crack boundary band is constructed based on the expected crack mask, and the Sobel operator is used to calculate the gradient intensity of the generated image inside and outside the boundary. The gradient ratio is used to evaluate whether the crack boundary is too abrupt.

[0088] Step 4 specifically includes:

[0089] To address the potential issues of insufficient contrast and unclear target visibility in generated crack targets, the visibility of the generated crack target is evaluated by calculating the grayscale difference between the crack region and the surrounding background region. Let the grayscale value of the generated image be... The original background image grayscale value is The expected crack mask region is Then the grayscale change within the desired region can be expressed as:

[0090]

[0091] in, This indicates the degree of grayscale change in the generated crack area relative to the original background. The average grayscale change within the expected crack area is further calculated to determine if the generated crack has sufficient visual response. If the grayscale change in the crack area is too small, it indicates that the generated crack target is not obvious, and the sample is classified as a low-quality sample.

[0092] Construct a neighborhood annulus of the desired crack mask, compare the grayscale changes between the crack region and the surrounding background region, and use the region contrast index:

[0093]

[0094] in, This represents the expected average grayscale change within the crack region. This represents the average grayscale change within the neighborhood ring of the desired mask. To prevent extremely small constants with a denominator of zero. When If the value is below the set threshold, the crack area is deemed insufficiently distinguishable from the background, and the sample is classified as an unqualified sample.

[0095] Crack boundary bands are constructed based on the expected crack mask, and the Sobel operator is used to calculate the gradient intensity of the generated image inside and outside the boundary. The gradient ratio is used to evaluate whether the crack boundary is too abrupt.

[0096]

[0097] in, This represents the average gradient intensity inside the boundary band. This represents the average gradient intensity outside the boundary zone. When the boundary gradient ratio is too large, it indicates that the crack edge changes too strongly, which may indicate a harsh boundary or unnatural fusion. The corresponding sample is judged as a low-quality sample.

[0098] Further statistical analysis was conducted on the proportion of excessively dark pixels in the expected crack region to eliminate samples with obvious black blocky areas or visual distortions. Based on this, a multi-condition joint judgment was performed, considering indicators such as target salience, regional contrast, boundary naturalness, and excessive darkness anomalies. Samples meeting all screening criteria were retained; otherwise, they were discarded. Figure 5 The results of comparing retained and removed samples are presented. The crack targets in the retained samples are clearer, the boundary transitions are more natural, and they are well coordinated with the surrounding concrete background. The removed samples mainly show that the crack targets are not obvious, local artifacts are obvious, the background blending is not coordinated, or the boundary is too dark and distorted.

[0099] The high-quality enhanced crack samples obtained in step 4 are fused with real crack training samples. The images and corresponding crack target annotations are processed in a unified format to construct an enhanced crack target detection training set. Model validation and testing use real inspected crack samples. The crack target detection model is trained using the constructed training set, and its crack detection performance is evaluated using the validation and test sets. Figure 6 As shown, after inputting the inspection image to be detected into the trained crack target detection model, the model outputs the location and category information of the crack target, thereby realizing automatic crack identification in the inspection image.

[0100] Example 2

[0101] This embodiment 2 provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, they implement the crack detection method based on generative enhancement of rail transit UAV inspection images as described above. The method includes:

[0102] Acquire the inspection image to be detected;

[0103] A pre-trained crack target detection model is used to process the inspection images to be detected, outputting the location and category information of the crack targets. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining expected crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using the real background image, expected crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the expected crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0104] Example 3

[0105] This embodiment 3 provides a computer device, including a memory and a processor, wherein the processor and the memory communicate with each other, and the memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the crack detection method based on generative enhancement of UAV inspection images of rail transit as described above, the method including:

[0106] Acquire the inspection image to be detected;

[0107] A pre-trained crack target detection model is used to process the inspection images to be detected, outputting the location and category information of the crack targets. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining expected crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using the real background image, expected crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the expected crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0108] Example 4

[0109] This embodiment 4 provides an electronic device, including: a processor, a memory, and a computer program; wherein, the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes instructions to implement the crack detection method based on generative enhancement of rail transit UAV inspection images as described above. The method includes:

[0110] Acquire the inspection image to be detected;

[0111] A pre-trained crack target detection model is used to process the inspection images to be detected, outputting the location and category information of the crack targets. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining expected crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using the real background image, expected crack mask, reference crack image, and reference crack mask as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the expected crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

[0112] In summary, the crack detection method for UAV inspection images of rail transit based on generative enhancement described in this invention, compared with traditional image enhancement methods, methods that directly introduce publicly available crack data, and general generation methods lacking crack morphology constraints, addresses the crack identification task of concrete bridges in rail transit inspection images by constructing a crack enhancement sample generation and detection method based on real-scene data. Traditional enhancement methods such as rotation, flipping, cropping, and brightness adjustment mainly change the appearance of existing images and are difficult to supplement new crack spatial structures; publicly available crack data differs from actual inspection images in terms of background texture, imaging conditions, and crack distribution characteristics; and general generation methods, lacking explicit crack morphology constraints, are prone to problems such as unreasonable crack positions, unnatural edges, and inconsistencies with background textures.

[0113] On the one hand, using real concrete inspection images as the crack generation background enables the enhanced samples to retain the actual background texture and environmental features of the target scene, reducing the difference between publicly available data and actual inspection scenes. On the other hand, two types of desired crack masks, namely narrow cracks and mesh cracks, are constructed based on the real crack morphology. The position, direction, branching, and local morphology of the cracks are constrained through skeleton generation, width expansion, and morphological perturbation, thereby supplementing the crack structure types that are insufficiently covered in the real training set. Based on this, the real background image, desired crack mask, reference crack image, and reference crack mask are jointly input into the improved TF-IDG model to complete the generation of regionally constrained cracks on the real concrete background. Candidate enhanced samples with different crack morphologies, texture features, and background conditions are formed through different input combinations. In addition, this invention addresses the problems that may exist in the candidate generated samples, such as unclear crack targets, unnatural boundaries, local artifacts, and excessive darkness distortion. It evaluates the quality from aspects such as target saliency, regional contrast, boundary naturalness, and excessive darkness anomalies, and uses a multi-condition joint discrimination method to screen out low-quality samples and retain enhanced samples that meet the requirements of subsequent detection and training. The enhanced samples after screening are used together with real crack samples to train the detection model, while the test still uses real inspection crack samples for evaluation, so as to verify the actual role of the generated enhanced samples in small sample crack detection without changing the real test scenario.

[0114] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0115] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0118] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.

Claims

1. A crack detection method based on generative enhancement of UAV inspection images for rail transit, characterized in that, include: Acquire the inspection image to be detected; The pre-trained crack target detection model is used to process the inspection image to be detected and output the location and category information of the crack target. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining desired crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using real background images, desired crack masks, reference crack images, and reference crack masks as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the desired crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

2. The method for crack detection in UAV inspection images of rail transit based on generative enhancement as described in claim 1, characterized in that, For the collected real inspection images, a sliding window method is used to slice them, and the edges of areas with insufficient size are padded to obtain local images of uniform size. The images are then classified and organized according to their content to obtain real crack samples and clean concrete background images. The real crack samples are used to provide reference crack texture information and for subsequent detection model training, while the clean concrete background images are used for subsequent crack image generation. Crack regions are extracted from the real crack samples to generate reference crack masks corresponding to the reference crack images, which are used to determine the reference crack regions during the subsequent crack image generation process.

3. The crack detection method for UAV inspection images of rail transit based on generative enhancement as described in claim 1, characterized in that, A crack skeleton model is established based on the morphological and structural features of real crack samples. Desired crack masks with different locations, shapes, and scales are obtained through crack skeleton generation, width expansion, and morphological perturbation, including: For narrow cracks, the crack initiation position and initial growth direction are determined within the image area, and the direction and step size are perturbed during the growth process to gradually generate a continuous crack skeleton. For network-like cracks, a fast expanding random tree method is used to simulate the multi-branch expansion process of cracks. The crack growth starting point is randomly selected, random sampling is performed within the image region, and the node closest to the sampling point is selected from the existing nodes for expansion.

4. The method for crack detection in UAV inspection images of rail transit based on generative enhancement as described in claim 3, characterized in that, After obtaining the crack skeleton, the crack area is widened according to the distribution of skeleton nodes, and the single-pixel skeleton is converted into a crack mask area with a certain area. For narrow cracks, the width is assigned according to the main path direction of the crack, so that the generated mask has a continuous and slender structure. For mesh cracks, different expansion widths are set according to different branch levels and local locations, so that there are hierarchical differences between the main crack and the secondary branches, which is more in line with the actual crack shape. The expanded crack region is subjected to morphological perturbation to induce certain bending, width variation and boundary irregularity characteristics. The disturbed crack region is then binarized, its boundaries corrected, and abnormal regions removed to obtain the final desired crack mask.

5. The method for crack detection in UAV inspection images of rail transit based on generative enhancement as described in claim 1, characterized in that, A TF-IDG-based crack image generation model is constructed by inputting a real background image, a desired crack mask, a reference crack image, and a reference crack mask as multi-source conditional inputs. Under the constraint of the desired crack mask, candidate enhancement samples with realistic background texture and crack features are generated, including: The generated desired crack mask is input into the constructed crack image generation model, and a multi-source conditional input consisting of a generated background image, a desired crack mask, a reference crack image, and a reference crack mask is constructed. The generated background image is sourced from a real background image library to provide realistic concrete surface texture and environmental information. The desired crack mask is used to define the crack generation location and spatial structure. The reference crack image is sourced from a real crack sample library to provide crack texture, grayscale variations, and edge features. The reference crack mask is used to determine the crack region in the reference image, reducing the influence of irrelevant background textures on the generation process. Background images are selected from a real background image library, and corresponding desired crack masks are selected to form a combination of background and target regions; reference crack images and their corresponding reference crack masks are selected, and the four types of data are input into the TF-IDG model; the model determines the crack generation area based on the desired crack mask, and combines the texture information in the reference crack image to complete local crack synthesis in the real background image, so that the generated cracks form a natural transition with the surrounding concrete background. The candidate enhancement sample generation process is organized in rounds. In each round of generation, a reference crack image and its corresponding mask are determined, and a background image and the desired crack mask are selected to form an input combination. After each round of generation is completed, the reference crack image, background image or desired crack mask is replaced to enter the next round of generation, thereby obtaining candidate crack enhancement samples with different crack morphology, texture features and background conditions.

6. The crack detection method for UAV inspection images of rail transit based on generative enhancement as described in claim 1, characterized in that, To address the potential issues of insufficient contrast and unclear targets in generated crack targets, the visibility of the generated crack target is evaluated by calculating the grayscale difference between the crack area and the surrounding background area. Further calculation of the average grayscale change within the desired crack area is used to determine whether the generated crack has sufficient visual response. If the grayscale change in the crack area is too small, it indicates that the generated crack target is not clear, and the sample is classified as a low-quality sample. A neighborhood ring of the desired crack mask is constructed, and the grayscale changes within the crack area and the surrounding background area are compared. When the region contrast index is below a set threshold, it is determined that the crack area is not sufficiently distinguishable from the background, and the sample is classified as an unqualified sample. Crack boundary bands are constructed based on the expected crack mask, and the gradient intensity of the generated image inside and outside the boundary is calculated using the Sobel operator. The gradient ratio is used to evaluate whether the crack boundary is too abrupt.

7. A crack detection system based on generative enhancement of UAV inspection images for rail transit, characterized in that, include: The acquisition module is used to acquire the inspection image to be detected. The processing module is used to process the inspection image to be detected using a pre-trained crack target detection model, and output the location and category information of the crack target. The training of the crack target detection model includes: acquiring multiple real inspection images for data preprocessing to construct a real background image library and a real crack sample library; establishing a crack skeleton model based on the morphological and structural features of the real crack samples, and obtaining desired crack masks with different positions, shapes, and scales through crack skeleton generation, width expansion, and morphological perturbation; using real background images, desired crack masks, reference crack images, and reference crack masks as multi-source conditional inputs to a TF-IDG-based crack image generation model to generate candidate enhancement samples with real background texture and crack features under the constraint of the desired crack mask; evaluating the quality of the generated candidate enhancement samples, and removing samples with unclear crack targets, abnormal boundaries, or unnatural background fusion to obtain the final crack enhancement samples; fusing the crack enhancement samples with real crack training samples to construct an enhanced crack target detection training set, and using the training set to train the crack target detection model.

8. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the crack detection method based on generative enhancement of UAV inspection images for rail transit as described in any one of claims 1-6.

9. A computer device, characterized in that, The method includes a memory and a processor, the processor and the memory communicating with each other, the memory storing program instructions executable by the processor, and the processor calling the program instructions to execute the crack detection method based on generative enhancement of UAV inspection images for rail transit as described in any one of claims 1-6.

10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the crack detection method based on generative enhancement of rail transit UAV inspection images as described in any one of claims 1-6.