Search

CN-122024241-A - Method for dividing crack, electronic equipment and storage medium

CN122024241ACN 122024241 ACN122024241 ACN 122024241ACN-122024241-A

Abstract

The application provides a method for segmenting a crack, electronic equipment and a storage medium, wherein the method is applied to the technical field of deep learning and comprises the steps of obtaining an image to be segmented of a target object; the method comprises the steps of inputting an image to be segmented into a target fracture segmentation model obtained through training in advance, enabling the target fracture segmentation model to segment the fracture region in the image to be segmented, outputting a target fracture mask of the image to be segmented, adjusting the target fracture segmentation model through an embedded low-rank adaptation layer by a basic fracture segmentation model, enabling the target fracture mask to be a binary image, enabling pixel values of the fracture region in the binary image to be set to be a first preset value, and enabling pixel values of the non-fracture region to be set to be a second preset value. The method can realize automatic, efficient and accurate segmentation of the fracture in the image to be segmented, and output the target fracture mask.

Inventors

  • YANG XI
  • ZHANG QUANCHAO
  • LV SHAOWU
  • Zhu Qinzhe

Assignees

  • 吉林大学

Dates

Publication Date
20260512
Application Date
20260415

Claims (10)

  1. 1. A method of segmenting a fracture, the method comprising: acquiring an image to be segmented of a target object, wherein the image to be segmented comprises a crack area of the target object; Inputting the image to be segmented into a target fracture segmentation model obtained through training in advance, so that the target fracture segmentation model segments a fracture region in the image to be segmented, and outputting a target fracture mask of the image to be segmented; The target fracture segmentation model is obtained by adjusting a basic fracture segmentation model through an embedded low-rank adaptation layer, the target fracture mask is a binarization image, the pixel value of a fracture region in the binarization image is set to be a first preset value, and the pixel value of a non-fracture region is set to be a second preset value.
  2. 2. The method of claim 1, wherein the target fracture segmentation model comprises a preprocessing module, an image encoder, a hint encoder, and a mask decoder, the low-rank adaptation layer being embedded in the image encoder; inputting the image to be segmented into a target fracture segmentation model obtained by training in advance, so that the target fracture segmentation model segments a fracture region in the image to be segmented, and outputting a target fracture mask of the image to be segmented, wherein the method comprises the following steps: inputting the image to be segmented into the preprocessing module, so that the preprocessing module processes the image to be segmented to obtain image data in a preset format; Inputting the image data into the image encoder to cause the image encoder to extract multi-scale visual features from the image data; the low-rank adaptation layer is used for enhancing the representation capability of the visual features on the surface texture and the crack area of the target object; inputting prompt information into the prompt encoder so that the prompt encoder generates prompt embedded features based on the prompt information, wherein the prompt information comprises a guide signal for indicating the target fracture segmentation model to carry out segmentation operation; Inputting the visual features and the prompt embedded features into the mask decoder, so that the mask decoder generates a segmentation result based on the visual features and the prompt embedded features, and outputting a target fracture mask of the image to be segmented based on the segmentation result.
  3. 3. The method according to claim 1 or 2, wherein the target fracture segmentation model is trained by: Constructing a training set based on the original fracture image of the target object; constructing a basic fracture segmentation model for segmenting the original fracture image; And training the basic fracture segmentation model based on the training set to obtain a target fracture segmentation model.
  4. 4. The method of claim 3, wherein constructing a training set based on the original fracture image of the target object comprises: Labeling the crack region of the target object in the original crack image, and generating a real crack mask of the original crack image based on a labeling result; and constructing the training set based on the original fracture image and a real fracture mask of the original fracture image.
  5. 5. The method of claim 4, wherein the constructing the training set based on the raw fracture image and a true fracture mask of the raw fracture image comprises: adjusting any one or more parameters of brightness, contrast, gamma value and noise of the original fracture image to obtain an enhanced image of the original fracture image; And constructing the training set based on the original fracture image, the enhanced image and a real fracture mask of the original fracture image.
  6. 6. The method of claim 3, wherein the base fracture segmentation model comprises an image encoder, a hint encoder, and a mask decoder, wherein a trainable low-rank adaptation layer is embedded in a multi-layer transducer module of the image encoder, wherein training the base fracture segmentation model based on the training set results in a target fracture segmentation model comprising: freezing parameters of the image encoder and the hint encoder; and updating parameters of the low-rank adaptation layer and the mask decoder based on the training set so as to train and obtain the target fracture segmentation model.
  7. 7. The method of claim 6, wherein the training set comprises a raw fracture image and a true fracture mask for the raw fracture image, wherein updating parameters of the low-rank adaptation layer and the mask decoder based on the training set comprises: inputting the original fracture image into the fracture segmentation model to enable the fracture segmentation model to output a fracture prediction mask of the original fracture image; calculating a segmentation loss value based on the real fracture mask and the fracture prediction mask; And updating parameters of the low-rank adaptation layer and the mask decoder based on the segmentation loss value.
  8. 8. The method of claim 7, wherein the updating parameters of the low rank adaptation layer and the mask decoder comprises: taking the parameters of the low-rank adaptation layer and the parameters of the mask decoder as trainable parameters; Determining an initial value and a minimum value of the learning rate of the trainable parameter, and in the training process, downwards regulating the learning rate of the trainable parameter from the initial value according to a cosine function to obtain a target value of the learning rate corresponding to each training round until the learning rate is downwards regulated from the initial value to the minimum value; In each training round, the trainable parameters are updated based on the current target learning rate.
  9. 9. An electronic device, the electronic device comprising: a memory for storing executable program code; a processor for calling and running the executable program code from the memory, causing the electronic device to perform the method of any one of claims 1 to 8.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed, implements the method according to any of claims 1 to 8.

