Multi-scale anomaly detection method, device, equipment and medium
By constructing a two-stage weakly supervised learning model and a multi-scale anomaly feature enhancement module, the problems of lesion distribution differences and insufficient feature extraction in medical image lesion detection are solved, achieving high-precision lesion detection and reducing the false negative rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF TECH
- Filing Date
- 2026-02-11
- Publication Date
- 2026-06-16
AI Technical Summary
Existing deep learning-based medical image anomaly detection methods suffer from several problems in lesion detection, including differences in pixel distribution of lesions in different modalities or different instruments in the same modality, inability of synthetic lesions to simulate the pixel distribution of real lesions, difficulty in extracting lesion features by pre-trained models, and confusion between small lesion regions and noise.
A multi-scale anomaly detection method is adopted. A two-stage weakly supervised learning model is constructed, a Mamba diffusion model is used to generate a structurally normal reference image, and a multi-scale anomaly feature enhancement module is used to extract and fuse multi-scale intermediate features. Combined with knowledge distillation technology, the feature discrimination ability is improved, and an accurate anomaly discrimination feature map is generated.
It improves the accuracy of detecting small lesions, reduces the false negative rate, and significantly enhances the accuracy of lesion detection and the effectiveness of clinical screening.
Smart Images

Figure CN122222907A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image anomaly detection technology, and in particular to a multi-scale anomaly detection method, apparatus, device, and medium based on diffusion and Mamba models. Background Technology
[0002] Detecting lesions based on medical images is crucial for the discovery and early treatment of diseases within the body. However, current methods for detecting abnormal areas such as tumors primarily rely on doctors directly observing patients' CT and MR scans. This approach is not only susceptible to subjective biases leading to individual differences, but also involves cumbersome and time-consuming procedures, increasing the workload of doctors. Therefore, leveraging deep learning technology to achieve automated and reliable lesion detection has become a research hotspot in recent years.
[0003] Due to the high demands for accurate detection of abnormal regions in clinical applications and significant individual differences among patients, this task typically requires a large amount of pixel-by-pixel annotation from specialist physicians to achieve deep learning-based lesion segmentation. However, such annotation is extremely costly in terms of manpower and time, and the singular learning objective causes the network to focus excessively on pixel classification rather than truly understanding and detecting abnormalities in the image.
[0004] Therefore, weakly supervised anomaly detection methods have become a major research direction for solving this problem due to their low cost and flexible annotation methods. Compared with fully supervised learning, these methods do not rely on pixel-level precise annotation and can effectively detect various anomalous regions that deviate from the normal data distribution. Furthermore, from the perspective of data modality, traditional lesion segmentation tasks typically input a single image modality, while weakly supervised anomaly detection can not only fully utilize the rich detailed information in the image modality but also utilize supervision signals from other modalities such as text, categories, or features, enabling the network to find correspondences between different modalities and thus uncover potential relationships between pixels at a deeper semantic level. Therefore, how to fully utilize limited supervision information to achieve accurate lesion detection is of great significance.
[0005] Currently, weakly supervised anomaly detection methods are mainly divided into reconstruction and knowledge distillation. Reconstruction methods locate anomaly regions by comparing the differences between the input anomaly image and the reconstructed normal image.
[0006] However, researchers often struggle to collect large amounts of healthy and lesion-bearing images of the same patient in clinical settings to train the network. Therefore, obtaining paired data through data synthesis has become a primary method for such approaches. These methods first synthesize diverse lesions on normal images and use this as training data, then use the original normal images as supervision. Knowledge distillation treats the teacher model as the gold standard for representing normal and abnormal images, while the student model is trained using only normal images, learning how to represent the features of normal images. Finally, when the network is input with abnormal samples, the student model will fail to extract the correct abnormal features, outputting an "incorrect" feature map. Comparing this with the "correct" feature map output by the teacher model reveals the abnormal regions in the image.
[0007] However, existing deep learning-based lesion detection methods still have the following shortcomings:
[0008] 1. The pixel distribution of lesions varies significantly across different modalities or even across different instruments within the same modality. For data synthesis-based reconstruction methods, the synthesized anomalies often fail to fully simulate the pixel distribution of real lesions in vivo.
[0009] 2. Most knowledge distillation methods use pre-trained models trained on natural images, making it difficult to accurately extract lesion features from medical images. This is because some normal parts of organs can exhibit abnormal pixel distributions; for example, the pixel values of blood vessels in the liver are significantly higher than those of the liver parenchyma, and the appearance of wrinkles and gray matter in the brain is completely different. The primary prerequisite for the success of knowledge distillation methods based on pre-trained weights is that the pre-trained network can effectively extract the target features.
[0010] 3. Because the scale distribution of lesions varies significantly in the human body, using only pixel-level abnormal features can lead to confusion between small lesion areas and noise, resulting in missed detections. Summary of the Invention
[0011] In view of the above problems, the present invention provides a multi-scale anomaly detection method, apparatus, device, and medium to overcome or at least partially solve the above problems. It overcomes the shortcomings of existing weakly supervised medical image anomaly detection methods in feature extraction, small lesion perception, and pixel distribution realism.
[0012] This invention provides the following solution: A multi-scale anomaly detection method includes: Obtain a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal; Construct and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image to be detected is input into the trained two-stage weakly supervised learning model; Based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, a pixel-level anomaly map and a feature-level anomaly heatmap are calculated. The two pixel-level anomaly maps and the feature-level anomaly heatmap are added together to obtain the final result.
[0013] Preferably, the U-shaped Mamba network is constructed by embedding Mamba modules in the encoder and decoder; the Mamba modules perform forward and backward scanning along the spatial dimension through a bidirectional scanning mechanism to simultaneously model the global long-range dependencies and local structural continuity of medical images.
[0014] Preferably, the specific steps for semantic alignment and fusion performed by the multi-scale anomaly feature enhancement module include: The multi-scale intermediate feature maps extracted from different depth levels of the decoder of the U-shaped Mamba network are input into a lightweight feature alignment network for channel and spatial dimension alignment. Using the image-level category labels as supervision signals, and employing knowledge distillation techniques, the deep semantic features extracted by the pre-trained teacher model are used as supervision targets to train the feature alignment network, thereby improving the category discrimination ability and structural anomaly perception ability of the fused features.
[0015] Preferably, the teacher model used in the knowledge distillation technique is a convolutional neural network pre-trained on a large natural image dataset, and the high-level semantic features output by the teacher model are used as soft targets to guide the feature alignment and fusion of the student model.
[0016] Preferably, the two-stage weakly supervised learning model is trained using a step-by-step optimization strategy: First, the Mamba diffusion model is trained independently using only the image-level category labels as guidance until it can stably generate normal reference images from anomalous input images. Subsequently, the network parameters of the Mamba diffusion model are fixed, and the multi-scale anomaly feature enhancement module is trained in an end-to-end manner using the same training dataset.
[0017] Preferably, the specific method for calculating pixel-level anomaly location heatmaps is as follows: The first stage generates a corresponding health-version reference image; By calculating the multi-scale enhanced abnormal features generated in the second stage of the medical image to be detected, a feature-level abnormality localization heatmap is finally output.
[0018] Preferably, the medical image dataset includes publicly available medical datasets, which include at least the LITS liver tumor dataset and the BRATS brain tumor dataset.
[0019] A multi-scale anomaly detection device is provided for performing the above-described multi-scale anomaly detection method. The device includes: The dataset acquisition unit is used to acquire a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal. The model building and training unit is used to build and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image input unit is used to input the medical image to be detected into the trained two-stage weakly supervised learning model. The anomaly localization heatmap output unit is used to calculate pixel-level anomaly maps and feature-level anomaly heatmaps based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, and to add the pixel-level anomaly maps and the feature-level anomaly heatmaps to obtain the final result.
[0020] A multi-scale anomaly detection device, the device comprising a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the multi-scale anomaly detection method described above according to the instructions in the program code.
[0021] A computer-readable storage medium for storing program code for executing the multi-scale anomaly detection method described above.
[0022] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: This application provides a multi-scale anomaly detection method, apparatus, device, and medium that combines a Mamba structure with a diffusion model for medical anomaly detection. The proposed U-shaped Mamba architecture simultaneously captures global context and preserves local structural details during the generation process, making the generated normal images more realistic and reliable, laying the foundation for accurate anomaly comparison later.
[0023] Simultaneously, a multi-scale anomaly feature enhancement module is proposed, which for the first time utilizes intermediate layer features of the diffusion model for anomaly detection. This module enhances the semantic information of multi-scale diffusion features through knowledge distillation, effectively compensating for information loss in pure pixel-level comparisons, and particularly improving the discriminative power for minute lesions and structural anomalies.
[0024] Furthermore, a two-stage collaborative weakly supervised learning paradigm is employed, enabling end-to-end training with only image-level labels. This method achieves state-of-the-art performance on publicly available datasets, significantly reducing the false negative rate and demonstrating its practical value in improving the accuracy of clinical screening.
[0025] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0027] Figure 1 This is a flowchart of the multi-scale anomaly detection method provided in the embodiments of the present invention; Figure 2 This is a flowchart of the model construction process provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of a medical image anomaly detection method based on weak supervision provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the multi-scale anomaly detection device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the multi-scale anomaly detection device provided in an embodiment of the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0029] See Figure 1 This invention provides a multi-scale anomaly detection method, such as... Figure 1 As shown, the method may include: S101: Obtain a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal; in specific implementation, the embodiments of the present invention may provide that the medical image dataset includes publicly available medical datasets, wherein the publicly available medical datasets include at least the LITS liver tumor dataset and the BRATS brain tumor dataset.
[0030] S102 constructs and trains a two-stage weakly supervised learning model, in which: The first stage includes a classifier-guided Mamba diffusion model for receiving medical images and reconstructing corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. In specific implementation, the embodiments of this application can provide that the U-shaped Mamba network is constructed by embedding Mamba modules in the encoder and decoder. The Mamba module performs forward and backward scanning along the spatial dimension through a bidirectional scanning mechanism to simultaneously model the global long-range dependencies and local structural continuity of the medical image.
[0031] The second stage includes a multi-scale anomaly feature enhancement module, used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map; in specific implementation, the embodiments of this application can provide the following specific steps for the semantic alignment and fusion of the multi-scale anomaly feature enhancement module: The multi-scale intermediate feature maps extracted from different depth levels of the decoder of the U-shaped Mamba network are input into a lightweight feature alignment network for channel and spatial dimension alignment. Using the image-level category labels as supervision signals, and employing knowledge distillation techniques, the deep semantic features extracted by the pre-trained teacher model are used as supervision targets to train the feature alignment network, thereby improving the category discrimination ability and structural anomaly perception ability of the fused features.
[0032] Furthermore, the teacher model used in the knowledge distillation technique is a convolutional neural network pre-trained on a large medical image dataset, and the high-level semantic features output by the teacher model are used as soft targets to guide the feature alignment and fusion of the student model.
[0033] The two-stage weakly supervised learning model is trained using a step-by-step optimization strategy: First, the Mamba diffusion model is trained independently using only the image-level category labels as guidance until it can stably generate normal reference images from anomalous input images. Subsequently, the network parameters of the Mamba diffusion model are fixed, and the multi-scale anomaly feature enhancement module is trained in an end-to-end manner using the same training dataset.
[0034] S103: Input the medical image to be detected into the trained two-stage weakly supervised learning model; S104: Based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, a pixel-level anomaly map and a feature-level anomaly heatmap are calculated. The pixel-level anomaly map and the feature-level anomaly heatmap are added together to obtain the final result. Specifically, in this embodiment of the invention, the specific method for calculating the pixel-level anomaly localization heatmap is as follows: The first stage generates a corresponding health-version reference image; By calculating the multi-scale enhanced abnormal features generated in the second stage of the medical image to be detected, a feature-level abnormality localization heatmap is finally output.
[0035] The multi-scale anomaly detection method provided in this invention receives medical images with only image-level labels. It employs a two-stage collaborative framework of Mamba-driven image generation and multi-scale anomaly feature enhancement. In the first stage, a classifier-guided diffusion model generates structurally normal reference images from the anomaly images. In the second stage, multi-scale features are extracted and enhanced during the diffusion process to locate the anomalies. After end-to-end training, the method can generate high-fidelity normal images and output accurate pixel-level anomaly localization maps during the testing phase, significantly reducing the false negative rate of small lesions while maintaining high sensitivity.
[0036] The multi-scale anomaly detection method provided in the embodiments of the present invention will be described in detail below.
[0037] The multi-scale anomaly detection method based on the multi-scale Mamba diffusion model provided by this invention, such as... Figure 2 As shown, the following steps may be included: Step 1: Construct a medical image dataset with image-level labels (normal / abnormal) and divide it into training and test sets. To meet the data volume requirements of weakly supervised learning, publicly available medical datasets with image-level labels (normal / abnormal) are selected, including the LITS liver tumor dataset and the BRATS brain tumor dataset. The raw data undergoes uniform size standardization and grayscale normalization preprocessing. The preprocessed dataset is then randomly divided into training and test sets in a 7:3 ratio.
[0038] Step 2: Building the Mamba-Diffusion Normal Image Generation Stage: Based on the classifier-guided diffusion framework, a U-shaped Mamba network is used to replace the standard U-NET. Its global receptive field and local scanning mechanism are utilized to generate images with normal structure and realistic texture from abnormal inputs. The core of this stage is to build a classifier-guided diffusion model, using a U-shaped Mamba network as the denoising backbone to replace the standard U-NET. This network embeds Mamba modules in both the encoder and decoder, which, through their bidirectional scanning mechanism, efficiently capture global context while preserving the continuity of local structures. During inference (denoising), image-level category labels ("normal" and "abnormal") are used to guide the model, controlling it to progressively reconstruct the input anomalous image into a structurally normal, textured image.
[0039] Step 3: Construct a multi-scale anomaly feature enhancement module: Extract multi-scale intermediate features from the inverse diffusion process, and perform semantic alignment and visual enhancement through category supervision and knowledge distillation to obtain highly discriminative structural anomaly features; This module is responsible for extracting and optimizing multi-scale intermediate features (referred to as "diffusion features") during the inverse diffusion process. Specifically, we extract feature maps from three different levels of the U-shaped Mamba decoder. To utilize these multi-scale features for classification and localization, we design a lightweight feature alignment and fusion network. This network uses class labels as supervision signals and, through knowledge distillation, transfers semantic prior knowledge from a large teacher model (such as VGG) to this module, thereby accelerating training and enhancing the discriminative power of the features, enabling them to more accurately capture structural anomalies.
[0040] Step 4: Jointly train the two-stage networks mentioned above to optimize the image generation quality and anomaly feature discrimination ability until the model converges and the network parameters are saved; The training process consists of two phases. First, the Mamba-Diffusion model is pre-trained to learn how to generate high-quality healthy images. Then, with the diffusion model weights fixed, a multi-scale anomaly feature enhancement module is trained. By designing ablation experiments, different feature fusion strategies and knowledge distillation weights are tried, and finally, an optimal set of training strategies and hyperparameter combinations is determined and the optimal network model parameters are saved.
[0041] Step 5: During the testing phase, such as Figure 3 As shown, the pre-trained model is imported, and by comparing the input image with the generated normal image and combining the enhanced multi-scale features, the final output is a pixel-level anomaly detection result and a localization heatmap.
[0042] During the testing and application phases, the pre-trained complete model parameters are imported. For the input image to be detected, the system first generates a corresponding "healthy" reference image through a Mamba-diffusion stage. Then, by calculating the residuals between the input image and the generated image in pixel space and multi-scale feature space, and combining them with enhanced anomaly features, the system finally outputs image-level classification results and pixel-level anomaly localization heatmaps, achieving fast and accurate weakly supervised anomaly detection.
[0043] In summary, the multi-scale anomaly detection method provided by this invention combines the Mamba structure with a diffusion model for medical anomaly detection. The proposed U-shaped Mamba architecture simultaneously captures global context and preserves local structural details during the generation process, making the generated normal images more realistic and reliable, laying the foundation for subsequent accurate anomaly comparison.
[0044] Simultaneously, a multi-scale anomaly feature enhancement module is proposed, which for the first time utilizes intermediate layer features of the diffusion model for anomaly detection. This module enhances the semantic information of multi-scale diffusion features through knowledge distillation, effectively compensating for information loss in pure pixel-level comparisons, and particularly improving the discriminative power for minute lesions and structural anomalies.
[0045] Furthermore, a two-stage collaborative weakly supervised learning paradigm is employed, enabling end-to-end training with only image-level labels. This method achieves state-of-the-art performance on publicly available datasets, significantly reducing the false negative rate and demonstrating its practical value in improving the accuracy of clinical screening.
[0046] See Figure 4 This application embodiment can also provide a multi-scale anomaly detection device, such as... Figure 4 As shown, the apparatus for performing the above-described multi-scale anomaly detection method may include: Data set acquisition unit 401 is used to acquire a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal. Model building and training unit 402 is used to build and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image input unit 403 is used to input the medical image to be detected into the trained two-stage weakly supervised learning model. The anomaly localization heatmap output unit 404 is used to calculate a pixel-level anomaly map and a feature-level anomaly heatmap based on the medical image to be detected, the reference image generated by the first stage, and the enhanced anomaly discrimination feature map generated by the second stage, and to add the pixel-level anomaly map and the feature-level anomaly heatmap to obtain the final result.
[0047] This application embodiment can also provide a multi-scale anomaly detection device, the device including a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of the multi-scale anomaly detection method described above according to the instructions in the program code.
[0048] like Figure 5 As shown in the figure, a multi-scale anomaly detection device provided in this application embodiment may include: a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, memory 11, and communication interface 12 all communicate with each other through the communication bus 13.
[0049] In this embodiment, the processor 10 may be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic devices.
[0050] The processor 10 can call the program stored in the memory 11. Specifically, the processor 10 can execute the operations in the embodiments of the multi-scale anomaly detection method.
[0051] The memory 11 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 11 stores at least a program for implementing the following functions: Obtain a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal; Construct and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image to be detected is input into the trained two-stage weakly supervised learning model; Based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, a pixel-level anomaly map and a feature-level anomaly heatmap are calculated. The pixel-level anomaly map and the feature-level anomaly heatmap are added together to obtain the final result.
[0052] In one possible implementation, the memory 11 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function (such as file creation or data read / write). The data storage area may store data created during use, such as initialization data.
[0053] In addition, memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.
[0054] Communication interface 12 can be an interface for a communication model, used to connect with other devices or systems.
[0055] Of course, it should be noted that, Figure 5 The structure shown does not constitute a limitation on the multi-scale anomaly detection device in the embodiments of this application. In practical applications, the multi-scale anomaly detection device may include more than Figure 5 More or fewer components as shown, or combinations of certain components.
[0056] This application embodiment may also provide a computer-readable storage medium for storing program code for executing the steps of the multi-scale anomaly detection method described above.
[0057] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0058] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0059] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0060] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A multi-scale anomaly detection method, characterized in that, The method includes: Obtain a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal; Construct and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image to be detected is input into the trained two-stage weakly supervised learning model. Based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, a pixel-level anomaly map and a feature-level anomaly heatmap are calculated. The two pixel-level anomaly maps and the feature-level anomaly heatmap are added together to obtain the final result.
2. The multi-scale anomaly detection method according to claim 1, characterized in that, The U-shaped Mamba network is constructed by embedding Mamba modules in the encoder and decoder; the Mamba modules perform forward and backward scanning along the spatial dimension through a bidirectional scanning mechanism to simultaneously model the global long-range dependencies and local structural continuity of medical images.
3. The multi-scale anomaly detection method according to claim 1, characterized in that, The specific steps for semantic alignment and fusion performed by the multi-scale anomaly feature enhancement module include: The multi-scale intermediate feature maps extracted from different depth levels of the decoder of the U-shaped Mamba network are input into a lightweight feature alignment network for channel and spatial dimension alignment. Using the image-level category labels as supervision signals, and employing knowledge distillation techniques, the deep semantic features extracted by the pre-trained teacher model are used as supervision targets to train the feature alignment network, thereby improving the category discrimination ability and structural anomaly perception ability of the fused features.
4. The multi-scale anomaly detection method according to claim 3, characterized in that, The teacher model used in the knowledge distillation technique is a convolutional neural network pre-trained on a large natural image dataset. The high-level semantic features output by the teacher model are used as soft targets to guide the feature alignment and fusion of the student model.
5. The multi-scale anomaly detection method according to claim 1, characterized in that, The two-stage weakly supervised learning model is trained using a step-by-step optimization strategy: First, the Mamba diffusion model is trained independently using only the image-level category labels as guidance until it can stably generate normal reference images from anomalous input images. Subsequently, the network parameters of the Mamba diffusion model are fixed, and the multi-scale anomaly feature enhancement module is trained in an end-to-end manner using the same training dataset.
6. The multi-scale anomaly detection method according to claim 1, characterized in that, The specific method for calculating pixel-level anomaly localization heatmaps is as follows: The first stage generates a corresponding health-version reference image; By calculating the multi-scale enhanced abnormal features generated in the second stage of the medical image to be detected, a feature-level abnormality localization heatmap is finally output.
7. The multi-scale anomaly detection method according to claim 1, characterized in that, The medical image dataset includes publicly available medical datasets, which include at least the LITS liver tumor dataset and the BRATS brain tumor dataset.
8. A multi-scale anomaly detection device, characterized in that, The apparatus for performing the multi-scale anomaly detection method according to any one of claims 1-7, the apparatus comprising: The dataset acquisition unit is used to acquire a medical image dataset with image-level category labels, wherein the image-level category labels include at least two categories: normal and abnormal. The model building and training unit is used to build and train a two-stage weakly supervised learning model, wherein: The first stage includes a classifier-guided Mamba diffusion model, which receives medical images and reconstructs corresponding structurally normal reference images. The first stage uses a U-shaped Mamba network as the denoising backbone network. The second stage includes a multi-scale anomaly feature enhancement module, which is used to extract at least three multi-scale intermediate features of different scales from the reverse diffusion process of the Mamba diffusion model, and to perform semantic alignment and fusion on the multi-scale intermediate features to generate an enhanced anomaly discrimination feature map. The medical image input unit is used to input the medical image to be detected into the trained two-stage weakly supervised learning model. The anomaly localization heatmap output unit is used to calculate pixel-level anomaly maps and feature-level anomaly heatmaps based on the medical image to be detected, the reference image generated in the first stage, and the enhanced anomaly discrimination feature map generated in the second stage, and to add the pixel-level anomaly maps and the feature-level anomaly heatmaps to obtain the final result.
9. A multi-scale anomaly detection device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the multi-scale anomaly detection method according to any one of claims 1-7 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the multi-scale anomaly detection method according to any one of claims 1-7.