Training methods and devices, electronic equipment and storage media for lesion detection models

By using a teacher-student model joint training method, a lesion detection model is trained using both unlabeled and labeled medical images. This solves the problem of insufficient sample size caused by the difficulty in obtaining labeled images and improves the accuracy of lesion detection.

CN116740485BActive Publication Date: 2026-05-26SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
Filing Date
2023-05-06
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing lesion detection models require a large number of labeled medical images during training, which is difficult to obtain, resulting in insufficient sample size and affecting detection accuracy.

Method used

A joint training strategy of teacher-student model is adopted, which uses unlabeled medical images and a small number of labeled medical images to adjust model parameters through loss calculation, thereby improving the accuracy of the lesion detection model.

Benefits of technology

By combining teacher and student models, and training the model using a small number of labeled images and a large number of unlabeled images, the cost of data annotation is reduced, the model's performance is enhanced, and the accuracy of lesion detection is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740485B_ABST
    Figure CN116740485B_ABST
Patent Text Reader

Abstract

This application provides a training method, apparatus, electronic device, and storage medium for a lesion detection model, belonging to the field of image processing technology. It involves acquiring a first medical image and a second medical image, where the first image is unlabeled and the second image is labeled. A preset teacher model is used to detect lesions in the first medical image, and a preset student model is used to detect lesions in both the first and second medical images. Based on the lesion detection results, a loss calculation is performed to obtain target loss data. The first network parameters of the preset student model are adjusted based on the target loss data, and the second network parameters of the preset teacher model are adjusted based on the first network parameters to train the preset student model, thus obtaining a lesion detection model. This lesion detection model is then used to detect lesions in the target medical image, obtaining the location and type of the target lesion, thereby improving the accuracy of lesion detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a training method and apparatus for a lesion detection model, an electronic device, and a storage medium. Background Technology

[0002] In related technologies, lesion detection models are used to detect lesion regions in images. Training these models often requires a large number of labeled medical images, which necessitates significant time and expertise from specialists, making the acquisition of medical images difficult. Due to the difficulty in obtaining medical images, a smaller number of labeled medical images are typically used for training the lesion detection model. Insufficient sample size leads to suboptimal model parameters, resulting in poor accuracy when using the lesion detection model for lesion detection. Summary of the Invention

[0003] The main objective of this application is to provide a training method and apparatus, electronic device and storage medium for a lesion detection model, which aims to improve the accuracy of lesion detection.

[0004] To achieve the above objectives, a first aspect of this application proposes a training method for a lesion detection model, the training method comprising:

[0005] Acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, the labels including lesion location labels and disease type labels;

[0006] The first medical image is used to detect lesions by using a pre-set teacher model to obtain the location of the first lesion and the type of the first disease.

[0007] The first medical image is subjected to lesion detection using a preset student model to obtain a second lesion location and a second disease type. The second medical image is then subjected to lesion detection using the same preset student model to obtain a third lesion location and a third disease type. The network structure of the preset student model is the same as that of the preset teacher model.

[0008] Loss calculations are performed based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, the third disease type, the lesion location label, and the disease type label to obtain target loss data;

[0009] The first network parameters of the preset student model are adjusted based on the target loss data, and the second network parameters of the preset teacher model are adjusted based on the first network parameters to train the preset student model and obtain the lesion detection model.

[0010] In some embodiments, the step of detecting lesions in the first medical image using a preset teacher model to obtain the location of the first lesion and the type of the first disease includes:

[0011] The first medical image is preliminarily feature extracted using the preset teacher model to obtain initial medical image features;

[0012] Multiple lesion candidate regions are generated based on the initial medical image features, and region alignment processing is performed on each of the lesion candidate regions to obtain lesion region features;

[0013] The features of the lesion region and the features of the initial medical image are fused to obtain fused features;

[0014] Based on the characteristics of the lesion area, the lesion location is regressed to obtain the first lesion location, and based on the fusion characteristics, the disease type is classified to obtain the first disease type.

[0015] In some embodiments, generating multiple lesion candidate regions based on the initial medical image features includes:

[0016] Multi-scale feature extraction is performed on the initial medical image features to obtain the first medical image features;

[0017] Multiple lesion candidate regions are generated based on the first medical image features.

[0018] In some embodiments, the initial medical image features include a first sub-feature, a second sub-feature, a third sub-feature, and a fourth sub-feature. The step of performing multi-scale feature extraction on the initial medical image features to obtain the first medical image feature includes:

[0019] The first sub-feature is convolved to obtain the first convolutional feature, the second sub-feature is convolved to obtain the second convolutional feature, the third sub-feature is convolved to obtain the third convolutional feature, and the fourth sub-feature is convolved to obtain the fourth convolutional feature.

[0020] The fourth convolutional feature is upsampled to obtain the first upsampled feature. The first upsampled feature and the third convolutional feature are then fused to obtain the first intermediate feature.

[0021] The first intermediate feature is upsampled to obtain the second upsampled feature. The second upsampled feature and the second convolutional feature are then fused to obtain the second intermediate feature.

[0022] The second intermediate feature is upsampled to obtain a third upsampled feature. The third upsampled feature and the first convolutional feature are then fused to obtain a third intermediate feature.

[0023] The first medical image feature is obtained based on the fourth convolutional feature, the first intermediate feature, the second intermediate feature, and the third intermediate feature.

[0024] In some embodiments, the feature fusion of the lesion region features and the initial medical image features to obtain fused features includes:

[0025] Contextual features are extracted from the initial medical image features to obtain lesion contextual features;

[0026] The lesion context features and the lesion region features are fused to obtain the fused features.

[0027] To achieve the above objectives, a second aspect of this application provides a lesion detection method, the lesion detection method comprising:

[0028] Acquire target medical images;

[0029] The target medical image is input into the lesion detection model for lesion detection to obtain the location of the target lesion and the type of the target disease; the lesion detection model is trained according to the training method of the lesion detection model as described in any embodiment of the first aspect.

