Defect identification method and device for X-ray image, equipment and storage medium

Through enhancing processing of X-ray images and U-Net deep learning model recognition, combined with ADE algorithm and multi-image annotation tool, the problems of low efficiency and low accuracy of X-ray image defect recognition are solved, and efficient and accurate defect recognition and detailed information are achieved.

CN120339178APending Publication Date: 2025-07-18FEITUO INNOVATION TECHNOLOGY (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510295414.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing X-ray image defect recognition efficiency is low, the recognition accuracy is low, and it is easily affected by component position deviation and production process burrs.

Method used

By acquiring X-ray images and performing image enhancement processing, the defect area is identified using the pre-trained U-Net deep learning model, and the target box is used to identify different defect types. The labeling data set is constructed in combination with the ADE algorithm and multi-image annotation tool for model training.

Benefits of technology

It improves the efficiency and accuracy of X-ray image defect recognition, provides detailed information of defects such as type, location and size, enhances the generalization ability of the model and the consistency of the label, and improves the accuracy and efficiency of the recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339178A_ABST
    Figure CN120339178A_ABST
Patent Text Reader

Abstract

The invention discloses an X-ray image defect identification method and device, equipment and a storage medium. The method comprises the following steps: acquiring an X-ray image; performing image enhancement on the X-ray image to obtain an X-ray enhanced image; an identification model is called to identify the X-ray enhanced image so as to output a target image with a defect segmentation area, the identification model is trained in advance, the defect segmentation area is based on a target frame identifier, and different defect types correspond to different target frame identifiers. According to the scheme, the pre-trained recognition model is imported into the image processing system, and the acquisition and recognition of the X-ray image and the direct output of the result are completed in the system at one time, so that the defect recognition efficiency and accuracy of the X-ray image are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image enhancement, and particularly relates to an X-ray image defect enhancement method, device, equipment and storage medium. Background Art

[0002] X-Ray non-destructive testing (X-Ray Non-Destructive Testing, NDT) is a technology that uses X-rays or gamma rays to detect materials and structures, and is widely used in the industrial field, especially in industries such as aerospace, automotive, construction, and manufacturing. The basic principle of X-Ray non-destructive testing is to utilize the ability of X-rays to penetrate materials. The density and thickness of different materials and structures will affect the absorption and attenuation degree of X-rays. By measuring the intensity of the transmitted X-rays, defects inside the materials, such as cracks, pores, inclusions, etc., can be identified.

[0003] The existing image discrimination scheme for X-Ray non-destructive testing is to discriminate by comparing photos after internal structure imaging. However, the deviation of the position of the parts placed and the burrs generated by the production process will both lead to misjudgment. Usually, the misjudgment rate is relatively high, and it requires operators to confirm again, which greatly affects the defect recognition efficiency. Summary of the Invention

[0004] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide a defect recognition method, device, equipment and storage medium for X-ray images, so as to solve the problems of low defect recognition efficiency and low recognition accuracy in the existing technology for X-ray images.

[0005] According to one aspect of the present application, a defect recognition method for X-ray images is disclosed. The method includes:

[0006] Obtain an X-ray image;

[0007] Perform image enhancement on the X-ray image to obtain an X-ray enhanced image;

[0008] Call a recognition model to recognize the X-ray enhanced image to output a target image with a defect segmentation area. The recognition model is pre-trained, and the defect segmentation area is marked based on a target box, and different defect types correspond to different target box markings.

[0009] In some embodiments, training the recognition model includes:

[0010] Collect multiple initial images;

[0011] Perform enhancement processing on each of the initial images to obtain multiple sample images;

[0012] Label the defect regions in each of the sample images to obtain an annotation dataset including multiple annotated images, where each of the annotated images corresponds to a defect bounding box and a defect mask, the structure of the defect bounding box is determined based on the defect type of the defect region, and the defect mask indicates the defect position and size;

[0013] Input the annotation dataset into a U-Net deep learning model for training, so that the U-Net deep learning model performs first feature extraction by downsampling and second feature extraction by upsampling on each annotated image in the annotation dataset and fuses them to obtain an identification model that outputs the defect prediction results of each annotated image based on a 1×1 convolutional layer.

[0014] In some embodiments, the enhancement processing of each of the initial images to obtain multiple sample images includes:

[0015] Perform enhancement processing on each of the initial images based on the ADE algorithm to obtain multiple sample images, where the enhancement processing includes image rotation, image scaling, image flipping, and image brightness adjustment.

[0016] In some embodiments, the annotation of the defect regions in each of the sample images to obtain an annotation dataset includes:

[0017] Configure multiple image annotation tools, and each image annotation tool is configured with a proprietary annotation box, and each proprietary annotation box corresponds to annotating a defect type;

[0018] Input each of the sample images into the image annotation tools in sequence for annotation to obtain multiple annotated images;

[0019] Construct the annotation dataset based on the annotated images.

[0020] In some embodiments, the U-Net deep learning model performs first feature extraction by downsampling and second feature extraction by upsampling on each annotated image in the annotation dataset and fuses them to obtain an identification model that outputs the defect prediction results of each annotated image based on a 1×1 convolutional layer, including:

[0021] The U-Net deep learning model performs a first feature extraction operation by downsampling on each annotated image in the annotation dataset to obtain the first image feature of each annotated image;

[0022] The U-Net deep learning model performs a second feature extraction operation by upsampling on each annotated image in the annotation dataset to obtain the second image feature of each annotated image;

[0023] The U-Net deep learning model performs data fusion on the first image feature and the second image feature to obtain fused feature data;

[0024] Perform 1×1 convolution processing on the fused feature data to output the defect prediction result of each labeled image.

[0025] In some embodiments, the U-Net deep learning model includes a contracting path. The U-Net deep learning model performs a first feature extraction operation of downsampling on each labeled image in the labeled dataset to obtain the first image feature of each labeled image, including:

[0026] The U-Net deep learning model performs a first feature extraction operation of downsampling on each labeled image in the labeled dataset in the contracting path to obtain the first image feature of each labeled image.

[0027] In some embodiments, the U-Net deep learning model further includes an expanding path. The U-Net deep learning model performs a second feature extraction operation of upsampling on each labeled image in the labeled dataset to obtain the second image feature of each labeled image, including:

[0028] The U-Net deep learning model performs a second feature extraction operation of upsampling on each labeled image in the labeled dataset in the expanding path to obtain the second image feature of each labeled image.

[0029] According to another aspect of the present application, a defect recognition device for X-ray images is also disclosed. The device includes:

[0030] An acquisition module for acquiring X-ray images;

[0031] An enhancement module for performing image enhancement on the X-ray images to obtain X-ray enhanced images;

[0032] A calling module for calling a recognition model to recognize the X-ray enhanced images to output target images with defect segmentation regions. The recognition model is pre-trained, and the defect segmentation regions are identified based on target boxes. Different defect types correspond to different target box identifications.

[0033] According to another aspect of the present application, an electronic device is also disclosed. The electronic device includes a memory and at least one processor. Instructions are stored in the memory; the at least one processor calls the instructions in the memory to enable the electronic device to execute each step of the defect recognition method for X-ray images as described in any one of the above.

[0034] According to another aspect of the present application, a computer-readable storage medium is also disclosed. Instructions are stored on the computer-readable storage medium, and are characterized in that when the instructions are executed by a processor, each step of the method for defect recognition of X-ray images described in any one of the above is implemented.

[0035] The present invention includes but is not limited to the following beneficial effects: (1) By importing a pre-trained recognition model into an image processing system, the acquisition, recognition, and direct output of results of X-ray images are completed in the system at one time, improving the efficiency and accuracy of defect recognition of X-ray images; (2) By performing image enhancement on X-ray images, the contrast of the images can be increased, the clarity of the images can be improved, and defects are more easily recognized; (3) By identifying different types of defects with different target boxes, the types of defects can be clearly understood, facilitating subsequent processing and repair; (4) Each annotated image corresponds to a defect marking box and a defect mask. The structure of the defect marking box is determined based on the type of defect in the defect area, and the defect mask is used to indicate the position and size of the defect. In this way, not only can defects be recognized, but detailed information about the defects, such as the type, position, and size of the defects, can also be provided, which has important guiding significance for subsequent processing and repair; (5) By performing enhancement processing on each initial image, more sample images can be created, increasing the diversity of training data, thereby improving the generalization ability of the model, so that the model can also have a good recognition effect on new and unseen X-ray images; (6) By configuring multiple image annotation tools, each image annotation tool is configured with a proprietary annotation box, and each proprietary annotation box corresponds to annotating one type of defect, so that the defects in the image can be annotated more accurately and quickly; (7) The type of defect annotated by the proprietary annotation box can provide detailed information about the defect, such as the type, position, and size of the defect, which has important guiding significance for subsequent processing and repair. Moreover, each image annotation tool is configured with a proprietary annotation box, which can ensure that the annotation of the same type of defect is consistent in different images, improving the consistency of annotation. Further, by sequentially inputting each sample image into the image annotation tool for annotation, multiple annotated images are obtained, and then an annotated data set is constructed based on the annotated images, which can provide a large amount of high-quality training data, improving the training efficiency and effect of the model; (8) The U-Net deep learning model extracts the first feature by downsampling and the second feature by upsampling for each annotated image in the annotated data set, and then fuses them, extracting the features of the image from different scales and angles, improving the accuracy of defect recognition; (9) The design of the contraction path and the expansion path enables the model to maintain the spatial information of the image while extracting features, and the use of skip connections after feature extraction further enhances the accuracy of segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the description of the embodiments or the prior art.

[0037] Figure 1 It is a flowchart of a method for defect recognition of X-ray images in an embodiment of the present application;

[0038] Figure 2 It is a flowchart of training an identification model in an embodiment of the present application;

[0039] Figure 3 It is the sampling principle in an embodiment of the present application;

[0040] Figure 4 It is a flowchart of annotating the defect regions in each sample image in an embodiment of the present application;

[0041] Figure 5 It is a structural block diagram of a defect recognition device for X-ray images in an embodiment of the present application;

[0042] Figure 6 It is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. Specific Embodiments

[0043] The embodiments of the present invention disclose a method, device, equipment and storage medium for defect recognition of X-ray images. The method includes obtaining an X-ray image; performing image enhancement on the X-ray image to obtain an enhanced X-ray image; calling an identification model to identify the enhanced X-ray image so as to output a target image with a defect segmentation region. The identification model is pre-trained, and the defect segmentation region is marked based on a target box, and different defect types correspond to different target box identifications. This solution improves the defect recognition efficiency and accuracy of X-ray images by importing a pre-trained identification model into an image processing system and completing the acquisition, identification and direct output of results of X-ray images in the system at one time.

[0044] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of the present invention are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these process, method, product or device.

[0045] For ease of understanding, the specific process of the embodiment of the present invention is described below. Specifically, Figure 1 A flow chart of a defect recognition method for X-ray images is shown in FIG. Figure 1 As shown, the following steps are included:

[0046] S100: Acquire an X-ray image.

[0047] Specifically, when shooting based on an X-ray detector, a highly sensitive detector and appropriate exposure settings can be used to ensure that the image can cover all details from dark to bright. Preferably, the same scene can be shot multiple times with different exposure settings to capture details in different brightness ranges. In this example, the acquisition of X-ray images is achieved through an image processing system. The image processing system includes a software module and an image acquisition module, and the X-ray image of the target object is acquired based on the image acquisition module, wherein the target object can be a material that needs to be detected, such as aviation materials, building materials, etc.

[0048] S102: Perform image enhancement on the X-ray image to obtain an X-ray enhanced image.

[0049] Specifically, the X-ray image enhancement process can be performed on each initial image based on the ADE algorithm, wherein the enhancement process can include image rotation, image scaling, image flipping, and image brightness adjustment. It can be understood that the ADE algorithm, namely the Advanced Differential Evolution algorithm, is an improved differential evolution algorithm.

[0050] Furthermore, the enhancement processing of the X-ray image may also include enhancement processing operations such as reducing image noise and improving image clarity based on, for example, median filtering and Wiener filtering.

[0051] By performing image enhancement on X-ray images, the contrast of the images can be increased, the clarity of the images can be improved, and defects can be more easily identified.

[0052] S104, calling the recognition model to recognize the X-ray enhanced image to output a target image with defect segmentation areas.

[0053] It can be understood that the recognition model is pre-trained, the defect segmentation area is based on the target frame identification, and different defect types correspond to different target frame identifications.

[0054] It can be understood that by importing the pre-trained recognition model into the image processing system, the acquisition, recognition and direct output of the X-ray image are completed in the system at one time, thereby improving the efficiency and accuracy of defect recognition of X-ray images.

[0055] In one example, as Figure 2 shown, a flowchart of identifying model training, refer to Figure 2 , includes the following steps:

[0056] S200. Collect multiple initial images.

[0057] Specifically, in one example, multiple initial images in a specific field can be collected. For example, multiple initial images in the construction field can be 500, 600, etc. The specific quantity can be set based on specific requirements.

[0058] S202. Perform enhancement processing on each initial image to obtain multiple sample images.

[0059] Specifically, the operation of performing enhancement processing on each initial image can refer to the description in step S102, which will not be elaborated here.

[0060] It can be understood that by performing enhancement processing on each initial image, more sample images can be created, increasing the diversity of training data, thereby improving the generalization ability of the model, enabling the model to also have a good recognition effect on new and unseen X-ray images.

[0061] S204. Label the defect regions in each sample image to obtain a labeled dataset including multiple labeled images.

[0062] Among them, each labeled image corresponds to a defect bounding box and a defect mask. The structure of the defect bounding box is determined based on the defect type of the defect region, and the defect mask indicates the defect position and size.

[0063] Each labeled image corresponds to a defect bounding box and a defect mask. The structure of the defect bounding box is determined based on the defect type of the defect region, and the defect mask is used to indicate the defect position and size. This can not only identify the defects but also provide detailed information about the defects, such as the type, position, and size of the defects, which has important guiding significance for subsequent processing and repair.

[0064] S206. Input the labeled dataset into the U-Net deep learning model for training, so that the U-Net deep learning model performs first feature extraction by downsampling and second feature extraction by upsampling on each labeled image in the labeled dataset and fuses them to obtain an identification model that outputs the defect prediction result of each labeled image based on a 1×1 convolutional layer.

[0065] Among them, the sampling principle is as Figure 3As shown, specifically, the U-Net deep learning model performs a first feature extraction operation of downsampling each labeled image in the labeled dataset to obtain the first image feature of each labeled image, and a second feature extraction operation of upsampling each labeled image in the labeled dataset by the U-Net deep learning model to obtain the second image feature of each labeled image. Then, the first image feature and the second image feature are fused to obtain fused feature data. Further, the fused feature data is processed by 1×1 convolution to output the defect prediction result of each labeled image.

[0066] In one example, the U-Net deep learning model includes a contracting path and an expanding path, and the expanding path is connected to the corresponding layer in the contracting path in a skip manner. Specifically, the U-Net deep learning model can perform a first feature extraction operation of downsampling each labeled image in the labeled dataset in the contracting path to obtain the first image feature of each labeled image, and perform a second feature extraction operation of upsampling each labeled image in the labeled dataset in the expanding path to obtain the second image feature of each labeled image.

[0067] Specifically, in one example, Figure 4 is a flowchart for annotating the defect area in each sample image. Refer to Figure 4 , including the following steps:

[0068] S400. Configure multiple image annotation tools, and each image annotation tool is configured with a proprietary annotation box.

[0069] Specifically, each proprietary annotation box corresponds to annotating a type of defect.

[0070] S402. Input each sample image into the image annotation tool in sequence for annotation to obtain multiple labeled images.

[0071] S404. Construct a labeled dataset based on the labeled images after annotation.

[0072] Specifically, the image annotation tool can include but is not limited to LabelMe, VGG Image Annotator, etc. Defect annotation is achieved by inputting the image into the annotation tool. Before annotation, each annotation tool can be reconfigured so that each image annotation tool only annotates one type of defect. For example, the LabelMe annotation tool only annotates scratch defects, and the VGG Image Annotator annotation tool only annotates black dot defects.

[0073] It can be understood that by configuring multiple image annotation tools, each image annotation tool is configured with a proprietary annotation box, and each proprietary annotation box corresponds to annotating a type of defect. In this way, the defects in the image can be annotated more accurately and quickly. The type of defect annotated by the proprietary annotation box can provide detailed information about the defect, such as the type, location, and size of the defect, which is of great guiding significance for subsequent processing and repair. Moreover, each image annotation tool is configured with a proprietary annotation box, which can ensure that the annotation of the same type of defect is consistent in different images, improving the consistency of annotation. Further, by sequentially inputting each sample image into the image annotation tool for annotation, multiple annotated images are obtained, and then an annotated data set is constructed based on the annotated images. In this way, a large amount of high-quality training data can be provided, improving the training efficiency and effect of the model.

[0074] Furthermore, Figure 5 is a structural block diagram of a defect recognition device for X-ray images, as Figure 5 shown. The device includes:

[0075] An acquisition module for acquiring X-ray images;

[0076] An enhancement module for enhancing the X-ray image to obtain an enhanced X-ray image;

[0077] A calling module for calling a recognition model to recognize the enhanced X-ray image so as to output a target image with a defect segmentation region. The recognition model is pre-trained, and the defect segmentation region is identified based on a target box, and different defect types correspond to different target box identifications.

[0078] Above Figure 5 The defect recognition device for X-ray images in the embodiments of the present invention is described in detail from the perspective of modular functional entities. Next, the electronic device in the embodiments of the present invention is described in detail from the perspective of hardware processing.

[0079] Figure 6It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 600 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 610 (for example, one or more processors) and a memory 620, and one or more storage media 630 (for example, one or more mass storage devices) that store application programs 633 or data 632. Among them, the memory 620 and the storage media 630 may be transient storage or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the electronic device 600. Further, the processor 610 may be set to communicate with the storage media 630 and execute a series of instruction operations in the storage media 630 on the electronic device 600.

[0080] The electronic device 600 may further include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 6 the shown structure of the electronic device does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0081] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the method for defect recognition of X-ray images.

