A method and device for generating a railway train fault image material

By constructing a real fault material library and a supervised dataset of artificially synthesized images, training a conditional localization model and a redrawing model, and performing multi-level discrimination mechanism verification, the problems of morphological uniformity and distortion in railway train fault image augmentation were solved, and efficient and diversified fault image material generation was achieved.

CN123160718APending Publication Date: 2026-11-24BEIJING JINGTIANWEI TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611494609.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing methods for augmenting railway train fault images are insufficient for efficient retrieval and large-scale synthesis of fault materials. Furthermore, the generated images suffer from morphological distortion and background variation, are not adapted to trackside grayscale imaging modalities, and lack quality verification mechanisms.

Method used

We constructed a searchable library of real-world fault images and a supervised dataset of artificially synthesized images, calibrated the morphological parameter distribution benchmark, trained a conditional localization model and a two-level redrawing model, and performed quality verification through a multi-level serial discrimination mechanism to generate railway train fault image materials.

Benefits of technology

It enables large-scale, diversified, and high-fidelity augmentation of fault image materials, improving the physical authenticity, background consistency, and iterative optimization of the generated results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160718A_ABST
    Figure CN123160718A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for generating railway train fault image materials. By constructing a searchable real fault material library and an artificial image synthesis supervised dataset, and calibrating the morphological parameter distribution benchmark, a conditional localization model and a two-level architecture redrawing model are trained respectively. The real reference anchor is retrieved online according to the target fault parameters, and the redrawing region is output by the localization model. The redrawing model completes local controlled redrawing. Finally, the quality is verified through a multi-level serial discrimination mechanism to generate railway train fault image materials. This method realizes the large-scale, diversified, and high-fidelity augmentation of fault image materials, and improves the physical authenticity, background consistency, and quality iterative optimization of the generated results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of railway train fault image generation technology, and in particular to a method and apparatus for generating railway train fault image materials. Background Technology

[0002] The railway train operation fault trackside image detection system, which acquires grayscale images of the underside and sides of the train using a trackside linear array camera, is a key piece of equipment for ensuring train operation safety. To compensate for the lack of real fault samples, a traditional method of data augmentation through manual image synthesis is commonly used. This involves operators using image processing software to extract fault materials from real images, then merging these materials through localization, overlay, and lighting processing to create a fault-free image. However, this manual fault image synthesis method is hampered by factors such as the limited format and loose organization of the fault material library, as well as the high labor intensity of the synthesis work. It is difficult to achieve efficient retrieval, retrieval, and large-scale synthesis of fault materials based on fault mechanisms and morphological parameters.

[0003] Existing methods for augmenting fault images in automated railway train systems are mainly divided into two categories: fault material augmentation methods based on image processing and overall redrawing methods based on generative models. Fault material augmentation methods based on image processing apply affine transformations such as rotation, translation, scaling, and mirroring to existing fault materials, which makes it difficult to break through the upper bound of the material library's own shape. Augmentation methods based on generative models use variational autoencoders and adversarial networks to perform overall redrawing operations on fault-free images, which makes it difficult to solve problems such as poor local fit, background variation, and fault shape distortion.

[0004] Furthermore, general defect generation methods based on repair or diffusion models typically use a mask provided manually or by a detector as input, redrawing the defect texture within the mask according to text prompts or random sampling. These methods are geared towards general surface texture defects, lacking fine-grained characterization of railway train faults and failing to use real-world fault materials as morphological anchors. Simultaneously, general diffusion models are more suited to processing natural color images, lacking stable surface texture and lighting modeling capabilities for industrial components in linear grayscale imaging modes. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a method and apparatus for generating railway train fault image materials. By constructing a searchable real fault material library and a supervised dataset for artificial image synthesis, and calibrating the morphological parameter distribution benchmark, a conditional localization model and a two-level architecture redrawing model are trained respectively. The real reference anchor is retrieved online according to the target fault parameters, and the redrawing area is output by the localization model. The redrawing model completes the local controlled redrawing. Finally, the quality is verified through a multi-level serial discrimination mechanism to generate railway train fault image materials. This solves the problems in the field of railway fault image sample amplification, such as the scarcity and monotonous morphological real samples of low-frequency rare faults, the high labor intensity and difficulty in scaling up manual synthesis, the distortion of fault morphology and background variation in automated whole-image redrawing, and the lack of adaptation of general generation methods to trackside grayscale imaging modality and quality verification mechanism. It realizes the large-scale, diversified, and high-fidelity amplification of fault image materials, and improves the physical authenticity, background consistency and quality iterative optimization of the generated results.

[0006] This application provides a method for generating railway train malfunction image materials, the method comprising: Based on the acquired set of railway train passing images collected by railway trackside linear array cameras, a searchable real fault material library and an artificial image synthesis supervision dataset are constructed respectively. Based on the real fault material library, the morphological parameter distribution benchmark threshold is calibrated. The preset conditional localization model and redrawing model are trained using the real fault material library and the artificial image synthesis supervised dataset, respectively, to obtain the trained target conditional localization model and target redrawing model. In response to the acquisition of the input target fault type, target morphological parameters and normal component region of interest image to be processed, a reference anchor is retrieved from the real fault material library based on the target fault type and the target morphological parameters, and the normal component region of interest image, the target fault type and the morphological reference conditions encoded by the reference anchor are input into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model; The normal component region of interest image, the redrawing area mask, and the morphological reference conditions are input into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model. Based on the morphological parameter distribution benchmark threshold, the candidate redrawing results are quality-judged using a preset multi-level serial discrimination mechanism, and the quality-judged result is qualified railway train fault image material.

[0007] Furthermore, the real-world fault material library is constructed through the following steps: Multiple fault material blocks are extracted from the real fault images in the railway train passing image set, and each fault material block is marked with a corresponding fault mask. Each fault material block is labeled with a fault type tag, a vehicle model tag, and a semantic morphology tag; wherein, the dimensions of the semantic morphology tag include at least morphology category, damage level, brightness, and contrast. Based on the fault material block and its corresponding fault mask, fault type label, vehicle model label and semantic morphology label, an index is established according to the fault type label and the semantic morphology label to construct a searchable real fault material library; wherein, the real fault material library also stores the normal image interest region of the same vehicle model and the same component corresponding to each fault material.

[0008] Furthermore, the artificial image synthesis supervised dataset includes localization mask data, redrawing reference data, and morphological label data; the artificial image synthesis supervised dataset is constructed through the following steps: Using a preset fault mechanism, the normal component region of interest images in the railway train passing image set are used to synthesize artificial fault images according to the fault type to be amplified. The location area covered by the operation when synthesizing the fault, the real fault morphology information on which the synthesis is based, and the fault type and morphological feature information of the synthesized fault are determined respectively. The positioning area is determined as the positioning mask data, the actual fault morphology information is determined as the redrawing reference data, and the fault type and morphological feature information are determined as the morphological label data.

[0009] Furthermore, the step of calibrating the morphological parameter distribution benchmark threshold based on the real fault material library includes: For each fault material in the real fault material library, feature statistics are performed on the fault mask area and local background ring, and geometric scale features, brightness domain features, internal contrast features and edge transition features are determined respectively to generate morphological parameter distribution. Based on the morphological parameter distribution, a baseline threshold for the morphological parameter distribution is determined; wherein the morphological parameter distribution is expressed in the form of a histogram or a multidimensional Gaussian fit.

[0010] Furthermore, the conditional localization model is trained through the following steps: The visual features of the normal component region of interest images in the real fault material library, the category vector corresponding to the fault type to be amplified, and the encoding features corresponding to the preset morphological reference training conditions are concatenated, and the concatenation result is determined as the model input result of the conditional localization model. The conditional localization model is trained using the model input results to obtain the trained target conditional localization model. The localization mask data is used as training supervision, and the conditional localization model is trained using a joint loss function of Dice loss and binary cross-entropy loss, so that the conditional localization model learns the prior mapping from normal component structure to fault location.

[0011] Furthermore, the redrawing model includes a two-level concatenated morphology and structure generation model and a deterministic domain transfer rendering model; the target redrawing model includes a two-level concatenated target morphology and structure generation model and a target deterministic domain transfer rendering model; the redrawing model is trained through the following steps: For the aforementioned morphology and structure generation model, a pre-trained diffusion generation model adapted to grayscale single-channel imaging modality is used as the backbone network. The cross-sample pairing between real fault images in the real fault material library and corresponding normal images of the same model and the same component is used as the main training source. The appearance of the fault in the fault mask area corresponding to each fault material in the real fault material library is used as the redrawing supervision and reference condition. The fault mask region of the artificially synthesized faulty image in the artificial image synthesis supervision dataset and the corresponding pixel-level aligned pair of the same region of the fault-free base image are used as supplementary training sources; wherein, the training weight of the main training source is higher than that of the supplementary training source. The morphology and structure generation model is trained using the main training source, the supplementary training source, and the redrawing supervision and reference conditions. Based on the redrawing reference data and the morphology label data, a dual-source hybrid supervision method is used to perform efficient low-rank fine-tuning of parameters to obtain the target morphology and structure generation model. The target morphology and structure generation model is used to output the illumination-normalized relative structure field and fine-grained redrawing mask. For the deterministic domain migration rendering model, the interior of the fault mask area is filled with the real material of the target domain, the structural details of the target material are modulated with the relative structure field, and the local lighting direction of the target domain is estimated. Correspondingly, directional shadows and cross-sectional highlights are applied to complete the natural fusion rendering of the fault mask area and the base map. Among them, the rendering parameters are optimized and verified by the local brightness of the target domain to obtain the target deterministic domain migration rendering model.

[0012] Furthermore, based on the target fault type and the target morphological parameters, a reference anchor is retrieved from the real fault material library, and the normal component region of interest image, the target fault type, and the morphological reference conditions encoded corresponding to the reference anchor are input into the target conditional localization model to obtain a redrawing area mask output by the target conditional localization model, including: Based on the target fault type, filter out the corresponding category of fault materials from the real fault material library; Using the semantic morphological tags corresponding to the target morphological parameters as the query, the matching similarity of the semantic morphological tags is determined, and the matching similarity is sorted in descending order. The fault materials in the descending sort results with a preset number of preceding items are selected as reference anchors. The reference anchors are encoded using a preset image encoder to obtain morphological reference conditions; wherein, when there are multiple reference anchors, the mean or weighted mean of the image encoding features of each reference anchor is aggregated to form the morphological reference conditions. The normal component region of interest image, the target fault type, and the morphological reference conditions are input into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model.

[0013] Furthermore, the step of inputting the normal component region of interest image, the redrawing region mask, and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model includes: The normal component region of interest image, the redrawing area mask and the morphological reference conditions are input into the target morphology and structure generation model to obtain the relative structure field and fine-grained redrawing mask output by the target morphology and structure generation model after illumination normalization. The relative structure field and the fine-grained redraw mask are input into the target deterministic domain transfer rendering model to generate an initial redraw image. A fidelity constraint is applied to the pixels outside the fine-grained redraw mask so that the gray-level difference between the corresponding pixels in the region outside the fine-grained redraw mask of the initial redraw image and the region of interest image of the normal component does not exceed a preset gray-level difference threshold, so as to obtain the candidate redraw result output by the target deterministic domain transfer rendering model.

[0014] Furthermore, before inputting the normal component region of interest image, the redrawn area mask, and the morphological reference conditions into the target morphology and structure generation model, the method further includes: When the target fault type is a preset fault type, the in-situ erasure area and the faulty component landing area in the normal component interest area image are determined; The normal components in the in-situ erasure area are erased, and the background, obscured structures, or cavities in the in-situ erasure area are filled in. The faulty component is generated by redrawing within the faulty component landing area corresponding to the redrawing area mask.

