Liver echinococcosis ultrasonic image intelligent classification and detection method based on deep learning, electronic equipment and storage medium
Through deep learning-based methods, preprocessing and model training of liver ultrasound images is solved, and the problems of low accuracy and high misdiagnosis rate of traditional ultrasound image processing for echinococcosis are achieved, achieving higher detection accuracy and calculation efficiency.
Patent Information
- Application Number
- CN202510269014.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-07
AI Technical Summary
Traditional ultrasound image processing has low accuracy for echinococcosis in the liver and is prone to misdiagnosis.
Using a deep learning-based method, ultrasonic images are preprocessed through the adaptive overlapping block denoising model, a classification data set is established and an adaptive multi-scale attention residual classification model is trained, and the Fractal-YOLO detection model is further trained through object detection annotation.
Improves the accuracy of echinococcosis, reduces the rate of misdiagnosis, and ensures computational efficiency.
Smart Images

Figure CN119784747A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of ultrasonic image classification and detection, and in particular relates to a deep learning-based intelligent classification and detection method for hepatic echinococcosis ultrasonic images, an electronic device and a storage medium. Background Art
[0002] Hepatic echinococcosis is a zoonotic parasitic disease caused by larval echinococcosis parasitizing humans (or animals). Once the disease occurs, it will endanger the patient's health and cause great economic losses. The most common site of hepatic echinococcosis is the liver, accounting for 80% of the total incidence, followed by other organs such as the lungs, and finally affecting the whole body. Hepatic echinococcosis can be divided into hepatic granular echinococcosis and hepatic alveolar echinococcosis pathologically. Among them, hepatic granular cysts are more common, accounting for more than 98% of hepatic echinococcosis cases. The World Health Organization divides hepatic echinococcosis into cystic echinococcosis and alveolar echinococcosis based on the ultrasound image characteristics of hepatic echinococcosis. Cystic echinococcosis is divided into 5 types, namely single cyst (CE-1), multi-asci (CE-2), internal capsule collapse (CE-3), necrotizing consolidation (CE-4) and calcification (CE-5). Alveolar echinococcosis is divided into three types: infiltrative, calcified, and liquefied cavitary. The incidence of hepatic alveolar echinococcosis is lower than that of hepatic cystic echinococcosis, accounting for about 3% to 5% of hepatic echinococcosis.
[0003] Since echinococcosis grows slowly in the early stage of liver infection, patients usually do not show obvious clinical symptoms. Only some patients will have allergic symptoms or occasional discomfort in the liver area. As the hepatic echinococcosis lesions gradually grow, they may compress the surrounding blood vessels or damage the bile duct. At this time, patients will have more obvious clinical symptoms such as abdominal discomfort, pain or jaundice. At present, the prevention and treatment of hepatic echinococcosis still faces many difficulties. Clinically, clinical diagnosis, imaging diagnosis, immunology and serological examinations are generally used to diagnose hepatic echinococcosis. Among them, ultrasound examination is the preferred method for diagnosis and screening of hepatic echinococcosis. As a non-invasive examination method, it uses the physical imaging characteristics to judge the physical characteristics, morphological structure and functional state of human soft tissue. However, conventional ultrasound images need to be quantitatively analyzed, and ultrasound physicians and oncologists need to spend a lot of time and energy to initially complete the diagnosis of the disease. There are problems such as strong human subjectivity, poor accuracy of measurement results, and poor reproducibility, which often lead to missed diagnosis or misdiagnosis of the disease. In clinical practice, physicians face a large number of ultrasound images generated during physical examinations, and it is difficult to ensure that they have enough energy to find all the hepatic echinococcosis lesions. In particular, it is difficult to effectively identify all cystic echinococcosis lesions when faced with diseases with similar structures. Summary of the invention
[0004] In view of this, the present invention aims to propose a deep learning-based intelligent classification and detection method for hepatic echinococcosis ultrasound images, an electronic device and a storage medium to solve the challenges of low accuracy and misdiagnosis of echinococcosis in traditional ultrasound image processing.
[0005] To achieve the above object, the technical solution of the present invention is achieved as follows: A method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning, comprising the following steps: S1. Collect liver ultrasound imaging data; S2, preprocessing the liver ultrasound image data, and denoising the preprocessed liver ultrasound image data based on an adaptive overlapping block denoising model guided by information entropy; S3. Classify and annotate, divide the pathological classification standards, establish a classification data set, and annotate the images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions; S4. Based on the classification dataset, train an adaptive multi-scale attention residual classification model; S5. Perform target detection and annotation on the cystic echinococcosis data to establish a cystic echinococcosis detection data set; S6. Perform target detection and annotation on alveolar echinococcosis data to establish an alveolar echinococcosis detection data set; S7. The detection model Fractal-YOLO is trained based on the cystic echinococcosis dataset and the alveolar echinococcosis detection dataset respectively.
[0006] Furthermore, in step S2, the preprocessed liver ultrasound image data is denoised based on an adaptive overlapping block denoising model guided by information entropy, including: S21, loading and inputting liver ultrasound image data; S22, calculating the local entropy value distribution; S23, dividing the area types according to the threshold value; S24, determining the region type and parameter settings for each reference block position, performing block matching denoising, and accumulating the results into an output image; S25: Generate a final denoising result image.
[0007] Furthermore, in step S22, the local entropy value distribution is calculated, including: Given an input image , first calculate the information entropy distribution of its local area; for each position in the image, define a sliding window of size 7×7, and at each window position , calculate the information entropy within the window: ; ; in, Indicates the gray value in the window The probability of occurrence is obtained by calculating the grayscale histogram within the window. The gray value in the sliding window is The number of pixels, is the total number of pixels in the window.
[0008] Furthermore, in step S23, the region types are divided according to the threshold, including: Based on the local entropy value calculated in step S22, an entropy matrix with the same size as the original image is established. , by setting two thresholds, high and low and , the image regions are divided into three categories: when > It is a high entropy area, which contains important structural edges or texture details; when < Low entropy area: Low entropy area is a uniform tissue area or a noise interference area; Medium entropy region: the transitional region between the two; Based on the statistical analysis of 8-bit grayscale images, the high entropy threshold is selected to be higher than 75% of the theoretical maximum entropy value, and the low entropy threshold is set to 45% of the theoretical maximum entropy value; For different types of areas, set different denoising parameters: For high entropy regions: Use a search radius lower than the set value ; A similarity threshold of 0.01 to 0.1 is used. ; Choose a block size smaller than the set value ; For low entropy regions: Use a search radius larger than the set value ; A similarity threshold of 0.1 to 0.3 is used. ; Choose a block size larger than the set value .
[0009] Further, in step S24, the region type and parameter settings are determined for each reference block position, block matching denoising is performed, and the results are accumulated into the output image, including: Next, matching and denoising are performed for each reference block position in the image. : Get the entropy value type of the reference block position , determine the corresponding parameter set , in Center, radius In the search window, find image blocks similar to the reference block; use the normalized mean square error to calculate the similarity: ; in, is the target block to be denoised, is the comparison block within the search window, are the relative coordinates of the pixels within the block, Select based on region type or ; When the similarity is less than the threshold When , the image block is added to the similar block set , calculate the weighted average of all similar blocks: ; is the weight of similar blocks; is the weight decay coefficient, which controls the speed at which the weight decreases with the similarity distance; so the noise removal module is: ; in, Represents a similar set.
[0010] Furthermore, in step S25, a final denoising result image is generated, including: For each pixel position , collect the denoising block results of the covered pixels, and calculate the weighted average to get the final pixel value: ; in, Indicates coverage pixels The set of all denoising blocks; Covering pixels The number of denoising blocks; Indicates The denoising blocks are at positions The pixel value of .
[0011] Further, in step S4, based on the classification data set, an adaptive multi-scale attention residual classification model is trained, including: Perform data augmentation on the image. For the enhanced input image , the network first enters the improved Stage 0 for feature preprocessing: After the main branch's 7×7 convolution, batch normalization and activation function, the main branch features are output , and record this process as: ; in, Represents the learnable parameters of the 7×7 convolution kernel, the number of convolution kernels is 64, and the step size is 2; the auxiliary branch uses two consecutive 3×3 convolutions instead of a single large convolution, and the batch normalization and activation function are also performed after each convolution to output the auxiliary branch features , expressed as follows: ; ; in, is the intermediate feature map in the auxiliary branch, and is the output feature map of the auxiliary branch; where and are the parameters of two 3×3 convolution operations, with 32 channels and a stride of 1. and The fusion features are obtained by splicing in the channel dimension: ; Again Apply 3×3 maximum pooling with a pooling step size of 2, and the output feature is recorded as ;exist The SE channel attention mechanism is introduced to extract channel statistics through global average pooling, and a two-layer fully connected layer plus nonlinear activation is used to filter the channel importance, and the generated channel weight vector is combined with Multiply channel by channel to get the output containing attention weighted information ; expressed in mathematical form: ; ; ; in, represents the maximum pooling, represents global average pooling, represents element-wise multiplication, , are the fully connected layer parameters for reducing and increasing dimensions, respectively. is the Sigmoid activation function; After being processed by Stage 0, the feature map carries preliminary channel attention information; The subsequent Stage 1 contains three Bottleneck structures, among which the first Bottleneck is denoted as BTNK1-1. If the input feature is denoted as , then the dynamic convolution operation is represented by the following expression; ; in, are several sets of kernels learned in advance, Calculate variable attention weights based on input features; The last two Bottlenecks are denoted as BTNK1-2, which introduce channel reorganization operations ChannelShuffle before and after feature transformation respectively; After the three bottlenecks of Stage 1 are completed, the spatial resolution of the output is the same as that of the previous stage, but the number of channels is gradually increased; ; The first Bottleneck in Stage 2 to Stage 4 is denoted as BTNK2-1, BTNK3-1, and BTNK4-1 respectively. In BTNK2-1, BTNK3-1, and BTNK4-1, the downsampling operation of the 3×3 strided convolution is replaced by a deformable convolution. , the sampling position of the deformable convolution kernel is determined by the preset grid position and learnable offset Together, the convolution calculation satisfies: ; in, Represents the coordinate mapping relationship of downsampling; A feature pyramid structure is added inside BTNK2-1, BTNK3-1, and BTNK4-1. The conditional calculation mechanism is used to dynamically cut some channels or branches for different inputs during forward reasoning. The adaptive calculation is recorded as: ; in, It is a computational indicator based on input features or network state estimation. In order to control the strategy threshold, BTNK2-2 in stage 2 is upgraded to a 1×1 dimension reduction-3×3 depthwise separable convolution-1×1 dimension increase structure, and a channel attention mechanism is embedded in it; A residual adaptive mechanism is added in BTNK4-1, and a gate control parameter is used to balance the fusion weight of the identity mapping and the residual transformation. The mathematical form of the fusion weight is expressed as: ; in, λ ∈ [0,1] Obtained by learning or dynamically determined by input data, is the input feature, is the residual transformation function; After each main branch convolution in Stage 4, DropBlock is introduced as a regularization method. The regularization method is recorded as: ; in, is the element-wise multiplication, represents a randomly generated square mask on the feature map, Represents the input feature map.
[0012] Further, in step S7, the detection model Fractal-YOLO is trained based on the cystic echinococcosis dataset and the alveolar echinococcosis detection dataset, respectively, including: Introducing fractal dimension analysis to enhance the model’s perception of lesion morphology and texture: In the C2F-Backbone module of YOLOV8, in addition to the conventional convolution operation, each feature map introduces fractal dimension calculation; for the feature map F, its local fractal dimension is calculated: ; in, represents the feature map location, is the local window size, Use side length The minimum number of windows required for the grid to cover the non-zero eigenvalues; Approximate calculation using discrete scale: ; in, is the number of sampling scales, It is The sampling scale, The side length is The minimum number of windows required for the grid to cover the non-zero eigenvalues; In the C2F-Backbone module, the fractal features of the main branch and the short-circuit branch are enhanced respectively, where the main branch features are enhanced: ; Short-circuit branch feature enhancements: ; in, is a nonlinear mapping function, and is a learnable parameter; The final C2F-Backbone module output is: ; in, represents the final output features of the C2F-Backbone module, Indicates that the main branch features are enhanced. It indicates that the short-circuit branch characteristics are enhanced; In the feature aggregation process of PANet, fractal features participate in the up- and down-sampling process: Bottom-up path: ; Top-down path: ; in, represents the feature level index, Indicates Layer original features, Indicates Layer original features, Indicates The fractal characteristics of the layers, represents upsampling / downsampling operations, represents the convolutional layer; Introducing boundary fractal dimension calculation, by Lower measurement boundary perimeter , we get the boundary fractal dimension reflecting the degree of boundary irregularity: ; in, is the measurement scale, Is the scale used The measured perimeter of the boundary, It reflects the degree of irregularity of the boundary. This boundary information is used to optimize the prediction of the bounding box through the learnable weight coefficient and the mapping function , fine-tune the original prediction box: ; Through global average pooling and fully connected layers, weight coefficients of different feature channels are generated to achieve adaptive fusion of features; Finally, the fractal feature loss is introduced, and the loss function is expressed as: ; ; in, is the fractal loss weight, , are the predicted and target fractal dimensions, is the KL divergence, which measures the difference between the distribution of predicted and target fractal features, is the KL loss weight.
[0013] An electronic device includes a processor and a memory that is communicatively connected to the processor and is used to store instructions executable by the processor, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor. The processor is used to execute the deep learning-based intelligent classification and detection method for ultrasonic images of hepatic echinococcosis.
[0014] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the deep learning-based intelligent classification and detection method for ultrasonic images of hepatic echinococcosis.
[0015] Compared with the prior art, the deep learning-based intelligent classification and detection method for hepatic echinococcosis ultrasound images, electronic equipment, and storage medium described in the present invention have the following beneficial effects: The present invention discloses a deep learning-based intelligent classification and detection method for liver echinococcosis ultrasound images, an electronic device and a storage medium. The present invention can use an adaptive overlapping block denoising model to denoise preprocessed liver ultrasound image data, then establish a classification data set, and train an adaptive multi-scale attention residual classification model based on the classification data set; then, through target detection and annotation, a cystic echinococcosis detection data set and an alveolar echinococcosis detection data set are respectively established; finally, a detection model Fractal-YOLO is trained based on the cystic echinococcosis data set and the alveolar echinococcosis detection data set, respectively, so that the model can more comprehensively understand and utilize the morphological characteristics of the lesion, thereby improving the detection performance, ensuring the calculation efficiency, and at the same time greatly improving the accuracy of echinococcosis and reducing the misdiagnosis rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings: Figure 1 It is a schematic diagram of the overall method flow of an embodiment of the present invention; Figure 2 It is a schematic diagram of a denoising process for pre-processed liver ultrasound image data using an adaptive overlapping block denoising model guided by information entropy according to an embodiment of the present invention; Figure 3 A schematic diagram of the architecture of the adaptive multi-scale attention residual classification model according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the process of training the detection model Fractal-YOLO based on two detection data sets according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0018] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0019] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.
[0020] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0021] like Figures 1 to 4 As shown, a method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning includes the following steps: S1. Data collection: collect high-quality liver ultrasound imaging data to ensure data representativeness and diversity; S2, preprocessing the liver ultrasound image data, and denoising the preprocessed liver ultrasound image data based on an adaptive overlapping block denoising model guided by information entropy; S3. Classify and annotate, divide clear pathological classification standards, establish classification data sets, and annotate images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions; S4. Based on the classification dataset, train an adaptive multi-scale attention residual classification model; S5. Perform target detection and annotation on the cystic echinococcosis data to establish a cystic echinococcosis detection data set; S6. Perform target detection and annotation on alveolar echinococcosis data to establish an alveolar echinococcosis detection data set; S7. Train the detection model Fractal-YOLO based on two detection datasets (cystic echinococcosis dataset and alveolar echinococcosis detection dataset) respectively.
[0022] Finally, the experimental results of this method are as follows: Cystic echinococcosis: P = 97.6%, R = 98.3%, mAP50 = 94.6%, mAP50-95 = 92.7%; Alveolar echinococcosis: P = 98.7%, R = 99.3%, mAP50 = 95.6%, mAP50-95 = 94.6%, where P is precision, R is recall, mAP50 is the average precision calculated based on an IoU (Intersection over Union) threshold of 0.5, and mAP50-95 is the average of the average precision calculated at IoU thresholds from 0.5 to 0.95 (usually in steps of 0.05).
[0023] In a preferred embodiment of the present invention, in step S2, the preprocessed liver ultrasound image data is denoised based on an adaptive overlapping block denoising model guided by information entropy, including: In the liver ultrasound image processing, there are two key challenges: one is to retain the important structural features required for diagnosis (such as the edge of hydatid cysts), and the other is to effectively suppress the speckle noise that affects the image quality. To solve this problem, the present invention proposes an adaptive overlapping block denoising method based on information entropy guidance. The method first identifies the key areas and noise areas in the image through information entropy analysis, and then performs differential denoising according to the entropy value distribution.
[0024] Algorithm flow: 1. Load the input image; 2. Calculate the local entropy distribution; 3. Divide the area types according to the threshold; 4. For each reference block position: Determine the zone type and parameter settings; Perform block matching denoising; Accumulate the results into an output image; 5. Generate the final denoising result image.
[0025] Specifically, given an input image , first calculate the information entropy distribution of its local area. For each position in the image, define a sliding window of size 7×7. At each window position , calculate the information entropy within the window: ; ; in, Indicates the gray value in the window The probability of occurrence is obtained by calculating the grayscale histogram within the window. The gray value in the sliding window is The number of pixels, is the total number of pixels in the window. Information entropy It reflects the complexity of the image information in the local area: the higher the entropy value, the more dispersed the grayscale distribution in the area is, and it may contain more structural details; the lower the entropy value, the more concentrated the grayscale distribution in the area is, and it may be a more uniform tissue area or an area affected by noise.
[0026] Based on the calculated local entropy value, establish an entropy matrix with the same size as the original image By setting two thresholds, high and low and , the image regions are divided into three categories: High entropy region ( > ): may contain important structural edges or texture details; Low entropy region ( < ): It may be a homogeneous tissue area or a noise interference area; Medium entropy region: the transitional region between the two.
[0027] Based on the statistical analysis of 8-bit grayscale images (256 levels), the high entropy threshold was selected to be slightly higher than 75% of the theoretical maximum entropy value, and the low entropy threshold was set to about 45% of the theoretical maximum entropy value.
[0028] For different types of areas, set different denoising parameters: For high entropy regions: Use a smaller search radius ; Use a strict similarity threshold (between coefficient values 0.01 and 0.1, suitable for high-quality images, especially in areas with rich details and low noise, to ensure that very similar blocks are selected) ; Choose a smaller block size .
[0029] For low entropy regions: Use a larger search radius ; Use a looser similarity threshold (the coefficient value is usually between 0.1 and 0.3, which is used in situations with strong noise or relatively uniform regional background. By accepting a larger error, more similar blocks can be found, thus improving the denoising effect) ; Choose a larger block size .
[0030] Next, matching and denoising are performed for each reference block position in the image. : Get the entropy value type of the location , determine the corresponding parameter set , in Center, radius In the search window, we search for image blocks similar to the reference block. And in order to prevent the similarity of blocks of different sizes from being directly comparable, we use the normalized mean square error to calculate the similarity (Euclidean distance): ; is the target block to be denoised, is the comparison block within the search window, are the relative coordinates of the pixels within the block, Select based on region type or .
[0031] When the similarity is less than the threshold When , add the block to the similar block set , calculate the weighted average of all similar blocks: ; is the weight of similar blocks; is the weight decay coefficient, which controls the speed at which the weight decreases with the similarity distance; so the noise removal module is: ; in Represents a similar set. Due to the overlapping block strategy, the same pixel position may be covered by multiple denoised blocks. , collect all denoising block results covering the pixel, and calculate the weighted average to get the final pixel value: ; Indicates coverage pixels The set of all denoising blocks; Covering pixels The number of denoising blocks; Indicates The denoising blocks are at positions The pixel value of .
[0032] In a preferred embodiment of the present invention, in step S3, classification annotation is performed, clear pathological classification standards are divided, a classification data set is established, and the images are annotated as cystic echinococcosis, alveolar echinococcosis, and other liver lesions.
[0033] In a preferred embodiment of the present invention, in step S4, the adaptive multi-scale attention residual classification model: The input of the model is an RGB image with a shape of (3,224,224). In order to further enhance the robustness of the model, the image is augmented with data, including random flipping, random cropping, and color jittering.
[0034] For the enhanced input image , the network first enters the improved Stage 0 for feature preprocessing. This stage adopts a dual-branch parallel structure, and in the subsequent stage, feature fusion and maximum pooling are used to obtain feature expressions with reduced spatial resolution and relatively high number of channels. Specifically, let After the main branch's 7×7 convolution, batch normalization and activation function, the main branch features are output , and record this process as: ; in Represents the learnable parameters of the 7×7 convolution kernel, the number of convolution kernels is 64, and the step size is 2. The auxiliary branch uses two consecutive 3×3 convolutions instead of a single large convolution. After each convolution, batch normalization and activation function are also performed to output the auxiliary branch features. , specifically described as follows: ; ; is the intermediate feature map in the auxiliary branch, and is the output feature map of the auxiliary branch. Among them, and are the parameters of two 3×3 convolution operations, with 32 channels and a stride of 1. and The fusion features are obtained by splicing in the channel dimension: ; Again Apply 3×3 maximum pooling for further downsampling, with a pooling step of 2, and the output feature is recorded as At this time, in order to improve the diversity and robustness of feature representation, The SE channel attention mechanism is introduced to extract channel statistics through global average pooling, and a two-layer fully connected layer plus nonlinear activation is used to filter the channel importance, and the generated channel weight vector is combined with Multiply channel by channel to get the output containing attention weighted information . It can be expressed in mathematical form as: ; ; in, represents global average pooling, ( , ) are the fully connected layer parameters for reducing and increasing dimensions, respectively. is the Sigmoid activation function. After being processed by Stage 0, the shape of the feature map becomes (64, 56, 56) and carries preliminary channel attention information.
[0035] The subsequent Stage 1 contains three improved Bottleneck structures. The first Bottleneck (denoted as BTNK1-1) uses dynamic convolution instead of standard convolution to adapt to the feature distribution of different positions or input samples. In the dynamic convolution branch, the convolution kernel is no longer a fixed single parameter, but different weight combinations are calculated according to the input to dynamically generate an effective convolution kernel. If the input feature is denoted as , then the dynamic convolution operation is represented by the following expression; ; in, are several sets of kernels learned in advance, Variable attention weights are calculated based on the input features. BTNK1-1 maintains the settings of step size S=1 and number of output channels C=C1=64 in the original ResNet50, but adds an additional spatial attention module in the main branch to weight the input feature map based on the spatial dimension, thereby highlighting key information. The subsequent two Bottlenecks (denoted as BTNK1-2) introduce the channel reorganization operation ChannelShuffle before and after the feature transformation, respectively, so that effective information interaction can be achieved between different channels in the case of grouped convolution or parallel branches. After the three Bottlenecks of Stage1 are completed, the spatial resolution of the output is the same as the previous stage, but the number of channels is gradually increased to construct a more expressive feature map.
[0036] ; The first Bottleneck in Stage 2 to Stage 4 is denoted as BTNK2-1, BTNK3-1, and BTNK4-1 respectively. In BTNK2-1, BTNK3-1, and BTNK4-1, the downsampling operation of the 3×3 strided convolution is replaced by a deformable convolution. , the sampling position of the deformable convolution kernel is determined by the preset grid position and learnable offset Together, the convolution calculation satisfies: ; in, Corresponding to the downsampling coordinate mapping relationship of stride=2, stride=2 is 3×3 strided convolution.
[0037] This allows for greater flexibility when dealing with deformable objects or complex backgrounds. At the same time, feature pyramid structures are added to BTNK2-1, BTNK3-1, and BTNK4-1 to preserve multi-scale information, and conditional computation mechanisms are used to dynamically trim some channels or branches for different inputs during forward reasoning. This type of adaptive computation can be written as: ; in, It is a computational indicator based on input features or network state estimation. To control the strategy threshold so as to dynamically reduce redundant calculations while ensuring accuracy, BTNK2-2 in stage 2 is upgraded to a "1×1 dimension reduction-3×3 depthwise separable convolution-1×1 dimension increase" structure, and a channel attention mechanism is embedded in it to highlight important channels or suppress redundant information in the process of scaling channel dimensions.
[0038] Inside the four Bottlenecks of Stage2, the output features of each layer are spliced with the input of the subsequent layer in the channel dimension to improve the feature reuse rate, thereby effectively strengthening the gradient flow and information retention. In addition to retaining the idea of multi-scale feature fusion, the six Bottlenecks after entering Stage3 also use a large number of group convolutions to reduce the amount of calculation. At this time, in order to ensure the smooth flow of information between different groups, channel reorganization operations will be inserted between groups so that group convolution does not excessively cause channel isolation. The three Bottlenecks of Stage4 further strengthen information aggregation on a global scale, and model the similarity between any two positions through the non-local attention module, so that the output features can capture long-range dependencies. In BTNK4-1 of Stage4, an additional residual adaptive mechanism is added, which balances the fusion weights of the identity mapping and the residual transformation through a gated control parameter. The mathematical form of the fusion weight is expressed as: ; in, λ ∈ [0,1] It can be learned or dynamically determined by the input data, so as to achieve fine-grained control over the residual contribution of different layers while maintaining network stability. is the input feature, is the residual transformation function; After each main branch convolution, DropBlock is introduced as a regularization method, and the regularization method is recorded as: ; in, is the element-wise multiplication, represents a randomly generated square mask on the feature map, whose size and survival probability change with the training process. Represents the input feature map.
[0039] The network also adopts a cross-layer feature aggregation mechanism at the overall structural level. Through the skip connection or aggregation module built at the end of each stage, the key information of the historical stage is passed backward step by step to reduce information loss.
[0040] In the output layer, global average pooling is usually performed on the final feature map to aggregate the spatial dimensions into a single value, followed by a linear classification layer to map the output to the number of categories to achieve the final classification prediction.
[0041] In a preferred embodiment of the present invention, in step S5, target detection and annotation are performed on the cystic echinococcosis data to establish a cystic echinococcosis detection data set, which is classified into single cyst type (CE-1), multi-ascus type (CE-2), internal capsule collapse type (CE-3), necrotic consolidation type (CE-4) and calcification type (CE-5).
[0042] In a preferred embodiment of the present invention, in step S6, target detection and annotation are performed on the alveolar echinococcosis data to establish an alveolar echinococcosis detection data set, and the categories are infiltrative type, calcified type and liquefied cavitary type.
[0043] In a preferred embodiment of the present invention, in step S7, the detection model Fractal-YOLO is trained based on two detection data sets respectively. The target detection model developed this time is based on the SOTA model yolov8. In order to be more suitable for the hydatid cyst dataset, fractal dimension analysis is introduced to enhance the model's perception of lesion morphology and texture: In the C2F-Backbone module of YOLOV8, in addition to the conventional convolution operation, each feature map introduces fractal dimension calculation. For the feature map F, calculate its local fractal dimension: ; in, represents the feature map location, is the local window size, Use side length The minimum number of windows required for the grid to cover the non-zero eigenvalues. To improve computational efficiency, the approximate calculation of the discrete scale is adopted: ; in is the number of sampling scales, It is The fractal dimension map obtained in this way reflects the local complexity of each position of the feature map, providing a basis for subsequent feature enhancement.
[0044] In the C2F-Backbone module, the fractal features of the main branch and the short-circuit branch are enhanced respectively, where the main branch features are enhanced: ; Short-circuit branch feature enhancements: ; in, is a nonlinear mapping function, and is a learnable parameter; the final C2F-Backbone module output is: ; in, represents the final output features of the C2F-Backbone module, Indicates that the main branch features are enhanced. It indicates that the short-circuit branch characteristics are enhanced; In the feature aggregation process of PANet, fractal features participate in the up- and down-sampling process: Bottom-up path: ; Top-down path: ; in, represents the feature level index, Indicates Layer original features, Indicates The fractal characteristics of the layers, represents upsampling / downsampling operations, Represents a convolutional layer. This multi-scale feature fusion ensures the transfer and integration of morphological information at different scale levels, allowing the model to perceive local details and global structures simultaneously.
[0045] In order to improve the perception of lesion boundaries, a special boundary fractal dimension calculation is introduced. Lower measurement boundary perimeter , we can get the boundary fractal dimension reflecting the degree of boundary irregularity: ; in, is the measurement scale, Is the scale used The measured perimeter of the boundary, It reflects the degree of irregularity of the boundary. This boundary information is used to optimize the prediction of the bounding box through the learnable weight coefficient and the mapping function , fine-tune the original prediction box: ; Through global average pooling (GAP) and fully connected layers (FC), weight coefficients of different feature channels are generated to achieve adaptive fusion of features. This mechanism enables the model to dynamically adjust the importance of different types of features according to the characteristics of the input image; Finally, in the design of the loss function, in addition to the conventional bounding box regression loss , classification loss and target existence loss In addition, fractal feature loss is introduced. This loss term includes the L2 distance between the predicted and target fractal dimensions, as well as the KL divergence between the predicted and target fractal feature distributions, which helps the model better learn morphological features. The loss function is expressed as: ; ; in, is the fractal loss weight, , are the predicted and target fractal dimensions, is the KL divergence, which measures the difference between the distribution of predicted and target fractal features, is the KL loss weight.
[0046] Through this multi-level fractal feature enhancement mechanism, the model acquires the ability to perceive the morphology of lesions at different levels: the bottom layer can capture local texture features, the middle layer extracts morphological structure information, and the high layer integrates global morphological features. This hierarchical design enables the model to more comprehensively understand and utilize the morphological features of lesions, thereby improving detection performance. At the same time, since the calculation of fractal features can be performed simultaneously with the forward propagation of the backbone network and multiple optimization strategies are adopted, the entire solution ensures computational efficiency while maintaining performance improvement.
[0047] The present invention can use an adaptive overlapping block denoising model to denoise the preprocessed liver ultrasound image data, then establish a classification data set, and train an adaptive multi-scale attention residual classification model based on the classification data set; then through target detection and annotation, a cystic echinococcosis detection data set and an alveolar echinococcosis detection data set are respectively established; finally, a detection model Fractal-YOLO is trained based on the cystic echinococcosis data set and the alveolar echinococcosis detection data set, so that the model can more comprehensively understand and utilize the morphological characteristics of the lesion, thereby improving the detection performance, ensuring the calculation efficiency, and at the same time greatly improving the accuracy of echinococcosis and reducing the misdiagnosis rate.
[0048] The present invention also proposes an electronic device, comprising a processor and a memory that is communicatively connected to the processor and is used to store instructions executable by the processor, wherein the memory stores instructions that can be executed by the processor, and the instructions are executed by the processor, and the processor is used to execute the deep learning-based intelligent classification and detection method for ultrasonic images of hepatic echinococcosis.
[0049] The present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the deep learning-based intelligent classification and detection method for ultrasonic images of hepatic echinococcosis.
[0050] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning, characterized in that: The following steps are involved: S1. Collect liver ultrasound imaging data; S2, preprocessing the liver ultrasound image data, and denoising the preprocessed liver ultrasound image data based on an adaptive overlapping block denoising model guided by information entropy; S3. Classify and annotate, divide the pathological classification standards, establish a classification data set, and annotate the images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions; S4. Based on the classification dataset, train an adaptive multi-scale attention residual classification model; S5. Perform target detection and annotation on the cystic echinococcosis data to establish a cystic echinococcosis detection data set; S6. Perform target detection and annotation on alveolar echinococcosis data to establish an alveolar echinococcosis detection data set; S7, training the detection model Fractal-YOLO based on the cystic echinococcosis dataset and the alveolar echinococcosis detection dataset respectively; In step S2, the preprocessed liver ultrasound image data is denoised based on an adaptive overlapping block denoising model guided by information entropy, including: S21, loading and inputting liver ultrasound image data; S22, calculating the local entropy value distribution; S23, dividing the area types according to the threshold value; S24, determining the region type and parameter settings for each reference block position, performing block matching denoising, and accumulating the results into an output image; S25: Generate a final denoising result image.
2. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 1, characterized in that: In step S22, the local entropy value distribution is calculated, including: Given an input image , first calculate the information entropy distribution of its local area; for each position in the image, define a sliding window of size 7×7, and at each window position , calculate the information entropy within the window: ; ; in, Indicates the gray value in the window The probability of occurrence is obtained by calculating the grayscale histogram within the window. The gray value in the sliding window is The number of pixels, is the total number of pixels in the window.
3. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 2, characterized in that: In step S23, the region types are divided according to the threshold, including: Based on the local entropy value calculated in step S22, an entropy matrix with the same size as the original image is established. , by setting two thresholds, high and low and , the image regions are divided into three categories: when > It is a high entropy area, which contains important structural edges or texture details; when < Low entropy area: Low entropy area is a uniform tissue area or a noise interference area; Medium entropy region: the transitional region between the two; Based on the statistical analysis of 8-bit grayscale images, the high entropy threshold is selected to be higher than 75% of the theoretical maximum entropy value, and the low entropy threshold is set to 45% of the theoretical maximum entropy value; For different types of areas, set different denoising parameters: For high entropy regions: Use a search radius lower than the set value ; A similarity threshold of 0.01 to 0.1 is used. ; Choose a block size smaller than the set value ; For low entropy regions: Use a search radius larger than the set value ; A similarity threshold of 0.1 to 0.3 is used. ; Choose a block size larger than the set value .
4. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 3, characterized in that: In step S24, the region type and parameter settings are determined for each reference block position, block matching denoising is performed, and the results are accumulated into the output image, including: Next, matching and denoising are performed for each reference block position in the image. : Get the entropy value type of the reference block position , determine the corresponding parameter set , in Center, radius In the search window, find image blocks similar to the reference block; use the normalized mean square error to calculate the similarity: ; in, is the target block to be denoised, is the comparison block within the search window, are the relative coordinates of the pixels within the block, Select based on region type or ; When the similarity is less than the threshold When , the image block is added to the similar block set , calculate the weighted average of all similar blocks: ; is the weight of similar blocks; is the weight decay coefficient, which controls the speed at which the weight decreases with the similarity distance; so the noise removal module is: ; in, Represents a similar set.
5. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 4, characterized in that: In step S25, a final denoising result image is generated, including: For each pixel position , collect the denoising block results of the covered pixels, and calculate the weighted average to get the final pixel value: ; in, Indicates coverage pixels The set of all denoising blocks; Covering pixels The number of denoising blocks; Indicates The denoising blocks are at positions The pixel value of .
6. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 1, characterized in that: In step S4, based on the classification data set, an adaptive multi-scale attention residual classification model is trained, including: Perform data augmentation on the image. For the enhanced input image , the network first enters Stage 0 for feature preprocessing: After the main branch's 7×7 convolution, batch normalization and activation function, the main branch features are output , and record this process as: ; in, Represents the learnable parameters of the 7×7 convolution kernel, the number of convolution kernels is 64, and the step size is 2; the auxiliary branch uses two consecutive 3×3 convolutions instead of a single large convolution, and the batch normalization and activation function are also performed after each convolution to output the auxiliary branch features , expressed as follows: ; ; in, is the intermediate feature map in the auxiliary branch, and is the output feature map of the auxiliary branch; where and are the parameters of two 3×3 convolution operations, with 32 channels and a stride of 1. and The fusion features are obtained by splicing in the channel dimension: ; Again Apply 3×3 maximum pooling with a pooling step size of 2, and the output feature is recorded as ;exist The SE channel attention mechanism is introduced to extract channel statistics through global average pooling, and a two-layer fully connected layer plus nonlinear activation is used to filter the channel importance, and the generated channel weight vector is combined with Multiply channel by channel to get the output containing attention weighted information ; expressed in mathematical form: ; ; ; in, represents the maximum pooling, represents global average pooling, represents element-wise multiplication, , are the fully connected layer parameters for reducing and increasing dimensions, respectively. is the Sigmoid activation function; After being processed by Stage 0, the feature map carries preliminary channel attention information; The subsequent Stage 1 contains three Bottleneck structures, among which the first Bottleneck is denoted as BTNK1-1. If the input feature is denoted as , then the dynamic convolution operation is represented by the following expression; ; in, are several sets of kernels learned in advance, Calculate variable attention weights based on input features; The last two Bottlenecks are denoted as BTNK1-2, which introduce channel reorganization operations ChannelShuffle before and after feature transformation respectively; After the three bottlenecks of Stage 1 are completed, the spatial resolution of the output is the same as that of the previous stage, but the number of channels is gradually increased; ; The first Bottleneck in Stage 2 to Stage 4 is denoted as BTNK2-1, BTNK3-1, and BTNK4-1 respectively. In BTNK2-1, BTNK3-1, and BTNK4-1, the downsampling operation of the 3×3 strided convolution is replaced by a deformable convolution. , the sampling position of the deformable convolution kernel is determined by the preset grid position and learnable offset Together, the convolution calculation satisfies: ; in, Represents the coordinate mapping relationship of downsampling; A feature pyramid structure is added inside BTNK2-1, BTNK3-1, and BTNK4-1. The conditional calculation mechanism is used to dynamically cut some channels or branches for different inputs during forward reasoning. The adaptive calculation is recorded as: ; in, It is a computational indicator based on input features or network state estimation. To control the strategy threshold, BTNK2-2 in stage 2 is upgraded to a 1×1 dimension reduction-3×3 depthwise separable convolution-1×1 dimension increase structure, and a channel attention mechanism is embedded in it; A residual adaptive mechanism is added in BTNK4-1, and a gate control parameter is used to balance the fusion weight of the identity mapping and the residual transformation. The mathematical form of the fusion weight is expressed as: ; in, Obtained by learning or dynamically determined by input data, is the input feature, is the residual transformation function; After each main branch convolution in Stage 4, DropBlock is introduced as a regularization method. The regularization method is recorded as: ; in, is the element-wise multiplication, represents a randomly generated square mask on the feature map, Represents the input feature map.
7. The method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning according to claim 1, characterized in that: In step S7, the detection model Fractal-YOLO is trained based on the cystic echinococcosis dataset and the alveolar echinococcosis detection dataset, respectively, including: Introducing fractal dimension analysis to enhance the model’s perception of lesion morphology and texture: In the C2F-Backbone module of YOLOV8, in addition to the conventional convolution operation, each feature map introduces fractal dimension calculation; for the feature map F, its local fractal dimension is calculated: ; in, represents the feature map location, is the local window size, Use side length The minimum number of windows required for the grid to cover the non-zero eigenvalues; Approximate calculation using discrete scale: ; in, is the number of sampling scales, It is The sampling scale, The side length is The minimum number of windows required for the grid to cover the non-zero eigenvalues; In the C2F-Backbone module, the fractal features of the main branch and the short-circuit branch are enhanced respectively, where the main branch features are enhanced: ; Short-circuit branch feature enhancements: ; in, is a nonlinear mapping function, and is a learnable parameter; The final C2F-Backbone module output is: ; in, represents the final output features of the C2F-Backbone module, Indicates that the main branch features are enhanced. It indicates that the short-circuit branch characteristics are enhanced; In the feature aggregation process of PANet, fractal features participate in the up- and down-sampling process: Bottom-up path: ; Top-down path: ; in, Represents the feature level index, Indicates Layer original features, Indicates Layer original features, Indicates The fractal characteristics of the layers, represents upsampling / downsampling operations, represents the convolutional layer; Introducing boundary fractal dimension calculation, by Lower measurement boundary perimeter , we get the boundary fractal dimension reflecting the degree of boundary irregularity: ; in, is the measurement scale, Is the scale used The measured perimeter of the boundary, It reflects the degree of irregularity of the boundary. This boundary information is used to optimize the prediction of the bounding box through the learnable weight coefficient and the mapping function , fine-tune the original prediction box: ; Through global average pooling and fully connected layers, weight coefficients of different feature channels are generated to achieve adaptive fusion of features; Finally, the fractal feature loss is introduced, and the loss function is expressed as: ; ; in, is the fractal loss weight, , are the predicted and target fractal dimensions, is the KL divergence, which measures the difference between the distribution of predicted and target fractal features, is the KL loss weight.
8. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The memory stores instructions that can be executed by the processor, and the instructions are executed by the processor. The processor is used to execute the deep learning-based intelligent classification and detection method for hepatic echinococcosis ultrasound images as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for intelligent classification and detection of hepatic echinococcosis ultrasound images based on deep learning as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Microbial marker for echinococcosis as well as screening method and application of microbial marker
CN114496088A
ShuffleNetv1-YOLOv5s-based nipponia nippon reproduction behavior real-time detection method
CN116824622A
Intelligent data analysis method based on artificial intelligence and big data
CN118378691A