[0030] To achieve the above objectives, a third aspect of this application provides a training device for a lesion detection model, the training device comprising:

[0031] A first acquisition module is used to acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, the labels including a lesion location label and a disease type label;

[0032] The first lesion detection module is used to detect lesions in the first medical image using a preset teacher model, and to obtain the location of the first lesion and the type of the first disease.

[0033] The second lesion detection module is used to detect lesions in the first medical image using a preset student model to obtain the second lesion location and the second disease type, and to detect lesions in the second medical image using the preset student model to obtain the third lesion location and the third disease type; the preset student model has the same network structure as the preset teacher model;

[0034] The loss calculation module is used to perform loss calculation based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, and the third disease type to obtain target loss data;

[0035] The training module is used to adjust the first network parameters of the preset student model according to the target loss data, and adjust the second network parameters of the preset teacher model according to the first network parameters, so as to train the preset student model and obtain the lesion detection model.

[0036] To achieve the above objectives, a fourth aspect of this application provides a lesion detection device, the lesion detection device comprising:

[0037] The second acquisition module is used to acquire the target medical image;

[0038] The target lesion detection module is used to input the target medical image into the lesion detection model for lesion detection, and obtain the location of the target lesion and the type of the target disease; the lesion detection model is trained according to the training device of the lesion detection model as described in the third aspect.

[0039] To achieve the above objectives, a fifth aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the training method for the lesion detection model described in the first aspect or the lesion detection method described in the second aspect.

[0040] To achieve the above objectives, a sixth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the lesion detection model described in the first aspect or the lesion detection method described in the second aspect.

[0041] This application proposes a training method, a lesion detection method, a training device, an electronic device, and a computer-readable storage medium for a lesion detection model. It utilizes a pre-set teacher model to detect lesions in an unlabeled first medical image, and a pre-set student model with the same network structure as the pre-set teacher model to detect lesions in both the unlabeled first medical image and a labeled second medical image. Based on the lesion detection results, target loss data is calculated, and the first network parameters of the pre-set student model are adjusted using the target loss data. The second network parameters of the pre-set teacher model are then adjusted based on the first network parameters to train the pre-set student model and obtain the lesion detection model. This joint training strategy combining the teacher and student models allows for the training of the lesion detection model using only a small number of labeled medical images and a large number of unlabeled medical images, solving the problem of difficulty in obtaining large-scale labeled medical images. Compared to methods that only use a small number of labeled medical images for model training, this application's embodiment utilizes a small number of labeled medical images and a large number of unlabeled medical images for model training, enhancing the model's performance and solving the problem of poor lesion detection ability due to insufficient sample size, thus improving the accuracy of lesion detection. Attached Figure Description

[0042] Figure 1 This is a flowchart of the training method for the lesion detection model provided in the embodiments of this application;

[0043] Figure 2 yes Figure 1 The flowchart of step S120 in the middle;

[0044] Figure 3 This is a network structure diagram of the teacher model provided in the embodiments of this application;

[0045] Figure 4 yes Figure 2 The flowchart of step S220 in the text;

[0046] Figure 5 yes Figure 4 The flowchart of step S410 in the middle;

[0047] Figure 6 yes Figure 4 A schematic diagram of feature extraction in step S410;

[0048] Figure 7 yes Figure 2 The flowchart of step S230 in the text;

[0049] Figure 8 yes Figure 7 The flowchart of step S720 in the process;

[0050] Figure 9 This is a schematic diagram illustrating the training of the lesion detection model provided in the embodiments of this application;

[0051] Figure 10 yes Figure 1 The flowchart of step S140 in the middle;

[0052] Figure 11 This is a flowchart of the lesion detection method provided in the embodiments of this application;

[0053] Figure 12 These are medical images provided in the embodiments of this application;

[0054] Figure 13 This is a schematic diagram of the structure of the training device for the lesion detection model provided in the embodiments of this application;

[0055] Figure 14 This is a schematic diagram of the lesion detection device provided in the embodiments of this application;

[0056] Figure 15 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0058] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0060] In related technologies, lesion detection models are used to detect lesion regions in images. Training these models often requires a large number of labeled medical images, but most medical images are unlabeled, necessitating significant time and expertise from professionals to annotate them. This makes obtaining a large number of labeled medical images extremely difficult. Due to the difficulty in acquiring such large-scale labeled medical images, a smaller number of labeled medical images are typically used for training the lesion detection model. Insufficient sample size leads to suboptimal model parameters, resulting in poor accuracy when using the lesion detection model for lesion detection.

[0061] Based on this, embodiments of this application provide a training method for a lesion detection model, a lesion detection method, a training device for a lesion detection model, a lesion detection device, an electronic device, and a computer-readable storage medium, aiming to improve the accuracy of lesion detection.

[0062] The training method, lesion detection method, lesion detection model training device, lesion detection device, electronic device, and computer-readable storage medium for lesion detection provided in this application are specifically described through the following embodiments. First, the training method for the lesion detection model in this application embodiment is described.

[0063] The training method for a lesion detection model provided in this application relates to the field of image processing technology. This training method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the training method for the lesion detection model, but is not limited to the above forms.

[0064] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0065] Figure 1 This is an optional flowchart of the training method for the lesion detection model provided in the embodiments of this application. Figure 1 The training methods may include, but are not limited to, steps S110 to S150.

[0066] Step S110: Acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, including a lesion location label and a disease type label;

[0067] Step S120: Detect lesions in the first medical image using a preset teacher model to obtain the location of the first lesion and the type of the first disease;

[0068] Step S130: Detect lesions in the first medical image using a preset student model to obtain the second lesion location and the second disease type; and then detect lesions in the second medical image using the preset student model to obtain the third lesion location and the third disease type; the network structure of the preset student model is the same as that of the preset teacher model.