[0015] Furthermore, the multi-level serial discrimination mechanism includes a physical rule layer, a structural consistency layer, and a perception verification layer connected in series; the step of using the preset multi-level serial discrimination mechanism to perform quality discrimination on the candidate redrawing results based on the morphological parameter distribution benchmark threshold, and obtaining qualified railway train fault image material by the quality discrimination result, includes: The physical rule layer is used to extract the morphological parameters from the candidate redrawing results, and the morphological parameters are verified to see if they meet the morphological parameter distribution benchmark threshold to obtain the first verification result. The continuity of the inner and outer edges of the fine-grained redraw mask, the rationality of the apparent recess depth, and the pixel fidelity of the area outside the mask in the candidate redraw results are verified using the structure consistency layer to obtain the second verification result. Using the visual language model configured in the perception verification layer after fine-tuning the grayscale image within the domain, it is determined whether the candidate redrawing result is consistent with the actual performance of the target fault type, and a third verification result is obtained. If any of the first verification result, the second verification result, and the third verification result is unqualified, the quality judgment result of the candidate redrawing result is determined to be unqualified, and the candidate redrawing result with the unqualified quality judgment result is processed using a preset processing method; When the first verification result, the second verification result, and the third verification result are all passed, the quality judgment result of the candidate redrawing result is determined to be qualified; According to a preset ratio, the candidate redrawing results that pass the quality judgment are randomly selected for inspection, and after passing the inspection, the candidate redrawing results are output as railway train fault image materials.

[0016] This application embodiment also provides an apparatus for generating railway train fault image materials, the apparatus comprising: The material and supervision construction module is used to construct a searchable real fault material library and an artificial image synthesis supervision dataset based on the acquired railway train passing image set collected by the railway trackside linear array camera, and to calibrate the morphological parameter distribution benchmark threshold based on the real fault material library. The model training module is used to train the preset conditional localization model and redrawing model using the real fault material library and the artificial image synthesis supervision dataset, respectively, to obtain the trained target conditional localization model and target redrawing model. The first generation module is used to respond to the acquisition of the input target fault type, target morphological parameters and normal component region of interest image to be processed, and to retrieve reference anchors from the real fault material library based on the target fault type and the target morphological parameters, and to input the normal component region of interest image, the target fault type and the morphological reference conditions encoded by the reference anchors into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model; The second generation module is used to input the normal component interest region image, the redrawing region mask and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model; The quality verification module is used to perform quality judgment on the candidate redrawing results based on the morphological parameter distribution benchmark threshold and using a preset multi-level serial discrimination mechanism, so as to obtain qualified railway train fault image material as the result of the quality judgment.

[0017] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the method for generating railway train fault image materials as described above are performed.

[0018] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method for generating railway train fault image materials as described above.

[0019] The method and apparatus for generating railway train fault image materials provided in this application include: based on an acquired set of railway train passing images collected by a railway trackside linear array camera, constructing a searchable real fault material library and an artificial image synthesis supervision dataset, and calibrating a morphological parameter distribution baseline threshold based on the real fault material library; training a preset conditional localization model and a redrawing model using the real fault material library and the artificial image synthesis supervision dataset, respectively, to obtain a trained target conditional localization model and a target redrawing model; and responding to the acquisition of the input target fault type, target morphological parameters, and the normal component region of interest image to be processed, based on the target fault type... Based on the type and the target morphological parameters, a reference anchor is retrieved from the real fault material library. The normal component region of interest image, the target fault type, and the morphological reference conditions encoded by the reference anchor are input into the target conditional localization model to obtain a redrawing area mask output by the target conditional localization model. The normal component region of interest image, the redrawing area mask, and the morphological reference conditions are input into the target redrawing model to obtain candidate redrawing results output by the target redrawing model. Based on the morphological parameter distribution benchmark threshold, a preset multi-level serial discrimination mechanism is used to perform quality discrimination on the candidate redrawing results to obtain qualified railway train fault image material.

[0020] Compared with existing automated railway train fault image augmentation methods, this new method constructs a searchable library of real fault materials and a supervised dataset of artificially synthesized images, calibrates the morphological parameter distribution benchmark, trains a conditional localization model and a two-level architecture redrawing model, retrieves real reference anchors online based on target fault parameters, outputs the redrawing region by the localization model, performs localized controlled redrawing by the redrawing model, and finally performs quality verification through a multi-level serial discrimination mechanism to generate railway train fault image materials. This method solves the problems in the field of existing railway fault image sample augmentation, such as the scarcity and monotonous morphological real samples of low-frequency rare faults, the high labor intensity and difficulty in scaling up manual synthesis, the distortion of fault morphology and background variation in automated whole-image redrawing, and the lack of adaptation of general generation methods to trackside grayscale imaging modalities and quality verification mechanisms. It achieves large-scale, diversified, and high-fidelity augmentation of fault image materials, and improves the physical authenticity, background consistency, and iterative optimization of the quality of the generated results.

[0021] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a method for generating railway train fault image materials provided in an embodiment of this application; Figure 2 A schematic diagram illustrating sample pairing for artificial image synthesis provided in an embodiment of this application; Figure 3 A schematic diagram of a supervised dataset for artificial image synthesis provided in an embodiment of this application; Figure 4 This is a schematic diagram of a redrawing area mask and redrawing result provided in an embodiment of this application; Figure 5 This is a schematic diagram of the output of a target redrawing model provided in an embodiment of this application; Figure 6 A schematic diagram of the structure of a device for generating railway train fault image material provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0025] The railway train operation fault trackside image detection system, which acquires grayscale images of the train's underside and sides using a trackside linear array camera, is a key piece of equipment for ensuring train operation safety. Deep learning-based fault recognition models rely on large-scale training samples with sufficient morphological coverage. However, in actual operation, for some low-frequency, rare, or subtle faults, there are problems such as a scarcity of real fault images and a lack of diversity in fault morphology, making it difficult to meet the needs of model training and validation. To compensate for the lack of real fault samples, the traditional approach is to use manual image synthesis for data augmentation. This involves operators using image processing software to extract fault materials from real images, and then merging these materials through localization, overlay, and lighting processing to synthesize a fault-free image.

[0026] Research has revealed that artificial fault image synthesis methods are hampered by factors such as the limited morphology and loose organization of the fault material library, as well as the high labor intensity of the synthesis operation. These limitations make it difficult to achieve efficient retrieval, retrieval, and large-scale synthesis of fault materials based on fault mechanisms and morphological parameters. Existing automated fault image augmentation methods for railway trains are mainly divided into image processing-based fault material augmentation methods and generative model-based overall redrawing methods. Image processing-based methods apply affine transformations such as rotation, translation, scaling, and mirroring to existing fault materials, making it difficult to overcome the morphological upper bounds of the material library itself. Generative model-based methods utilize variational autoencoders and adversarial networks to perform overall redrawing operations on fault-free images, but these methods struggle to address issues such as poor local fit, background variations, and fault morphological distortion.

[0027] Furthermore, general defect generation methods based on repair or diffusion models typically use a mask provided manually or by a detector as input, redrawing the defect texture within the mask according to text prompts or random sampling. These methods are geared towards general surface texture defects, lacking fine-grained characterization of railway train faults and failing to use real-world fault materials as morphological anchors. Simultaneously, general diffusion models are more suited to processing natural color images, lacking stable surface texture and lighting modeling capabilities for industrial components in linear grayscale imaging modes.

[0028] For the problem of augmenting railway train fault images, existing methods have failed to comprehensively utilize the advantages of human prior knowledge, real fault materials, and generative models. Therefore, a material generation method is needed that injects human prior knowledge offline into the model, redraws the fault morphology with real fault materials as constraints, and uses online multi-layer discrimination and manual sampling to ensure correctness. This method can achieve large-scale and diversified generation of fault materials while ensuring the correctness of the generated fault materials.

[0029] Based on this, this application provides a method for generating railway train fault image materials. By constructing a searchable real fault material library and a supervised dataset for artificial image synthesis, and calibrating the morphological parameter distribution benchmark, a conditional localization model and a two-level architecture redrawing model are trained respectively. The real reference anchor is retrieved online according to the target fault parameters, and the redrawing area is output by the localization model. The redrawing model completes local controlled redrawing. Finally, the quality is verified through a multi-level serial discrimination mechanism to generate railway train fault image materials. This method solves the problems in the field of railway fault image sample amplification, such as the scarcity and monotonous morphological real samples of low-frequency rare faults, the high labor intensity and difficulty in scaling up manual synthesis, the distortion of fault morphology and background variation in automated whole-image redrawing, and the lack of quality verification mechanism for general generation methods that are not adapted to the trackside grayscale imaging modality. It realizes the large-scale, diversified, and high-fidelity amplification of fault image materials, and improves the physical authenticity, background consistency, and iterative optimization of the quality of the generated results.

[0030] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for generating railway train malfunction image materials provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for generating railway train fault image materials specifically involves a method for generating railway train fault image materials that integrates fault simulation completed with image processing software and local controlled redrawing. This method can be applied to the scenario of expanding training samples for deep learning fault recognition models in railway train trackside image detection systems. The generation method includes: S101. Based on the acquired set of railway train passing images collected by the railway trackside linear array camera, a searchable real fault material library and an artificial image synthesis supervision dataset are constructed respectively, and the morphological parameter distribution benchmark threshold is determined based on the real fault material library.

[0031] Here, the railway train passing image set is a collection of grayscale images of the underside and sides of the train captured by the railway trackside line array camera when the train passes by, including but not limited to real fault images and normal images without faults. It is the original data source for building the material library and training the model.

[0032] In this embodiment, the real fault material library is a searchable database formed by extracting fault material blocks from real fault images, labeling them with corresponding masks and attribute tags, and establishing a structured index according to the tags. It stores real train fault image samples and their classification, morphology, model and other attribute information.

[0033] The artificial image synthesis supervision dataset is a collection of supervision data naturally generated by operators using image processing software to artificially synthesize faults in normal component areas. It includes localization mask data, redrawing reference data, and morphological label data. No additional manual annotation is required, and it can be directly used as a supervision signal for model training.

[0034] The location mask data is a binary mask data corresponding to the area covered by the operation when the fault is artificially synthesized, which is used to supervise the localization model to learn the prior mapping from the normal component structure to the fault location; the redrawing reference data is the real fault morphology image data on which the fault is based when it is artificially synthesized, which is used to supervise the redrawing model to learn the morphological structure and texture features of the fault; the morphological label data is a set of discrete labels that provide a structured description of the fault type and morphological features of the artificially synthesized fault, which can be used as a conditional supervision signal injected into the model training process, and can also be used as a retrieval and query basis for the real fault material library.

[0035] Here, the morphological parameter distribution benchmark threshold is the probability distribution law obtained by statistically analyzing various morphological features of the real fault material library. It serves as a quantitative benchmark for quality verification and is used to judge the physical rationality of the generated results. It is usually expressed in the form of histogram or multidimensional Gaussian fitting.

[0036] In this embodiment of the application, this step is the offline data preparation stage of the method described in this embodiment of the application. The input is a set of railway train passing images collected by the railway trackside linear array camera. The image set is grayscale single-channel mode and includes two types of raw data: real fault images of the train undercarriage and side and normal images without faults.

[0037] In this step, real fault images are selected from the collection of railway train passing images. Fault material blocks containing complete fault morphology are manually extracted according to fault category. At the same time, the fault mask corresponding to the fault area is marked for each fault material block. Each fault material block is labeled with fault type label, vehicle type label and semantic morphology label, and the material attributes are described from three dimensions: classification, attribution and morphological features. Finally, a structured retrieval index is established according to fault type label and semantic morphology label to form a material database that can be quickly retrieved according to fault mechanism and morphological parameters.

[0038] Furthermore, for the target fault type to be amplified, operators use image processing software to perform manual fault synthesis (i.e., PS fault simulation) on the image of the region of interest of normal components. During the synthesis process, three types of supervision data are naturally generated without additional manual annotation: the area covered by the synthesis operation is the localization mask data, the real fault morphology on which the synthesis is based is the redrawing reference data, and the type and morphological features of the synthesized fault are the morphological label data. The three types of data are stored in pairs to form a supervision dataset for model training.

[0039] Here, the artificial image synthesis process does not require additional standardized pixel-level annotations; training supervision is naturally generated during the data augmentation process.

[0040] Furthermore, for the fault mask area and surrounding local background ring of all fault materials in the real fault material library, four types of continuous morphological features are extracted: geometric scale, brightness domain, internal contrast, and edge transition. Statistical distribution fitting is performed on each type of feature to generate a morphological parameter distribution. This distribution is used as the quantitative benchmark for subsequent quality verification, namely the morphological parameter distribution benchmark threshold. The distribution form is expressed by histogram or multidimensional Gaussian fitting.

