Breast feature extraction, detection model training method and device
Through region replacement processing and feature extraction and restoration technology, the feature extraction problem of the breast detection model in the case of insufficient samples is solved, high-precision breast feature extraction and detection is achieved, and the accuracy of breast tissue examination is improved.
Patent Information
- Application Number
- CN202210579797.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-05-26
AI Technical Summary
In existing breast tissue examinations, detection models based on deep learning are difficult to learn and determine areas related to breast abnormalities in the absence of a large number of sample sets, resulting in insufficient feature extraction and low detection accuracy.
By dividing the breast image into multiple areas, determine the area to be replaced and the target area, use the encoder model for feature extraction and the decoder model for image restoration, adjust the initial feature model to reduce the difference, gradually improve the feature extraction capability, and form breast features Extract model.
A high-precision breast feature extraction model is trained with a small sample size, focusing on easily overlooked regional features, improving detection accuracy and saving training time.
Smart Images

Figure CN114820576B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of medical image processing, and in particular to a method, apparatus, computer equipment, computer-readable storage medium and computer program product for extracting and detecting breast features and training a detection model. Background Art
[0002] When examining breast tissue, mammography, computed tomography, ultrasound or magnetic resonance imaging can be used to image the breast. After imaging, the breast image can be manually outlined to identify areas where abnormalities may exist. However, this method is too time-consuming and labor-intensive, and is highly subjective, resulting in a low accuracy rate in identifying abnormalities. In order to solve this problem, traditional technologies have introduced detection models based on deep learning, neural networks, etc. for automatic abnormality identification. This type of detection model requires feature extraction during the processing process, and the effect of feature extraction is closely related to the final detection accuracy. However, due to the lack of a large number of sample sets, it is difficult for the detection model to learn and determine which areas are related to breast abnormalities during the training process, thereby ignoring the features of some important areas and not extracting them, resulting in the detection model still unable to achieve a high detection accuracy. Summary of the invention
[0003] Based on this, it is necessary to provide a training method, device, computer equipment, computer-readable storage medium and computer program product for a breast feature extraction and detection model that can train a high-precision model with a smaller sample size to address the above-mentioned technical problems.
[0004] In a first aspect, an embodiment of the present invention provides a training method for a breast feature extraction model, which is used to train an initial feature model, wherein the initial feature model includes an encoder model and a decoder model, and the training method includes: dividing an original breast image into multiple regions; determining at least one region to be replaced and a target region from the multiple regions, and replacing the image of the region to be replaced with the image of the target region to obtain multiple replacement images; wherein the target region has different region attributes from the region to be replaced, and the region attributes are determined by the proportion of the image of interest contained in the region; using the encoder model to extract features from the replacement image, and using the decoder model to restore the image according to the result of the feature extraction to obtain a restored image; determining a first difference based on the difference between the restored image and the original breast image; adjusting the initial feature model with the goal of reducing the first difference; and obtaining a breast feature extraction model based on the encoder model in the initial feature model after the training is completed.
[0005] In one of the embodiments, the region attributes include positive sample attributes and negative sample attributes, the ratio of the image of interest contained in the region with the positive sample attributes is greater than or equal to a preset ratio threshold, the ratio of the image of interest contained in the region with the negative sample attributes is less than the preset ratio threshold, the region to be replaced includes a first region to be replaced and a second region to be replaced, the target region includes a first target region and a second target region, and the replacement image includes a first replacement image and a second replacement image;
[0006] Determining at least one area to be replaced and a target area from the multiple areas includes:
[0007] At least one region with negative sample attributes is used as a first region to be replaced, and at least one region with positive sample attributes is used as a first target region; at least one region with positive sample attributes is used as a second region to be replaced, and at least one region with negative sample attributes is used as a second target region;
[0008] Replacing the image of the to-be-replaced area with the image of the target area to obtain multiple replacement images includes:
[0009] The image of the first area to be replaced is replaced with the image of the first target area to obtain a first replacement image, and the image of the second area to be replaced is replaced with the image of the second target area to obtain a second replacement image.
[0010] In one embodiment, the initial feature model also includes a region replacement model, which replaces the image of the first region to be replaced with the image of the first target region to obtain a first replacement image, and replaces the image of the second region to be replaced with the image of the second target region to obtain the second replacement image, including: inputting the original breast image into the region replacement model, replacing the image of the first region to be replaced with the image of the first target region through the region replacement model to obtain the first replacement image, and replacing the image of the second region to be replaced with the image of the second target region to obtain the second replacement image.
[0011] In one embodiment, with the goal of reducing the first difference, before adjusting the initial feature model, the method further includes: determining a second difference based on differences between the plurality of replacement images and the corresponding original breast images, and / or determining a third difference based on differences between the first replacement image and the second replacement image;
[0012] With the goal of reducing the first difference, adjusting the initial feature model includes:
[0013] The initial feature model is adjusted with the goal of reducing the first difference and increasing the second difference and / or the third difference.
[0014] In one embodiment, replacing the image of the first area to be replaced with the image of the first target area to obtain the first replacement image includes: performing image transformation processing on the image of the first target area; replacing the image of the first area to be replaced with the image of the first target area after the image transformation processing to obtain the first replacement image.
[0015] In one embodiment, before dividing the original breast image into a plurality of regions, the method further includes: performing boundary segmentation processing on the original breast image to remove the background in the original breast image.
[0016] In a second aspect, an embodiment of the present invention provides a training method for a breast detection model, which is used to train an initial detection model. The initial detection model includes a feature recognition model and a breast feature extraction model obtained by the above-mentioned training method. The training method includes: inputting a labeled breast image into a breast feature extraction model to obtain image features; the annotations in the labeled breast image are used to reflect the detection results of the image of interest; inputting the image features into a feature recognition model to obtain predicted detection results; determining a fourth difference based on the difference between the predicted detection results and the annotations of the labeled breast image; adjusting the initial detection model with the goal of reducing the fourth difference, and obtaining a breast detection model based on the initial detection model after the training is completed.
[0017] In a third aspect, an embodiment of the present invention provides a training device for a breast feature extraction model, which is used to train an initial feature model, wherein the initial feature model includes an encoder model and a decoder model, and the training device includes: a region division module, which is used to divide an original breast image into multiple regions; a replacement image acquisition module, which is used to determine at least one region to be replaced and a target region from multiple regions, and replace the image of the region to be replaced with the image of the target region to obtain multiple replacement images; wherein the target region has different region attributes from the region to be replaced, and the region attributes are determined by the proportion of the image of interest contained in the region; an image processing module, which is used to extract features from the replacement image using the encoder model, and restore the image according to the result of the feature extraction using the decoder model to obtain a restored image; a difference determination module, which is used to determine a first difference according to the difference between the restored image and the original breast image; a parameter adjustment module, which is used to adjust the initial feature model with the goal of reducing the first difference; and a model determination module, which is used to obtain a breast feature extraction model based on the encoder model in the initial feature model after the training is completed.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program, or the steps of the above method.
[0019] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method or the steps of the above method when the computer program is executed by a processor.
[0020] In a sixth aspect, an embodiment of the present invention provides a computer program product, comprising a computer program, which implements the steps of the above method or the steps of the above method when executed by a processor.
[0021] Based on any of the above embodiments, the original breast image is subjected to region replacement processing to obtain multiple replacement images corresponding to the original breast image, and then the initial feature model is used to extract features and restore the replacement images. In the process of adjusting the initial feature model, the difference between the restored image and the original breast image is gradually reduced to gradually improve the feature extraction capability of the encoder model, and ensure that the encoder model can focus on the features of easily ignored areas. This method is applied to scenarios where there are few original breast images, resulting in an insufficient number of training samples. Many images with learning value can be obtained through region replacement processing, which provides a large number of samples for training, ensuring high training accuracy and saving training time, and being able to achieve the same effect as training with a large number of original breast images by using fewer original breast images. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a flow chart of a method for training a breast feature extraction model in one embodiment;
[0023] Figure 2 A schematic diagram of a process of performing region replacement on an original breast image in one embodiment;
[0024] Figure 3 is a schematic diagram of a process of performing region replacement on an original breast image in another embodiment;
[0025] Figure 4 A schematic diagram of a flow chart of a method for training a breast detection model in one embodiment;
[0026] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0028] The breast feature extraction model and the training method of the breast detection model provided by the present application can be applied to a terminal, a physical server or a cloud server. Wherein, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers, etc. The physical server can be implemented with an independent server or a server cluster composed of multiple servers. After the breast detection model training is completed, it is arranged in a terminal, a physical server or a cloud server, which can be used to detect breast images. The detection tasks include but are not limited to image segmentation, target detection, image classification, etc. In another possible implementation, the terminal, physical server or cloud server can also call the breast detection model on other terminals, physical servers or cloud servers to perform the process of the detection task when there is a detection task, and the embodiment of the present application is not limited to this.
[0029] In one embodiment, Figure 1 As shown, a training method for a breast feature extraction model is provided. The method can be used to train an initial feature model. The initial feature model includes an encoder model and a decoder model. The training method includes steps S102 to S112.
[0030] S102, dividing the original breast image into multiple regions.
[0031] Breast imaging can be obtained by imaging breast tissue through medical imaging technology, and the original breast image can be obtained by annotating the image of interest in the breast imaging. The breast tissue at the image of interest may have lesions, and the position of the corresponding breast tissue is determined according to the position of the image of interest, so as to perform further laboratory tests. The annotation can be performed by manually, automatically, or semi-automatically outlining the breast imaging. The annotation of the image of interest in the original breast image can be an actual annotation box on the breast imaging, or it can be the position of the image of interest, such as coordinates. In addition, since the size of the original breast image is large, in order to ensure the processing speed, the original breast image is first divided into multiple regions, and the image of each region is processed separately to ensure efficiency. Optionally, the original breast image can be divided into regions by sliding window method, random sampling method, grid method, etc. In addition, the input encoder model in this embodiment does not necessarily mean that the original breast image is actually cropped. It can be determined whether the actual image cropping is required based on the structure of the initial feature model. For example, when the initial feature model adopts a transformer structure, the image of the input model needs to be cropped into small blocks. However, if the initial feature model adopts the structure of a convolutional neural network and has good computing performance, image cropping may not be performed.
[0032] S104, determining at least one area to be replaced and a target area from the multiple areas, and replacing the image of the area to be replaced with the image of the target area to obtain multiple replacement images.
[0033] Among them, the target area has different regional attributes from the area to be replaced, and the regional attributes are determined by the proportion of the image of interest contained in the area. Specifically, the regional attributes include positive sample attributes and negative sample attributes. The proportion of the image of interest contained in the area with positive sample attributes is greater than or equal to the preset ratio threshold, and the proportion of the image of interest contained in the area with negative sample attributes is less than the preset ratio threshold. The preset ratio threshold can be set according to actual conditions, for example, the preset ratio threshold is selected as 10%. Since there are annotations about the image of interest in the original breast image, the proportion of the image of interest contained in each divided area can be determined based on the annotation. For example, when the annotation is a annotation box, the ratio between the number of pixels of the image of interest encircled by the annotation box in this area and the number of all pixels in this area can be determined. Or when the annotation is the position of the image of interest, the overlap ratio of the position of the image of interest and the position of this area can be determined.
[0034] Since it is time-consuming and laborious to annotate breast imaging, the number of original breast images is relatively small. Therefore, the number of samples that can be used for model training is insufficient, and the present embodiment performs regional replacement on the original breast image to obtain a plurality of replacement images corresponding to the original breast image that have learning value. Specifically, when the area to be replaced is an area with positive sample attributes, the target area corresponding to the area to be replaced is an area with negative sample attributes, and vice versa. The correspondence between the area to be replaced and the target area can be one-to-one correspondence or two or more areas to be replaced correspond to one target area, which is not limited in the present embodiment. In order to obtain a plurality of different replacement images based on an original breast image, there are many ways of replacement. For example, for the same area to be replaced, different target areas are used for replacement, respectively, to obtain a plurality of replacement images. For another example, different areas to be replaced are selected, and the same or different target areas are used for replacement, to obtain a plurality of replacement images. The replacement method is not limited to the above examples, and one or more of the multiple replacement methods can be used as long as different replacement images can be obtained.
[0035] S106, using the encoder model to extract features from the replacement image, and using the decoder model to restore the image according to the feature extraction results to obtain a restored image.
[0036] S108, determining a first difference according to the difference between the restored image and the original breast image.
[0037] S110, adjusting the initial feature model with the goal of reducing the first difference.
[0038] It can be understood that the traditional technology includes an autoencoder neural network, which is composed of an encoder model and a decoder model. For a trained autoencoder neural network, an object is input into the encoder model for feature extraction, and the decoder model can restore the feature extraction to the input object. Based on this neural network technology, this embodiment replaces the image input encoder model, and uses the decoder model to restore the image according to the result of feature extraction to obtain a restored image.
[0039] Unlike conventional autoencoder neural networks, the training of the initial feature model in this embodiment is not intended to make the restored image obtained after the replacement image is input close to the replacement image, but to make the restored image close to the original breast image. This is because, since the replacement image is the original breast image after region replacement, if you want to restore the image of the replaced region, you need to learn the features of the region attributes from the region with the same region attributes as the replaced region, so that restoration can be achieved based on the features. Therefore, in the process of adjusting the initial feature model with the goal of reducing the first difference, the encoder model can understand which features in the region with positive sample attributes or negative sample attributes are the most important, thereby forcing the encoder to pay attention to regions with important features that were not paid attention to when the sample size was small.
[0040] Therefore, as the first difference decreases, the encoder model has a stronger ability to extract features from breast-related images, that is, it is easier to accurately judge the correlation between the image features and the image of interest in the region based on its output. Specifically, the initial feature model can be adjusted to construct a first loss function based on the first difference, with the goal of reducing the value of the first loss function, and adjusting the first parameter corresponding to the encoder model and the second parameter corresponding to the decoder model respectively. The first loss function can be in the form of a mean square error (MSE) loss function, a mean absolute error (MAE) loss function, a dice loss function, a cross entropy loss function, or the like. A combination of one or more of these can be used, and when using multiple forms of loss functions, corresponding weights can also be set for different loss functions.
[0041] S112, obtaining a breast feature extraction model based on the encoder model in the initial feature model after training.
[0042] In the whole training process, steps S102 to S110 can be repeated for many times, that is, can be repeated for a certain original mammary gland image, or can be repeated for many times after reselecting another original mammary gland image, which is not limited in the present embodiment. The condition for the end of training can be designed according to actual conditions, such as the first difference is less than the first threshold value, the number of iterations reaches the first preset number of times, etc. The encoder model after the training can pay attention to the area ignored by the traditional feature extraction model, so as to extract features more comprehensively. The mammary gland feature extraction model obtained based on the encoder model after the training can be used for further mammary gland detection, for example, for classifying mammary gland images, target detection, image segmentation, etc., because the feature extraction ability of the mammary gland feature extraction model is very strong, it lays the foundation for improving the accuracy of mammary gland detection.
[0043] Based on the training method of the breast feature extraction model in the present embodiment, the original breast image is subjected to region replacement processing to obtain multiple replacement images corresponding to the original breast image, and then the initial feature model is used to extract features and restore the replacement images. In the process of adjusting the initial feature model, the difference between the restored image and the original breast image is gradually reduced to gradually improve the feature extraction capability of the encoder model, and ensure that the encoder model can focus on the features of easily ignored areas. This method is applied to the scenario where there are few original breast images, resulting in an insufficient number of training samples. Many images with learning value can be obtained through region replacement processing, which provides a large number of samples for training, ensuring high training accuracy and saving training time, and being able to achieve the same effect as training with a large number of original breast images by training with fewer original breast images.
[0044] In one embodiment, the area to be replaced includes a first area to be replaced and a second area to be replaced. The target area includes a first target area and a second target area. The replacement image includes a first replacement image and a second replacement image. Figure 2 , determining at least one to-be-replaced area and a target area from the multiple areas, and replacing the image of the to-be-replaced area with the image of the target area to obtain multiple replacement images includes step S202 to step S206.
[0045] S202: Taking at least one region with negative sample attributes as a first region to be replaced, and taking at least one region with positive sample attributes as a first target region.
[0046] One or more regions are selected from the regions with negative sample attributes as the first region to be replaced. The ratio between the number of regions included in the first region to be replaced and the total number of regions with negative sample attributes can be a first preset ratio. The size of the first preset ratio will affect the difference between the replacement image and the original breast image. The larger the first preset ratio, the more regions are replaced, and the greater the difference between the replacement image and the original breast image obtained thereby, and vice versa, which is similar and will not be repeated.
[0047] S204: taking at least one region having a positive sample attribute as a second region to be replaced, and taking at least one region having a negative sample attribute as a second target region.
[0048] One or more regions are selected from the regions with positive sample attributes as the second region to be replaced. The ratio between the number of regions included in the second region to be replaced and the total number of regions with positive sample attributes can be a second preset ratio. The size of the second preset ratio will affect the difference between the replacement image and the original breast image. The larger the second preset ratio, the more regions are replaced, and the greater the difference between the replacement image obtained and the original breast image, and vice versa, similar, no further description is given.
[0049] S206: Replace the image of the first area to be replaced with the image of the first target area to obtain a first replacement image, and replace the image of the second area to be replaced with the image of the second target area to obtain a second replacement image.
[0050] Only replacing the region with negative sample attributes in the original breast image can obtain the first replacement image, and a good restoration can be performed based on the first replacement image, which means that the encoder model can extract features related to the image of normal breast tissue from the second replacement image. Only replacing the region with positive sample attributes in the original breast image can obtain the second replacement image, and a good restoration can be performed based on the second replacement image, which means that the encoder model can extract important features related to the image of interest.
[0051] In one embodiment, the initial feature model also includes a region replacement model, that is, the relevant processing of region replacement can be implemented by the region replacement model in the neural network of the initial feature model. Specifically, replacing the image of the first region to be replaced with the image of the first target region to obtain a first replacement image, and replacing the image of the second region to be replaced with the image of the second target region to obtain a second replacement image includes: inputting the original breast image into the region replacement model, replacing the image of the first region to be replaced with the image of the first target region through the region replacement model, obtaining the first replacement image, and replacing the image of the second region to be replaced with the image of the second target region through the region replacement model, obtaining the second replacement image.
[0052] That is, the region replacement process in this embodiment is also implemented by a part of the initial feature model. Therefore, the region replacement model can be adjusted during the training of the initial feature model, so as to find a replacement method with better learning effect among multiple replacement methods.
[0053] In one embodiment, with the goal of reducing the first difference, before adjusting the initial feature model, the method further includes: determining a second difference based on the difference between the plurality of replacement images and the corresponding original breast image, and / or determining a third difference based on the difference between the first replacement image and the second replacement image. With the goal of reducing the first difference, adjusting the initial feature model includes: adjusting the initial feature model with the goal of reducing the first difference and expanding the second difference and / or the third difference.
[0054] In order to find a better way to replace the region, it is necessary to adjust the region replacement model when adjusting the encoder model and the decoder model, and in order to improve the capabilities of the encoder model and the decoder model, the restoration difficulty should be increased. Therefore, the direction in which the region replacement model can be adjusted is to enlarge the difference between the replacement image and the original breast image, and / or to enlarge the difference between the first replacement image and the second replacement image. Both of these adjustment directions can increase the difficulty of restoration. If the encoder model and the decoder model can achieve the restoration task with greater difficulty, it means that the capabilities of the encoder model and the decoder model are further enhanced. Specifically, when constructing the first loss function, in addition to the loss term corresponding to the first difference, the loss term of the second difference and / or the third difference should also be added. However, if the goal is to reduce the value of the first loss function, the first parameter corresponding to the encoder model, the second parameter corresponding to the decoder model, and the third parameter corresponding to the region replacement model are adjusted respectively, then the negative value of the loss term of the second difference and / or the third difference should be added to the first loss function to reduce the first difference and enlarge the second difference and / or the third difference. Among them, since the first preset ratio or the second preset ratio is related to the difference between the replacement image and the original breast image, the third parameter may include the first preset ratio and / or the second preset ratio, so as to select a more appropriate first preset ratio and / or second preset ratio. Optionally, in order to evaluate the above-mentioned first difference, second difference or third difference, common image quality evaluation indicators can be used, such as PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity), MSE (Mean Square Error), etc.
[0055] In one embodiment, see Figure 3 , replacing the image of the first to-be-replaced area with the image of the first target area, and obtaining the first replacement image includes step S302 to step S304.
[0056] S302: Perform image transformation processing on the image of the first target area.
[0057] S304: Replace the image of the first area to be replaced with the image of the first target area after image transformation processing to obtain a first replacement image.
[0058] Specifically, since the proportion of the image of interest in the entire original breast image is small, the number of areas with positive sample attributes is small, so the number of areas that can be used to replace the negative sample areas is also small, making it difficult to obtain a large number of first replacement images. In order to solve this problem, the image of the selected first target area can be subjected to image transformation processing, such as random rotation, flipping, scaling, mirroring, etc. The number of areas with positive sample attributes is expanded through image transformation processing, and additional areas with positive sample attributes can be obtained without re-imaging and labeling the breast. In the case of performing region replacement processing through a region replacement model, the steps in this embodiment can also be performed by the region replacement model.
[0059] Similarly, in one embodiment, replacing the image of the second area to be replaced with the image of the second target area to obtain the second replacement image includes: performing image transformation processing on the image of the second target area; replacing the image of the second area to be replaced with the image of the second target area after the image transformation processing to obtain the second replacement image. Considering that there are a large number of areas with negative sample attributes, in some embodiments, the expansion can be performed without the above-mentioned image transformation processing.
[0060] In one embodiment, before dividing the original breast image into a plurality of regions, the method further includes: performing boundary segmentation processing on the original breast image to remove the background in the original breast image. It is understandable that the background refers to an image that is irrelevant to breast tissue, such as a large black background included in some original breast images, which results in the initial feature model having to process more useless images during the training process, affecting the processing speed. Therefore, in this embodiment, the background is removed by boundary segmentation processing to speed up the training speed. The boundary segmentation processing can be performed by resampling method, threshold limiting method, gray histogram normalization method, etc.
[0061] In one embodiment, Figure 4 As shown, a breast detection model training method is provided, which is used to train an initial detection model. The initial detection model includes a feature recognition model and a breast feature extraction model obtained by the above-mentioned training method. The training method includes steps S402 to S410.
[0062] S402, inputting the labeled breast image into a breast feature extraction model to obtain image features.
[0063] The annotations in the annotated breast image are used to reflect the detection results of the image of interest. The annotation can be performed manually, automatically, semi-automatically, etc. on the breast imaging. The annotations in the annotated breast image can be a labeling box for the image of interest on the breast imaging, or the location of the image of interest, such as coordinates, or a classification of the nature of the image of interest, such as whether the image of interest is benign or malignant, whether the breast image contains the image of interest, etc. The image of interest can be a breast calcification tissue image, a breast mass tissue image, etc. Since the breast feature extraction model is obtained through the training method of the above-mentioned breast feature extraction model, the possibility that the extracted image features ignore the features related to the image of interest is very small, laying a foundation for improving the accuracy of breast detection.
[0064] S404, inputting the image features into a feature recognition model to obtain a predicted detection result.
[0065] It can be understood that the feature recognition model is used to output the predicted detection results based on the image features. The predicted detection results have various forms. The appropriate feature recognition model can be selected according to the detection task to be performed and the category of the detection results in the annotated breast image to obtain the corresponding predicted detection results. Optionally, when the position of the annotated box or the image of interest is marked, the feature recognition model can be an image segmentation model, and the image segmentation model can segment the image of interest contained in the breast image. The feature recognition model can also be a target detection model, and the target detection model can detect the image of interest contained in the breast image. The difference between the target detection model and the image segmentation model is mainly that the output result of the target detection model can directly select the image of interest on the breast image, that is, the annotated box can be marked on the breast image, while the output of the image segmentation model is a mask image, and the pixels at the image of interest in the mask image are different from other non-images of interest, so as to achieve image segmentation. Image segmentation also specifically includes semantic segmentation, instance segmentation, etc., and the corresponding image segmentation model can be selected according to actual needs. Optionally, when the annotation is property classification, the feature recognition model can be a classification model, which can classify the breast image, for example, whether the entire breast image contains an image of interest, whether the image of interest marked in the annotated breast image is benign or malignant, etc.
[0066] S406: Determine a fourth difference according to a difference between the predicted detection result and the annotation of the annotated breast image.
[0067] The manner of determining the fourth difference is related to the selected feature recognition model. For example, when the feature recognition model is a segmentation model, the fourth difference can be determined based on the degree of overlap between the image of interest obtained from the segmentation result and the image of interest annotated by the annotated breast image. When the feature recognition model is a target detection model, the fourth difference can be determined based on the difference between the annotation box in the target detection result and the annotation box of the annotated breast image. When the feature recognition model is a classification model, the fourth difference can also be determined by comparing the difference between the classification result of the classification model and the actual classification in the annotation.
[0068] S408, adjusting the initial detection model with the goal of reducing the fourth difference.
[0069] It can be understood that, since the annotation of the annotated breast image can accurately reflect the detection result of the image of interest, as the fourth difference decreases, the predicted detection result predicted by the initial detection model is gradually close to the accurate detection result, so that the accuracy of automatic detection is gradually improved. Specifically, the initial detection model is adjusted, and a second loss function can be constructed based on the fourth difference, with the goal of reducing the value of the second loss function, and the fourth parameter corresponding to the breast feature extraction model and the fifth parameter corresponding to the feature recognition model are adjusted respectively. The second loss function can be in the form of a mean square error (MSE) loss function, a mean absolute error (MAE) loss function, a dice loss function, a cross entropy loss function, etc. When using multiple forms of loss functions, corresponding weights can also be set for different loss functions. Optionally, considering that the breast feature extraction model has been preliminarily trained, in the adjustment process of this embodiment, the fourth parameter is not adjusted first and only the fifth parameter is adjusted. After the preset training conditions are met (which can be after the number of iterations reaches the second preset number of times, the fourth difference is less than the second threshold, etc.), the fourth parameter and the fifth parameter are fine-tuned at the same time.
[0070] S410, obtaining a breast detection model based on the initial detection model after training.
[0071] During the entire training process, steps S402 to S408 can be repeated multiple times, that is, they can be repeated for a certain labeled breast image, or they can be repeated multiple times after reselecting another labeled breast image, which is not limited in this embodiment. The conditions for the end of training can be designed according to actual conditions, such as the fourth difference is less than the third threshold, the number of iterations reaches the third preset number, etc. The third threshold is greater than or equal to the second threshold. The third preset number is greater than or equal to the second preset number.
[0072] Based on the training method of the breast detection model in this embodiment, the initial detection model including the breast feature extraction model and the feature recognition model is trained. Since the breast feature extraction model has a strong feature extraction capability, when the number of training samples is insufficient, high training accuracy can still be guaranteed and training time can be saved. The same effect as training with a large number of labeled breast images can be achieved by using fewer labeled breast images.
[0073] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0074] The embodiment of the present invention provides a training device for a breast feature extraction model, which is used to train an initial feature model, wherein the initial feature model includes an encoder model and a decoder model, and the training device includes a region division module, a replacement image acquisition module, an image processing module, a difference determination module, a parameter adjustment module, and a model determination module, wherein:
[0075] The region division module is used to divide the original breast image into multiple regions.
[0076] The replacement image acquisition module is used to determine at least one area to be replaced and a target area from multiple areas, and replace the image of the area to be replaced with the image of the target area to obtain multiple replacement images. The target area and the area to be replaced have different area attributes, and the area attribute is determined by the proportion of the image of interest contained in the area.
[0077] The image processing module is used to use the encoder model to extract features of the replacement image, and use the decoder model to restore the image according to the result of the feature extraction to obtain a restored image.
[0078] The difference determination module is used to determine a first difference according to the difference between the restored image and the original breast image.
[0079] The parameter adjustment module is used to adjust the initial feature model with the goal of reducing the first difference.
[0080] The model determination module is used to obtain a breast feature extraction model based on the encoder model in the initial feature model after training.
[0081] In one of the embodiments, the area to be replaced includes a first area to be replaced and a second area to be replaced. The target area includes a first target area and a second target area. The replacement image includes a first replacement image and a second replacement image. The replacement image acquisition module is used to use at least one area with negative sample attributes as the first area to be replaced, and at least one area with positive sample attributes as the first target area; use at least one area with positive sample attributes as the second area to be replaced, and use at least one area with negative sample attributes as the second target area; replace the image of the first area to be replaced with the image of the first target area to obtain a first replacement image, and replace the image of the second area to be replaced with the image of the second target area to obtain a second replacement image.
[0082] The process of region replacement processing can be independently executed by the replacement image acquisition module. When the region replacement model is included in the neural network of the initial feature model, the region replacement model can be used to perform region replacement processing. Therefore, the replacement image acquisition module can also send the original breast image to the region replacement model, perform region replacement on the original breast image through the region replacement model, and the replacement image acquisition module obtains multiple replacement images output by the region replacement model. Specifically, in one embodiment, the initial feature model also includes a region replacement model. The replacement image acquisition module is used to input the original breast image into the region replacement model, so as to replace the image of the first area to be replaced with the image of the first target area through the region replacement model to obtain a first replacement image, and replace the image of the second area to be replaced with the image of the second target area through the region replacement model to obtain a second replacement image.
[0083] In one embodiment, the difference determination module is used to determine the second difference based on the difference between the plurality of replacement images and the corresponding original breast image, and / or to determine the third difference based on the difference between the first replacement image and the second replacement image. The parameter adjustment module is used to adjust the initial feature model with the goal of reducing the first difference and expanding the second difference and / or the third difference.
[0084] In one embodiment, the region replacement model is used to perform image transformation processing on the image of the first target region; the image of the first region to be replaced is replaced with the image of the first target region after the image transformation processing, to obtain a first replacement image.
[0085] In one of the embodiments, the region replacement model is used to perform image transformation processing on the image of the second target region; the image of the second region to be replaced is replaced with the image of the second target region after the image transformation processing, to obtain a second replacement image.
[0086] In one embodiment, the training device of the breast feature extraction model further includes a boundary segmentation module. The boundary segmentation module is used to perform boundary segmentation processing on the original breast image to remove the background in the original breast image.
[0087] The embodiment of the present invention provides a training device for a breast detection model, which is used to train an initial detection model, wherein the initial detection model includes a feature recognition model and a breast feature extraction model obtained by the above-mentioned training method. The training device includes a feature extraction module, a prediction module, a difference determination module, a parameter adjustment module, and a model determination module, wherein:
[0088] The feature extraction module is used to input the labeled breast image into the breast feature extraction model to obtain image features.
[0089] The prediction module is used to input image features into the feature recognition model to obtain the predicted detection results.
[0090] The difference determination module is used to determine a fourth difference according to the difference between the predicted detection result and the annotation of the annotated breast image.
[0091] The parameter adjustment module is used to adjust the initial detection model with the goal of reducing the fourth difference.
[0092] The model determination module is used to obtain a breast detection model based on the initial detection model after training.
[0093] Each module in the above-mentioned breast feature extraction model and the training device of the breast detection model can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0094] The embodiment of the present invention provides a computer device, which may be a server, a terminal, etc. Its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a communication interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a training method for a breast detection model or a breast feature extraction model is implemented.
[0095] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a regional diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method or the steps of the above method are implemented.
[0097] An embodiment of the present invention provides a computer program product, including a computer program, which implements the steps of the above method or the steps of the above method when executed by a processor.
[0098] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0099] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0100] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0101] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A training method for a breast feature extraction model, characterized in that: The training method comprises: Divide the original breast image into multiple regions; Determine at least one area to be replaced and a target area from the multiple areas, and replace the image of the area to be replaced with the image of the target area to obtain multiple replacement images; wherein the target area has different area attributes from the area to be replaced, and the area attributes are determined by the proportion of the image of interest contained in the area; the area attributes include positive sample attributes and negative sample attributes, the proportion of the image of interest contained in the area with the positive sample attributes is greater than or equal to a preset proportion threshold, and the proportion of the image of interest contained in the area with the negative sample attributes is less than the preset proportion threshold; Using the encoder model in the initial feature model to extract features from the replacement image, and using the decoder model in the initial feature model to restore the image according to the result of the feature extraction to obtain a restored image; determining a first difference according to a difference between the restored image and the original breast image; Adjusting the initial feature model with the goal of reducing the first difference; A breast feature extraction model is obtained based on the encoder model after training.
2. The training method according to claim 1, characterized in that: The to-be-replaced area includes a first to-be-replaced area and a second to-be-replaced area, the target area includes a first target area and a second target area, and the replacement image includes a first replacement image and a second replacement image; The determining at least one area to be replaced and a target area from the multiple areas comprises: At least one region having a negative sample attribute is used as the first region to be replaced, and at least one region having a positive sample attribute is used as the first target region; At least one region having a positive sample attribute is used as the second region to be replaced, and at least one region having a negative sample attribute is used as the second target region; The step of replacing the image of the to-be-replaced area with the image of the target area to obtain a plurality of replacement images comprises: The image of the first area to be replaced is replaced with the image of the first target area to obtain the first replacement image, and the image of the second area to be replaced is replaced with the image of the second target area to obtain the second replacement image.
3. The training method according to claim 2, characterized in that: The initial feature model further includes a region replacement model, wherein replacing the image of the first region to be replaced with the image of the first target region to obtain the first replacement image, and replacing the image of the second region to be replaced with the image of the second target region to obtain the second replacement image includes: The original breast image is input into the region replacement model to replace the image of the first region to be replaced with the image of the first target region through the region replacement model to obtain the first replacement image, and the image of the second region to be replaced is replaced with the image of the second target region through the region replacement model to obtain the second replacement image.
4. The training method according to claim 3, characterized in that: The step of adjusting the initial feature model with the goal of reducing the first difference further includes: Determine a second difference based on differences between the plurality of replacement images and the corresponding original breast images, and / or determine a third difference based on differences between the first replacement image and the second replacement image; The adjusting the initial feature model with the goal of reducing the first difference includes: The initial feature model is adjusted with the goal of reducing the first difference and increasing the second difference and / or the third difference.
5. The training method according to claim 2, characterized in that: Replacing the image of the first to-be-replaced area with the image of the first target area to obtain the first replacement image includes: performing image transformation processing on the image of the first target area; The image of the first area to be replaced is replaced with the image of the first target area after the image transformation process to obtain the first replacement image.
6. The training method according to any one of claims 1 to 5, characterized in that: Before dividing the original breast image into multiple regions, the following steps are also included: The original breast image is subjected to boundary segmentation processing to remove the background in the original breast image.
7. A method for training a breast detection model, characterized in that: Used to train an initial detection model, the initial detection model includes a feature recognition model and the breast feature extraction model obtained by the training method according to any one of claims 1 to 6, the training method comprising: Inputting the annotated breast image into the breast feature extraction model to obtain image features; the annotations in the annotated breast image are used to reflect the detection results of the image of interest; Inputting the image features into the feature recognition model to obtain a predicted detection result; determining a fourth difference according to a difference between the predicted detection result and the annotation of the annotated breast image; With the goal of reducing the fourth difference, the initial detection model is adjusted, and a breast detection model is obtained based on the initial detection model after training.
8. A training device for a breast feature extraction model, characterized in that: Used to train an initial feature model, the initial feature model includes an encoder model and a decoder model, and the training device includes: A region division module, used for dividing the original breast image into multiple regions; A replacement image acquisition module, used to determine at least one area to be replaced and a target area from the multiple areas, and replace the image of the area to be replaced with the image of the target area to obtain multiple replacement images; wherein the target area has different area attributes from the area to be replaced, and the area attribute is determined by the proportion of the image of interest contained in the area; the area attribute includes positive sample attributes and negative sample attributes, the proportion of the image of interest contained in the area with positive sample attributes is greater than or equal to a preset proportion threshold, and the proportion of the image of interest contained in the area with negative sample attributes is less than the preset proportion threshold; An image processing module, configured to extract features from the replacement image using the encoder model, and to restore the image using the decoder model according to the result of the feature extraction to obtain a restored image; a difference determination module, configured to determine a first difference according to a difference between the restored image and the original breast image; A parameter adjustment module, used to adjust the initial feature model with the goal of reducing the first difference; A model determination module is used to obtain a breast feature extraction model based on the encoder model in the initial feature model after training.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of the method according to any one of claims 1 to 6 or the steps of the method according to claim 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 or the steps of the method according to claim 7 are implemented.