[0069] Step S140: Calculate the loss based on the first lesion location, first disease type, second lesion location, second disease type, third lesion location, third disease type, lesion location label, and disease type label to obtain the target loss data;

[0070] Step S150: Adjust the first network parameters of the preset student model according to the target loss data, and adjust the second network parameters of the preset teacher model according to the first network parameters to train the preset student model and obtain the lesion detection model.

[0071] Steps S110 to S150, as illustrated in the embodiments of this application, reduce the reliance on large-scale labeled medical images for model training by combining the teacher model and the student model. Training the lesion detection model can be completed using only a small number of labeled medical images and a large number of unlabeled medical images, solving the problems of difficulty in obtaining large-scale labeled medical images and the inability to use large-scale unlabeled medical images for training, thus reducing the cost of data annotation. Furthermore, by combining a small number of labeled medical images with a large number of unlabeled medical images for model training, labeled medical images can guide the model training process, while large-scale unlabeled medical images enhance the model's performance, solving the problem of poor lesion detection ability due to insufficient sample size and improving the accuracy of lesion detection.

[0072] In step S110 of some embodiments, a large number of unlabeled medical images are collected. 5% to 20% of these images are labeled to obtain second medical images, and the remaining images are used as first medical images. The first and second medical images are then added to the medical image dataset. In each round of model training, the first and second medical images are randomly selected from the medical image dataset according to a preset ratio, forming a batch of input data. The first medical images are unlabeled, while the second medical images are labeled. The preset ratio is the ratio of the number of first to second medical images, with the number of first medical images exceeding the number of second medical images. For example, the preset ratio can be 4:1, meaning the ratio of unlabeled samples to labeled samples is 4:1, and the batch size is a multiple of 5. The batch size can be adjusted according to the graphics card capacity of the device used for model training. Labels include lesion location labels and disease type labels. Lesion location labels represent the lesion region in the medical image, and disease type labels represent the lesion type within the lesion region.

[0073] Please see Figure 2 In some embodiments, step S120 may include, but is not limited to, steps S210 to S240:

[0074] Step S210: Perform preliminary feature extraction on the first medical image using a preset teacher model to obtain initial medical image features;

[0075] Step S220: Generate multiple lesion candidate regions based on the initial medical image features, and perform region alignment processing on each lesion candidate region to obtain lesion region features;

[0076] Step S230: Perform feature fusion on the lesion area features and the initial medical image features to obtain fused features;

[0077] Step S240: Regress the lesion location based on the lesion area characteristics to obtain the first lesion location, and classify the disease type based on the fusion characteristics to obtain the first disease type.

[0078] In step S210 of some embodiments, the unlabeled sample is strongly augmented and then input into a preset teacher model for inference and prediction. The preset teacher model is used to detect lesions in the unlabeled first medical image to obtain the location of the first lesion and the first disease type. Strong data augmentation refers to adding color perturbations to the image and erasing a certain part of the image based on weak data augmentation. Weak data augmentation refers to performing various operations on the image, such as random flipping, filling, and normalization.

[0079] The network structure of the pre-set teacher model is as follows: Figure 3 As shown, the preset teacher model includes a backbone network, a regression branch, and a classification branch. The regression branch is used to predict lesion regions in the image and includes a feature pyramid network, a region proposal network (RPN), and a regression head. The classification branch is used to predict lesion types and includes a global context embedding module, a global context cross-attention module, and a classification head. Preliminary feature extraction is performed on the first medical image through the backbone network, which is a ResNet50 network and includes four residual modules. The initial medical image features include a first sub-feature, a second sub-feature, a third sub-feature, and a fourth sub-feature. The extraction process for these four sub-features is as follows: convolution processing is performed on the first medical image to obtain convolutional features; batch normalization is performed on the convolutional features to obtain normalized features; the normalized features are activated using the ReLU activation function to obtain activated features; and max pooling is performed on the activated features. Feature extraction is performed on the max-pooled activated features using the first residual module to obtain the first sub-feature. Feature extraction is performed on the first sub-feature using the second residual module to obtain the second sub-feature. The third sub-feature is obtained by extracting features from the second sub-feature using the third residual module. The fourth sub-feature is obtained by extracting features from the third sub-feature using the fourth residual module.

[0080] In step S220 of some embodiments, the initial medical image features are extracted at multiple scales using a feature pyramid network to obtain the first medical image features. A region proposal network is used to extract candidate boxes at different scales. Multiple candidate boxes are generated using the first medical image features, and the regions within these candidate boxes are used as lesion candidate regions. Region alignment is performed on the lesion candidate regions to obtain lesion region features. Region alignment is achieved through Region of Interest Align (ROI Align) operations. First, the candidate boxes are transformed to the current feature map scale, and the coordinate values ​​of the candidate boxes remain floating-point numbers without quantization. Then, the lesion candidate regions are divided into n×n blocks, and the coordinates of each block are not quantized; the block coordinates are floating-point coordinates. Since each block often does not correspond to a value on the feature map, k interpolation points are fixed in each block. The positions of these k points are calculated using bilinear interpolation. Max pooling or average pooling is performed on the position values ​​of the k points in each image block to output lesion region features of size n×n. The lesion region features include texture, contour, and other features of the lesion region. The ROI Align operation calculates the position through interpolation, and can achieve more accurate calculations by setting more interpolation points, avoiding the large errors caused by rounding twice in the Region of Interest Pooling (ROI Pooling) operation.

[0081] In step S230 of some embodiments, the initial medical image features are extracted by the global context embedding module to obtain lesion context features. The lesion context features are used to identify lesions, including features such as information on the tissue surrounding the lesion and the location information of the tissue where the lesion is located. The lesion context features and lesion region features are fused by the global context cross-attention module to obtain fused features.

