Search

CN-121982015-A - Defect detection method, electronic device and program product

CN121982015ACN 121982015 ACN121982015 ACN 121982015ACN-121982015-A

Abstract

The invention discloses a defect detection method, electronic equipment and a program product. The method comprises the steps of obtaining a target medical balloon image to be detected and a detection prompt text, inputting the target medical balloon image and the detection prompt text into a defect detection model to obtain a defect detection result corresponding to the target medical balloon image, wherein the defect detection model comprises a visual encoder, a text encoder and a defect identification module, an interactive attention unit is arranged in the visual encoder, and the defect detection result is used for indicating whether the medical balloon image has defects or not and the defect type of the medical balloon image when the defects exist. According to the technical scheme, the image of the target medical balloon to be detected is analyzed through the defect detection model, so that the problems of low detection efficiency, poor robustness and the like of the defect detection of the traditional medical balloon are solved, and the defect detection accuracy of the medical balloon is improved.

Inventors

  • Xiong Kezan
  • LU ZHEMING
  • WenRen Ji

Assignees

  • 苏州桓球医疗科技有限公司

Dates

Publication Date
20260505
Application Date
20260324

Claims (10)

  1. 1. A defect detection method, comprising: Acquiring a target medical balloon image to be detected and a detection prompt text, wherein the detection prompt text is used for prompting image content to be detected by a defect detection model in the target medical balloon image and/or a defect detection result to be output by the defect detection model aiming at the target medical balloon image; The method comprises the steps of inputting the target medical balloon image and a detection prompt text into a defect detection model to obtain a defect detection result corresponding to the target medical balloon image, wherein the defect detection model comprises a visual encoder, a text encoder and a defect identification module, an interactive attention unit is arranged in the visual encoder, and the defect detection result is used for indicating whether the medical balloon image has a defect or not and the defect type of the medical balloon image when the defect exists.
  2. 2. The method according to claim 1, wherein the inputting the target medical balloon image and the detection prompt text into the defect detection model to obtain a defect detection result corresponding to the target medical balloon image includes: inputting the target medical balloon image to a visual encoder to obtain a target feature map, and inputting the detection prompt text to a text encoder to obtain text features; and inputting the text features and the target feature map into a defect recognition module to obtain a defect detection result corresponding to the target medical balloon image.
  3. 3. The method of claim 2, wherein the visual encoder comprises a plurality of serially connected feature extraction modules, wherein at least two of the feature extraction modules comprise serially connected feature extraction units and interactive attention units, and wherein the interactive attention units in at least two of the feature extraction modules correspond to different feature transformation scales; inputting the target medical balloon image to a visual encoder to obtain a target feature map, wherein the method comprises the following steps of: Inputting the target medical balloon image into the feature extraction module, and carrying out feature extraction on the target medical balloon image through a feature extraction unit of the feature extraction module to obtain an original feature image; In the case that the feature extraction module comprises the interaction attention unit, performing attention enhancement processing on the original feature map based on the interaction attention unit to obtain a target enhancement feature map, and inputting the target enhancement feature map into the next feature extraction module; inputting the original feature map into a next feature extraction module in the case that the feature extraction module does not include the interactive attention unit; and taking the feature map output in the last feature extraction module as a target feature map.
  4. 4. A method according to claim 3, wherein the interactive attention unit comprises a local feature subunit and a semantic feature subunit; the performing attention enhancement processing on the original feature map based on the interaction attention unit to obtain a target enhanced feature map, including: Processing the original feature map based on the local feature subunit to obtain a first distribution map and a first channel vector; Processing the original feature map based on the semantic feature subunit to obtain a second distribution map and a second channel vector; performing matrix multiplication on the first distribution diagram and the second channel vector to obtain a first space attention weight, and performing matrix multiplication on the second distribution diagram and the first channel vector to obtain a second space attention weight; Obtaining attention weights according to the first spatial attention weights and the second spatial attention weights; And performing matrix point multiplication on the attention weight and the original feature map to obtain the target enhancement feature map.
  5. 5. The method of claim 4, wherein the local feature sub-units comprise a first pooling layer, a first convolution layer, a normalization layer, a second pooling layer, and a first probability distribution layer; The processing the original feature map based on the local feature subunit to obtain a first distribution map and a first channel vector, including: carrying out global average pooling treatment on the original feature map in the horizontal direction based on the first pooling layer to obtain a first description vector, and carrying out global average pooling on the original feature map in the vertical direction based on the first pooling layer to obtain a second description vector; respectively carrying out convolution processing on the first description vector and the second description vector based on a first convolution layer, and respectively processing the convolved first description vector and second description vector based on an activation function to obtain a first attention weight vector and a second attention weight vector; multiplying the first attention weight vector by the second attention weight vector matrix, and then performing matrix point multiplication on the first attention weight vector matrix and the original feature map to obtain a space enhancement feature map; Normalizing the spatial enhancement feature map based on the normalization layer, processing the normalized spatial enhancement feature map based on the first probability distribution layer to obtain the first distribution map, and And carrying out pooling treatment on the spatial enhancement feature map after normalization treatment based on the second pooling layer to obtain the first channel vector.
  6. 6. The method of claim 4, wherein the semantic feature sub-unit comprises a second convolution layer, a second probability distribution layer, and a third pooling layer; The processing the original feature map based on the semantic feature subunit to obtain a second distribution map and a second channel vector, including: Carrying out convolution processing on the original feature map based on the second convolution layer to obtain a convolution result; and inputting the convolution result into the second probability distribution layer to obtain the second distribution layer, and inputting the convolution result into the third pooling layer to obtain the second channel vector.
  7. 7. The method of claim 1, wherein the training process of the defect detection model comprises: Acquiring an original defect image data set, wherein the original defect image data set comprises a plurality of sample medical balloon images, the plurality of sample medical balloon images comprise normal medical balloon images and defect medical balloon images, and the defect medical balloon images comprise at least one defect area; Performing data enhancement processing on at least part of sample medical balloon images in the original defect image data set to obtain expanded medical balloon images, and adding the expanded medical balloon images into the original defect image data set to obtain a target defect image data set; training a model based on the target defect image dataset to obtain the defect detection model.
  8. 8. The method of claim 7, wherein performing data enhancement processing on at least a portion of the sample medical balloon image in the original defect image dataset to obtain an expanded medical balloon image comprises: labeling at least one defect area in a plurality of defect medical balloon images to obtain a plurality of defect labeling images; Generating a plurality of mask images corresponding to a plurality of defect areas based on the defect labeling images, and taking the minimum circumscribed rectangle of the mask images as a foreground patch; When the intersection ratio of the foreground patch and the image area corresponding to the defective medical balloon image in the defective area is smaller than a first preset threshold value, adding the foreground patch into at least part of effective imaging areas of the sample medical balloon image to obtain an enhanced defective image, wherein the effective imaging areas are areas where medical balloons in the image are located; Determining an area ratio of a pixel area of the defect region in the enhanced defect image to a pixel area of the defect region in the mask image, and determining the enhanced defect image with the area ratio being greater than or equal to a second preset threshold value as an extended medical balloon image.
  9. 9. An electronic device, the electronic device comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the defect detection method of any of claims 1-8.
  10. 10. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the defect detection method according to any of claims 1-8.