[0041] This addresses the problems of fragmented and disorganized real-world fault samples, high costs of training and supervision data annotation, and lack of objective quantitative basis for quality verification in existing technologies. It transforms scattered field data and artificially synthesized experience into standardized, reusable, and searchable data assets and quantitative benchmarks, providing a complete data foundation and judgment basis for subsequent model training and online quality verification.

[0042] Here, this step achieves structured management of real fault samples, supports millisecond-level retrieval by fault type and morphological features; realizes the natural generation of training supervision data without the need for additional pixel-level precise annotation, and the supervision data is completely consistent with the artificial synthesis logic; establishes a quantitative verification benchmark based on real sample statistics, replacing the traditional purely subjective manual judgment, and greatly improving the consistency and repeatability of quality verification.

[0043] In one possible implementation of this application, the step of constructing the real fault material library in step S101 may include: S1011. Extract multiple fault material blocks from the real fault images in the railway train passing image set and mark the corresponding fault mask for each fault material block.

[0044] Here, the fault material block is a local image block extracted from a real fault image that contains the complete fault shape, and is the basic unit constituting the real fault material library; the fault mask is a binary image corresponding to the fault material block and used to mark the range of the fault area. The white area represents the fault pixels and the black area represents the background pixels, which is used to accurately define the pixel range of the fault area.

[0045] In this step, multiple fault material blocks are manually extracted from real fault images in the railway train passing image set according to the fault type to ensure that each fault material block contains the complete fault form; at the same time, a corresponding fault mask is marked for each fault material block. The marking can use a thick frame or a thick mask, without the need for pixel-level precision.

[0046] S1012. Label each of the fault material blocks with a fault type label, a vehicle model label, and a semantic morphology label.

[0047] Among them, semantic morphological tags are a set of discrete tags set according to the fault mechanism to describe the morphological characteristics of the fault. The dimensions of the semantic morphological tags include at least morphological category, degree of damage, brightness and contrast, and are used as conditional inputs for material retrieval and conditional generation.

[0048] In this step, each fault material block is labeled with three types of tags: Fault Type Tag: identifies the type of fault, such as axle damage, loose bolts, or detached parts; Train Model Tag: identifies the train model to which the fault belongs, such as CR200J1-D; Semantic Morphology Tag: is set according to the fault mechanism, and the dimensions include at least morphology category, degree of damage, brightness, and contrast; different fault types can use corresponding effective distinguishing dimensions, for example, surface damage faults can add an edge transition dimension, and detachment faults can add a detachment distance dimension.

[0049] S1013. Based on the fault material block and its corresponding fault mask, vehicle model label and semantic morphology label, an index is established according to the fault type label and the semantic morphology label to construct a searchable real fault material library.

[0050] The real fault material library also stores the normal image region of interest for the same model and component corresponding to each fault material.

[0051] In this step, based on the fault material block and the fault mask and vehicle model label corresponding to each fault material block, a structured index is established according to the fault type label and the semantic morphological label; optionally, morphological feature vectors can be additionally recorded as auxiliary retrieval fields other than labels, and finally a searchable real fault material library is constructed.

[0052] For example, regarding axle damage faults of the CR200J EMU, 120 material blocks containing faults such as axle dents, peeling, and cracks were extracted from grayscale images of the train passing through the trackside line array camera. Each material block was approximately 80×100 pixels in size. A binary fault mask was marked for each material block. The fault type was labeled as "axle damage", the train model was labeled as "CR200J1-D", and the semantic morphological tags included: morphological category (dent-like missing parts, peeling, edge cracking), damage degree (slight, moderate, severe), brightness (dark interior, bright interior), and contrast (low, medium, high). An index was created according to "fault type and semantic morphological tags" and stored in a real fault material library.

[0053] In one possible implementation of this application, the step of constructing the artificial image synthesis supervision dataset in step S101 may include: S1014. Using a preset fault mechanism, the normal component region of interest images in the railway train passing image set are used to synthesize artificial fault images according to the fault type to be amplified, and the positioning area covered by the operation when synthesizing the fault, the real fault morphology information on which the synthesis is based, and the fault type and morphological feature information of the synthesized fault are determined respectively.

[0054] In this step, for the fault type to be amplified, the operator uses image processing software to synthesize artificial fault images from the normal component region of interest images in the railway train passing image set according to the preset fault mechanism, that is, PS fault simulation.

[0055] S1015. The positioning area is determined as the positioning mask data, the actual fault morphology information is determined as the redrawing reference data, and the fault type and morphological feature information are determined as the morphological label data.

[0056] In this step, the location area covered by the operation when synthesizing the fault is determined, and the location area is identified as the location mask data, which serves as the location supervision for the subsequent conditional location model; the real fault morphology information on which the synthesis is based is determined, and the real fault morphology information is identified as the redrawing reference data, which serves as the reference condition and redrawing supervision for the subsequent redrawing model; the fault type and morphological feature information of the synthesized fault are determined, and the fault type and morphological feature information are identified as the morphological label data, encoded as a morphological parameter vector, which serves as the conditional supervision for the subsequent two models.

[0057] In this way, the experience of manually synthesizing PS faults is transformed into standardized training and supervision data, eliminating the need for additional pixel-level annotation and significantly reducing the annotation cost of training data. At the same time, the prior knowledge of manual localization and synthesis is injected into the model. This achieves "zero additional cost" output of training and supervision data, and the supervision data is completely consistent with the manual synthesis logic, ensuring that the model learns mature experience from manual synthesis.

[0058] For example, for shaft breakage faults, 500 grayscale images of normal shaft ROIs are selected, and the operators composite the real fault material into the reasonable position of the normal shaft. During the compositing process, the selected compositing area is automatically saved as positioning mask data, the original fault material used is saved as redrawing reference data, and the morphological features of the synthesized fault are recorded as morphological label data. The three types of data are stored in pairs to form an artificial image compositing supervision dataset.

[0059] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating sample pairing for an example of artificial image synthesis provided in an embodiment of this application. Figure 2As shown, the left side is the base map of the ROI of a normal component. This image is a region of interest (ROI) image of a normal component extracted from a grayscale image of a faultless train passing by a railway trackside linear array camera. In this example, the target component is the train axle body component. The orange dashed box in the image is the boundary range of the ROI, which defines the area of ​​action for fault synthesis and subsequent model redrawing. This image is the base map for artificial fault synthesis and also the benchmark input for subsequent model training and online inference.

[0060] like Figure 2 As shown, the right side is a PS fault simulation diagram. This diagram is a manual fault image synthesized by the operator using image processing software (i.e., PS fault simulation). Based on the normal component ROI base map on the left, the result image of the fault is artificially synthesized according to the preset fault mechanism. In this example, the synthesized fault is a shaft breakage type, specifically a pitted peeling defect on the upper part of the shaft, which belongs to the surface damage type of fault.

[0061] For example, please refer to Figure 3 , Figure 3 This is a schematic diagram of a supervised dataset for artificial image synthesis provided in an embodiment of this application. The attribute labels and quantification parameters corresponding to the fault samples include: a basic attribute column containing fault type and vehicle model labels, clearly defining the fault's classification and applicable vehicle model, which is the core dimension of the material library's classification index. A semantic morphological label column (p) contains five discrete dimensions: morphological category, damage degree, brightness, contrast, and shape approximation, corresponding to semantic morphological labels, used for material library retrieval matching and model training conditional input, realizing the discrete description and conditional control of fault morphology. The quantified morphological parameter column contains the quantified statistical values ​​of the fault morphology, including mask area ratio, average grayscale difference inside and outside the mask, average edge gradient magnitude, and mask circumscribed rectangle size, corresponding to statistically calibrated morphological features; statistical fitting of these parameters across all materials yields the morphological parameter distribution baseline threshold, serving as the quantification basis for quality verification.

[0062] like Figure 3As shown in the diagram, the left image is the original grayscale image of the fault sample. A pitted peeling defect with edge cracking exists on the upper part of the shaft, serving as the original carrier of the fault morphology and the benchmark image for subsequent mask annotation, label definition, and parameter extraction. The middle image is the localization mask. The thick orange outline in the image represents the localization mask, a coarse-grained region covering the core fault area. It does not require pixel-level precision but only defines the approximate location of the fault. Its function is to serve as a training supervision signal for the conditional localization model, guiding the model to learn the prior mapping relationship between "normal component structure and high-incidence fault location." The right image is the redrawing reference. The red closed outline in the image represents the boundary of the fault area, i.e., the redrawing reference. This outline depicts the morphological details of the fault, including the shape of the pit and the characteristics of edge cracking. Its function is to serve as the redrawing supervision and morphological reference for the redrawing model, anchoring the generated fault's true morphological structure and ensuring the physical authenticity of the generated result.

[0063] In one possible implementation of this application, in specific implementation, the step of calibrating the morphological parameter distribution benchmark threshold based on the real fault material library in step S101 may include: S1016. Perform feature statistics on the fault mask area and local background ring corresponding to each fault material in the real fault material library, and determine the geometric scale features, brightness domain features, internal contrast features and edge transition features respectively to generate morphological parameter distribution.

[0064] In this step, multi-dimensional feature statistics are performed on the fault mask area and local background ring corresponding to each fault material in the real fault material library to determine the geometric scale features (mask area, outer rectangle size, aspect ratio, etc.), brightness domain features (internal average gray level, gray level range, etc.), internal contrast features (internal maximum gray level difference, average gradient, etc.) and edge transition features (edge ​​gradient magnitude, transition band width, etc.).

[0065] S1017. Based on the morphological parameter distribution, the baseline threshold for the morphological parameter distribution is determined.

[0066] The morphological parameter distribution benchmark threshold is expressed in the form of a histogram or a multidimensional Gaussian fitting.

[0067] In this step, the distribution of various morphological parameters obtained from statistics is fitted to generate a morphological parameter distribution; based on the morphological parameter distribution, the baseline threshold of the morphological parameter distribution is determined.

[0068] Here, the morphological parameter distribution benchmark threshold is expressed in the form of histogram or multidimensional Gaussian fitting. The subsequent physical rule layer verification uses the morphological parameters of the synthesized result falling within the mean ± 3 times the standard deviation of the benchmark distribution as the qualification criterion.

[0069] In this way, establishing a quantitative statistical benchmark for real-world fault patterns provides an objective and executable physical rule basis for subsequent online quality verification, avoiding the generation of fault patterns that violate physical laws. Quantifying the morphological patterns of real-world faults into a calculable distribution benchmark enables quantitative verification of generation quality, rather than relying solely on subjective judgment.

[0070] For example, for shaft breakage fault materials in the real fault material library, the area ratio, internal average gray level difference, and edge average gradient magnitude of all fault masks are statistically analyzed. Gaussian fitting is performed on the mask area ratio, and the mean is 0.4% with a standard deviation of 0.15%. Gaussian fitting is performed on the internal average gray level difference, and the mean is -16 (internal darker) with a standard deviation of 5. The above distribution is used as the baseline threshold for the morphological parameter distribution. During the subsequent physical rule layer verification, the parameters are considered qualified if they fall within the range of mean ± 3σ.

[0071] S102. Using the real fault material library and the artificial image synthesis supervision dataset, the preset conditional localization model and redrawing model are trained respectively to obtain the trained target conditional localization model and target redrawing model.

[0072] Here, the conditional localization model takes normal component images, fault types, and morphological reference conditions as inputs and outputs a deep learning model of a coarse mask for the fault redrawing area. Its core function is to predict the reasonable location of the fault, without needing to output pixel-level accurate fault morphology. The target conditional localization model is the conditional localization model that has been trained and can be directly used for online inference, outputting a coarse-grained redrawing area mask.

[0073] The redrawing model is a deep learning model used to generate high-fidelity fault images within a specified area. It adopts a two-level cascaded structure of "morphological structure generation and domain transfer rendering", which are responsible for fault morphology generation and imaging adaptation, respectively. The target redrawing model is the redrawing model that has been trained and can be directly used for online inference to generate candidate redrawing results.