[0082] In step S240 of some embodiments, the lesion region features are input into a regression head to regress the lesion location, obtaining the first lesion location, i.e., the lesion localization result. The regression head consists of two fully connected layers and two ReLU activation functions. The first fully connected layer performs feature mapping on the lesion region features, and the first ReLU activation function activates the feature-mapped lesion region features. The second fully connected layer performs feature mapping on the activated features, and the second ReLU activation function activates the features mapped by the second fully connected layer, obtaining the first lesion location. The fused features are input into a classification head for disease type classification, obtaining the first disease type, i.e., the lesion classification result. The first disease type corresponds one-to-one with the first lesion location. The classification head has the same structure as the regression head and the same calculation method as the regression head, so it will not be described again here.

[0083] The first lesion location and the first disease type are combined into a single detection result. The pre-defined teacher model outputs multiple detection results. Non-Maximum Suppression (NMS) is used to post-process these multiple results to remove redundant ones. This embodiment employs a threshold filtering method for NMS to filter out unreliable detection boxes. The first disease type includes not only the disease type but also a confidence score for the first lesion location (detection box), with the confidence score ranging from 0 to 1. By setting a confidence threshold, unreliable detection boxes are filtered out at the category level. The confidence score is compared to the confidence threshold; if the confidence score is less than the threshold, the detection result corresponding to that score is removed; if the confidence score is greater than or equal to the threshold, the detection result corresponding to that score is retained. For example, if the confidence threshold is 0.5, detection boxes with confidence scores less than 0.5 are filtered out, and detection boxes with confidence scores greater than or equal to 0.5 are retained.

[0084] The remaining detection boxes after threshold filtering are subjected to N jitters, i.e., slight translations in all directions (up, down, left, and right) to obtain N jittered boxes. The regression variance of the remaining detection boxes is calculated based on the positional information of these N jittered boxes. The regression variance reflects the stability of the detection boxes; a smaller regression variance indicates a more stable detection box. A variance threshold is set to further filter the remaining detection boxes at the localization level. The regression variance is compared to the variance threshold; detection boxes with a regression variance greater than the threshold are removed, while those with a regression variance less than or equal to the threshold are retained. For example, setting the variance threshold to 0.5 will remove detection boxes with a regression variance greater than 0.5, and retain those with a regression variance less than or equal to 0.5.

[0085] The variance is calculated as shown in formula (1).

[0086]