Description

Defect detection method, electronic device and program product Technical Field The embodiment of the invention relates to the technical field of defect detection, in particular to a defect detection method, electronic equipment and a program product. Background With the rapid development of medicine, the balloon is used as a key functional component in the interventional instrument, and the structure and the performance of the balloon are directly related to the expansion effect, the vascular/tissue safety and the controllability of the operation process. Once the balloon is defective, it may cause abnormal inflation pressure, balloon burst, air leakage failure, uneven inflation, vascular injury, or intraoperative complications in clinical use. The defect detection of the traditional medical balloon mainly depends on manual observation and a traditional image processing method, and has the problems of low detection efficiency, poor robustness, insufficient sensitivity to tiny defects and the like. The method can not accurately identify the tiny defects such as the fine scratches, the tiny fish eyes, the tiny jelly and the like, can not ensure the consistency and the stability of the detection result, and is difficult to meet the strict standard and the high-efficiency detection requirement of the quality control of the medical balloon production. Disclosure of Invention The embodiment of the invention provides a defect detection method, electronic equipment and a program product, which are used for improving the accuracy of detecting the defects of a medical balloon. According to an aspect of the present invention, there is provided a defect detection method including: Acquiring a target medical balloon image to be detected and a detection prompt text, wherein the detection prompt text is used for prompting image content to be detected by a defect detection model in the target medical balloon image and/or a defect detection result to be output by the defect detection model aiming at the target medical balloon image; The method comprises the steps of inputting the target medical balloon image and a detection prompt text into a defect detection model to obtain a defect detection result corresponding to the target medical balloon image, wherein the defect detection model comprises a visual encoder, a text encoder and a defect identification module, an interactive attention unit is arranged in the visual encoder, and the defect detection result is used for indicating whether the medical balloon image has a defect or not and the defect type of the medical balloon image when the defect exists. According to another aspect of the present invention, there is provided a defect detecting apparatus including: The data acquisition module is used for acquiring a target medical balloon image to be detected and a detection prompt text, wherein the detection prompt text is used for prompting the image content to be detected by a defect detection model in the target medical balloon image and/or the defect detection result to be output by the defect detection model aiming at the target medical balloon image; The defect detection result determining module is used for inputting the target medical balloon image and the detection prompt text into the defect detection model to obtain a defect detection result corresponding to the target medical balloon image, the defect detection model comprises a visual encoder, a text encoder and a defect identification module, an interactive attention unit is arranged in the visual encoder, and the defect detection result is used for indicating whether the medical balloon image has a defect or not and the defect type of the medical balloon image when the defect exists. According to another aspect of the present invention, there is provided an electronic apparatus including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the defect detection method according to any one of the embodiments of the present invention. According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the defect detection method according to any embodiment of the present invention. According to another aspect of the invention, a computer program product is provided, which, when being executed by a processor, implements a defect detection method according to any of the embodiments of the invention. According to the embodiment of the invention, the target medical balloon image to be detected and the detection prompt text are acquired, and the detection prompt text is used for prompting the image content to be detected by the defect detection model in the target medical balloon image and/or the defect detection result to be output by the def