[0074] In this embodiment, the conditional localization model is a condition-driven semantic segmentation model. Its core function is to predict the reasonable region where a fault occurs based on the input normal component image, fault type, and morphological reference conditions, and output a coarse-grained redrawing area mask. The model does not need to learn pixel-level fault morphology, but only needs to learn the prior mapping between "normal component structure and high-incidence fault location". Therefore, the model structure is lightweight and the inference speed is fast. The model input includes three parts: visual features of the normal component ROI image, category embedding vector corresponding to the fault type, and encoded features corresponding to the morphological reference conditions; the three parts of features are concatenated and fed into the decoder to output the redrawing area mask.

[0075] The redrawing model employs a two-level cascaded architecture, comprising a first-level morphology and structure generation model and a second-level deterministic domain migration rendering model. This two-level architecture decouples "fault morphology and structure generation" from "imaging adaptation rendering": the first level focuses on generating physically accurate fault morphology and structures, outputting a relative structure field independent of lighting; the second level focuses on adapting to the materials and lighting of the target scene, rendering the structure field as a realistic grayscale fault image. This design ensures both the diversity and realism of the morphology, as well as the close fit between the imaging effect and the target scene.

[0076] Here, this step is the offline model training stage. The input is a real fault material library and a supervised dataset of artificially synthesized images. A decoupled architecture is adopted, in which two models are trained independently and do not share the backbone network, to complete the training of fault localization capability and fault generation capability respectively.

[0077] In this step, the conditional localization model is trained: the conditional localization model is a condition-driven semantic segmentation model, and the input consists of three parts: visual features of normal component images, fault type category vectors, and morphological reference conditional encoding features. During training, the localization mask data in the artificial image synthesis supervision dataset is used as the supervision ground value, and the model parameters are iteratively optimized using a joint loss function of Dice loss and binary cross-entropy loss, so that the model learns the prior mapping relationship between "normal component structure and high-incidence fault location". After training, a target conditional localization model that can be directly used for inference is obtained.

[0078] Furthermore, the first-level morphology and structure generation model uses a pre-trained diffusion generation model adapted to a single grayscale channel as its backbone and employs dual-source hybrid supervised training: the main training source is cross-sample pairing of real fault images and normal images of the same model and component, with a higher weighting to ensure the physical authenticity of the generated morphology; the supplementary training source is pixel-level alignment pairing of artificially synthesized fault images to supplement the adaptability of the synthesis logic; the training method is parameter-efficient low-rank fine-tuning, which only requires updating a small number of parameters to complete domain adaptation. After training, the target morphology and structure generation model is obtained, which can output a light-normalized relative structure field and a fine-grained redraw mask.

[0079] Furthermore, the second-level deterministic domain transfer rendering model is built based on physically based rendering rules and adapted through parameter tuning. The core logic is to fill the fault area with real materials from the target domain, modulate the material structure details with relative structure fields, and apply shadows and highlights to match the lighting direction of the target domain. After parameter tuning, the target deterministic domain transfer rendering model is obtained.

[0080] In this embodiment of the application, the core purpose of this step is to compile the localization experience of manual PS fault synthesis and the morphological features of real faults into the model weights, transform the implicit knowledge of manual operation into the automation capability of the model, and solve the problems of inaccurate localization, morphological distortion and lighting incompatibility of existing generated models through a two-level architecture of "decoupling localization and redrawing, and decoupling morphology and imaging", so as to provide a deployable, high-fidelity automated model for online generation.

[0081] In this way, the localization model can automatically predict the fault area with a high recall rate, eliminating the need for online manual selection and achieving high generation efficiency. The two-level redrawing architecture achieves a balance between morphological realism and imaging adaptability, with the physical realism of the generated faults being far higher than that of the whole-image redrawing model, and its adaptability to industrial grayscale images is significantly better than that of the general color diffusion model. The low-rank fine-tuning technology reduces the number of model training parameters, has low computing power requirements, and the trained model can be deployed and run entirely on local edge devices without relying on cloud computing power.

[0082] In one possible implementation of this application, the step of training the conditional localization model in step S102 may include: S1021. The visual features of the normal component region of interest image in the real fault material library, the category vector corresponding to the fault type to be amplified, and the encoding features corresponding to the preset morphological reference training conditions are concatenated, and the concatenation result is determined as the model input result of the conditional localization model.

[0083] In this step, the images of normal component regions of interest from the real fault material library are input into the feature extractor to obtain visual features; the fault type to be amplified is mapped into a category vector through an embedding layer; the preset morphological reference training conditions are encoded into coded features through an image encoder; the three types of features are concatenated, and the concatenation result is determined as the model input result of the conditional localization model.

[0084] S1022. The conditional localization model is trained using the model input results to obtain the trained target conditional localization model.

[0085] The location mask data is used as training supervision, and the conditional location model is trained using a joint loss function of Dice loss and binary cross-entropy loss, so that the conditional location model learns the prior mapping from normal component structure to fault location.

[0086] In this step, the conditional localization model is trained using the model input results. During the training process, the localization mask data is used as training supervision, and the training loss is calculated using a joint loss function of Dice loss and binary cross-entropy loss. The model parameters are iteratively optimized through backpropagation so that the conditional localization model learns the prior mapping from the normal component structure to the fault location. After training, the target conditional localization model is obtained.

[0087] In this embodiment, the formula for the loss function is: .

[0088] in, To locate the true value of the mask, For the model-predicted redraw area mask, The training loss for the conditional localization model. This is the Dice loss value. This represents the binary cross-entropy loss value.

[0089] In this way, the localization experience gained from manual fault synthesis is transformed into model capabilities, enabling automatic prediction of fault areas without the need for online manual selection of fault locations. The localization accuracy is high, and the output coarse mask can completely cover the core fault area; the model is lightweight, with fast inference speed, meeting the efficiency requirements for online batch generation.

[0090] For example, the U-Net structure was selected as the backbone of the conditional localization model, and injection channels for class embedding and morphological reference features were added to the encoder part; 400 sets of samples from the artificial image synthesis supervision dataset were used as the training set and 100 sets as the validation set; the training batch size was set to 8, the initial learning rate was set to 1e-4, the Adam optimizer was used, and the training was carried out for 50 rounds; after training, the model achieved a recall rate of 98.2% for the redrawn region mask on the validation set, which can completely cover the core fault region.

[0091] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram of a redrawing area mask and redrawing result provided in an embodiment of this application. Figure 4 It intuitively demonstrates the complete output process of "normal base map input, fault area location, and local redrawing generation" in the online inference stage, reflecting the core design concept of "decoupling of location and redrawing, and local controlled generation".

[0092] like Figure 4As shown in the diagram, the left image represents the Region of Interest (ROI) of the normal image. The area defined by the blue outline is the normal component ROI, which is the grayscale image of the normal shaft to be processed. This is the input base image for the online generation process. This area contains the complete shaft component without faults. All subsequent fault localization and redrawing operations are limited to this area to ensure the correspondence between the generated scene and the target component. The middle image shows the redrawing area mask. The thick red circular area in the image is the redrawing area mask. This mask is a rough range covering the core fault occurrence area and does not require pixel-level precision. It is only used to define the boundary of subsequent redrawing operations. It is automatically predicted and generated by the conditional localization model based on the input normal ROI image, the target fault type, and morphological reference conditions, replacing the traditional manual selection of fault locations. The right image shows the redrawing result. The defect within the red outline is the final generated fault image, i.e., the candidate redrawing result. The fault is generated within the mask of the redrawing area, accurately presenting the morphological details and lighting features of the pitted damage on the shaft. The edge transition is natural and highly consistent with the material and lighting of the base image. At the same time, the shaft area outside the mask of the redrawing area is completely consistent with the original normal ROI image, reflecting the technical features of local controlled redrawing and pixel fidelity outside the mask.

[0093] In one possible implementation of this application, the step of training the redrawing model in step S102 may include: S1023. For the morphology and structure generation model, a pre-trained diffusion generation model adapted to grayscale single-channel imaging mode is used as the backbone network. The cross-sample pairing between real fault images in the real fault material library and the corresponding normal images of the same model and the same part is used as the main training source. The appearance of the fault in the fault mask area corresponding to each fault material in the real fault material library is used as the redrawing supervision and reference condition.

[0094] S1024. The fault mask region of the artificially synthesized fault image in the artificial image synthesis supervision dataset and the corresponding fault-free base image of the same region are aligned and paired at the same pixel level as supplementary training sources; wherein, the training weight of the main training source is higher than that of the supplementary training source.

[0095] In this step, a pre-trained diffusion generation model adapted to the grayscale single-channel imaging modality is used as the backbone network. An instruction editing model based on a diffusion transformer or a repair model based on a diffusion model can be selected, and local deployment is supported.

[0096] Furthermore, two types of training data are set up: a primary training source and a supplementary training source, with the primary training source having a higher weight than the supplementary training source. The primary training source uses cross-sample pairings between real fault images from the real fault material library and corresponding normal images of the same model and component. The fault appearance within the fault mask area corresponding to each fault material in the real fault material library is used as the supervision and reference condition for redrawing. The primary training source does not require pixel-level alignment, and differences in cross-sample imaging conditions can be suppressed through subsequent illumination normalization. The supplementary training source uses pixel-level alignment pairings between the fault mask areas of artificially synthesized fault images and the corresponding fault-free base images from the artificial image synthesis supervision dataset.

[0097] S1025. The morphology and structure generation model is trained using the main training source, the supplementary training source, and the redrawing supervision and reference conditions. Based on the redrawing reference data and the morphology label data, the parameters are efficiently tuned in a low-rank manner using a dual-source hybrid supervision method to obtain the target morphology and structure generation model.

[0098] The target morphology and structure generation model is used to output the relative structure field normalized by illumination and the fine-grained redraw mask.

[0099] In this step, based on the redrawing reference data and the morphological label data, a dual-source hybrid supervision method is used to perform efficient low-rank fine-tuning of the parameters of the pre-trained backbone model. The rank value range of the low-rank fine-tuning is preferably 8 to 16, which controls the amount of training parameters while ensuring the adaptation effect.

[0100] Furthermore, after training, the target morphology and structure generation model is obtained, and its output is a relative structure field normalized to illumination and a fine-grained redraw mask. The relative structure field carries morphological details such as fractures, depressions, and bright fractures, and has approximately invariance to slowly changing illumination, which can suppress interference from source domain imaging conditions.

[0101] In this embodiment, the illumination normalization process is as follows: the training target of the morphology and structure generation model is subjected to illumination normalization to obtain the illumination-normalized training target, as shown in the formula: .

[0102] in, For training images, The local illumination profile is estimated by applying a low-pass filter or local mean estimation to the training image; the illumination normalization ratio is... It can be greater than 1, and after normalization and mapping to [0,1], it is used as the training target value of the structural field S, so that the model learns the structural expression that is insensitive to illumination; during online re-rendering, the relative structural field S is extracted from the normalized model output, and its brightness and illumination are re-rendered by the deterministic domain transfer rendering model according to the local illumination of the target domain.

[0103] In this way, using real fault data as the core supervision allows the model to learn realistic fault morphology and structure; at the same time, artificially synthesized samples are used to supplement training, improving the model's adaptability to synthetic logic; low-rank fine-tuning ensures that the model can be deployed and run locally. The generated fault morphologies are anchored to real data, resulting in high physical realism; at the same time, it can generate diverse morphologies of the same type but with different details, breaking through the morphology limit of the static data library.

[0104] For example, a locally deployed repair model based on a diffusion transformer is selected as the backbone, and the input channel is modified to a single channel to adapt to grayscale images. 1000 sets of real fault and normal image cross-sample pairings are selected from a real fault material library as the main training source, with a weight of 0.7. 2000 sets of pixel-level aligned samples are selected from a supervised dataset of artificial image synthesis as supplementary training sources, with a weight of 0.3. The rank of low-rank fine-tuning is set to 12, the training batch size is 4, the initial learning rate is 5e-5, and the training is conducted for 30 rounds. After training, the relative structure field output by the model can clearly present morphological details such as pits, peeling, and cracks, and has good robustness to different lighting conditions.

[0105] S1026. For the deterministic domain migration rendering model, the interior of the fault mask area is filled with the real material of the target domain, the structural details of the target material are modulated with the relative structure field, and the local lighting direction of the target domain is estimated. Directional shadows and cross-sectional highlights are applied accordingly to complete the natural fusion rendering of the fault mask area and the base map.