[0087] in, For the i-th retained detection box p i The variance; the detection box is a rectangular detection box, including the x-coordinate of the center point, the y-coordinate of the center point, and the length h(b) of the rectangle. i ) and rectangle width w(b i There are four parameters, therefore k = 1, 2, 3, 4. σ k Let be the standard deviation of the k-th parameter among N dithering frames.

[0088] Through steps S210 to S240, the detection results output by the preset teacher model can be obtained, which can guide the training of the preset student model. This semi-supervised training method reduces the data labeling cost and improves the accuracy of lesion detection.

[0089] Please see Figure 4 In some embodiments, step S220 may include, but is not limited to, steps S410 to S420:

[0090] Step S410: Perform multi-scale feature extraction on the initial medical image features to obtain the first medical image features;

[0091] Step S420: Generate multiple lesion candidate regions based on the features of the first medical image.

[0092] In step S410 of some embodiments, a feature pyramid network is attached to the backbone network for extracting multi-scale features. The feature pyramid network consists of 1×1 convolutional layers and upsampling layers. The first medical image features include features at different spatial scales.

[0093] In step S420 of some embodiments, the region proposal network includes a 3×3 convolution, a ReLU activation layer, two 1×1 convolutions, and a proposal layer. Initial convolutional features are obtained by performing feature semantic transformation on the initial medical image features through the 3×3 convolution, increasing the network complexity and improving the fitting ability of the region proposal network. The initial convolutional features are then transformed by the first 1×1 convolution, converting the number of feature channels to 18, resulting in the first intermediate convolutional features. The first intermediate convolutional features are then reshaped, and softmax classification is applied to the reshaped features to obtain multiple initial anchor box features. These initial anchor box features include anchor box coordinates and anchor box category. The anchor box coordinates represent the position of the anchor box in the image, and the anchor box category indicates whether the anchor box is a foreground or background box. Foreground boxes include the region of interest (lesion region), while background boxes do not. The initial anchor box features are then reshaped to obtain the first intermediate anchor box features, which have the same number of feature channels as the first intermediate convolutional features. The initial convolutional features are transformed using a second 1×1 convolution, converting the number of feature channels in the initial convolutional features to 36, resulting in the second intermediate anchor box features. The first and second intermediate anchor box features are then merged, and the merged anchor box features are filtered through a proposal layer to obtain the region proposal coordinates and the corresponding lesion candidate regions.

[0094] Steps S410 to S420 above, through multi-scale feature extraction, can extract more comprehensive feature information, so that the first medical image features have both global overall information and local detailed information, which improves the accuracy of feature extraction and thus improves the accuracy of lesion candidate region generation.

[0095] Please see Figure 5In some embodiments, the initial medical image features include a first sub-feature, a second sub-feature, a third sub-feature, and a fourth sub-feature, and step S410 may include, but is not limited to, steps S510 to S550:

[0096] Step S510: Perform convolution processing on the first sub-feature to obtain the first convolution feature, perform convolution processing on the second sub-feature to obtain the second convolution feature, perform convolution processing on the third sub-feature to obtain the third convolution feature, and perform convolution processing on the fourth sub-feature to obtain the fourth convolution feature.

[0097] Step S520: Upsample the fourth convolutional feature to obtain the first upsampled feature; fuse the first upsampled feature and the third convolutional feature to obtain the first intermediate feature.

[0098] Step S530: Upsample the first intermediate feature to obtain the second upsampled feature, and fuse the second upsampled feature and the second convolutional feature to obtain the second intermediate feature;

[0099] Step S540: Upsample the second intermediate feature to obtain the third upsampled feature, and fuse the third upsampled feature with the first convolutional feature to obtain the third intermediate feature;

[0100] Step S550: Based on the fourth convolutional feature, the first intermediate feature, the second intermediate feature, and the third intermediate feature, the first medical image feature is obtained.

[0101] In step S510 of some embodiments, such as Figure 6 As shown, the first sub-feature extracted by the backbone network is C1, the second sub-feature is C2, the third sub-feature is C3, and the fourth sub-feature is C4. The first sub-feature C1 is convolved with a 1×1 convolution to obtain the first convolutional feature; the second sub-feature C2 is convolved with a 1×1 convolution to obtain the second convolutional feature; the third sub-feature C3 is convolved with a 1×1 convolution to obtain the third convolutional feature; and the fourth sub-feature C4 is convolved with a 1×1 convolution to obtain the fourth convolutional feature P4.

[0102] In step S520 of some embodiments, the high-level feature, namely the fourth convolutional feature P4, is upsampled by 2 times to obtain the first upsampled feature. The first upsampled feature and the third convolutional feature are added together to obtain the first intermediate feature P3.

[0103] In step S530 of some embodiments, the first intermediate feature P3 is upsampled by 2 times to obtain the second upsampled feature, and the second upsampled feature and the second convolutional feature are added to obtain the second intermediate feature P2.

[0104] In step S540 of some embodiments, the second intermediate feature P2 is upsampled by 2 times to obtain a third upsampled feature, and the third upsampled feature is added to the first convolutional feature to obtain the third intermediate feature.

[0105] In step S550 of some embodiments, the fourth convolutional feature, the first intermediate feature, the second intermediate feature, and the third intermediate feature are used as the first medical image feature.

[0106] Steps S510 to S550 above utilize the property that shallow features help detect small targets and high-level features help detect large targets. By extracting features from different scale spaces, lesion areas of different sizes can be detected, thus enhancing the lesion detection capability of the model.

[0107] Please see Figure 7 In some embodiments, step S230 may include, but is not limited to, steps S710 to S720:

[0108] Step S710: Extract contextual features from the initial medical image features to obtain lesion contextual features;

[0109] Step S720: Feature fusion is performed on the lesion context features and lesion region features to obtain fused features.

[0110] In step S710 of some embodiments, such as Figure 3 As shown, the global context embedding module includes a 3×3 convolution, a global context-aware attention (GCA) unit, and a feature attention (FA) unit. The GCA unit includes a global average pooling (GAP) layer, a global max pooling (GMP) layer, and a full connection (FC) layer. The FA unit includes an image pooling layer and a 1×1 convolution. The initial medical image features are processed by 3×3 convolution to obtain convolutional features. The GAP layer performs global average pooling on the convolutional features to preserve the background relationships of the global context, resulting in average pooled features. The GMP layer performs global max pooling on the convolutional features to extract the feature texture of the global context, resulting in max pooled features. The average pooled features and max pooled features are added together to capture the global context relationships. The summed features are then input into the FC layer for feature mapping to obtain the global context feature L. GCEImage pooling is performed on the convolutional features through image pooling layers to extract more abstract image features. The image features are then convolved using 1×1 convolutions to obtain the lesion context features G.

[0111] In step S720 of some embodiments, in order to reduce the amount of computation, global context features L are removed. GCE Only the lesion context features G that are helpful for disease type classification are retained. To identify the disease type of the lesion region, the lesion context features and lesion region features are fused through a global context cross-attention module to obtain fused features, where each lesion region feature corresponds to a global context cross-attention module.

[0112] Through the above steps S710 to S720, the disease type of the lesion area can be identified, while reducing the amount of calculation required for disease type classification by the classification branch.

[0113] Please see Figure 8 In some embodiments, step S720 may include, but is not limited to, steps S810 to S850:

[0114] Step S810: Perform feature reconstruction on the lesion context features to obtain reconstructed context features, and perform feature reconstruction on the lesion region features to obtain reconstructed region features;

[0115] Step S820: Calculate the first similarity data between the recombination context features and the recombination region features;

[0116] Step S830: Activate the first similarity data to obtain activated features;

[0117] Step S840: Calculate the second similarity data between the activation features and the recombined context features;

[0118] Step S850: Reorganize the features of the second similarity data to obtain the fused features.

[0119] In step S810 of some embodiments, such as Figure 3 As shown, the lesion context feature G is reshaped to obtain the reconstructed context feature, and the lesion region feature L1 is reshaped to obtain the reconstructed region feature.

[0120] In step S820 of some embodiments, the reconstructed context features are used as key vector K, the reconstructed region features are used as query vector Q, and the key vector K and query vector Q are multiplied to obtain the first similarity data.

[0121] In step S830 of some embodiments, the first similarity data is activated by the softmax function to obtain activated features.

[0122] In step S840 of some embodiments, the reorganized context features are used as a value vector V, and the activation features and the value vector V are multiplied to obtain the second similarity data.

[0123] In step S850 of some embodiments, a reshape operation is performed on the second similarity data to obtain the fusion feature F1 corresponding to the lesion region feature L1. If there are N lesion region features (L1,...,L... N ), respectively, the lesion context feature G and the lesion region feature L i Perform feature fusion, 1≤i≤N, to obtain the fused feature F. i , fusion feature F i The combination is input into F and then into the classification head for disease type classification.

[0124] In steps S810 to S850 above, there are also dependencies between pixels that are far apart in the image. By using global contextual cross attention, contextual information can be captured from long-distance dependencies, so as to efficiently and effectively obtain important information that is helpful for disease type judgment.

[0125] In step S130 of some embodiments, such as Figure 9 As shown, the unlabeled sample first medical image is subjected to data enhancement and then input into the preset student model for lesion detection to obtain the second lesion location and the second disease type. The labeled sample second medical image is then input into the preset student model for lesion detection to obtain the third lesion location and the third disease type. The network structure of the preset student model is the same as that of the preset teacher model. The method for lesion detection using the preset student model is the same as that using the preset teacher model, and can be referred to steps S210 to S240, which will not be repeated here.

[0126] Please see Figure 10 In some embodiments, step S140 may include, but is not limited to, steps S1010 to S1050:

[0127] Step S1010: Calculate the regression loss based on the first lesion location and the second lesion location to obtain the first regression loss;

[0128] Step S1020: Calculate the classification loss based on the first lesion location, the first disease type, the second lesion location, and the second disease type to obtain the first classification loss;

[0129] Step S1030: Calculate the regression loss based on the third lesion location and the lesion location label to obtain the second regression loss;

[0130] Step S1040: Calculate the classification loss based on the third lesion location, the third disease type, the lesion location label, and the disease type label to obtain the second classification loss;

[0131] Step S1050: Perform loss summation on the first regression loss, the first classification loss, the second regression loss, and the second classification loss to obtain the target loss data.

[0132] In step S1010 of some embodiments, the first lesion location and first disease type output by the preset teacher model for lesion detection of unlabeled samples are used as pseudo-labels. Loss is calculated using the pseudo-labels, the second lesion location and second disease type output by the preset student model for lesion detection of unlabeled samples, and the third lesion location and third disease type output by the preset student model for lesion detection of labeled samples, along with the labels of the labeled samples. The losses are accumulated to obtain the target loss data. The first lesion location is mapped to the first medical image to obtain a pseudo-regression box, and the second lesion location is mapped to the first medical image to obtain a predicted regression box. The intersection and union of the pseudo-regression boxes and the predicted regression boxes are calculated. The intersection-union ratio (IU) is obtained based on the ratio of the intersection and union. If the IU is less than a preset threshold, the predicted regression box is used as the background box; if the IU is greater than or equal to the preset threshold, the predicted regression box is used as the foreground box. The predicted regression boxes output by the preset student model are divided into... A foreground frame and A background bounding box. The first lesion location t in the pseudo-regression bounding box. * for The second lesion position t in the foreground box is (x1, y1, x2, y2). The first regression loss is calculated using this position, where (x1, y1) is the coordinate of the upper left corner of the pseudo-regression box and the foreground box, and (x2, y2) is the coordinate of the lower right corner of the pseudo-regression box and the foreground box. The calculation method for the first regression loss is shown in formulas (2) to (4).

[0133]

[0134]

[0135] x=tt * Formula (4)

[0136] in, Let g be the i-th foreground bounding box; g is the pseudo-regression bounding box output by the pre-defined teacher model; l reg The smooth-L1 loss function is used.

[0137] In step S1020 of some embodiments, after determining the pseudo-regression box, foreground box, and background box based on the first lesion location and the second lesion location, a classification loss is calculated based on the second disease type of the foreground box, the second disease type of the background box, and the first disease type of the pseudo-regression box to obtain the first classification loss. The calculation method of the first classification loss is shown in formula (5).

[0138]

[0139] Among them, l cls The cross-entropy loss function is used.

[0140] If it is a two-category disease classification, the cross-loss function is as shown in formula (6).

[0141] l cls =-[ylog(p i )+(1-y)log(1-p i )] Formula (6)

[0142] Where y represents the first disease type, with 1 for positive and 0 for negative; p i The probability that the second disease type of the i-th foreground or background box is predicted as positive.

[0143] If it is a classification of multiple disease types, the cross loss function is as shown in formula (7).

[0144]

[0145] Where M is the number of disease categories; c represents disease type c; y c Let y be the first disease type. If the first disease type is c, then y c p is 1 if it is positive, otherwise it is 0; ic The probability that the second disease type of the i-th foreground or background box is predicted as category c.

[0146] In some embodiments, steps S1030 to S1040 involve calculating the loss of labeled samples to obtain loss data L. s Loss data L s It consists of a second regression loss and a second classification loss. The calculation method of the second regression loss is the same as that of the first regression loss, which can be referred to in step S1010. The calculation method of the second classification loss is the same as that of the first classification loss, which can be referred to in step S1020. It will not be repeated here.

[0147] In step S1050 of some embodiments, the first regression loss, the first classification loss, the second regression loss, and the second classification loss are added together to obtain the target loss data.

[0148] Steps S1010 to S1050 above can obtain target loss data, so as to train a preset student model with better parameters by minimizing the target loss data.

[0149] In step S150 of some embodiments, the network parameters of the preset student model are adjusted to minimize the target loss data to obtain the first network parameters. The first network parameters are then updated to the network parameters of the preset teacher model using an exponentially weighted average to obtain the second network parameters. The preset teacher model with the second network parameters is used to detect lesions in the first medical image. The preset student model with the first network parameters is used to detect lesions in the first and second medical images respectively. The first and second network parameters are then updated again to train the preset student model. The preset student model with the minimum target loss data is used as the lesion detection model. The method for updating the network parameters of the preset teacher model is shown in formula (8).

[0150] θ′ t =αθ′ t-1 +(1-α)θ t Formula (8)

[0151] Where t is the t-th iteration in the model training process; θ t Let θ′ be the network parameters of the student model in round t. t The network parameters for the pre-defined teacher model in round t are: θ′ t-1 Here are the network parameters of the preset teacher model in round t-1; α is the weight hyperparameter, set to 0.99.

[0152] Figure 11 This is an optional flowchart of the lesion detection method provided in the embodiments of this application. Figure 11 The lesion detection method may include, but is not limited to, steps S1110 to S1120.

[0153] Step S1110: Acquire the target medical image;

[0154] Step S1120: Input the target medical image into the lesion detection model to detect the lesion and obtain the target lesion location and target disease type; the lesion detection model is trained according to the training method of the lesion detection model as described in any embodiment of the first aspect.

[0155] In step S1110 of some embodiments, a target medical image is acquired using medical imaging technology, wherein the target medical image is unlabeled. For example, the target medical image is obtained using optical coherence tomography (OCT) technology, such as... Figure 12 As shown.

[0156] In step S1120 of some embodiments, lesion detection is performed on the target medical image using a lesion detection model to obtain the location of the target lesion and the type of the target disease.

[0157] Age-related macular degeneration (AMD) is an age-related change in the macular structure, including wet age-related macular degeneration (wAMD), characterized by choroidal neovascularization. Most current algorithms for screening and diagnosing fundus diseases are coarse-grained, with a lack of algorithms specifically targeting wet AMD subtypes.

[0158] The lesion detection method of this application embodiment is applied to lesion region detection in wAMD images, including: acquiring a first wAMD sample and a second wAMD sample, wherein the first wAMD sample is unlabeled and the second wAMD sample is labeled. The weakly enhanced first wAMD sample is input into a teacher model for inference prediction to obtain an initial detection result. The initial detection result is then subjected to threshold filtering and bounding box jitter processing sequentially to obtain a first detection result. The strongly enhanced first wAMD sample is input into a student model for inference prediction to obtain a second detection result. The second wAMD sample is input into the student model for supervised training to obtain a third detection result. The first detection result is used as a pseudo-label, and a loss calculation is performed using the pseudo-label and the second detection result to obtain first loss data. A loss calculation is performed using the second detection result and the labels of the second wAMD sample to obtain second loss data. The first loss data and the second loss data are summed to obtain target loss data. The network parameters of the student model are updated using the target loss data, and the network parameters of the student model are updated to the teacher model using an exponentially weighted average. When the target loss data is less than or equal to a preset loss threshold, the student model is used as the wAMD recognition model.

[0159] The wAMD image is acquired and input into the wAMD recognition model, which includes a backbone network, a feature pyramid network, a region proposal network, a regression head, a global context embedding module, a global context cross-attention module, and a classification head. The backbone network extracts features from the wAMD image to obtain initial image features. The feature pyramid network then performs multi-scale feature extraction on the initial image features to obtain the first image features. These first image features are then input into the region proposal network to generate N lesion proposal boxes B:{B1,...,B N The features (L1, L2, ..., L) of each lesion proposal box are obtained through ROI Align. N ), by regressing the head pair of features (L1,L2,...,LN Regression processing is performed to locate the lesion. The initial image features are extracted using a global context embedding module, preserving the lesion context features G. A global context cross-attention module then integrates the lesion context features G with the features of each lesion proposal box (L1, L2, ..., L...). N The interaction and fusion are performed to obtain N fusion features (F1, F2, ..., F). N The N fused features are input into the classification head for parallel classification processing to obtain the subtype of the lesion. The subtype of the lesion includes subretinal pigment epithelial (RPE) type and subretinal type.

[0160] Please see Figure 13 This application also provides a training device for a lesion detection model, which can implement the above-mentioned training method for the lesion detection model. The training device includes:

[0161] The first acquisition module 1310 is used to acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, including a lesion location label and a disease type label;

[0162] The first lesion detection module 1320 is used to detect lesions in the first medical image through a preset teacher model to obtain the location of the first lesion and the first disease type.

[0163] The second lesion detection module 1330 is used to detect lesions in the first medical image through a preset student model to obtain the location of the second lesion and the second disease type, and to detect lesions in the second medical image through the preset student model to obtain the location of the third lesion and the third disease type; the network structure of the preset student model is the same as that of the preset teacher model.

[0164] The loss calculation module 1340 is used to calculate the target loss data based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, and the third disease type.

[0165] The training module 1350 is used to adjust the first network parameters of the preset student model based on the target loss data, and to adjust the second network parameters of the preset teacher model based on the first network parameters, so as to train the preset student model and obtain the lesion detection model.

[0166] The specific implementation of the training device for the lesion detection model is basically the same as the specific implementation of the training method for the lesion detection model described above, and will not be repeated here.

[0167] Please see Figure 14This application also provides a lesion detection device that can implement the above-described lesion detection method. The lesion detection device includes:

[0168] The second acquisition module 1410 is used to acquire the target medical image;

[0169] The target lesion detection module 1420 is used to input the target medical image into the lesion detection model for lesion detection, and obtain the target lesion location and target disease type; the lesion detection model is trained according to the training device of the lesion detection model as described in the third aspect embodiment.

[0170] The specific implementation of this lesion detection device is basically the same as the specific implementation of the lesion detection method described above, and will not be repeated here.

[0171] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described lesion detection method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0172] Please see Figure 15 , Figure 15 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0173] The processor 1510 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0174] The memory 1520 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1520 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1520 and is called and executed by the processor 1510 to execute the training method or lesion detection method of the lesion detection model in the embodiments of this application.

