The invention discloses a medical
image segmentation method and
system based on SAM
fine tuning and automatic prompt generation, and belongs to the field of medical
image processing, and the method comprises the steps: employing a pixel-level feature adapter to enhance the feature representation of a medical image, and then employing low-rank
adaptation LoRA to carry out the efficient
fine tuning of parameters of an SAM image
encoder; secondly, an automatic bounding box generator based on a Transform decoder is designed, and a target bounding box is directly regressed from image features to serve as a space prompt; and finally, constructing a two-stage
mask decoder, in the first stage, generating a coarse segmentation
mask by using the frozen native SAM decoder in combination with the bounding box prompt, and in the second stage, inputting the coarse
mask as an additional prompt into a trainable decoder for fine segmentation, and outputting a final result. According to the method, full-automatic and high-precision medical
image segmentation is realized, and the segmentation performance on various medical images such as
skin lesions, breast tumors and
lung nodules is remarkably improved while the original architecture advantages of the SAM are reserved.