[0106] Specifically, the rendering parameters are optimized and verified using the local brightness of the target domain to obtain the target deterministic domain migration rendering model.

[0107] In this step, the interior of the fault mask area is filled with the real material of the target domain. The real material can be locally sampled from the ROI area of ​​the normal target component or obtained by retrieving the material of the same component from the material library, so that the texture inside the fault matches the target domain. The structural details of the target material are modulated with the relative structure field to preserve morphological features such as fractures and depressions, while suppressing interference from source domain imaging and lighting conditions.

[0108] In this embodiment, the formulas for material filling and structural modulation are as follows: .

[0109] in, To achieve the true material brightness of the target component's surface. ∈(0,1) is the brightness domain correction coefficient, which makes the brightness domain inside the fault consistent with the brightness domain of the local surface of the target. ∈[0,1] and ≤T, the upper limit T is dynamically set according to the target domain brightness, and the part exceeding it is truncated at the pixel level to avoid pixel overflow after multiplication; Brightness is modulated by material filling and structural adjustment.

[0110] Furthermore, the local illumination direction of the target domain is estimated, and a linear fit is performed on the mean brightness profile of the target region, with the highlight side of the profile as the illumination direction. Directional shading and section highlights are applied according to the illumination direction, and the synthesis formula is as follows: .

[0111] in, The apparent concavity of the fault area is obtained by normalizing the relative local background darkening degree expressed by the relative structure field S through the maximum and minimum values. It expresses the relative concavity of the fault area. The darkness of the deeper concavity has been encoded by the relative structure field. The shadow term supplements the directional illumination gradient in the shallower concavity area. Let S be the gradient projection of the relative structure field S along the illumination direction. Let be the angular distance attenuation function of the cross-sectional pixels relative to the illumination direction. Let be the angle between the pixel normal of the cross section and the illumination direction l. , The intensity coefficients for shadows and highlights are preferably constrained to the (0,1) range to avoid overexposure or underexposure in the composite result. The composite result is saturated and truncated to be constrained to the effective grayscale range. For synthesized brightness, Brightness is modulated by material filling and structural adjustment.

[0112] Furthermore, the final synthesized result is constrained to the effective grayscale range by saturation truncation. The rendering parameters are then optimized and verified based on the local brightness of the target domain to obtain the target deterministic domain transfer rendering model.

[0113] In this way, the relative structure field, which is independent of lighting, is rendered into a realistic fault image that fits the material and lighting of the target scene, ensuring a natural integration of the generated fault with the base map. The fault texture is completely consistent with the material of the target part, and the lighting direction and intensity match the base map without any sense of incongruity; the rendering based on physical rules has high determinism and will not exhibit the random distortions common in generated models.

[0114] For example, for a broken switch body, the metal texture is sampled from the fault-free area of ​​the normal switch body ROI; the brightness domain correction coefficient k is set to 0.7, and the brightness upper limit T is set to 1.2; the estimated image lighting direction is incident from the upper left, and the shadow intensity coefficient β is set to 0.3 and the specular intensity coefficient γ is set to 0.4; after rendering, the metal texture of the faulty area is consistent with that of the normal switch body, the shadow and specular direction are matched, and the edge transition is natural.

[0115] S103. In response to acquiring the input target fault type, target morphological parameters, and normal component region of interest image to be processed, a reference anchor is retrieved from the real fault material library based on the target fault type and the target morphological parameters, and the normal component region of interest image, the target fault type, and the morphological reference conditions encoded by the reference anchor are input into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model.

[0116] Here, the target fault type is a user-specified fault category to be generated, such as shaft damage, bolt detachment, spring breakage, etc. The target morphological parameters are user-specified quantitative parameters used to describe the morphological characteristics of the target fault, obtained from semantic morphological labels, and used to retrieve matching real-world materials. The normal component region of interest image is a local image of the target component containing the fault to be generated, cropped from a normal vehicle image. It serves as the base map for fault generation; redrawing is performed only within a specified area of ​​this region, and is referred to as the normal component ROI image.

[0117] In this embodiment, the reference anchor is a real fault image retrieved from the real fault image library that most closely resembles the target fault shape. It serves as a morphological reference benchmark for redrawing, ensuring the physical realism of the generated fault. The morphological reference condition is a feature vector obtained by encoding the reference anchor using an image encoder, or conditional information directly converted from morphological description text. It guides the generation model to generate faults of the corresponding shape. The redrawing region mask is a coarse-grained region mask output by the target conditional localization model, covering the core fault area. It defines the scope of the redrawing model without requiring pixel-level precision.

[0118] In this step, firstly, based on the input target fault type, all fault materials of the corresponding category are filtered out from the real fault material library; then, using the semantic morphological tags corresponding to the target morphological parameters as queries, the tag matching similarity is calculated by dimension weighting, and after sorting the similarity in descending order, the top N real fault materials are selected as reference anchors. The target morphological parameters are only used for retrieval and matching, and are not directly used as hard constraints for model generation, but are indirectly guided by the reference anchors to generate the morphology.

[0119] Furthermore, the retrieved reference anchors are input into the image encoder for feature encoding to obtain morphological reference conditions. If there are multiple reference anchors, the mean or weighted mean of the encoded features of each reference anchor is taken as the aggregated morphological reference conditions. The normal component region of interest image to be processed, the encoded vector of the target fault type, and the morphological reference conditions are jointly input into the trained target conditional localization model. The model outputs a coarse-grained redrawing area mask covering the core fault area. This mask is only used to define the approximate range of redrawing and does not require pixel-level precision. The boundary can be fine-tuned later according to physical rules.

[0120] Here, the core purpose of this step is to automatically match the most similar real fault sample as the morphological anchor point according to the business generation requirements, and at the same time automatically predict the reasonable area where the fault occurs, so as to define the scope of action for subsequent local redrawing; using real materials as anchor points avoids physical distortion generated out of thin air from the source, and uses automatic positioning to replace manual selection to improve the efficiency of online generation.

[0121] In this way, the generated fault patterns always use real fault samples as physical anchors, which avoids the problem of general generation models fabricating fault patterns out of thin air, and greatly improves the rationality of the patterns. The fault area is automatically located, and the location of a single image takes less time, much faster than manual selection, and the location position conforms to the physical laws of component failure. The morphological parameters are only used for retrieval and do not directly control the design of the generation, which not only ensures the authenticity of the generated baseline, but also retains the diversity space of the model generation, and avoids excessive constraints that cause the generated results to completely duplicate the source material.

[0122] In one possible implementation of this application, step S103 may include: S1031. Based on the target fault type, filter out the corresponding category of fault materials from the real fault material library.

[0123] S1032. Using the semantic morphological tag corresponding to the target morphological parameter as the query, determine the matching similarity of the semantic morphological tag, sort the matching similarity in descending order, and select the fault material in the descending sort result with the previous preset number as the reference anchor.

[0124] In this step, the semantic morphological tag corresponding to the target morphological parameter is used as the query to determine the matching similarity of the semantic morphological tag. The matching similarity is sorted in descending order, and the fault material with a preset number of N items in the descending sort result is selected as the reference anchor.

[0125] In this embodiment of the application, the formula for calculating matching similarity is: .

[0126] in, A higher value indicates a higher degree of matching. For query With materials Matching similarity; A query consisting of semantic morphological labels corresponding to the target morphological parameters. and The first and second parts of the query and materials are respectively A semantic morphological label, The weights are assigned to the corresponding distinguishing dimensions.

[0127] Here, the target morphological parameter p is only used for retrieval and query, and the morphological parameter distribution d is only used for statistical calibration and verification benchmark. It indirectly guides the target conditional localization model and the target redrawing model through the morphological reference conditions of the reference anchor code, and is not used as the precise condition for the target conditional localization model to predict the redrawing area mask.

[0128] S1033. Encode the reference anchor using a preset image encoder to obtain morphological reference conditions.

[0129] When there are multiple reference anchors, the mean or weighted mean of the image coding features of each reference anchor is aggregated to form the morphological reference condition.

[0130] Alternatively, the morphological description text corresponding to the semantic morphological label can be used directly as the morphological reference condition.

[0131] S1034. Input the normal component region of interest image, the target fault type, and the morphological reference conditions into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model.

[0132] Here, the output redraw area mask can be morphologically expanded to form a transition zone, or the mask boundary can be finely adjusted according to physical rules such as component outlines before being sent to the next step.

[0133] It should be noted that the target morphological parameters are only used to retrieve reference anchors and indirectly guide model generation through the reference anchors. They are not directly used as precise control conditions for model input to avoid excessive constraints that lead to insufficient generation diversity.

[0134] In this way, the most similar real-world fault sample is matched as the morphological anchor point based on business needs, automatically delineating the approximate area where the fault is generated, providing range constraints for subsequent local redrawing. The generated morphology uses real-world materials as anchor points, avoiding physical distortion caused by generating it out of thin air; the fault area is automatically located, eliminating the need for manual selection and improving online generation efficiency.

[0135] For example, the business requirement is to generate a moderate-severity pitting-like spalling fault on the axle of a CR200J EMU. The semantic labels corresponding to the target morphological parameters are: morphological category is pitting-like spalling, damage level is moderate, brightness is darker inside, and contrast is high. In the real fault material library, axle damage materials are filtered, the label matching similarity is calculated, and the top 3 materials with the highest matching degree are selected as reference anchors. The 3 reference anchors are encoded by an image encoder and the feature mean is taken to obtain the morphological reference conditions. The normal axle ROI image, fault type code, and morphological reference conditions are input into the target conditional localization model, and a coarse-grained redrawing area mask is output. The mask position is located in the easily worn area of ​​the axle, which conforms to the physical law of fault occurrence.

[0136] S104. Input the normal component interest region image, the redrawing area mask, and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model.

[0137] Here, the candidate redrawing result is a faulty image generated by the target redrawing model that has not yet undergone quality verification, and it serves as the input for the quality judgment step.

[0138] In this embodiment, this step is the core of online inference and belongs to the "locally controlled redrawing" stage. It generates the fault image within the area defined by the mask in the redrawing region, while strictly ensuring that the area outside the mask is consistent with the original image. Figure 1 To.

[0139] In this step, the normal component region of interest image, the redrawing area mask, and the morphological reference conditions are input into the target morphology and structure generation model. The model generates a relative structure field that has been normalized by illumination within the mask area, and outputs a fine-grained redrawing mask that accurately defines the fault boundary. The relative structure field carries the morphological details of the fault, such as fractures, depressions, and bright fractures, and is not sensitive to changes in illumination and is not affected by the imaging conditions of the source material.

[0140] Furthermore, the relative structure field and fine-grained redraw mask are input into the target deterministic domain transfer rendering model. First, the real material of the target part is sampled to fill the fault area. Then, the relative structure field is used to modulate the material structure details to preserve the morphological details. Finally, the local lighting direction of the target image is estimated, and matching directional shadows and cross-sectional highlights are applied to generate the initial redraw image.

[0141] Furthermore, pixel fidelity constraints are applied to areas outside the fine-grained redraw mask to control the grayscale difference between the corresponding pixels of the redrawn image and the original image to not exceed a preset threshold. The mask edges are then smoothed to obtain the final complete candidate redraw result.

[0142] Optionally, for faults such as displacement, detachment, and breakage, this step also includes a pre-wipe and complete process: first, erase the original position of the normal parts and complete the background and the obscured structure, and then redraw the faulty parts in the landing area to ensure the rationality of the physical logic.

[0143] Here, the core objective of this step is to generate a high-fidelity fault image within a limited local area, based on the form of real materials and conforming to the material and lighting of the target scene, while strictly ensuring that the non-faulty areas are completely consistent with the original image, thus solving the problems of background variation and poor local conformation in existing whole-image redrawing methods.

[0144] In this way, the computational area of ​​local redrawing only occupies a small part of the entire image, improving the inference speed compared to full image redrawing and significantly reducing computational power consumption; the mask-outside fidelity constraint makes the difference between non-faulty background areas and the original image small, imperceptible to the human eye, and the background consistency is far superior to the full image generation scheme; the two-level rendering architecture takes into account both morphological diversity and imaging realism, and the generated faults not only retain the physical characteristics of real faults, but also produce detailed variations different from the original materials, breaking through the morphological upper limit of the static material library.