[0175] The input / output interface 1530 is used to implement information input and output;

[0176] The communication interface 1540 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0177] Bus 1550 transmits information between various components of the device (e.g., processor 1510, memory 1520, input / output interface 1530, and communication interface 1540);

[0178] The processor 1510, memory 1520, input / output interface 1530 and communication interface 1540 are connected to each other within the device via bus 1550.

[0179] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method or lesion detection method of the lesion detection model described above.

[0180] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0181] The lesion detection model training method, lesion detection method, lesion detection model training device, lesion detection device, electronic device, and computer-readable storage medium provided in this application reduce the dependence of model training on large-scale labeled medical images by combining a teacher model and a student model. Training the lesion detection model can be completed using only a small number of labeled medical images and a large number of unlabeled medical images, solving the problems of difficulty in obtaining large-scale labeled medical images and the inability to use large-scale unlabeled medical images for training. Furthermore, by combining a small number of labeled medical images with a large number of unlabeled medical images for model training, labeled medical images can guide the model training process, while large-scale unlabeled medical images enhance the model's performance, solving the problem of poor lesion detection ability due to insufficient sample size and improving the accuracy of lesion detection.

[0182] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0183] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0185] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0186] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0187] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0188] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0189] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0190] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0191] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0192] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A training method for a lesion detection model, characterized in that, The training method includes: Acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, the labels including lesion location labels and disease type labels; The first medical image is used to detect lesions by using a pre-set teacher model to obtain the location of the first lesion and the type of the first disease. The first medical image is subjected to lesion detection using a preset student model to obtain a second lesion location and a second disease type. The second medical image is then subjected to lesion detection using the same preset student model to obtain a third lesion location and a third disease type. The network structure of the preset student model is the same as that of the preset teacher model. Loss calculations are performed based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, the third disease type, the lesion location label, and the disease type label to obtain target loss data; The first network parameters of the preset student model are adjusted according to the target loss data, and the second network parameters of the preset teacher model are adjusted according to the first network parameters to train the preset student model and obtain the lesion detection model. The step of calculating the target loss data based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, the third disease type, the lesion location label, and the disease type label includes: A first regression loss is obtained by calculating regression loss based on the first lesion location and the second lesion location; a first classification loss is obtained by calculating classification loss based on the first lesion location, the first disease type, the second lesion location, and the second disease type; a second regression loss is obtained by calculating regression loss based on the third lesion location and the lesion location label; a second classification loss is obtained by calculating classification loss based on the third lesion location, the third disease type, the lesion location label, and the disease type label; the first regression loss, the first classification loss, the second regression loss, and the second classification loss are summed to obtain the target loss data.

