SAM large model prompt segmentation method oriented to interactive medical image segmentation
By combining deep learning and reinforcement learning technology, the prompt sequence is intelligently generated and an adaptive early stopping mechanism is introduced, which solves the sensitivity and resource optimization problems of medical image segmentation technology when processing complex images, and achieves efficient and high-precision segmentation effects. .
Patent Information
- Application Number
- CN202410777878.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-03
AI Technical Summary
When existing medical image segmentation technology processes complex medical images, the sensitivity of the model to different prompt forms and the optimization of computing resources are difficult, especially under limited annotation resources and high costs, making it difficult to achieve efficient and accurate diagnosis.
The SAM large model prompt segmentation method for interactive medical image segmentation is adopted, combined with deep learning and reinforcement learning technology, to intelligently generate prompt sequences and introduce an adaptive early stopping mechanism, automatically adjust the number of iterations based on segmentation accuracy and interaction cost, and optimize the segmentation process.
It significantly improves the accuracy and efficiency of medical image segmentation, can achieve high accuracy in fewer iterations, and reduces unnecessary calculations and time consumption. It is suitable for tumor identification and segmentation tasks in different data sets.
Smart Images

Figure CN118587193A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical image analysis technology, and in particular to a SAM large model prompt segmentation method for interactive medical image segmentation, which is suitable for tumor recognition and analysis, enhances the model's recognition ability for complex tumor images through an adaptively optimized interactive learning prompt mechanism, and provides more accurate auxiliary information for medical diagnosis. Background Art
[0002] The complexity of medical image segmentation comes not only from the diversity and complexity of the images themselves, such as differences in imaging manifestations of different diseases, differences in imaging of the same disease between different patients, and differences in image characteristics produced by different imaging technologies; in addition, the high requirements for accuracy and speed in the diagnostic process further increase the technical challenges.
[0003] In the modern medical field, the progress of medical image segmentation technology has provided important support for disease diagnosis and treatment, especially in the early identification and treatment evaluation of tumors. Interactive medical image segmentation technology (SAM) uses advanced machine learning algorithms to assist doctors in making more accurate diagnostic decisions by deeply analyzing massive medical image data. These technologies significantly improve the efficiency and accuracy of the diagnostic process by combining the computing power of artificial intelligence and the professional knowledge of doctors.
[0004] However, despite its significant potential, SAM technology still faces many challenges in practical application; among them, the model's sensitivity to different forms of prompts may affect its performance in processing various medical images (especially when segmenting with natural images); how to accurately determine the best termination time for interaction with patients to optimize computing resources, and how to make the predictive model effectively respond to feedback and adjust accordingly are all key issues that need to be addressed.
[0005] To address these challenges, human-machine collaborative learning methods have been proposed, which aim to improve the overall diagnostic efficiency and accuracy by collaborating with human experts to jointly complete prediction tasks. These methods usually rely on precise human expert labeling to optimize the data processing and learning process of the model, and use the expert's intuition and knowledge to make up for the possible cognitive deficiencies of AI. However, this strategy that relies on expert labeling faces feasibility issues in actual operations, especially when labeling resources are limited or costly.
[0006] The complexity of medical images comes from the diversity and complexity of the images themselves, as well as the high requirements for diagnostic accuracy and speed; advances in SAM technology, especially in the application of deep learning models such as convolutional neural networks (CNNs), have shown great potential for processing such complex data; by designing a network structure specifically for medical image segmentation, the performance of the model has been significantly improved; in addition, in order to optimize the human-computer interaction process, researchers have explored a variety of interactive learning strategies including active learning and reinforcement learning; these strategies improve the efficiency and accuracy of analysis by optimizing human-computer interaction during the learning process.
[0007] When dealing with medical images from different imaging technologies, multimodal learning has become another important research direction; this method provides a more comprehensive view of the disease by integrating information from different imaging technologies, such as X-ray, CT, MRI, etc.; combined with the patient's clinical data, such as medical history, laboratory test results, etc., multimodal learning can further improve the accuracy of diagnosis; future research will be committed to overcoming these challenges and exploring new learning models and algorithms, including but not limited to semi-supervised learning and unsupervised learning, to reduce the reliance on high-cost manual labeling; at the same time, technologies such as reinforcement learning are expected to be used to automatically adjust strategies in the interactive learning process to achieve more efficient resource utilization and more accurate diagnosis; in addition, the continued development of deep learning technology also indicates that the accuracy and automation level of medical image segmentation will be significantly improved; through these advances, SAM technology is expected to be more widely used in medical diagnosis in the future, providing patients with faster and more accurate disease diagnosis and treatment recommendations. Summary of the invention
[0008] The purpose of the present invention is to propose a SAM large model prompt optimization method for interactive medical image segmentation, which aims to make full use of doctors to guide and optimize the analysis process of medical images by introducing an interactive learning mechanism; this method combines deep learning and reinforcement learning techniques to intelligently generate prompt sequences that interact with doctors to guide the model to focus on key areas in the image, thereby improving the accuracy of segmentation and recognition; at the same time, the method also includes an adaptive early stopping mechanism, which automatically adjusts the number of iterations according to the segmentation accuracy and interaction cost to achieve the best balance between efficiency and accuracy.
[0009] The purpose of the present invention is achieved based on the following technical solutions:
[0010] A SAM Large Model Hinted Segmentation Method (AIRS) for Interactive Medical Image Segmentation is characterized by integrating an end-to-end process from image preprocessing to prompting to generate the final segmentation result image, which includes the following specific steps:
[0011] Step 1: First, extract medical images from the Brats database and perform preprocessing operations on them using the data preprocessing module; preprocessing includes cropping the image to remove redundant background, standardization, blurring, adding noise, affine transformation, and rescaling the intensity of the image to obtain the preprocessed image I rescale , which will be used as input data for the next step to adjust the prompt sequence module;
[0012] Step 2: Next, the reinforcement learning algorithm is used to generate an initial prompt sequence, and the prompt sequence is automatically optimized based on the doctor's feedback; the initial probability of the prompt generated by reinforcement learning is: Where π(a|s) is the probability of taking action a in each state s, Q(s,a) is the state-action value function; adjust the prompt sequence based on the feedback: Among them, α is the reinforcement learning learning rate, r is the feedback reward, and γ is the discount factor; s′, a′ represent the state and action to be reached at the next moment. So far, the adjusted prompt sequence is obtained. The optimized prompt sequence will generate specific prompts for image segmentation and serve as the input data of the intelligent interaction stop module;
[0013] Step 3: Use the intelligent interaction stop module. When it is detected that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, it will automatically judge and stop the interaction. At this time, the segmentation result R is obtained; the segmentation accuracy is obtained by the Dice coefficient: To evaluate the segmentation accuracy, R is the segmentation result, H is the real annotation; when ΔD dice Stop interaction when <∈, where ∈ is the preset accuracy threshold;
[0014] Step 4: Finally, through iterative learning and real-time guidance from doctors, the weights are updated after each interaction, and the model weight update formula is: Among them, λ is the model parameter, η is the learning rate, and L(λ) is the loss function; the accuracy of the segmentation result is gradually improved until it meets the clinical requirements, and the final image segmentation result is output.
[0015] Furthermore, the data preprocessing module performs preprocessing operations, specifically including: cropping the image to remove the redundant background, detecting the region of interest (ROI) in the image, and using the bounding box to crop the original image I to obtain a cropped image I′, that is, I′=Crop(I,bounding D ox), where I is the original image and bounding_box is the bounding box used for cropping; the image is then standardized, and the cropped image is standardized by mean and standard deviation to eliminate the gray value differences between different images, and the standardized image I is obtained. LMNO ,Right now Among them, μ and σ are the mean and standard deviation of the image respectively; then blur processing is performed, using the Gaussian kernel function Where x, y are the image space coordinates, σ is the standard deviation of the Gaussian distribution, denoted as G, and the standardized image is blurred to smooth the image noise to obtain the blurred image I blur =I norm *G, where G is a Gaussian kernel function; then add zero mean and variance σ to the blurred image 2 Gaussian noise N(0,σ 2 ), and get the noisy image I noise , that is I noise =I blur +N(0,σ 2 ); Next, the noisy image is subjected to affine transformation, including rotation, translation and scaling, to enhance the robustness of the image, and the image I after affine transformation is obtained affine , that is I affine =T(I noise ,ρ,t,μ), where T represents the transformation operation, ρ is the rotation angle, indicating that the image will be rotated around the center point by ρ degrees, t is the translation vector, and μ is the scaling factor; finally, the intensity of the image after affine transformation is rescaled to adjust the image contrast, and the final preprocessed image α·I is obtained. rescale , that is I rescale =α·I affine +β, where α and β are scaling and offset coefficients respectively; these preprocessing steps are designed to optimize image quality and make subsequent segmentation tasks more accurate and efficient. rescale This will be used as input data for the next step to adjust the prompt sequence module.
[0016] Furthermore, the step 2 specifically includes: first, the input data is the pre-processed image I rescale , using convolutional neural network (CNN) from the preprocessed image I rescale Extract the feature φ(I rescale )=CNN(I rescale ), the extracted feature vector φ(I rescale ) as the representation of the initial state s, and use the reinforcement learning algorithm to generate the prompt sequence. The probability of the initial prompt sequence is Among them, π(a|s) is the probability of taking action a in state s, Q(s,a) is the state-action value function; when using it, the doctor interacts with it through the touch screen or voice command; the gesture analysis formula is: F gesture =ML gesture (input gesture ) Among them, ML gesture It is a gesture parsing model, input gestureis gesture input; the voice analysis formula is: F voice =ML voice (input voice ) Among them, ML voice is a speech parsing model, input voice The first step is voice input; then, based on the doctor’s feedback, the model’s analysis direction and accuracy are dynamically adjusted: Among them, λ is the model parameter, η is the learning rate, and L(λ) is the loss function; when the doctor points out that a certain area needs higher resolution, the model parameters will be adjusted accordingly to analyze the area more accurately: τ resolution ←Adjust(τ resolution ,F doctor ) Among them, F doctor is the doctor’s feedback information; then, the prompt sequence is adjusted according to the doctor’s feedback, and the prompt sequence is optimized by updating the state-action value function. The specific formula is:
[0017]
[0018] Among them, α is the reinforcement learning learning rate, r is the feedback reward, and γ is the discount factor; the optimized prompt sequence will generate specific prompts for image segmentation and serve as input data for the intelligent interactive stopping module.
[0019] Furthermore, the step 3 specifically includes: inputting the prompt sequence generated by the prompt sequence adjustment module, and executing in sequence according to the prompt sequence to obtain the actual segmented image R; using the intelligent interaction stop module, when the model detects that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, it will automatically judge and stop the interaction; specifically, by calculating the Dice coefficient between the segmentation result and the true annotation To evaluate the segmentation accuracy, R is the segmentation result, H is the real annotation; when the increment of Dice coefficient ΔD dice When the accuracy is less than the preset threshold ∈, the interaction will be automatically stopped to avoid unnecessary computational overhead and time waste. In addition, other indicators will be considered comprehensively. The first is the stability of the segmentation result. The stability S is defined as lsmt+n+su The change of Dice coefficient between two consecutive interactions: in, and are the Dice coefficients of the nth and n-1th interactions respectively; when S stability When it is less than the preset threshold δ, it means that the segmentation result is stable and meets the conditions for stopping interaction. In addition, the consistency between the segmentation result and the average segmentation result after multiple interactions is checked. The consistency index C is defined as consistency The Dice coefficient of the segmentation result and the average result is: in, is the average segmentation result after multiple interactions; when C consistency When it is greater than the preset threshold κ, it means that the segmentation result is consistent with the average result and meets the condition for stopping the interaction. According to the actual interaction step sequence ζ with a stop step, the output data of the intelligent interaction stop module is the initial segmentation result Image_seg, and serves as the input data of the iterative update module. By comprehensively evaluating the segmentation accuracy, stability and consistency, it is possible to improve the interaction efficiency and reduce unnecessary calculation and time consumption while ensuring the segmentation effect.
[0020] Furthermore, the step 4 specifically includes: inputting data to generate an initial segmentation result Image_seg for the intelligent interaction stop module; first, optimizing the model parameters according to the result of each interaction, and the specific update formula is: Where λ is the model parameter, η is the learning rate, and L(λ) is the loss function. After each update, the performance of the model is re-evaluated to ensure that the adjustment of the model weights can effectively improve the accuracy of the segmentation results. In order to further improve the segmentation effect, the deep learning model is retrained and fine-tuned by combining historical data and new interaction feedback. In each iteration, the loss function is designed using historical data and new interaction data. Let the loss function of historical data be L h (θ), the loss function of the new interactive feedback is L n (θ), where θ is the parameter of the model. The loss function is designed to make full use of these two parts of information and weighted average the two parts of loss. The formula is: L 综合 (θ) = αL h (θL n (θ))+βL n (θ), where α and β are the weight coefficients of historical data and new interactive feedback respectively; the mean square error (MSE) is used as the loss function, and the specific form is: in and are the prediction results of the model for the i-th time on historical data and new interaction feedback, N h and N n is the number of historical interactions and the number of new interactions; so the comprehensive loss function is: By combining historical data and a new interactive feedback mechanism, not only can previous experience be utilized in each iteration, but timely adjustments can also be made to adapt to new information, thereby gradually optimizing the performance of the model and ensuring that the segmentation results can achieve high accuracy in different situations, and obtaining the final segmentation result Image_segment to meet the requirements of clinical applications.
[0021] Technical Effects
[0022] The present invention is a SAM large model prompted segmentation method (AIES) for interactive medical image segmentation. Through the comprehensive application of deep learning and reinforcement learning techniques, the medical image segmentation process is significantly optimized. The core of the method is to intelligently adjust the prompt sequence and monitor the segmentation accuracy in real time, so as to automatically optimize the segmentation strategy at different stages. In particular, according to the experimental results, such as in the analysis of the spleen data set, the method achieved an accuracy of 0.8922 in iterative step 6, and achieved excellent performances of 0.9046 and 0.8203 on the polyn and brats data sets, respectively. This achievement highlights the significant technical effect of the method in improving the accuracy of medical image segmentation, especially in the recognition and segmentation tasks of key medical images such as tumors. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of the present invention;
[0024] Figure 2 is a flow chart of an embodiment of the present invention;
[0025] Figure 3 Schematic diagram of the segmentation result of the medical slice image according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The invention is further described in detail with reference to the following specific embodiments and drawings. The process, conditions, experimental methods, etc. for implementing the present invention, except for the contents specifically mentioned below, are all common knowledge and common common sense in the art and are not particularly limited by the present invention.
[0027] See also Figure 1 The SAM large model prompted segmentation method for interactive medical image segmentation of the present invention includes an end-to-end process from image preprocessing to prompt generation of the final segmentation result image. First, medical images are extracted from the Brats database and preprocessed, including cropping the image to remove redundant background, standardization, blurring, adding noise, affine transformation and intensity rescaling. Next, the reinforcement learning algorithm is used to generate the initial prompt sequence, and these prompt sequences are automatically optimized based on the doctor's feedback. The initial probability of the prompt generated by reinforcement learning is based on the state-action value function, and is based on the feedback. Adjust the prompt sequence. Then, the intelligent interaction stop module is used. When the model detects that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, it will automatically judge and stop the interaction. The segmentation accuracy is detected by the Dice coefficient. When the accuracy change is less than the preset threshold, the interaction is stopped. Finally, through iterative learning and real-time guidance from doctors, the model weights are updated after each interaction, and the accuracy of the segmentation results is gradually improved until it meets the clinical requirements, and the final image segmentation result Image_segment is output.
[0028] Example
[0029] The data of this embodiment uses the BraTS2020 brain tumor MRI dataset to preprocess and enhance the images to adapt to the needs of deep learning training; data enhancement includes random flipping, rotation and other operations to improve the model's adaptability to image variations; basic cropping and scaling preprocessing are performed on the test images; the model is based on the SAM framework, and an early stopping mechanism is added to avoid overfitting and improve training efficiency; during the training process, the images are cropped to a uniform size of 200×150 to adapt to the model input, and strict training scheduling is implemented. The Adam optimizer is used, the learning rate is set to 1e-5, the gamma value is set to 0.99, and a batch size of 64 is used for training; the entire training process includes 100 epochs, each epoch samples 2000 steps, and a grid search is performed every 8 epochs to optimize the model parameters to improve performance; the model evaluation uses the Dice coefficient as the main performance indicator to measure the consistency between the prediction and the true segmentation; through this method, excellent segmentation performance is achieved on BraTS2020, and the generalization ability of the model is verified;
[0030] like Figure 2 As shown, the present invention is a SAM large model prompt segmentation method for interactive medical image segmentation, comprising the following steps:
[0031] Step 1: Extract the images to be processed from the database and preprocess the input medical images, including cropping and standardization, to adapt to the input requirements of the deep learning model; in addition, the data preprocessing module blurs the images, adds noise, performs affine transformation (rotation, translation, scaling, etc.), and rescales the intensity to ensure the consistent quality of the image data before entering the model;
[0032] Step 2: The image encoder processes the input image I rescale . Use convolutional neural network (CNN) to extract the image from the preprocessed image I rescale Extract the feature φ(I rescale )=CNN(I rescale ), the extracted feature vector φ(I rescale ) as the representation of the initial state s, extracting key features;
[0033] Step 3: Generate the initial prompt sequence using reinforcement learning algorithm. Image feature φ(I rescale ) as the initial state s, and the prompt sequence as the action s. The generation of the initial prompt sequence depends on the strategy π(a|s), and its probability is determined by the state-action value function Q(s,a), which is: This probability distribution can ensure that the optimal prompt action is selected in different states to improve the segmentation effect.
[0034] Step 4: In actual use, doctors can interact with the system through touch screen or voice commands to provide feedback information. According to the doctor's feedback, the state-action value function Q(s,a) is dynamically adjusted, and the optimization formula is: Where α is the learning rate, r is the feedback reward, and γ is the discount factor. Through this process, the prompt sequence is continuously updated to improve the accuracy and efficiency of segmentation. These feedbacks are used to optimize the prompt sequence to make it more in line with the needs of doctors and the specific conditions of the images.
[0035] Step 5: When the model detects that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, the Dice coefficient between the segmentation result and the true annotation is calculated. R is the segmentation result, H is the real annotation, and the segmentation accuracy is evaluated to automatically determine and stop the interaction. This can avoid unnecessary computing overhead and time waste, and improve interaction efficiency.
[0036] Step 6: After each interaction, update the model weight parameters based on the current segmentation results and the doctor’s feedback. The specific update formula is: Where λ is the model parameter, η is the learning rate, and L(λ) is the loss function. In order to further improve the segmentation effect of the model, historical data and new interaction feedback will be combined for retraining and fine-tuning. In each iteration, the historical data from the previous interaction process is used for retraining, and the new interaction feedback is combined for fine-tuning. In each iteration, not only can the previous experience be used, but also timely adjustments can be made to adapt to new information, ensuring that the segmentation results can achieve high accuracy in different situations, and the final segmentation result Image_segment is obtained.
[0037] Figure 3 The segmentation results of a medical slice image on the Brats dataset are visualized. It is obvious that the adaptive early stopping stops at the right place and the segmentation results are excellent.
[0038] The adaptive interactive segmentation method and early stopping mechanism of the present invention greatly improve the accuracy and operational efficiency of medical image segmentation without human intervention, which is of great significance for advancing the field of automated medical image segmentation; by combining the powerful feature extraction capability of deep learning and the sequence decision optimization capability of reinforcement learning, the adaptability and interactivity in the medical image segmentation task are achieved; the sequence prompt strategy automatically adjusts the segmentation process to respond to real-time segmentation needs, rather than relying solely on static data annotation. This dynamic learning process allows the model to iteratively refine its segmentation strategy and improve the accuracy and reliability of the segmentation task; the reinforcement learning agent self-learns and adjusts according to a pre-defined reward mechanism to continuously optimize the segmentation effect.
[0039] Compared with the existing technology, the uniqueness of this method lies in combining the advantages of deep learning and reinforcement learning to achieve high efficiency and accuracy in medical image segmentation; by dynamically adjusting the segmentation strategy, this method can achieve higher accuracy in fewer iterations, and maintain consistent segmentation effects even in changing data sets, thereby enhancing the generalization ability and reliability on different data sets.
[0040] Implement a classification method that can be applied to identify tumors in different data sets;
[0041] Since the unknown class and the known class are randomly divided, in order to avoid the contingency caused by the random strategy, the experiment of the present invention uses the average value of the experimental results obtained by 5 random seeds, and compares the method of the present invention (AIES) with other methods, and adds ablation test results to show the advantages of the method of the present invention;
[0042] Table 1
[0043]
[0044] The present invention is superior to common rule-based algorithms because it can intelligently adjust its segmentation strategy by learning the patterns contained in historical interaction data, thereby achieving higher accuracy in fewer iterations; even in changing data sets, the method in this paper can maintain consistent segmentation results, which strengthens the generalization ability and reliability on different data sets. It is an important progress in the field of medical image segmentation and provides more reliable guidance for doctors.
[0045] Compared with the prior art, the uniqueness of the present invention lies in that it combines the powerful feature extraction capability of deep learning and the sequential decision optimization capability of reinforcement learning to achieve adaptability and interactivity in medical image segmentation tasks; through a sequence prompt strategy, the segmentation process is automatically adjusted to respond to real-time segmentation needs, rather than just relying on static data annotation. This dynamic learning process allows the model to iteratively refine its segmentation strategy, improving the accuracy and reliability of the segmentation task; in addition, the application of reinforcement learning agents self-learns and adjusts according to a pre-defined reward mechanism to continuously optimize the segmentation effect; it not only improves the performance of the model, but also provides a highly flexible and adaptive solution for handling variable and complex medical image segmentation tasks, which marks an important development direction of adaptive interactive segmentation technology.
[0046] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A SAM large model prompted segmentation method for interactive medical image segmentation, characterized in that: The method comprises the following specific steps: Step 1: First, extract medical images from the Brats database and perform preprocessing operations on them using the data preprocessing module; the preprocessing includes cropping the image to remove redundant background, standardization, blurring, adding noise, affine transformation, and rescaling the intensity of the image to obtain the preprocessed image I rescale , which will be used as input data for the next step to adjust the prompt sequence module; Step 2: Generate an initial prompt sequence using a reinforcement learning algorithm, and automatically optimize the prompt sequence based on the doctor's feedback; the initial probability of prompts generated by reinforcement learning is: Where π(a|s) is the probability of taking action a in each state s, Q(s,a) is the state-action value function; adjust the prompt sequence based on the feedback: Among them, α is the reinforcement learning learning rate, r is the feedback reward, and γ is the discount factor; s′, a′ represent the state and action to be reached at the next moment. So far, the adjusted prompt sequence is obtained. The optimized prompt sequence will generate specific prompts for image segmentation and serve as the input data of the intelligent interaction stop module; Step 3: Use the intelligent interaction stop module. When it is detected that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, it will automatically judge and stop the interaction. At this time, the segmentation result R is obtained; the segmentation accuracy is obtained by the Dice coefficient: To evaluate the segmentation accuracy, R is the segmentation result, H is the real annotation; when ΔD dice Stop interaction when <∈, where ∈ is the preset accuracy threshold; Step 4: Finally, through iterative learning and real-time guidance from doctors, the weights are updated after each interaction, and the model weight update formula is: Among them, λ is the model parameter, η is the learning rate, and L(λ) is the loss function; the accuracy of the segmentation result is gradually improved until it meets the clinical requirements, and the final image segmentation result is output.
2. The SAM large model prompt segmentation method according to claim 1, characterized in that: The data preprocessing module performs preprocessing operations on the image, specifically including: cropping the image to remove the redundant background, detecting the region of interest in the image, and using the bounding box to crop the original image I to obtain the cropped image I′, that is, I′=Crop(I,bounding b ox), where I is the original image and bounding_box is the bounding box used for cropping; the image is then standardized, and the cropped image is standardized by mean and standard deviation to eliminate the gray value differences between different images, and the standardized image I is obtained. norm ,Right now Among them, μ and σ are the mean and standard deviation of the image respectively; then blur processing is performed, using the Gaussian kernel function Where x, y are the image space coordinates, σ is the standard deviation of the Gaussian distribution, denoted as G, and the standardized image is blurred to smooth the image noise to obtain the blurred image I blur =I norm *G, where G is a Gaussian kernel function; then add zero mean and variance σ to the blurred image 2 Gaussian noise N(0,σ 2 ), and get the noisy image I noise , that is I noise =I blur +N(0,σ 2 ); Next, the noisy image is subjected to affine transformation, including rotation, translation and scaling, to enhance the robustness of the image, and the image I after affine transformation is obtained affine , that is I affine =T(I noise ,ρ,t,μ), where T represents the transformation operation, ρ is the rotation angle, indicating that the image will rotate ρ degrees around the center point, t is the translation vector, and μ is the scaling factor; finally, the intensity of the image after affine transformation is rescaled to adjust the image contrast, and the final preprocessed image I is obtained. rescale , that is I rescale =α·I affine +β, where α and β are scaling and offset coefficients respectively; the preprocessed image I rescale This will be used as input data for the next step to adjust the prompt sequence module.
3. The SAM large model prompt segmentation method according to claim 1, characterized in that: The step 2 specifically includes: first, the input data is the pre-processed image I rescale , using convolutional neural network CNN from the preprocessed image I rescale Extract the feature φ(I rescale )=CNN(I rescale ), the extracted feature vector φ(I rescale ) as the representation of the initial state s, and use the reinforcement learning algorithm to generate the prompt sequence. The probability of the initial prompt sequence is Among them, π(a|s) is the probability of taking action a in state s, Q(s,a) is the state-action value function; when using it, the doctor interacts with it through the touch screen or voice command; the gesture analysis formula is: F gesture =ML gesture (input gesture ) Among them, ML gesture It is a gesture parsing model, input gesture is gesture input; the voice analysis formula is: F voice =ML voice (input voice ) Among them, ML voice is a speech parsing model, input voice The first step is voice input; then, based on the doctor’s feedback, the model’s analysis direction and accuracy are dynamically adjusted: Among them, λ is the model parameter, η is the learning rate, and L(λ) is the loss function; when the doctor points out that a certain area needs higher resolution, the model parameters will be adjusted accordingly to analyze the area more accurately: τ resolution ←Adjust(τ resolution ,F doctor ) Among them, F doctor is the doctor’s feedback information; then, the prompt sequence is adjusted according to the doctor’s feedback, and the prompt sequence is optimized by updating the state-action value function. The specific formula is: Among them, α is the reinforcement learning learning rate, r is the feedback reward, and γ is the discount factor; the optimized prompt sequence will generate specific prompts for image segmentation and serve as input data for the intelligent interactive stopping module.
4. The SAM large model prompt segmentation method according to claim 1, characterized in that: The step 3 specifically includes: inputting the prompt sequence generated by the prompt sequence adjustment module as input data, and executing in sequence according to the prompt sequence to obtain the actual segmentation result R; using the intelligent interaction stop module, when the model detects that the segmentation accuracy reaches the preset standard and further interaction does not significantly improve the accuracy, it will automatically judge and stop the interaction; specifically, by calculating the Dice coefficient between the segmentation result and the true annotation To evaluate the segmentation accuracy, R is the segmentation result, H is the real annotation; when the increment of Dice coefficient ΔD dice When the accuracy is less than the preset threshold ∈, the interaction will be automatically stopped to avoid unnecessary computational overhead and time waste. In addition, other indicators will be considered comprehensively. The first is the stability of the segmentation result. The stability S is defined as stability The change of Dice coefficient between two consecutive interactions: in, and are the Dice coefficients of the nth and n-1th interactions respectively; when S stability When it is less than the preset threshold δ, it means that the segmentation result is stable and meets the conditions for stopping interaction. In addition, the consistency between the segmentation result and the average segmentation result after multiple interactions is checked. The consistency index C is defined as consistency The Dice coefficient of the segmentation result and the average result is: in, is the average segmentation result after multiple interactions; when C consistency When it is greater than the preset threshold κ, it means that the segmentation result is consistent with the average result and meets the condition for stopping the interaction. According to the actual interaction step sequence ζ with a stop step, the output data of the intelligent interaction stop module is the initial segmentation result Image_seg, which is used as the input data of the iterative update module.
5. The SAM large model prompt segmentation method according to claim 1, characterized in that: The step 4 specifically includes: inputting data to generate the initial segmentation result Image_seg for the intelligent interaction stop module; first, optimizing the model parameters according to the result of each interaction, and the specific update formula is: Where λ is the model parameter, η is the learning rate, and L(λ) is the loss function. In each iteration, the loss function is designed using historical data and new interaction data. Let the loss function of historical data be L h (θ), the loss function of the new interactive feedback is L n (θ), where θ is the parameter of the model. The loss function is designed to make full use of these two parts of information and weighted average the two parts of loss. The formula is: L 综合 (θ)=αL h (θL L (θ))+βL n (θ), where α and β are the weight coefficients of historical data and new interactive feedback respectively; the mean square error (MSE) is used as the loss function, and the specific form is: in and are the prediction results of the model for the i-th time on historical data and new interaction feedback, N h and N n is the number of historical interactions and the number of new interactions; so the comprehensive loss function is: By combining historical data and a new interactive feedback mechanism, the model performance is gradually optimized to obtain the final segmentation result Image_segment.
Citation Information
Cited By
Medical image lesion detection system
CN118918106A
A medical imaging lesion detection system
CN118918106B
Image recognition system for artificial intelligence based on reinforcement learning
CN120278901A
Medical image segmentation system and method based on interactive click and adaptive ROI regulation and control
CN121564016A