[0082] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, or units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0083] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0084] In the above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for defect recognition of X-ray images, characterized in that, The method includes: Obtain an X-ray image; Perform image enhancement on the X-ray image to obtain an X-ray enhanced image; Call an identification model to identify the X-ray enhanced image to output a target image with a defective segmentation region. The identification model is pre-trained, and the defective segmentation region is based on a target box identifier, and different defective types correspond to different target box identifiers.

2. The method for defect recognition of X-ray images according to claim 1, wherein, Training the identification model includes: Collect multiple initial images; Perform enhancement processing on each of the initial images to obtain multiple sample images; Annotate the defective regions in each of the sample images to obtain an annotation data set including multiple annotated images, where each of the annotated images corresponds to a defective marking box and a defective mask. The structure of the defective marking box is determined based on the defective type of the defective region, and the defective mask indicates the defective position and size; Input the annotation data set into a U-Net deep learning model for training, so that the U-Net deep learning model performs first feature extraction by downsampling and second feature extraction by upsampling on each annotated image in the annotation data set and fuses them to obtain an identification model that outputs a defective prediction result for each annotated image based on a 1×1 convolutional layer.

3. The method for defect recognition of X-ray images according to claim 1 or 2, characterized in that The performing enhancement processing on each of the initial images to obtain multiple sample images includes: Perform enhancement processing on each of the initial images based on the ADE algorithm to obtain multiple sample images, where the enhancement processing includes image rotation, image scaling, image flipping, and image brightness adjustment.