[0145] In one possible implementation of this application, step S104 may include: S1041. Input the normal component region of interest image, the redrawing area mask, and the morphological reference conditions into the target morphology and structure generation model to obtain the illumination-normalized relative structure field and fine-grained redrawing mask output by the target morphology and structure generation model.

[0146] Here, the relative structure field is a feature map characterizing the relative brightness and gradient structure inside the fault, processed by illumination normalization. It carries morphological details such as fractures, depressions, and bright fractures, and has approximately invariance to slowly changing illumination, thus suppressing interference from source domain imaging conditions. The fine-grained redraw mask is a binary mask output by the morphology and structure generation model that precisely defines the boundaries of fault pixels. It is used to control the precise range of redrawing and ensure the fidelity of pixels outside the mask.

[0147] In this step, the normal component region of interest image, the redrawing area mask, and the morphological reference conditions are input into the target morphology and structure generation model to obtain the illumination-normalized relative structure field and fine-grained redrawing mask output by the target morphology and structure generation model; the output results are geometrically registered with the redrawing area mask, and the registration is completed by centroid alignment and scale normalization with the outer rectangle of the redrawing area mask as the reference.

[0148] S1042. Input the relative structure field and the fine-grained redraw mask into the target deterministic domain migration rendering model to generate an initial redraw image.

[0149] In this step, the relative structure field and the fine-grained redraw mask are input into the target deterministic domain migration rendering model, and material filling, structure modulation and lighting rendering are performed to generate the initial redraw image.

[0150] S1043. Apply a fidelity constraint to the pixels outside the fine-grained redraw mask, so that the gray-level difference between the corresponding pixels of the initial redraw image in the region outside the fine-grained redraw mask and the normal component region of interest image does not exceed a preset gray-level difference threshold, so as to obtain the candidate redraw result output by the target deterministic domain transfer rendering model.

[0151] In this step, a fidelity constraint is applied to pixels outside the fine-grained redraw mask to ensure that the grayscale difference between the corresponding pixels in the region outside the fine-grained redraw mask of the initial redrawn image and the region of interest image of the normal component does not exceed a preset grayscale difference threshold; the edge of the fine-grained redraw mask is smoothly connected to the base image via a transition band to ensure that the non-faulty structure and the original image are seamlessly integrated. Figure 1 The grayscale difference threshold is preferably 8 grayscale levels. Finally, candidate redrawing results are obtained from the target redrawing model.

[0152] In this way, within a limited local area, a fault image is generated that uses real materials as shape anchors and conforms to the material and lighting of the target scene, while strictly maintaining the relationship between the non-faulty areas and the original image. Figure 1 The results are as follows: local redrawing requires less computation and has a faster inference speed; the mask-outside fidelity constraint ensures zero background modification, avoiding the background variation problem of full-image redrawing; the generated fault modes are diverse and physically realistic.

[0153] For example, the normal shaft ROI image, the redrawing area mask, and the morphological reference conditions are input into the target morphology and structure generation model, and the output is a relative structure field and a fine-grained redrawing mask. The relative structure field clearly presents the morphology of medium-sized pit peeling, with dark interior and bright fracture at the lower edge. It is then input into the target deterministic domain transfer rendering model, filled with the shaft metal material, and shadows and highlights are added according to the upper left lighting direction. The gray-level difference threshold outside the mask is set to 8, and fidelity constraints are applied to the pixels outside the mask. The final generated candidate redrawing result shows that the fault morphology is realistic and blends naturally with the base image. The difference between the non-faulty area and the original image is less than 3 gray levels, which is difficult for the human eye to distinguish.

[0154] For example, please refer to Figure 5 , Figure 5 This is a schematic diagram of the output of a target redrawing model provided in an embodiment of this application. Figure 5 The two-level serial architecture of the redrawn model and the output effects of each level are intuitively demonstrated. The core of the model embodies the technical concept of "decoupling of morphological structure generation and imaging rendering", which is the core design to ensure the realism of fault morphology and scene adaptability.

[0155] like Figure 5As shown, the upper part represents the target morphology and structure generation model's redrawn fault material blocks and relative structural field. This part corresponds to the output effect of the morphology and structure generation model. The target morphology and structure generation model outputs a lighting-normalized relative structural field and the technical features of a fine-grained redraw mask. The figure shows three sets of shaft damage fault examples with different morphologies. Each set corresponds to a fault material block generated by the first-level model: it includes both precise damage edge contours (i.e., fine-grained redraw mask boundaries) and detailed structural features such as internal concave textures, bright edge fractures, and peeling debris. The output is a lighting-normalized relative structural field, retaining only the essential morphological and structural information of the fault, stripping away the imaging attributes such as lighting and material of the source material. It has approximately invariance to slowly changing lighting, suppressing interference from source domain imaging conditions, and ensuring the universality and physical realism of the fault morphology.

[0156] like Figure 5 As shown in the figure, the lower half represents the target deterministic domain transfer rendering model, specifically the domain transfer rendering. This section corresponds to the output effect of the target deterministic domain transfer rendering model, highlighting the technical features of the model in achieving natural fusion rendering of the fault area and the base map. The figure illustrates three different vehicle models, lighting conditions, and installation scenarios for axle components, showcasing the final effect of rendering the unified structural field output from the first level onto the corresponding target base map. The second-level model, through realistic material filling in the target domain, relative structural field texture modulation, and shadow and section highlight rendering matching the target lighting direction, ensures that the generated fault perfectly matches the material texture, lighting intensity, and environmental background of the target component, resulting in natural edge transitions and no compositing inconsistencies. The three examples correspond to different axle application scenarios, verifying the adaptability of the second-level domain transfer rendering to different industrial grayscale imaging scenarios.

[0157] In one possible implementation of this application, before step S104, the generation method further includes: S10401. When the target fault type is a preset fault type, determine the in-situ erasure area and the faulty component landing area in the normal component interest area image.

[0158] In this embodiment of the application, the preset fault type can be set as displacement, detachment, or breakage faults.

[0159] In this step, when the target fault type is a preset displacement, detachment, or breakage fault, the in-situ erasure area and the faulty component landing area in the normal component interest area image are determined; the in-situ erasure area is the currently visible in-situ area of ​​the normal component, and the redraw area mask corresponds to the faulty component landing area, that is, the area where the faulty component is located after it leaves its original position.

[0160] S10402. Erase the normal components in the in-situ erasure area and complete the background, obscured structures or cavities in the in-situ erasure area.

[0161] In this step, normal components in the in-situ erasure area are erased, and the background, occluded structures, or cavities within the in-situ erasure area are filled in. Erasure and filling can be performed by a locally deployable repair model, an instruction editing model, or a large receptive field repair network. When it is necessary to fill in occluded structures or large cavities, a repair model or instruction editing model is preferred. When the erasure area is a narrow strip or computing power is limited, a large receptive field repair network can be selected. When the background of the erasure area is complex and the erasure and filling are difficult, manual repair can be used as a fallback solution.

[0162] S10403. Perform redrawing to generate faulty components within the faulty component landing area corresponding to the redrawing area mask.

[0163] In this step, redrawing is performed within the faulty component landing area corresponding to the redrawing area mask to generate the faulty component; the connection area mask is output by the target shape and structure generation model within the landing area, which is a sub-region on the boundary of the landing area that is connected to the base map support or connection structure, and the physical connection between the redrawing result and the base map structure is constrained by the contact connection loss, which is the continuity penalty of the pixels at the junction of the connection area boundary and the base map support structure.

[0164] This approach supports the generation of faults such as displacement, detachment, and breakage, ensuring the physical and logical rationality of these faults and expanding the range of applicable fault types. The erasure and completion effects are natural, and the redrawn faulty components in the landing area are reasonably connected to the supporting structure, conforming to physical laws; this can be completed automatically without manual processing frame by frame.

[0165] For example, for a bolt detachment fault, the original installation position of the bolt is first determined as the in-situ erasure area, and the detachment area is the bracket surface below the bolt. The original bolt is erased using a repair model, and the mounting hole and bracket background that are obscured by the bolt are filled in. The detached bolt is redrawn in the detachment area, and shadows and contact compression effects are added to the contact area between the bolt and the bracket surface. The continuity of the connection edge is ensured through the loss of contact connection. The final generated bolt detachment fault image has natural in-situ erasure marks, and the position and posture of the detached bolt conform to the law of gravity, with no obvious difference from the real fault image.

[0166] S105. Based on the morphological parameter distribution benchmark threshold, the candidate redrawing results are quality-judged using a preset multi-level serial discrimination mechanism, and the quality-judgment result is qualified railway train fault image material.

[0167] In this embodiment, the multi-level serial discrimination mechanism is a quality verification system composed of a physical rule layer, a structural consistency layer, and a perception verification layer connected in series. If any layer fails, it is judged as unqualified, thus ensuring the quality of the generated results from multiple dimensions.

[0168] Here, this step is the quality verification and output stage, which adopts a three-level serial discrimination mechanism. If any level fails, it is judged as unqualified. The quality is guaranteed layer by layer from three dimensions: physical rules, structural logic, and semantic perception.

[0169] In this step, morphological parameters such as geometric scale, brightness domain, contrast, and edge transition of the candidate redrawing results are extracted. It is verified whether these parameters fall within the mean ± 3σ range of the calibrated morphological parameter distribution baseline threshold; otherwise, they are deemed unqualified. The continuity of the inner and outer edges of the fine-grained redrawing mask, the reasonableness of the depth of the fault appearance depression, and whether the pixel fidelity of the area outside the mask meets the threshold requirements are also verified; otherwise, they are deemed unqualified. A visual language model fine-tuned using railway grayscale fault samples is used to semantically determine whether the fault morphology of the candidate results matches the true representation of the target fault type; otherwise, they are deemed unqualified.

[0170] Furthermore, samples that pass all three layers of verification are deemed qualified, and a portion of these samples are randomly selected for manual inspection according to a preset ratio. Samples that pass the inspection are used as the final railway train fault image material for output. Samples that fail any layer of verification are deemed unqualified, and are handled in three ways depending on the type of unqualified sample: resampling, manual correction, or reinjection into the offline training set as difficult examples, thus forming a quality optimization closed loop.

[0171] Here, the core purpose of this step is to establish a multi-level quality safety net mechanism to filter out generated results that do not conform to physical laws, structural logic, and visual realism, ensuring that the quality of the output materials can meet the requirements of deep learning model training; at the same time, through the refeeding mechanism of unqualified samples, a closed loop of "generation, verification, and optimization" is formed to continuously iterate and improve the model performance.

[0172] In this way, the three-level serial verification achieves multi-dimensional quality control, with a low rate of erroneous samples and stable and reliable output material quality, which can be directly used for fault identification model training; automated verification replaces most of the manual quality inspection work, improving quality inspection efficiency, and only requires a small amount of manual spot checks as a backup; the difficult example refeeding mechanism enables the model to have continuous evolution capabilities, and as the amount of generated data accumulates, the model generation effect will continue to be optimized, forming a positive cycle.

[0173] In one possible implementation of this application, step S105 may include: S1051. Extract the morphological parameters from the candidate redrawing results using the physical rule layer, verify whether the morphological parameters meet the morphological parameter distribution benchmark threshold, and obtain the first verification result.

[0174] Here, the physical rule layer is the first checkpoint of the three-level verification. It belongs to pure quantitative statistical verification, which uses the statistical patterns of real fault modes calibrated offline as the sole basis for judgment. There is no subjective judgment, the calculation speed is fast, and it can be executed automatically in batches.

[0175] In this step, for the candidate redrawing results to be verified, four types of morphological parameters that are completely consistent with the offline calibration dimensions are extracted: geometric scale parameters, including the pixel area of ​​the fine-grained redrawing mask, the height and width of the bounding rectangle, the aspect ratio, and the proportion of the fault area to the component ROI; brightness domain parameters, including the average gray level inside the fault area, the gray level range, and the average gray level difference between the fault area and the surrounding background; internal contrast parameters, including the maximum gray level difference inside the fault area, the average gradient of internal pixels, and the proportion of bright breaks; and edge transition parameters, including the average gradient magnitude of the fault edge and the pixel width of the edge transition zone.