2. The training method for the lesion detection model according to claim 1, characterized in that, The step of detecting lesions in the first medical image using a preset teacher model to obtain the location of the first lesion and the type of the first disease includes: The first medical image is preliminarily feature extracted using the preset teacher model to obtain initial medical image features; Multiple lesion candidate regions are generated based on the initial medical image features, and region alignment processing is performed on each of the lesion candidate regions to obtain lesion region features; The features of the lesion region and the features of the initial medical image are fused to obtain fused features; Based on the characteristics of the lesion area, the lesion location is regressed to obtain the first lesion location, and based on the fusion characteristics, the disease type is classified to obtain the first disease type.

3. The training method for the lesion detection model according to claim 2, characterized in that, The generation of multiple lesion candidate regions based on the initial medical image features includes: Multi-scale feature extraction is performed on the initial medical image features to obtain the first medical image features; Multiple lesion candidate regions are generated based on the first medical image features.

4. The training method for the lesion detection model according to claim 3, characterized in that, The initial medical image features include a first sub-feature, a second sub-feature, a third sub-feature, and a fourth sub-feature. The multi-scale feature extraction of the initial medical image features to obtain the first medical image feature includes: The first sub-feature is convolved to obtain the first convolutional feature, the second sub-feature is convolved to obtain the second convolutional feature, the third sub-feature is convolved to obtain the third convolutional feature, and the fourth sub-feature is convolved to obtain the fourth convolutional feature. The fourth convolutional feature is upsampled to obtain the first upsampled feature. The first upsampled feature and the third convolutional feature are then fused to obtain the first intermediate feature. The first intermediate feature is upsampled to obtain the second upsampled feature. The second upsampled feature and the second convolutional feature are then fused to obtain the second intermediate feature. The second intermediate feature is upsampled to obtain a third upsampled feature. The third upsampled feature and the first convolutional feature are then fused to obtain a third intermediate feature. The first medical image feature is obtained based on the fourth convolutional feature, the first intermediate feature, the second intermediate feature, and the third intermediate feature.