4. The method for defect recognition of X-ray images according to claim 2, wherein The annotating the defective regions in each of the sample images to obtain an annotation data set includes: Configure multiple image annotation tools, and each image annotation tool is configured with a proprietary annotation box, and each of the proprietary annotation boxes corresponds to annotating a defective type; Input each of the sample images into the image annotation tools in sequence for annotation to obtain multiple annotated images; Construct the annotation data set based on the annotated images after annotation.

5. The method for defect recognition of X-ray images according to claim 2, wherein The U-Net deep learning model performs first feature extraction by downsampling and second feature extraction by upsampling on each annotated image in the annotation data set and fuses them to obtain an identification model that outputs a defective prediction result for each annotated image based on a 1×1 convolutional layer includes: The U-Net deep learning model performs a first feature extraction operation by downsampling on each annotated image in the annotation data set to obtain a first image feature of each annotated image; The U-Net deep learning model performs a second feature extraction operation by upsampling on each annotated image in the annotation data set to obtain a second image feature of each annotated image; The U-Net deep learning model performs data fusion on the first image feature and the second image feature to obtain fused feature data; Perform 1×1 convolutional processing on the fused feature data to output a defective prediction result for each annotated image.

6. The method for defect recognition of X-ray images according to claim 5, characterized in that, The U-Net deep learning model includes a contracting path. The U-Net deep learning model performs a first feature extraction operation of downsampling on each labeled image in the labeled dataset to obtain a first image feature of each labeled image, including: The U-Net deep learning model performs a first feature extraction operation of downsampling on each labeled image in the labeled dataset in the contracting path to obtain a first image feature of each labeled image.