[0176] Furthermore, each extracted morphological parameter is compared one by one with the morphological parameter distribution benchmark threshold to verify whether the parameter falls within the range of ±3 standard deviations of the benchmark distribution mean. This criterion is based on the statistical 3σ principle: 99.73% of real fault samples under a normal distribution fall within this interval; exceeding this range indicates that the fault does not conform to the physical and statistical laws of real faults. If all dimensional parameters fall within the ±3σ interval, the first verification result is "passed"; if any parameter exceeds the interval range, the first verification result is "failed".

[0177] For example, for shaft breakage faults, the offline calibrated mask area ratio benchmark is a mean of 0.4% and a standard deviation of 0.15%, corresponding to a ±3σ range of 0% to 0.85%. If the fault area ratio of a candidate redraw result is 1.2%, exceeding the upper limit of the range, the physical rule layer will directly determine it as unqualified.

[0178] S1052. Using the structure consistency layer, verify the continuity of the inner and outer edges of the fine-grained redraw mask, the rationality of the apparent recess depth, and the pixel fidelity of the area outside the mask in the candidate redraw results to obtain the second verification result.

[0179] Here, the structural consistency layer is the second checkpoint of the three-level verification. It belongs to the local structural logic verification and focuses on three dimensions: the integration of faults with the base map, the structural rationality of the fault itself, and the fidelity of non-fault areas. It makes up for the structural logic problems that pure quantitative verification cannot cover.

[0180] In this step, the transition between faulty pixels and background pixels at the boundary of the fine-grained redraw mask is checked to ensure continuity and naturalness. By calculating the gray-level gradient change rate and transition band width of neighboring pixels on both sides of the edge, it is determined whether there are harsh splicing marks, pixel breaks, or abnormally jagged edges, ensuring a smooth connection between the faulty edge and the background image. Based on the brightness gradient of the candidate redraw results, the apparent depth of the fault is calculated, and the ratio of depth to fault area is verified to conform to the physical logic of this type of fault. For example, the depth of surface peeling faults will not exceed the component wall thickness range, and there will be no situation of "small area but extremely large depth" that violates the physical structure. The gray-level difference between pixels in the area outside the fine-grained redraw mask and the corresponding pixels in the original normal component region of interest image is calculated, and it is verified whether the difference does not exceed the preset gray-level difference threshold (preferably 8 gray levels) to ensure that non-faulty areas are not accidentally modified by the model and to ensure the consistency between the background and the original image.

[0181] Furthermore, if all three checks are satisfied, the second check result of "pass" will be output; if any one of them is not satisfied, the second check result of "fail" will be output.

[0182] S1053. Using the visual language model configured in the perception verification layer after fine-tuning the grayscale image within the domain, determine whether the candidate redrawing result is consistent with the true performance of the target fault type, and obtain the third verification result.

[0183] Here, the perception verification layer is the third checkpoint in the three-level verification. It belongs to the high-level semantic visual verification, which simulates the overall judgment ability of human quality inspection and identifies the rationality of fault modes that cannot be covered by the first two layers from the semantic level.

[0184] In this embodiment, the perception verification layer is configured with a visual language model fine-tuned by in-domain grayscale images. This model uses a general visual language model as its backbone and performs domain adaptation fine-tuning using a set of grayscale fault images of railway tracks. It specifically learns the visual characteristics and occurrence logic of various faults of railway trains, rather than a general natural image model.

[0185] In this step, the candidate redrawing results and the corresponding target fault types are input into the model. The model judges from the overall visual semantic level: whether the fault in the image matches the true appearance of the target fault type, whether it conforms to the structural logic and fault occurrence mechanism of the corresponding component, and whether there are any problems such as strange shape, unreasonable location, or failure to conform to the physical common sense of faults. If the model determines that the fault shape matches the true appearance of the target fault type, it outputs a "pass" third verification result; if it determines that they do not match or that there are semantic logic errors, it outputs a "fail" third verification result.

[0186] S1054. When any one of the first verification result, the second verification result, and the third verification result is unqualified, the quality judgment result of the candidate redrawing result is determined to be unqualified, and the candidate redrawing result with the unqualified quality judgment result is processed using a preset processing method.

[0187] In the embodiments of this application, the preset handling methods include, but are not limited to, resampling, manual correction, and reinjection into the offline training set as difficult examples, and the corresponding method can be selected according to the type of non-compliance.

[0188] S1055. When the first verification result, the second verification result, and the third verification result are all passed, the quality judgment result of the candidate redrawing result is determined to be qualified.

[0189] In this embodiment, the three-layer verification is performed sequentially from low to high computational cost and from coarse to fine granularity: the physical rule layer quickly removes obviously distorted samples, the structural consistency layer controls local fusion and fidelity quality, and the perception verification layer safeguards the overall semantic authenticity. This layered design ensures both overall verification efficiency and multi-dimensional quality control; simultaneously, samples failing at different levels can be handled differently: those failing at the physical rule layer are prioritized for resampling, those failing at the structural consistency layer can be manually corrected, and difficult examples failing at the perception verification layer can be fed back into the training set for model iteration, forming a closed loop for quality optimization.

[0190] S1056. Randomly inspect the candidate redrawing results that are qualified according to a preset ratio, and output the candidate redrawing results as railway train fault image materials after the random inspection is qualified.

[0191] In this embodiment of the application, the candidate redrawing results that are qualified according to the quality judgment result are manually inspected according to a preset sampling ratio. The sampling ratio is preferably 10%. After the sampling is qualified, the candidate redrawing results are output as railway train fault image materials.

[0192] This multi-layered quality assurance mechanism filters out generated results that do not conform to physical laws, structural logic, or visual realism. Simultaneously, the return of substandard samples creates a quality loop, continuously iterating and optimizing the model's performance. The generated quality is controllable and verifiable, with a low rate of erroneous samples. The difficult example refeeding mechanism enables continuous model evolution, with generation performance steadily improving as data accumulates.

[0193] For example, the generated 1000 candidate images of shaft damage were subjected to three levels of verification: the physical rule layer verification found that the fault area of ​​12 images exceeded the 3σ range of the baseline distribution and was judged as unqualified; the structural consistency layer verification found that the gray-scale difference outside the mask of 8 images exceeded the 8-level threshold and was judged as unqualified; the perception verification layer found that the fault morphology of 5 images did not conform to the semantic features of shaft damage and was judged as unqualified. A total of 25 unqualified samples were found, of which 15 were resampled, 8 were manually corrected, and 2 were used as difficult examples to feed back into the training set; the remaining 975 qualified samples were sampled at a ratio of 10% for manual inspection, and all of them passed the inspection; finally, 975 qualified fault image materials were output, with a generation pass rate of 97.5%.

[0194] Optionally, in addition to the above-described embodiments, the method described in this application also includes the following optional extended embodiments, which can be selected according to actual scenario requirements: Automatic extraction of real-world fault masks: A small number of manually labeled fault masks are used as supervision to train a few-sample segmentation model or fine-tune a pre-trained large-scale segmentation model. Fault masks are automatically extracted from more real-world fault images to expand the mask library. Automatic extraction uses compact detection boxes as prior constraints to limit the segmentation range, and is corrected by manual sampling. The automatically extracted masks, together with the manually labeled masks, serve as expanded supervision for fine-grained redrawing masks in the morphology and structure generation model. This method can significantly reduce the annotation cost of real-world fault masks and rapidly expand the material library.

[0195] Automatic extraction of faulty material masks: For faulty materials generated by the model or synthesized manually, a fine-grained redraw mask is automatically extracted by combining the difference map between the material and the base image with thresholding and morphological processing, eliminating the need for manual annotation. This method can achieve automated generation of material masks, improving the efficiency of dataset construction.

[0196] A parallel deployment model, primarily based on online manual image synthesis and supplemented by a model, is suitable for scenarios with extremely small sample sizes, such as cold starts. Operators perform online image synthesis to locate and overlay the core fault area. The model only provides assistance with real fault material retrieval, morphological parameterized variants, lighting coordination, and fine-grained redrawing masks and materials for new morphologies. The generated results are manually verified before being stored in the database. This morphological model complements the core large-scale generation model; the former ensures the highest accuracy through online manual work, while the latter achieves large-scale generation through offline example samples, online models, and a closed-loop verification process. Both share the same real fault material library and morphological parameter space.

[0197] The model quality improvement and optimization scheme can further enhance model performance through the following methods: Introduce adversarial training into the training of the morphology and structure generation model, adding a discriminator to apply adversarial loss to the realism of high-frequency details such as metallic highlights, threads, and fractures, as a supplementary quality improvement item to the main loss of the diffusion or editing model, thereby improving detail realism. Employ a conditional generation model to generate redraw area masks under normal component masks and fault type and morphological reference conditions, serving as a data-driven alternative or supplement to the conditional localization model, improving localization flexibility. Perform domain adaptation fine-tuning on the locally deployed diffusion editing model or repair model using normal component samples from the target domain, allowing the model to complete the transfer rendering of complex materials and lighting residuals, serving as a supplement or replacement to deterministic domain transfer rendering, improving the adaptation effect in complex scenes.

[0198] In summary, the method described in this application has the following beneficial technical effects compared to the prior art: The generation quality is controllable and verifiable: the generation model only undertakes controlled local generation tasks, and the correctness of the generation results is guaranteed by offline human prior injection, anchoring of real material form, and online multi-layer discrimination mechanism. Unqualified results can be rejected and can be recycled for optimization, avoiding the inflow of erroneous samples into the training set.

[0199] Diverse forms and physical fidelity: Controlled redrawing is performed using real fault materials as form anchors. The generated faults are similar to the reference anchors in terms of fault mechanism, and their form details can be controlled to change with the form parameters. This avoids physical distortion generated out of thin air and breaks through the diversity limitations of static material libraries.

[0200] Adapted to industrial grayscale imaging scenarios: A two-level redrawing structure is adopted to decouple the morphological structure generation from the imaging rendering. The first level outputs a relative structure field that is independent of the lighting, and the second level adapts the target domain material and lighting. Special adaptation has been made for the track edge linear array grayscale imaging mode. The texture and lighting fit of the generated result is much higher than that of the general generation model.

[0201] It can be mass-produced and has a low deployment threshold: the localization and morphological experience of manual PS fault synthesis is transformed into model priors, and fault samples can be generated in batches online, requiring only a small amount of manual sampling for backup; at the same time, it adopts local redrawing and low-rank fine-tuning technology, the model has a small amount of computation, can be deployed and run locally, and does not need to rely on cloud computing power.

[0202] Comprehensive fault coverage: It not only supports the generation of surface damage faults, but also the generation of displacement, detachment, and breakage faults. The physical logic of such faults is ensured through a pre-wipe and completion mechanism.

[0203] The method for generating railway train fault image materials provided in this application constructs a searchable library of real fault materials and a supervised dataset of artificial image synthesis, and calibrates the morphological parameter distribution benchmark. It trains a conditional localization model and a two-level redrawing model, respectively, retrieves real reference anchors online based on target fault parameters, outputs the redrawing region by the localization model, completes localized controlled redrawing by the redrawing model, and finally performs quality verification through a multi-level serial discrimination mechanism to generate railway train fault image materials. This method solves the problems in the existing field of railway fault image sample amplification, such as the scarcity and uniform morphology of real samples of low-frequency rare faults, the high labor intensity and difficulty in scaling up manual synthesis, the distortion of fault morphology and background variation in automated whole-image redrawing, and the lack of adaptation of general generation methods to trackside grayscale imaging modalities and quality verification mechanisms. It achieves large-scale, diversified, and high-fidelity amplification of fault image materials, improving the physical authenticity, background consistency, and iterative optimization of the generated results.

[0204] Please see Figure 6 , Figure 6 This is a schematic diagram of a device for generating railway train fault image materials according to an embodiment of this application. Figure 6 As shown, the generating apparatus 600 includes: The material and supervision construction module 610 is used to construct a searchable real fault material library and an artificial image synthesis supervision dataset based on the acquired railway train passing image set collected by the railway trackside linear array camera, and to calibrate the morphological parameter distribution benchmark threshold based on the real fault material library. The model training module 620 is used to train the preset conditional localization model and redrawing model respectively using the real fault material library and the artificial image synthesis supervision dataset, so as to obtain the trained target conditional localization model and target redrawing model. The first generation module 630 is used to respond to the acquisition of the input target fault type, target morphological parameters and normal component region of interest image to be processed, and to retrieve the reference anchor in the real fault material library based on the target fault type and the target morphological parameters, and to input the normal component region of interest image, the target fault type and the morphological reference conditions corresponding to the reference anchor into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model; The second generation module 640 is used to input the normal component interest region image, the redrawing region mask and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model; The quality verification module 650 is used to perform quality judgment on the candidate redrawing results based on the morphological parameter distribution benchmark threshold and using a preset multi-level serial discrimination mechanism, so as to obtain qualified railway train fault image material as the result of the quality judgment.