5. The training method for the lesion detection model according to claim 2, characterized in that, The feature fusion of the lesion region features and the initial medical image features to obtain fused features includes: Contextual features are extracted from the initial medical image features to obtain lesion contextual features; The lesion context features and the lesion region features are fused to obtain the fused features.

6. A method for detecting lesions, characterized in that, The lesion detection method includes: Acquire target medical images; The target medical image is input into the lesion detection model for lesion detection to obtain the location of the target lesion and the type of the target disease; the lesion detection model is trained according to the training method of the lesion detection model as described in any one of claims 1 to 5.

7. A training device for a lesion detection model, characterized in that, The training device includes: A first acquisition module is used to acquire a first medical image and a second medical image; the first medical image is unlabeled, and the second medical image is labeled, the labels including lesion location labels and disease type labels; The first lesion detection module is used to detect lesions in the first medical image using a preset teacher model, and to obtain the location of the first lesion and the first disease type. The second lesion detection module is used to detect lesions in the first medical image using a preset student model to obtain the second lesion location and the second disease type, and to detect lesions in the second medical image using the preset student model to obtain the third lesion location and the third disease type; the preset student model has the same network structure as the preset teacher model; The loss calculation module is used to perform loss calculation based on the first lesion location, the first disease type, the second lesion location, the second disease type, the third lesion location, and the third disease type to obtain target loss data; The training module is used to adjust the first network parameters of the preset student model according to the target loss data, and adjust the second network parameters of the preset teacher model according to the first network parameters, so as to train the preset student model and obtain the lesion detection model. The training device is also used for: A first regression loss is obtained by calculating regression loss based on the first lesion location and the second lesion location; a first classification loss is obtained by calculating classification loss based on the first lesion location, the first disease type, the second lesion location, and the second disease type; a second regression loss is obtained by calculating regression loss based on the third lesion location and the lesion location label; a second classification loss is obtained by calculating classification loss based on the third lesion location, the third disease type, the lesion location label, and the disease type label; the first regression loss, the first classification loss, the second regression loss, and the second classification loss are summed to obtain the target loss data.

8. A lesion detection device, characterized in that, The lesion detection device includes: The second acquisition module is used to acquire the target medical image; The target lesion detection module is used to input the target medical image into the lesion detection model for lesion detection, and obtain the target lesion location and target disease type; the lesion detection model is trained according to the training device of the lesion detection model as described in claim 7.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement: The training method for the lesion detection model as described in any one of claims 1 to 5; or, The lesion detection method as described in claim 6.

10. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to achieve the following: The training method for the lesion detection model as described in any one of claims 1 to 5; or, The lesion detection method as described in claim 6.