7. The defect recognition method for X-ray images according to claim 5, characterized in that, The U-Net deep learning model further includes an expanding path. The expanding path is connected to the corresponding layer in the contracting path in a skip manner. The U-Net deep learning model performs a second feature extraction operation of upsampling on each labeled image in the labeled dataset to obtain a second image feature of each labeled image, including: The U-Net deep learning model performs a second feature extraction operation of upsampling on each labeled image in the labeled dataset in the expanding path to obtain a second image feature of each labeled image.

8. A defect recognition device for X-ray images, characterized in that, The device includes: An acquisition module for acquiring X-ray images; An enhancement module for enhancing the X-ray images to obtain enhanced X-ray images; An invocation module for invoking an identification model to identify the enhanced X-ray images so as to output a target image with a defect segmentation region. The identification model is pre-trained, and the defect segmentation region is identified based on a target box, and different defect types correspond to different target box identifications.

9. An electronic device, characterized in that, The electronic device includes a memory and at least one processor. Instructions are stored in the memory. The at least one processor invokes the instructions in the memory so that the electronic device executes each step of the defect identification method for X-ray images according to any one of claims 1-7.

10. A computer-readable storage medium, on which instructions are stored, characterized in that, When the instructions are executed by the processor, each step of the defect identification method for X-ray images according to any one of claims 1-7 is implemented.