[0205] The railway train fault image material generation device provided in this application embodiment constructs a searchable real fault material library and a supervised dataset for artificial image synthesis, and calibrates the morphological parameter distribution benchmark. It trains a conditional localization model and a two-level architecture redrawing model, respectively. It retrieves real reference anchors online based on target fault parameters and outputs the redrawing area by the localization model. The redrawing model completes local controlled redrawing. Finally, it performs quality verification through a multi-level serial discrimination mechanism to generate railway train fault image materials. This device solves the problems in the existing field of railway fault image sample amplification, such as the scarcity and monotonous morphological real samples of low-frequency rare faults, the high labor intensity and difficulty in scaling up manual synthesis, the distortion of fault morphology and background variation in automated whole-image redrawing, and the lack of quality verification mechanism for general generation methods that are not adapted to trackside grayscale imaging modalities. It realizes the large-scale, diversified, and high-fidelity amplification of fault image materials, and improves the physical authenticity, background consistency, and iterative optimization of the quality of the generated results.

[0206] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 includes a processor 710, a memory 720, and a bus 730.

[0207] The memory 720 stores machine-readable instructions executable by the processor 710. When the electronic device 700 is running, the processor 710 communicates with the memory 720 via the bus 730. When the machine-readable instructions are executed by the processor 710, they can perform the operations described above. Figure 1 The steps of the method for generating railway train fault image materials in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0208] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the method for generating railway train fault image materials in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0209] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0210] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0211] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0212] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0213] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0214] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating image materials of railway train malfunctions, characterized in that, The generation method includes: Based on the acquired set of railway train passing images collected by railway trackside linear array cameras, a searchable real fault material library and an artificial image synthesis supervision dataset are constructed respectively. Based on the real fault material library, the morphological parameter distribution benchmark threshold is calibrated. The preset conditional localization model and redrawing model are trained using the real fault material library and the artificial image synthesis supervised dataset, respectively, to obtain the trained target conditional localization model and target redrawing model. In response to the acquisition of the input target fault type, target morphological parameters and normal component region of interest image to be processed, a reference anchor is retrieved from the real fault material library based on the target fault type and the target morphological parameters, and the normal component region of interest image, the target fault type and the morphological reference conditions encoded by the reference anchor are input into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model; The normal component region of interest image, the redrawing area mask, and the morphological reference conditions are input into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model. Based on the morphological parameter distribution benchmark threshold, the candidate redrawing results are quality-judged using a preset multi-level serial discrimination mechanism, and the quality-judged result is qualified railway train fault image material.

2. The method according to claim 1, characterized in that, The real-world fault material library is constructed using the following steps: Multiple fault material blocks are extracted from the real fault images in the railway train passing image set, and each fault material block is marked with a corresponding fault mask. Each fault material block is labeled with a fault type tag, a vehicle model tag, and a semantic morphology tag; wherein, the dimensions of the semantic morphology tag include at least morphology category, damage level, brightness, and contrast. Based on the fault material block and its corresponding fault mask, fault type label, vehicle model label and semantic morphology label, an index is established according to the fault type label and the semantic morphology label to construct a searchable real fault material library; wherein, the real fault material library also stores the normal image interest region of the same vehicle model and the same component corresponding to each fault material.

3. The method according to claim 1, characterized in that, The artificial image synthesis supervised dataset includes localization mask data, redrawing reference data, and morphological label data; The artificial image synthesis supervised dataset is constructed using the following steps: Using a preset fault mechanism, the normal component region of interest images in the railway train passing image set are used to synthesize artificial fault images according to the fault type to be amplified. The location area covered by the operation when synthesizing the fault, the real fault morphology information on which the synthesis is based, and the fault type and morphological feature information of the synthesized fault are determined respectively. The positioning area is determined as the positioning mask data, the actual fault morphology information is determined as the redrawing reference data, and the fault type and morphological feature information are determined as the morphological label data.

4. The method according to claim 1, characterized in that, The step of calibrating the morphological parameter distribution baseline threshold based on the real fault material library includes: For each fault material in the real fault material library, feature statistics are performed on the fault mask area and local background ring, and geometric scale features, brightness domain features, internal contrast features and edge transition features are determined respectively to generate morphological parameter distribution. Based on the morphological parameter distribution, a baseline threshold for the morphological parameter distribution is determined; wherein the morphological parameter distribution is expressed in the form of a histogram or a multidimensional Gaussian fit.

5. The method according to claim 3, characterized in that, The conditional localization model is trained using the following steps: The visual features of the normal component region of interest images in the real fault material library, the category vector corresponding to the fault type to be amplified, and the encoding features corresponding to the preset morphological reference training conditions are concatenated, and the concatenation result is determined as the model input result of the conditional localization model. The conditional localization model is trained using the model input results to obtain the trained target conditional localization model. The localization mask data is used as training supervision, and the conditional localization model is trained using a joint loss function of Dice loss and binary cross-entropy loss, so that the conditional localization model learns the prior mapping from normal component structure to fault location.

6. The method according to claim 3, characterized in that, The redrawing model includes a two-level cascaded morphology and structure generation model and a deterministic domain migration rendering model; the target redrawing model includes a two-level cascaded target morphology and structure generation model and a target deterministic domain migration rendering model. The redrawing model is trained using the following steps: For the aforementioned morphology and structure generation model, a pre-trained diffusion generation model adapted to grayscale single-channel imaging modality is used as the backbone network. The cross-sample pairing between real fault images in the real fault material library and corresponding normal images of the same model and the same component is used as the main training source. The appearance of the fault in the fault mask area corresponding to each fault material in the real fault material library is used as the redrawing supervision and reference condition. The fault mask region of the artificially synthesized faulty image in the artificial image synthesis supervision dataset and the corresponding pixel-level aligned pair of the same region of the fault-free base image are used as supplementary training sources; wherein, the training weight of the main training source is higher than that of the supplementary training source. The morphology and structure generation model is trained using the main training source, the supplementary training source, and the redrawing supervision and reference conditions. Based on the redrawing reference data and the morphology label data, a dual-source hybrid supervision method is used to perform efficient low-rank fine-tuning of parameters to obtain the target morphology and structure generation model. The target morphology and structure generation model is used to output the illumination-normalized relative structure field and fine-grained redrawing mask. For the deterministic domain migration rendering model, the interior of the fault mask area is filled with the real material of the target domain, the structural details of the target material are modulated with the relative structure field, and the local lighting direction of the target domain is estimated. Correspondingly, directional shadows and cross-sectional highlights are applied to complete the natural fusion rendering of the fault mask area and the base map. Among them, the rendering parameters are optimized and verified by the local brightness of the target domain to obtain the target deterministic domain migration rendering model.

7. The method according to claim 1, characterized in that, Based on the target fault type and the target morphological parameters, a reference anchor is retrieved from the real fault material library. The normal component region of interest image, the target fault type, and the morphological reference conditions encoded by the reference anchor are input into the target conditional localization model to obtain a redrawing area mask output by the target conditional localization model, including: Based on the target fault type, filter out fault materials of the corresponding category from the real fault material library; Using the semantic morphological tags corresponding to the target morphological parameters as the query, the matching similarity of the semantic morphological tags is determined, and the matching similarity is sorted in descending order. The fault materials in the descending sort results with a preset number of preceding items are selected as reference anchors. The reference anchors are encoded using a preset image encoder to obtain morphological reference conditions; wherein, when there are multiple reference anchors, the mean or weighted mean of the image encoding features of each reference anchor is aggregated to form the morphological reference conditions. The normal component region of interest image, the target fault type, and the morphological reference conditions are input into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model.

8. The method according to claim 6, characterized in that, The step of inputting the normal component region of interest image, the redrawing region mask, and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing results output by the target redrawing model includes: The normal component region of interest image, the redrawing area mask and the morphological reference conditions are input into the target morphology and structure generation model to obtain the relative structure field and fine-grained redrawing mask output by the target morphology and structure generation model after illumination normalization. The relative structure field and the fine-grained redraw mask are input into the target deterministic domain migration rendering model to generate an initial redraw image. A fidelity constraint is applied to the pixels outside the fine-grained redraw mask so that the gray-level difference between the corresponding pixels in the region outside the fine-grained redraw mask of the initial redraw image and the region of interest image of the normal component does not exceed a preset gray-level difference threshold, so as to obtain the candidate redraw result output by the target deterministic domain transfer rendering model.

9. The method according to claim 8, characterized in that, Before inputting the normal component region of interest image, the redrawn area mask, and the morphological reference conditions into the target morphology and structure generation model, the method further includes: When the target fault type is a preset fault type, the in-situ erasure area and the faulty component landing area in the normal component interest area image are determined; The normal components in the in-situ erasure area are erased, and the background, obscured structures, or cavities in the in-situ erasure area are filled in. The faulty component is generated by redrawing within the faulty component landing area corresponding to the redrawing area mask.

10. The method according to claim 1, characterized in that, The multi-level serial discrimination mechanism includes a physical rule layer, a structural consistency layer, and a perception verification layer connected in series. The step of using the preset multi-level serial discrimination mechanism to perform quality discrimination on the candidate redrawing results based on the morphological parameter distribution benchmark threshold, and obtaining qualified railway train fault image materials based on the quality discrimination result, includes: The physical rule layer is used to extract the morphological parameters from the candidate redrawing results, and the morphological parameters are verified to see if they meet the morphological parameter distribution benchmark threshold to obtain the first verification result. The continuity of the inner and outer edges of the fine-grained redraw mask, the rationality of the apparent recess depth, and the pixel fidelity of the area outside the mask in the candidate redraw results are verified using the structure consistency layer to obtain the second verification result. Using the visual language model configured in the perception verification layer after fine-tuning the grayscale image within the domain, it is determined whether the candidate redrawing result is consistent with the actual performance of the target fault type, and a third verification result is obtained. If any of the first verification result, the second verification result, and the third verification result is unqualified, the quality judgment result of the candidate redrawing result is determined to be unqualified, and the candidate redrawing result with the unqualified quality judgment result is processed using a preset processing method; When the first verification result, the second verification result, and the third verification result are all passed, the quality judgment result of the candidate redrawing result is determined to be qualified; According to a preset ratio, the candidate redrawing results that pass the quality judgment are randomly selected for inspection, and after passing the inspection, the candidate redrawing results are output as railway train fault image materials.

11. An apparatus for generating image materials of railway train malfunctions, characterized in that, The generating apparatus includes: The material and supervision construction module is used to construct a searchable real fault material library and an artificial image synthesis supervision dataset based on the acquired railway train passing image set collected by the railway trackside linear array camera, and to calibrate the morphological parameter distribution benchmark threshold based on the real fault material library. The model training module is used to train the preset conditional localization model and redrawing model using the real fault material library and the artificial image synthesis supervision dataset, respectively, to obtain the trained target conditional localization model and target redrawing model. The first generation module is used to respond to the acquisition of the input target fault type, target morphological parameters and normal component region of interest image to be processed, and to retrieve reference anchors from the real fault material library based on the target fault type and the target morphological parameters, and to input the normal component region of interest image, the target fault type and the morphological reference conditions encoded by the reference anchor into the target conditional localization model to obtain the redrawing area mask output by the target conditional localization model; The second generation module is used to input the normal component interest region image, the redrawing region mask and the morphological reference conditions into the target redrawing model to obtain the candidate redrawing result output by the target redrawing model; The quality verification module is used to perform quality judgment on the candidate redrawing results based on the morphological parameter distribution benchmark threshold and using a preset multi-level serial discrimination mechanism, so as to obtain qualified railway train fault image material as the result of the quality judgment.

12. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the method for generating railway train fault image material as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for generating railway train fault image material as described in any one of claims 1 to 10.