Axillary nerve ultrasound image semantic segmentation method based on domain self-adaption
Through clustering prototype self-training and adversarial training mechanisms, the high labeling cost and poor generalization ability in the segmentation of axillary nerve ultrasound images are solved, and the adaptability and robustness to different scenarios and data distributions are achieved, reducing clinical Data labeling workload.
Patent Information
- Application Number
- CN202411714123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-11-27
AI Technical Summary
The prior art has high data labeling costs in axillary nerve ultrasound image segmentation, insufficient utilization of unlabeled data, and poor generalization ability of models in different scenarios and data distribution changes.
Using the semantic segmentation method of axillary nerve ultrasound image based on domain adaptation, through clustering prototype self-training and adversarial training mechanism, the pseudo-label is generated using labelless data and self-supervised learning to build a semantic segmentation model that is anti-noise and cross-domain adaptation. .
It significantly reduces the cost of manual labeling, improves the cross-domain generalization ability and robustness of the model, and can adapt to image quality and distribution changes caused by individual differences between different ultrasound devices and patients.
Smart Images

Figure CN119229128A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a semantic segmentation method of axillary nerve ultrasound images based on domain adaptation. Background Art
[0002] Damage or disease of the axillary nerve may cause severe pain and dysfunction, such as brachial plexus injury. Accurate nerve imaging is very important for diagnosis and treatment. Ultrasound-guided nerve localization has gradually become the doctor's tool of choice due to its non-invasive, real-time imaging and high resolution. However, due to its complex anatomical structure and individual differences among patients, doctors need not only high professional skills and rich experience to locate the nerve under ultrasound guidance, but are also easily affected by subjective factors, resulting in poor accuracy and repeatability. In order to improve the efficiency and safety of clinical operations, accurate axillary nerve ultrasound image segmentation technology with individual generalization capabilities is urgently needed as an important auxiliary tool to help doctors quickly and accurately identify the location of the axillary nerve.
[0003] The Chinese invention patent with application number CN202410209816.9 proposes a multi-target segmentation method for multi-scale discrete optimization of brachial plexus ultrasound images, which relates to the field of ultrasonic image intelligent recognition technology. The method includes the following steps: S1, preprocessing the ultrasonic brachial plexus image to match the multi-target balance and discrete point optimization semantic segmentation network; S2, using the downsampling feature encoding module to downsample the preprocessed ultrasonic brachial plexus image to obtain several layers of encoded feature maps; S3, using the target balanced attention module to process the underlying feature map in the encoded feature map, and output a feature map with multi-scale balanced attention; S4, using the category information supervision point vector reclassification module to process the feature map with balanced attention, and output a feature map with discrete optimization; S5, upsampling and fusion the feature map with multi-scale balanced attention and the feature map with discrete optimization through the upsampling multi-scale fusion module, and using the multi-scale fused feature map to generate the final segmentation result through the segmentation head.
[0004] The Chinese invention patent with application number CN202410478201.6 proposes an ultrasound image segmentation method based on window attention semantic stream alignment, which relates to the technical field of ultrasound image intelligent recognition. The method includes the following steps: S1, collecting ultrasound images for preprocessing to construct a data set, and dividing the data set into a training data set and a test data set; S2, constructing an ultrasound image segmentation model based on window attention semantic stream alignment, the model includes an encoding-decoding framework, a window self-attention module and a stream alignment module, wherein: the encoding-decoding framework is used to separate the breast cancer feature extraction and feature recognition processes, which is convenient for feature information mining and integration; the window self-attention module is used to mine more effective global features by dividing the image into a series of tokens under the action of the attention mechanism, avoiding the interference of ultrasound image shadows and noise, and improving the robustness and segmentation accuracy of the model; the stream alignment module is used to connect periodically or skip connections. Improve the features and align the feature sets in the neural network to promote cross-layer communication, allow relevant information to propagate between layers, and enhance the model's cross-layer communication, contextual reasoning, and prediction capabilities; S3. Use a custom BCE-Dice hybrid loss function, combined with pixel accuracy and the accuracy of predicted overlapping areas, to optimize the model segmentation performance and improve segmentation accuracy; S4. Use the training data set to train the model, optimize the model parameters through back propagation and gradient descent algorithms, adjust hyperparameters and model structure, and improve the performance and generalization ability of the model; S5. Use the test data set to evaluate the model, calculate precision, recall, overall accuracy, prediction error, Kappa coefficient, F1 score, and intersection-over-union multiple indicators to measure the performance of the model.
[0005] However, the above technologies have the following limitations:
[0006] 1) Constructing a clinical ultrasound image dataset of the axillary nerve requires expensive data annotation costs. Existing fully supervised image segmentation methods require a large amount of accurately annotated data as training sets. For image segmentation tasks of anatomical structures such as the axillary nerve, this reliance on annotations makes model development expensive and difficult to iterate quickly. In practice, the acquisition cost of less-annotated or unannotated ultrasound images is lower, and existing fully supervised methods cannot fully utilize these unlabeled datasets.
[0007] 2) The quality and distribution of axillary nerve ultrasound images are affected by many factors, including the model of ultrasound equipment, usage parameters, the operator's technical level, and individual differences in patients (such as age, body shape, degree of lesions, etc.). These factors lead to large differences in ultrasound images in different application scenarios. Even images collected by the same device at different time points may have different quality and are highly diverse.
[0008] 3) Fully supervised ultrasound image segmentation models usually rely on a large amount of homologous data for training. Although such models perform well in specific scenarios, they often show poor generalization ability when faced with different scenarios or changes in data distribution. Since the morphological features of nerve tissue in ultrasound images are relatively vague, the model may not be able to accurately identify the target nerves without sufficient adaptability, resulting in unstable segmentation results. Summary of the invention
[0009] In view of the deficiencies in the prior art, the present invention provides a domain-adaptive semantic segmentation method for axillary nerve ultrasound images, comprising the following steps: Step S1: collecting axillary nerve ultrasound images, annotating some of the axillary nerve ultrasound images, preprocessing all axillary nerve ultrasound images, and constructing a data set based on them; Step S2: construct a semantic segmentation model and perform preliminary supervised fine-tuning to obtain a preliminary optimized semantic segmentation model based on the labeled data in step S1; The semantic segmentation model includes a serially connected encoder, a decoder, and a semantic segmentation head, and the axillary nerve ultrasound image in step S1 is imported into the semantic segmentation model for processing to obtain a semantic segmentation result; Step S3: self-training the clustering prototype of the semantic segmentation model initially optimized in step S2; specifically: The unlabeled axillary nerve ultrasound image and the labeled axillary nerve ultrasound image in the step S1 data set are respectively subjected to feature extraction by an encoder, and unlabeled extracted features and labeled extracted features are obtained respectively, and the labeled extracted features are clustered in a high-dimensional feature space by a clustering algorithm to generate multiple clustering prototypes, and the clustering prototypes are used as pseudo labels of the unlabeled axillary nerve ultrasound image, and a preliminarily optimized semantic segmentation model is obtained according to the pseudo labels and the unlabeled extracted features for self-training; Step S4: constructing a domain classifier, which classifies the unlabeled axillary nerve ultrasound images and the labeled axillary nerve ultrasound images in step S3; specifically, the unlabeled axillary nerve ultrasound images are used as target domains, and the labeled axillary nerve ultrasound images are used as source domains; Based on this, an adversarial training function is constructed and minimized to maximize the consistency of feature distribution between the source domain and the target domain; Step S5: Introduce the perturbation feature tensor according to the output of the encoder, import the output of the encoder and the perturbation feature tensor into the decoder together, construct a consistency loss function, and improve the noise resistance of the semantic segmentation model by minimizing the consistency loss function.
[0010] Furthermore, step S1 is specifically as follows: Step S11: Acquire axillary nerve ultrasound images of different patients under different equipment conditions; Step S12: marking the axillary nerve in the partial axillary nerve ultrasound image in step S11, and obtaining a marked axillary nerve ultrasound image; Step S13: preprocess all acquired axillary nerve ultrasound images through Gaussian filtering and histogram equalization, then perform grayscale standardization and RGB standardization, and then adjust the resolution of all axillary nerve ultrasound images to a uniform size.
[0011] Furthermore, step S2 is specifically as follows: Step S21: Transmit the axillary nerve ultrasound image After inputting the encoder, the encoder feature map is obtained. In this process, each layer of the encoder structure obtains the corresponding feature map, which is expressed as: ; ; in, represents the convolution operation, represents the downsampling operation, Represents the total number of layers of the encoder structure, represents the first layer encoder feature map, Indicates Layer encoder feature map; Step S22: Get the middle layer of the encoder Layer encoder feature map Then, the multi-head self-attention mechanism is used to Layer encoder feature map Process and obtain multi-head attention feature map , expressed as: ; ; ; ; ; in, are all learnable weight matrices, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Represents a multi-head self-attention mechanism; specifically: ; ; ; in, is the scaling factor, represents the number of attention heads, represents the preset weight matrix, represents the self-attention function, represents the normalization function, Indicates A head of attention, Indicates A head of attention, represents the concatenation function, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Step S23: The multi-head attention feature map is processed by a decoder based on a multi-head cross convolution attention mechanism. Process and obtain Layer decoder feature map , expressed as: ; ; ;
[0012] ; ; in, represents the upsampling operation, Represents the multi-head cross convolution attention mechanism; Step S24: Use the semantic segmentation head to segment the Layer decoder feature map Make predictions and obtain semantic segmentation results; Step S25: construct a loss function, and minimize the loss function based on the annotations in step S12 to optimize the model.
[0013] Furthermore, step S3 is specifically as follows: Step S31: annotated axillary nerve ultrasound images in the data set And an unlabeled ultrasound image of the axillary nerve Performing random change operations for preprocessing, the random change operations include rotation, inversion, cropping and grayscale transformation; The preprocessed and labeled axillary nerve ultrasound image And an unlabeled ultrasound image of the axillary nerve Input to encoder Perform feature extraction operations in the and unlabeled feature extraction ; Step S32: Extract features from labeled data using density clustering algorithm and unlabeled feature extraction Perform unsupervised clustering; specifically: For each data point , calculate the value of this data point Neighborhood, expressed as: ; in, express of Neighborhood, represents the Euclidean distance, Represents data points The adjacent data points of The data points As the core point, The points in the neighborhood are grouped into the same cluster and continue to Neighborhood expansion: adjacent data points ,if It can also be used as a core point for further expansion Neighborhood; expressed as: ; ; in, is the minimum number of cluster core points, express Neighborhood; Repeat the expansion process until the constraints cannot be satisfied; In this process, the marker is not a core point and does not belong to any core point. The points in the neighborhood are noise points, and no processing is done on them; Step S33: After completing the clustering operation, obtain the clustering prototype , expressed as: ; in, is assigned to The feature set of each cluster; It is The number of features contained in each cluster; is assigned to Features in clusters; Step S34: Cluster prototype As pseudo labels, a self-supervised loss function is constructed based on the pseudo labels, and the self-supervised loss function is minimized to further optimize the semantic segmentation model; Among them, the self-supervised loss function includes the contrast loss function and the mean square error consistency loss function. The contrast loss function It is expressed as: ; in, represents the pseudo labels corresponding to samples i and j, represents the unlabeled extracted features corresponding to sample i and sample j, is the indicator function, represents the Euclidean distance; Among them, the mean square error consistency loss function It is expressed as: ; in, Indicates the total number of samples.
[0014] Furthermore, the domain classifier in step S4 consists of 2 fully connected layers; Step S4 is specifically as follows: Step S41: Domain classifier extracts features from the labeled and unlabeled feature extraction The process of differentiation is expressed as: ; in, represents the domain classifier, represents the prediction output of the domain classifier for the annotated extracted features, represents the prediction output of the domain classifier for the unlabeled extracted features; Step S42: Construct an adversarial loss function and maximize the domain classifier by minimizing the loss function prediction accuracy while minimizing the encoder The loss makes the features of the source domain and the target domain indistinguishable; the adversarial loss function includes the domain classifier loss and encoder loss ; Domain Classifier Loss It is expressed as: ; Encoder loss It is expressed as: ; in, represents the number of samples in the source domain, represents the number of samples in the target domain, represents the probability that the target domain sample i belongs to the source domain, represents the probability that the source domain sample j belongs to the target domain, represents the probability that the target domain sample i is misclassified as the source domain, It represents the probability that the source domain sample j is misclassified as the target domain.
[0015] Furthermore, step S5 is specifically as follows: Step S51: Obtain the corresponding disturbance feature tensor according to the output feature F of the encoder , the perturbed feature tensor By solving the following optimization problem: ; in, Represents the original feature tensor, that is, the encoder output feature The probability distribution of is the probability distribution of the perturbed feature tensor, express Divergence is a measure of the difference between two distributions; it is measured by maximizing Divergence, ensuring that the perturbed feature tensor has a difference with the original feature tensor, represents the maximum value function; Step S52: Input the perturbed feature tensor and the original feature tensor into the decoder for decoding prediction, and construct a consistency loss function to make the prediction results of the perturbed feature tensor and the original feature tensor in the decoder consistent. The consistency loss function It is expressed as: ; in, represents the cross entropy loss, Represents the prediction result of the decoder.
[0016] The positive and progressive effects of the present invention are: 1) This invention discloses a self-training semantic segmentation method based on clustering prototypes. By fully mining the hidden information of unlabeled ultrasound image data, it reduces the reliance on large-scale labeled data. Through pseudo-labels generated by adaptive clustering, the model can automatically learn segmentation features, significantly reducing the cost of manual labeling and improving training efficiency. This self-supervised learning method greatly reduces the workload of clinical data labeling while ensuring segmentation accuracy.
[0017] 2) The domain-adaptive semantic segmentation model constructed by the present invention effectively solves the image quality and distribution differences caused by different ultrasound equipment, individual differences among patients, and changes in acquisition conditions. Through the adversarial training mechanism, the model achieves consistency in feature distribution between the source domain and the target domain, enhances the cross-domain generalization ability of the model, and ensures that the segmentation model can adapt to ultrasound images in various clinical environments.
[0018] 3) The present invention is based on the perturbation consistency learning method, which introduces random perturbations in the feature space to ensure the consistency of the model's output for the same data in different views or modalities. By solving the perturbation feature tensor with the maximum KL divergence, the model shows higher robustness and stability when processing diverse and complex ultrasound images, effectively overcoming the limitations of existing technologies in the face of data diversity and noise. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The present invention is a flowchart of the steps of a method for semantic segmentation of axillary nerve ultrasound images based on domain adaptation. DETAILED DESCRIPTION
[0020] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0021] Reference Figure 1 , a domain-adaptive semantic segmentation method for axillary nerve ultrasound images, in one example, comprises the following steps: Step S1: collecting axillary nerve ultrasound images, annotating some of the axillary nerve ultrasound images, preprocessing all axillary nerve ultrasound images, and constructing a data set based on them; Step S2: construct a semantic segmentation model and perform preliminary supervised fine-tuning to obtain a preliminary optimized semantic segmentation model based on the labeled data in step S1; The semantic segmentation model includes a serially connected encoder, a decoder, and a semantic segmentation head, and the axillary nerve ultrasound image in step S1 is imported into the semantic segmentation model for processing to obtain a semantic segmentation result; Step S3: self-training the clustering prototype of the semantic segmentation model initially optimized in step S2; specifically: The unlabeled axillary nerve ultrasound image and the labeled axillary nerve ultrasound image in the step S1 data set are respectively subjected to feature extraction by an encoder, and unlabeled extracted features and labeled extracted features are obtained respectively, and the labeled extracted features are clustered in a high-dimensional feature space by a clustering algorithm to generate multiple clustering prototypes, and the clustering prototypes are used as pseudo labels of the unlabeled axillary nerve ultrasound image, and a preliminarily optimized semantic segmentation model is obtained according to the pseudo labels and the unlabeled extracted features for self-training; Step S4: constructing a domain classifier, which classifies the unlabeled axillary nerve ultrasound images and the labeled axillary nerve ultrasound images in step S3; specifically, the unlabeled axillary nerve ultrasound images are used as target domains, and the labeled axillary nerve ultrasound images are used as source domains; Based on this, an adversarial training function is constructed and minimized to maximize the consistency of feature distribution between the source domain and the target domain; Step S5: Introduce the perturbation feature tensor according to the output of the encoder, import the output of the encoder and the perturbation feature tensor into the decoder together, construct a consistency loss function, and improve the noise resistance of the semantic segmentation model by minimizing the consistency loss function.
[0022] Furthermore, in one example, step S1 is specifically as follows: Step S11: Acquire axillary nerve ultrasound images of different patients under different equipment conditions; Step S12: marking the axillary nerve in the partial axillary nerve ultrasound image in step S11, and obtaining a marked axillary nerve ultrasound image; Step S13: preprocess all acquired axillary nerve ultrasound images through Gaussian filtering and histogram equalization, then perform grayscale standardization and RGB standardization, and then adjust the resolution of all axillary nerve ultrasound images to a uniform size.
[0023] Furthermore, in one example, step S2 is specifically as follows: Step S21: Transmit the axillary nerve ultrasound image After inputting the encoder, the encoder feature map is obtained. In this process, each layer of the encoder structure obtains the corresponding feature map, which is expressed as: ; ; in, represents the convolution operation, represents the downsampling operation, Represents the total number of layers of the encoder structure, represents the first layer encoder feature map, Indicates Layer encoder feature map; Step S22: Get the middle layer of the encoder Layer encoder feature map Then, the multi-head self-attention mechanism is used to Layer encoder feature map Process and obtain multi-head attention feature map , expressed as: ; ; ; ; ; in, are all learnable weight matrices, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Represents a multi-head self-attention mechanism; specifically: ; ; ; in, is the scaling factor, represents the number of attention heads, represents the preset weight matrix, represents the self-attention function, represents the normalization function, Indicates A head of attention, Indicates A head of attention, represents the concatenation function, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Step S23: The multi-head attention feature map is processed by a decoder based on a multi-head cross convolution attention mechanism. Process and obtain Layer decoder feature map , expressed as: ; ; ;
[0024] ; ; in, represents the upsampling operation, Represents the multi-head cross convolution attention mechanism; Step S24: Use the semantic segmentation head to segment the Layer decoder feature map Make predictions and obtain semantic segmentation results; Step S25: construct a loss function, and minimize the loss function based on the annotations in step S12 to optimize the model.
[0025] Furthermore, in one example, step S3 is specifically: Step S31: annotated axillary nerve ultrasound images in the data set And an unlabeled ultrasound image of the axillary nerve Performing random change operations for preprocessing, the random change operations include rotation, inversion, cropping and grayscale transformation; The preprocessed and labeled axillary nerve ultrasound image And an unlabeled ultrasound image of the axillary nerve Input to encoder Perform feature extraction operations in the and unlabeled feature extraction ; Step S32: Extract features from labeled data using density clustering algorithm and unlabeled feature extraction Perform unsupervised clustering; specifically: For each data point , calculate the value of this data point Neighborhood, expressed as: ; in, express of Neighborhood, represents the Euclidean distance, Represents data points The adjacent data points of The data points As the core point, The points in the neighborhood are grouped into the same cluster and continue to Neighborhood expansion: adjacent data points ,if It can also be used as a core point for further expansion Neighborhood; expressed as: ; ; in, is the minimum number of cluster core points, express Neighborhood; Repeat the expansion process until the constraints cannot be satisfied; In this process, the marker is not a core point and does not belong to any core point. The points in the neighborhood are noise points, and no processing is done on them; Step S33: After completing the clustering operation, obtain the clustering prototype , expressed as: ; in, is assigned to The feature set of each cluster; It is The number of features contained in each cluster; is assigned to Features in clusters; Step S34: Cluster prototype As pseudo labels, a self-supervised loss function is constructed based on the pseudo labels, and the self-supervised loss function is minimized to further optimize the semantic segmentation model; Among them, the self-supervised loss function includes the contrast loss function and the mean square error consistency loss function. The contrast loss function It is expressed as: ; in, represents the pseudo labels corresponding to samples i and j, represents the unlabeled extracted features corresponding to sample i and sample j, is the indicator function, represents the Euclidean distance; Among them, the mean square error consistency loss function It is expressed as: ; in, Indicates the total number of samples.
[0026] Further, in one example, the domain classifier in step S4 is composed of 2 fully connected layers; Step S4 is specifically as follows: Step S41: Domain classifier extracts features from the labeled and unlabeled feature extraction The process of differentiation is expressed as: ; in, represents the domain classifier, represents the prediction output of the domain classifier for the annotated extracted features, represents the prediction output of the domain classifier for the unlabeled extracted features; Step S42: Construct an adversarial loss function and maximize the domain classifier by minimizing the loss function prediction accuracy while minimizing the encoder The loss makes the features of the source domain and the target domain indistinguishable; the adversarial loss function includes the domain classifier loss and encoder loss ; Domain Classifier Loss It is expressed as: ; Encoder loss It is expressed as: ; in, represents the number of samples in the source domain, represents the number of samples in the target domain, represents the probability that the target domain sample i belongs to the source domain, represents the probability that the source domain sample j belongs to the target domain, represents the probability that the target domain sample i is misclassified as the source domain, It represents the probability that the source domain sample j is misclassified as the target domain.
[0027] Furthermore, in one example, step S5 is specifically as follows: Step S51: Obtain the corresponding disturbance feature tensor according to the output feature F of the encoder , the perturbed feature tensor By solving the following optimization problem: ; in, Represents the original feature tensor, that is, the encoder output feature The probability distribution of is the probability distribution of the perturbed feature tensor, express Divergence is a measure of the difference between two distributions; it is measured by maximizing Divergence, ensuring that the perturbed feature tensor has a difference with the original feature tensor, represents the maximum value function; Step S52: Input the perturbed feature tensor and the original feature tensor into the decoder for decoding prediction, and construct a consistency loss function to make the prediction results of the perturbed feature tensor and the original feature tensor in the decoder consistent. The consistency loss function It is expressed as: ; in, represents the cross entropy loss, Represents the prediction result of the decoder.
[0028] The present invention is described in detail above in conjunction with the embodiments of the accompanying drawings. A person skilled in the art can make various variations of the present invention according to the above description. Therefore, some details in the embodiments should not be construed as limiting the present invention, and the present invention shall be protected by the scope defined by the attached claims.
Claims
1. A domain-adaptive semantic segmentation method for axillary nerve ultrasound images, characterized in that: The following steps are involved: Step S1: collecting axillary nerve ultrasound images, annotating some of the axillary nerve ultrasound images, preprocessing all axillary nerve ultrasound images, and constructing a data set based on them; Step S2: construct a semantic segmentation model and perform preliminary supervised fine-tuning to obtain a preliminary optimized semantic segmentation model based on the labeled data in step S1; The semantic segmentation model includes a serially connected encoder, a decoder, and a semantic segmentation head, and the axillary nerve ultrasound image in step S1 is imported into the semantic segmentation model for processing to obtain a semantic segmentation result; Step S3: self-training the clustering prototype of the semantic segmentation model initially optimized in step S2; specifically: The unlabeled axillary nerve ultrasound image and the labeled axillary nerve ultrasound image in the step S1 data set are respectively subjected to feature extraction by an encoder, and unlabeled extracted features and labeled extracted features are obtained respectively, and the labeled extracted features are clustered in a high-dimensional feature space by a clustering algorithm to generate multiple clustering prototypes, and the clustering prototypes are used as pseudo labels of the unlabeled axillary nerve ultrasound image, and a preliminarily optimized semantic segmentation model is obtained according to the pseudo labels and the unlabeled extracted features for self-training; Step S4: constructing a domain classifier, which classifies the unlabeled axillary nerve ultrasound images and the labeled axillary nerve ultrasound images in step S3; specifically, the unlabeled axillary nerve ultrasound images are used as target domains, and the labeled axillary nerve ultrasound images are used as source domains; Based on this, an adversarial training function is constructed and minimized to maximize the consistency of feature distribution between the source domain and the target domain; Step S5: Introduce the perturbation feature tensor according to the output of the encoder, import the output of the encoder and the perturbation feature tensor into the decoder together, construct a consistency loss function, and improve the noise resistance of the semantic segmentation model by minimizing the consistency loss function.
2. The domain-adaptive semantic segmentation method for axillary nerve ultrasound images according to claim 1, characterized in that: Step S1 is specifically as follows: Step S11: Acquire axillary nerve ultrasound images of different patients under different equipment conditions; Step S12: marking the axillary nerve in the partial axillary nerve ultrasound image in step S11, and obtaining a marked axillary nerve ultrasound image; Step S13: preprocess all acquired axillary nerve ultrasound images through Gaussian filtering and histogram equalization, then perform grayscale standardization and RGB standardization, and then adjust the resolution of all axillary nerve ultrasound images to a uniform size.
3. The domain-adaptive semantic segmentation method for axillary nerve ultrasound images according to claim 2, characterized in that: Step S2 is specifically as follows: Step S21: Transmit the axillary nerve ultrasound image After inputting the encoder, the encoder feature map is obtained. In this process, each layer of the encoder structure obtains the corresponding feature map, which is expressed as: ; ; in, represents the convolution operation, represents the downsampling operation, Represents the total number of layers of the encoder structure, represents the first layer encoder feature map, Indicates Layer encoder feature map; Step S22: Get the middle layer of the encoder Layer encoder feature map Then, the multi-head self-attention mechanism is used to Layer encoder feature map Process and obtain multi-head attention feature map , expressed as: ; ; ; ; ; in, are all learnable weight matrices, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Represents a multi-head self-attention mechanism; specifically: ; ; ; in, is the scaling factor, represents the number of attention heads, represents the preset weight matrix, represents the self-attention function, represents the normalization function, Indicates A head of attention, Indicates A head of attention, represents the concatenation function, Indicates The query vector corresponding to the layer encoder feature map, Indicates The key vector corresponding to the layer encoder feature map, Indicates The value vector corresponding to the layer encoder feature map; Step S23: The multi-head attention feature map is processed by a decoder based on a multi-head cross convolution attention mechanism. Process and obtain Layer decoder feature map , expressed as: ; ; ; ; ; in, represents the upsampling operation, Represents the multi-head cross convolution attention mechanism; Step S24: Use the semantic segmentation head to segment the Layer decoder feature map Make predictions and obtain semantic segmentation results; Step S25: construct a loss function, and minimize the loss function based on the annotations in step S12 to optimize the model.
4. The domain-adaptive semantic segmentation method for axillary nerve ultrasound images according to claim 3, characterized in that: Step S3 is specifically as follows: Step S31: annotated axillary nerve ultrasound images in the data set And an unlabeled ultrasound image of the axillary nerve Performing random change operations for preprocessing, the random change operations include rotation, inversion, cropping and grayscale transformation; The preprocessed and labeled axillary nerve ultrasound image And an unlabeled ultrasound image of the axillary nerve Input to encoder Perform feature extraction operations in the and unlabeled feature extraction ; Step S32: Extract features from labeled data using density clustering algorithm and unlabeled feature extraction Perform unsupervised clustering; specifically: For each data point , calculate the value of this data point Neighborhood, expressed as: ; in, express of Neighborhood, represents the Euclidean distance, Represents data points The adjacent data points of The data points As the core point, The points in the neighborhood are grouped into the same cluster and continue to Neighborhood expansion: adjacent data points ,if It can also be used as a core point for further expansion Neighborhood; expressed as: ; ; in, is the minimum number of cluster core points, express Neighborhood; Repeat the expansion process until the constraints cannot be satisfied; In this process, the marker is not a core point and does not belong to any core point. The points in the neighborhood are noise points, and no processing is done on them; Step S33: After completing the clustering operation, obtain the clustering prototype , expressed as: ; in, is assigned to The feature set of each cluster; It is The number of features contained in each cluster; is assigned to Features in clusters; Step S34: Cluster prototype As pseudo labels, a self-supervised loss function is constructed based on the pseudo labels, and the self-supervised loss function is minimized to further optimize the semantic segmentation model; Among them, the self-supervised loss function includes the contrast loss function and the mean square error consistency loss function. The contrast loss function It is expressed as: ; in, represents the pseudo labels corresponding to samples i and j, represents the unlabeled extracted features corresponding to sample i and sample j, is the indicator function, represents the Euclidean distance; Among them, the mean square error consistency loss function It is expressed as: ; in, Indicates the total number of samples.
5. The domain-adaptive semantic segmentation method for axillary nerve ultrasound images according to claim 4, characterized in that: The domain classifier in step S4 consists of 2 fully connected layers; Step S4 is specifically as follows: Step S41: Domain classifier extracts features from the labeled and unlabeled feature extraction The process of differentiation is expressed as: ; in, represents the domain classifier, represents the prediction output of the domain classifier for the annotated extracted features, represents the prediction output of the domain classifier for the unlabeled extracted features; Step S42: Construct an adversarial loss function and maximize the domain classifier by minimizing the loss function prediction accuracy while minimizing the encoder The loss makes the features of the source domain and the target domain indistinguishable; the adversarial loss function includes the domain classifier loss and encoder loss ; Domain Classifier Loss It is expressed as: ; Encoder loss It is expressed as: ; in, represents the number of samples in the source domain, represents the number of samples in the target domain, represents the probability that the target domain sample i belongs to the source domain, represents the probability that the source domain sample i belongs to the target domain, represents the probability that the target domain sample j is misclassified as the source domain, It represents the probability that the source domain sample j is misclassified as the target domain.
6. The domain-adaptive semantic segmentation method for axillary nerve ultrasound images according to claim 5, characterized in that: Step S5 is specifically as follows: Step S51: Obtain the corresponding disturbance feature tensor according to the encoder output feature F , the perturbed feature tensor By solving the following optimization problem: ; in, Represents the original feature tensor, that is, the encoder output feature The probability distribution of is the probability distribution of the perturbed feature tensor, express Divergence is a measure of the difference between two distributions; it is measured by maximizing Divergence, ensuring that the perturbed feature tensor has a difference with the original feature tensor, represents the maximum value function; Step S52: Input the perturbed feature tensor and the original feature tensor into the decoder for decoding prediction, and construct a consistency loss function to make the prediction results of the perturbed feature tensor and the original feature tensor in the decoder consistent. The consistency loss function It is expressed as: ; in, represents the cross entropy loss, Represents the prediction result of the decoder.
Citation Information
Patent Citations
Unsupervised domain adaptation method based on adversarial learning loss function
CN110837850A
Method, system and device for realizing classification and identification of X-ray image based on two-way decoder, processor and storage medium
CN115631183A
High-resolution image change detection method based on CIM-T architecture
CN116030361A
Semi-supervised segmentation model construction and image analysis method, device and system
CN116051574A
MRI brain tumor classification method and system based on semi-supervised learning
CN116385809A
Cited By
Cross-domain weather adaptive point cloud semantic segmentation method and device, equipment and medium
CN122574856A