Description

Method for dividing crack, electronic equipment and storage medium Technical Field The present application relates to the field of deep learning technology, and more particularly, to a method of segmenting a fracture in the field of deep learning technology, an electronic device, and a storage medium. Background With the rapid development of deep learning technology, the convolutional neural network-based image segmentation model gradually falls to the ground and shows remarkable technical advantages in the fields of medical image analysis, archaeology and archaeology research by virtue of strong feature extraction and pixel level judgment capability. The existing deep learning-based fossil segmentation related work mainly focuses on fossil body data obtained by CT scanning or synchrotron radiation scanning, and research on fossil surface crack segmentation under visible light images is still insufficient. Disclosure of Invention The application provides a method for dividing a crack, an electronic device and a storage medium, the method can realize automatic, efficient and accurate segmentation of the fracture in the image to be segmented, and output the target fracture mask. The method comprises the steps of obtaining an image to be segmented of a target object, enabling the image to be segmented to comprise a fracture area of the target object, inputting the image to be segmented into a target fracture segmentation model obtained through training in advance, enabling the target fracture segmentation model to segment the fracture area in the image to be segmented, outputting a target fracture mask of the image to be segmented, enabling the target fracture segmentation model to be obtained through adjustment of a base fracture segmentation model through an embedded low-rank adaptation layer, enabling the target fracture mask to be a binary image, enabling pixel values of the fracture area in the binary image to be set to be a first preset value, and enabling pixel values of the non-fracture area to be set to be a second preset value. According to the technical scheme, the target fracture segmentation model is trained in advance to segment the fracture region in the image to be segmented, and the target fracture mask of the image to be segmented is output, so that automatic, efficient and accurate segmentation of the fracture in the image to be segmented can be achieved, manual fracture identification and labeling of a technician on the image pixel by pixel are not needed, the fracture identification efficiency is improved, the actual research requirements can be met, the low-rank adaptation layer is embedded to adjust the basic fracture segmentation model, the target fracture segmentation model with high light weight, high precision and generalization capability can be obtained efficiently under the conditions of low calculation power and few samples, and the accurate adaptation from the general model to the fracture segmentation task is achieved. With reference to the first aspect, in some possible implementations, the target fracture segmentation model comprises a preprocessing module, an image encoder, a prompt encoder and a mask decoder, wherein the low-rank adaptation layer is embedded into the image encoder, the target fracture segmentation model obtained by training in advance is input into the image to be segmented, the target fracture segmentation model is used for segmenting fracture areas in the image to be segmented, and a target fracture mask of the image to be segmented is output, the target fracture segmentation model comprises the steps of inputting the image to be segmented into the preprocessing module, processing the preprocessing module into image data in a preset format, inputting the image data into the image encoder, enabling the image encoder to extract multi-scale visual features from the image data, the low-rank adaptation layer is used for enhancing the representation capability of the visual features on the surface texture and the fracture areas of a target object, inputting prompt information into the prompt encoder, enabling the prompt encoder to generate prompt embedded features based on the prompt information, the prompt information comprises a guide signal for indicating the segmentation operation of the target fracture segmentation model, inputting the visual features and the prompt embedded features into the mask decoder, enabling the mask decoder to generate fractures based on the visual features and the prompt segmented results and output the target segmentation results based on the target segmentation results. In the technical scheme, the visual features and the prompt embedded features of the fossil cracks modulated by LoRA are fused, whether each position is a crack is predicted pixel by pixel, a low-resolution crack probability map is restored to the size consistent with a fossil input image, a pixel-level binarized crack mask is generated after binarization, and th