Liver echinococcosis ultrasonic image intelligent processing method based on deep learning, electronic equipment and storage medium
Through intelligent deep learning-based processing methods, preprocessing and classification of echinococcosis ultrasound images is solved, and the problems of low accuracy and frequent misdiagnosis of traditional ultrasound diagnosis are solved, achieving more efficient and accurate diagnosis.
Patent Information
- Application Number
- CN202510154559.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-12
AI Technical Summary
Traditional ultrasound diagnosis has low accuracy for echinococcosis and is prone to misdiagnosis, especially when there are huge variations in the ultrasound manifestations of alveolar echinococcosis.
The intelligent ultrasonic image processing method of hepatic echinococcosis based on deep learning is adopted, including data collection, adaptive denoising and enhancement model for image preprocessing, and the classification model DFEV-VIT is trained based on the classification data set to improve the accuracy of diagnosis.
The diagnostic efficiency and accuracy of echinococcosis are significantly improved, and misdiagnosis and misdiagnosis are reduced, especially when dealing with complex ultrasound images of alveolar echinococcosis.
Smart Images

Figure CN119624959A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to an intelligent processing method for hepatic echinococcosis ultrasound images based on deep learning, an electronic device and a storage medium. Background Art
[0002] Echinococcosis, also known as echinococcosis, is a disease caused by parasites. The pathogen of the disease is echinococcosis, which is mainly transmitted to humans through contact with infected or eating undercooked animal products infected with this parasite. Echinococcosis can affect organs such as the liver and lungs, and can cause death in severe cases. Among them, hepatic echinococcosis mainly includes cystic hepatic echinococcosis and alveolar hepatic echinococcosis. Almost all primary alveolar echinococcosis lesions and 70% of cystic echinococcosis lesions originate from the liver. The early stages of echinococcosis can last for 10-15 years without symptoms. The long incubation period and invasive growth make many patients with alveolar echinococcosis unsuitable for surgical treatment when the lesions are finally diagnosed. Some patients with alveolar echinococcosis receive incorrect treatment due to misdiagnosis, and patients with cystic echinococcosis are often overtreated. With the application of big data and artificial intelligence in the medical field, it is a trend to classify patients' ultrasound images into gold standard cases for training models to assist doctors in the clinical diagnosis and treatment of echinococcosis. However, the existing image processing of echinococcosis has the following problems: 1. The ultrasound features of echinococcosis overlap significantly with a variety of other focal liver lesions, but there are important differences in the treatment strategies for these conditions. Specifically, for alveolar echinococcosis, the ultrasound appearance is highly variable and may be mistaken for hepatic hemangioma, liver abscess, intrahepatic cholangiocarcinoma, or liver metastasis. 2. In a prospective study conducted in Germany in 2000, CT detected a total of 55 echinococcosis lesions in 30 patients, but ultrasound imaging only detected 31 of them, with a low accuracy rate and prone to misdiagnosis. Summary of the invention
[0003] In view of this, the present invention aims to propose an intelligent processing method, electronic device and storage medium for liver echinococcosis ultrasound images based on deep learning, so as to solve the challenges of low accuracy and misdiagnosis of echinococcosis in traditional ultrasonic diagnosis.
[0004] To achieve the above object, the technical solution of the present invention is achieved as follows: A method for intelligent processing of hepatic echinococcosis ultrasound images based on deep learning, comprising the following steps: S1. Data collection: Collect liver ultrasound imaging data; S2, using an adaptive denoising and enhancement model to perform image preprocessing on the liver ultrasound image data collected in step S1, and classifying and labeling the preprocessed image data to establish a classification data set, labeling the images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions; S3, based on the classification data set, train the classification model DFEV-VIT; In step S2, the liver ultrasound image data collected in step S1 is preprocessed using an adaptive denoising and enhancement model, including: S21, evaluating the signal-to-noise ratio and suppressing noise on the image; S22, performing adaptive wavelet denoising on the image processed in step S21; S23, performing edge-preserving filter and non-local mean denoising on the image processed in step S22; S24, dynamically expanding the grayscale of the image processed in step S23; S25, performing dynamic block processing on the image processed in step S24; S26, setting an inter-block overlap module for the image processed in step S25; S27, performing contrast-limited histogram equalization on the image processed in step S26; S28, reconstructing the image processed in step S27; S29, performing image post-processing and optimization on the image processed in step S28; In step S3, based on the classification data set, the classification model DFEV-VIT is trained, including: S31, performing image preprocessing and segmentation on the classification data set; S32, embedding image blocks into the data processed in step S31; S33, performing position coding and category marking on the data processed in step S32; S34, using a Transformer encoder to process the data processed in step S33; S35, using a feature discarding mechanism to process features of the data processed in step S34; S36, performing classification prediction on the data processed in step S35; S37. Perform loss calculation and back propagation on the data processed in step S36.
[0005] Furthermore, in step S21, signal-to-noise ratio evaluation and noise suppression include: The standard deviation method is used to evaluate the signal-to-noise ratio of the image and measure the speckle noise and signal strength in the image. The signal strength calculation is: calculate the average gray value of the image, which represents the strength of the signal. The expression of the average gray value is: ; in, is the total number of pixels in the region, It is The gray value of pixels; Calculation of speckle noise intensity: Select an area of 1 / 10 the size of the current image in the upper right corner of the image as the background, and calculate the standard deviation of this area: ; Calculation of signal-to-noise ratio: ; in, is the average value for the region.
[0006] Furthermore, in step S22, adaptive wavelet denoising includes: First, for the image with a signal-to-noise ratio lower than 20 in step S21, adaptive wavelet denoising is used to remove noise; In this process, the image needs to be converted into the wavelet domain, and the part corresponding to the noise in the image wavelet coefficients needs to be removed by threshold processing; If the signal-to-noise ratio after denoising is higher than the set value, the current threshold is maintained; If the signal-to-noise ratio does not improve or decreases, the threshold value is dynamically adjusted based on the feedback; Finally, the denoised wavelet coefficients are converted back to the spatial domain using an inverse wavelet transform to generate an ultrasound image.
[0007] Furthermore, in step S23, edge preserving filter and non-local mean denoising include: Apply non-local mean denoising to the image after wavelet denoising. For each pixel in the image to be processed, calculate the similarity by comparing it with other pixels in its neighborhood: ; in, is the pixel value, is the similarity control parameter, represents the difference of corresponding pixels, is the normalization factor, and the pixels are weighted averaged according to the weights calculated by the similarity to obtain the denoised pixel value: ; in, It's pixels The neighborhood set of ; After the non-local mean denoising is completed, the denoised image is processed using an edge-preserving filter to clarify edge and texture features: ; in, is the new grayscale value of the pixel at position x in the image after edge filtering. x and y are the coordinates of the processed pixel. They are Gaussian functions in the spatial domain and the grayscale domain, is the normalization factor.
[0008] Furthermore, in step S24, the grayscale is dynamically expanded, including: The grayscale of the denoised image is dynamically expanded. The histogram equalization method is used to redistribute the grayscale values of the image. The linear mapping rule is used to gradually expand the pixels concentrated in the set grayscale range to the entire grayscale range. The grayscale histogram of the original image is calculated to determine the grayscale value distribution, the minimum and maximum grayscale values of the image are found, and converted into a standard grayscale range through linear mapping, and the mapped values are applied to all pixels in the image.
[0009] Furthermore, in step S25, dynamic block processing includes: The size and shape of the image blocks are dynamically adjusted according to the image texture, and the texture features of each image region are calculated using local gradient and gray-level co-occurrence matrix.
[0010] Furthermore, in step S26, an inter-block overlap module is set, including: An overlapping area is set between adjacent blocks, and the overlapping ratio ranges from 15% to 25%.
[0011] Further, in step S27, contrast-limited histogram equalization includes: First, edge detection algorithms are used to identify features in the image by analyzing the edge graph of the image; Apply clustering algorithms to edge maps to divide the image into different regions; The adaptive denoising and enhancement model calculates the grayscale histogram of each region and limits the uniform distribution of the histogram according to the set dynamic truncation threshold. The calculation formula of the histogram is: ; in, Indicates grayscale The number of pixels, Indicates that the image is at position The gray value of Indicates the width of the image. Indicates the height of the image. Kronecker function, is the gray level, considered as a constant; The histogram is then processed according to a dynamic cutoff threshold, and the histogram of each region is limited in the following way: ; in, Represents the total number of pixels in the specific image region currently being processed. Indicates the frequency threshold; After completing the histogram equalization process, the adaptive denoising and enhancement model implements the regional merging operation, and the merging process is represented by the weighted average method: ; in, and are the equalized images of the left and right regions, respectively, and the weight factor The value range is 0 to 1.
[0012] Furthermore, in step S28, image reconstruction includes: A gradient-guided interpolation method is used to eliminate artifacts produced by block processing; First, the gradient changes between adjacent blocks are analyzed, and then the edge-preserving interpolation method is used to combine the pixel values of adjacent blocks through weights to preserve the edge features of the image during the reconstruction process; The processed blocks are merged into a complete ultrasound image.
[0013] Furthermore, in step S29, image post-processing and optimization include: Apply non-local means denoising to find similar pixels in the same area based on similarity and remove the remaining noise: ; in, is the pixel value after denoising, : Normalization coefficient, represents all pixel indices within the search window, Represents the weight, calculated by similarity measurement , is a smoothing parameter that controls the influence range of the weight; Apply an adaptive sharpening filter to sharpen only the edge areas of the image. The adaptive sharpening of the image is expressed as: ; in, Represents the pixel value after sharpening, Indicates at point The gradient value calculated at Represents the parameter that controls the sharpening strength; edge detection is achieved by calculating the gradient of the pixel, and the gradient expression of the pixel is: .
[0014] Furthermore, in step S31, image preprocessing and segmentation include: First, use the dynamic normalization method to perform mean normalization: ; in, is the input image at position The pixel value at and Local areas The mean and standard deviation of is a constant; The information entropy is used to evaluate the complexity of each image block and determine the priority of subsequent feature extraction. The information entropy expression of region A is: ; in, It is a region The probability distribution of pixel values in , is the number of possible pixel values; By evaluating the information entropy value, the size and shape of the image block can be dynamically selected. The image set is In this process, the block strategy follows the following principles: for information entropy For areas above the set value, select image blocks smaller than the contrast threshold; for information entropy For areas below the set value, select image blocks with a contrast greater than the threshold.
[0015] Furthermore, in step S32, the image block is embedded, including: For each preprocessed and segmented image block , set up the embedding conversion module, which converts the original image block into a feature vector with semantic information through the attention mechanism: First, the input image block is transformed into Convert to query ,key Sum : ; By query raised With all keys Calculate the similarity score: ; in, is the dimension of the key; The scores are normalized by soft maximization to obtain the attention weights: ; Use attention weights to Perform weighted summation to obtain the final feature representation: .
[0016] Furthermore, in step S33, the position coding and category labeling include: Set up a hybrid positional encoding model with learnable parameters and a periodic function: ; in The two-dimensional space coordinates of the corresponding image block, and Nonlinear mapping function, mapping To other dimensions, It is a bias composed of learning parameters, and outputs values of the same dimension as the input coordinates; Adaptive spatial weights are introduced to adjust the position encoding influence of different image blocks based on information entropy: ; in, is the output of the multi-layer perceptron that processes position encoding; the original single category label is expanded to feature aggregation, and the feature aggregation is expressed as , the multi-head self-attention mechanism of Vision Transformer is used to extract and map global features.
[0017] Further, in step S34, the Transformer encoder processes, including: The Transformer encoder consists of multiple stacked encoder layers, each of which consists of two key modules: a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism allows each image block to establish an interactive relationship with all other image blocks, adding an interactive bidirectional mode to the multi-head self-attention mechanism: ; ; The reverse attention mechanism swaps the roles of key and query; Introducing the attention gating mechanism: ; in, and is a learnable parameter, sigmoid activation function, Represents element-by-element multiplication; through the gating mechanism, the multi-head self-attention mechanism can adaptively choose to retain or suppress information; The feedforward neural network performs a nonlinear transformation on the output of the multi-head self-attention mechanism, and the output of the multi-head self-attention mechanism is fed into the feedforward neural network: ; The feedforward neural network consists of multiple feedforward layers and activation functions. The operation of each feedforward layer is expressed as: ; in, , is the weight matrix, , is the bias term; Each encoder layer also includes layer normalization and residual connections. Layer normalization ensures that the input of each layer maintains statistical properties: ; in, and are the mean and standard deviation, and is a learnable parameter; Residual connection is to skip the input to the output.
[0018] Furthermore, in step S35, the feature rejection mechanism is used to process the feature, including: By calculating the embedding vector The weight of each feature in the dataset is calculated, and the contribution of each feature is evaluated using standard deviation and information entropy indicators: ; in, It is The weight of the feature, It is The value of the feature, is the total number of features; Dynamically adjust the rejection threshold based on batch size: ; For each element in the feature, if < , then the feature will be considered unimportant and set to zero.
[0019] Furthermore, in step S36, classification prediction includes: After being processed by the Transformer encoder, the category tags are added Contains the global semantic information of the entire image and adds the category tag As input, it is passed to the multi-head self-attention mechanism, which includes two fully connected layers. A nonlinear activation function is used between the two fully connected layers, and the final output layer uses Softmax activation to generate the probability distribution of each category.
[0020] Furthermore, in step S37, loss calculation and back propagation include: The difference between the model prediction and the true label is calculated using the cross entropy loss function, the backpropagation algorithm calculates the gradient of the loss with respect to the model parameters, and the optimizer is used to update the model parameters.
[0021] 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 that can be executed by the processor, and the instructions are executed by the processor. The processor is used to execute the intelligent processing method for ultrasonic images of hepatic echinococcosis based on deep learning.
[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the deep learning-based intelligent processing method for ultrasonic images of hepatic echinococcosis.
[0023] Compared with the prior art, the deep learning-based intelligent processing method, electronic device and storage medium for hepatic echinococcosis ultrasound images of the present invention have the following advantages: The deep learning-based intelligent processing method, electronic device and storage medium of liver echinococcosis ultrasound images described in the present invention can greatly improve the diagnostic efficiency and accuracy and reduce the missed diagnosis and misdiagnosis of echinococcosis by using the ADEN model to perform image preprocessing on the collected data and then training the classification model DFEV-VIT based on the classification data set after image preprocessing. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] 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 This is a schematic flow chart of a processing method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the image preprocessing process according to an embodiment of the present invention; Figure 3 Schematic diagram of the classification model process according to an embodiment of the present invention Figure 4 This is a schematic diagram of the process of training a classification model DFEV-VIT based on a classification data set according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] 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.
[0026] 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.
[0027] 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.
[0028] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0029] like Figures 1 to 4 As shown, the intelligent processing method of hepatic echinococcosis ultrasound image 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. Image preprocessing. The present invention uses an optimized CLAHE algorithm (ADEN, adaptive denoising and enhancement model) to perform image reconstruction. After the image reconstruction, the images are classified and labeled to divide clear pathological classification standards, establish a classification data set, and label the images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions. S3. Based on the classification data set, the classification model DFEV-VIT is trained, and finally the experimental result of this method reaches Top1 ACC=95%.
[0030] In a preferred embodiment of the present invention, in step S2, image preprocessing includes: Adaptive Denoising and Enhancement Model (ADEN): Signal-to-noise ratio evaluation and noise suppression: First, use the standard deviation method to evaluate the signal-to-noise ratio of the image to measure the speckle noise and signal strength in the image. Signal strength calculation: Calculate the average grayscale value of the image. This value represents the strength of the signal: ; in, is the total number of pixels in the region, It is The gray value of a pixel.
[0031] Calculation of noise intensity: Select an area of 1 / 10 the size of the current image in the upper right corner of the image as the background, and calculate the standard deviation of the area: ; in, is the average value for the region.
[0032] Calculation of signal-to-noise ratio: ; The higher the value, the clearer the image and the less noise.
[0033] Adaptive wavelet denoising: Next, adaptive wavelet denoising is used to remove noise for images with SNR lower than 20. In this process, the image is converted to the wavelet domain, and the corresponding noise part of the wavelet coefficient is removed by threshold processing. Select a suitable threshold (the threshold is to analyze a large amount of sample data through the random forest model to learn different types of noise and their corresponding optimal thresholds) to achieve better noise suppression and edge preservation. This threshold is to analyze a large amount of sample data through the random forest model to learn different types of noise and their corresponding optimal thresholds. In order to use the inverse wavelet transform to convert the denoised wavelet coefficients back to the spatial domain, a denoised ultrasound image is generated. If the SNR after denoising is significantly improved, it indicates that the processing effect is ideal, and the current threshold can be maintained at this time; if the SNR is not improved or reduced, the threshold is dynamically adjusted according to feedback, such as increasing the threshold (can be 10%) to remove more high-frequency noise, or reducing the threshold (can be 10%, usually first increase and then decrease, if it is still lower than 20, continue to increase or decrease until it reaches 20%) to restore more image details. Through this feedback mechanism, adaptive adjustments can be effectively made to different image characteristics to ensure a more ideal denoising effect. Finally, the denoised wavelet coefficients are converted back to the spatial domain using inverse wavelet transform to generate a clear ultrasound image. This method achieves more efficient noise suppression by dynamically adjusting the threshold, while retaining important edge features and image details, significantly improving image quality.
[0034] Edge-preserving filter and non-local mean denoising: In order to further enhance the details and edge features of the image, the image that has been denoised by wavelet is first applied with non-local mean denoising to further suppress the noise and preserve the details of the image. For each pixel in the image to be processed, the similarity is calculated by comparing it with other pixels in its neighborhood: ; in, is the pixel value, is the similarity control parameter, represents the difference of corresponding pixels, is the normalization factor. The pixels are weighted averaged according to the weights calculated by similarity to obtain the denoised pixel value: ; in It's pixels The neighborhood set of .
[0035] After the non-local mean denoising is completed, the denoised image is processed using an edge-preserving filter (bilateral filtering) to clarify important edge and texture features: ; in, is the new grayscale value of the pixel at position x in the image after edge filtering. x and y are the coordinates of the processed pixel. They are Gaussian functions in the spatial domain and the grayscale domain, is the normalization factor.
[0036] Grayscale dynamic expansion: Dynamically expand the grayscale of the denoised image to improve the contrast of the image. The grayscale values of the image are redistributed using the histogram equalization method. Using the linear mapping rule, pixels concentrated in a certain grayscale range (calculate the grayscale histogram of the original image to determine the grayscale value distribution) are gradually expanded to the entire grayscale range. Calculate the grayscale histogram of the original image to determine the grayscale value distribution. Find the minimum and maximum grayscale values of the image and convert them to a standard grayscale range (0 to 255) through linear mapping. Apply the mapped values to all pixels in the image to enhance the overall contrast.
[0037] Dynamic block processing: dynamically adjust the size and shape of the blocks according to the complexity of the image texture. Use local gradients and gray-level co-occurrence matrices to calculate the texture features of each region. Use larger blocks in simple texture areas and smaller blocks in complex areas (all sizes are designed for contrast thresholds, larger than 100 is a large block, and the rest are small blocks) to ensure that key details are captured.
[0038] Setting an inter-block overlapping module: In order to improve the continuity of the image, the present invention designs an inter-block overlapping module. The overlapping ratio is set between 15% and 25%. This overlapping design can not only improve the detail capture rate, but also effectively reduce the boundary blur caused by block processing. For example, for each block, its edge portion can be covered into the adjacent block, so as to retain more context information during splicing. In this embodiment, by setting an overlapping area between adjacent blocks, the inter-block overlapping module can effectively alleviate the edge blur caused by block processing. In the actual processing process, some detail information of the image may be ignored, lost or become unclear during block division. The overlapping design helps to retain and strengthen these edge information, making the transition between different blocks smoother and enhancing the continuity of the image.
[0039] Contrast-limited histogram equalization: First, edge detection algorithms (such as Canny detection) are used to identify key features in the image (areas in the image where the contrast changes significantly, these areas are called key features). This step not only finds the edges of the image, but also provides important information for subsequent region division. By analyzing the edge map, the model can determine those key areas, which are usually places where the contrast changes greatly in the image. Next, a clustering algorithm (K-means) is applied to the edge map to divide the image into different regions. The feature similarity of these regions enables them to share the same random features when processing, thereby maintaining uniformity and natural effects between regions. After determining the regions of the image, the model calculates the grayscale histogram for each region and limits the uniform distribution of the histogram according to the set dynamic truncation threshold. The histogram calculation formula is: ; in, Indicates grayscale The number of pixels, Indicates that the image is at position The gray value of Indicates the width of the image. Indicates the height of the image. represents the Kronecker function, is the gray level and can be regarded as a constant.
[0040] The histogram is then processed according to a dynamic cutoff threshold, and the histogram of each region is limited in the following way: ; in, Represents the total number of pixels in the specific image region currently being processed. Represents the frequency threshold, which is 0.01 in this case.
[0041] After completing the histogram equalization process, the model also performs a region merging operation. In this process, it pays special attention to the overlapping parts of adjacent regions to ensure that the image details are maintained during merging, while also effectively reducing the visual seam phenomenon caused by region segmentation. The specific merging process can be expressed by the weighted average method: ; in, and are the equalized images of the left and right regions, respectively, and the weight factor Usually the value ranges from 0 to 1. Adjusting this factor can ensure smooth gradients.
[0042] Image reconstruction: During the image reconstruction phase, a gradient-guided interpolation method is used to eliminate artifacts generated by block processing. First, the gradient changes between adjacent blocks are analyzed, and then an edge-preserving interpolation method is used to combine the pixel values of adjacent blocks through weights to ensure that the edge features of the image are preserved during the reconstruction process. The processed blocks are merged into a complete ultrasound image to achieve clear edges and natural transitions.
[0043] Image post-processing and optimization: The quality of the final image is further improved by using non-local mean denoising and adaptive sharpening techniques. Non-local mean denoising is applied to find similar pixels in the same area based on similarity, effectively removing residual noise: ; in, is the pixel value after denoising, : Normalization coefficient. represents all pixel indices within the search window, Represents the weight, usually calculated by similarity measurement , is a smoothing parameter that controls the influence range of the weight.
[0044] Applying an adaptive sharpening filter only sharpens the edge area, enhancing the edge features without over-enhancing other parts of the image. The adaptive sharpening of the image can be expressed as: ; Indicates the pixel value after sharpening.
[0045] Indicates at point The gradient value calculated at is usually obtained using the Sobel operation.
[0046] Represents the parameter that controls the sharpening strength. Edge detection can be achieved by calculating the gradient of the pixel. The gradient expression of the pixel is: ; In a preferred embodiment of the present invention, in step S3, the dynamic feature extraction VIT classification model (ie, visual transformer model) includes: Image preprocessing and segmentation: The input image undergoes a rigorous preprocessing process. First, a dynamic normalization method is used to replace the traditional mean normalization: ; in, is the input image at position The pixel value at and Local areas The mean and standard deviation of is a small constant to avoid division by zero errors. Through such dynamic normalization, the model can adaptively evaluate the local information complexity of the image for subsequent block segmentation.
[0047] In the process of information processing and feature extraction, it is very important to evaluate the complexity of each image block through information entropy. Information entropy can not only be used as a quantitative indicator of the content and complexity of the image, but also can be used to determine the priority of subsequent feature extraction.
[0048] ; in, It is a region The probability distribution of pixel values in , is the number of possible pixel values. By evaluating the entropy value, we can dynamically choose the size and shape of the image patch. The image set is In this process, the block strategy follows the following principles: for information entropy For higher areas, smaller image patches are selected. In the lower region, larger image patches are selected for efficient allocation of computational resources.
[0049] Image patch embedding: For each preprocessed and segmented image patch , we designed a learnable embedding conversion module. The main purpose of this module is to convert the original image patch into a feature vector rich in semantic information through the attention mechanism, thereby improving the efficiency of subsequent feature extraction and classification: First, the input image block is transformed into Convert to query ,key Sum : ; By query raised With all keys Calculate the similarity score: ; in, is the dimension of the key. Normalization is to prevent the score from being too large, which would lead to the problem of gradient explosion.
[0050] The scores are normalized by soft maximization to obtain the attention weights: ; Use attention weights to Perform weighted summation to obtain the final feature representation: ; Position encoding and category labeling: Position encoding is a crucial component of Vision Transformer. The learnable position encoding vectors will be directly added to the embedded representation of the image patch. These position encoding vectors enable the model to distinguish image patches at different positions and preserve spatial structure information. In order to capture position features more effectively, we designed a hybrid position encoding model that contains learnable parameters and periodic functions: ; in The two-dimensional space coordinates of the corresponding image block. and Nonlinear mapping function, mapping To other dimensions. It is a bias consisting of learned parameters that outputs values of the same dimensions as the input coordinates.
[0051] In order to improve the sensitivity of the model to complex images, adaptive spatial weights are introduced, which adjust the position encoding influence of different image blocks based on information entropy: ; in is the output of the multi-layer perceptron that processes the positional encoding. In order to support category understanding on classification tasks, we expand the original single category labeling into a rich feature aggregation representation , the multi-head self-attention mechanism of VisionTransformer is used to extract and map global features.
[0052] Transformer encoder processing: The Transformer encoder is composed of multiple identical encoder layers stacked together. Each encoder layer contains two key modules: a multi-head self-attention mechanism and a feedforward neural network.
[0053] The multi-head self-attention mechanism allows each image patch to establish complex interactive relationships with all other image patches. This study adds an interactive bidirectional mode to the multi-head self-attention mechanism: ; ; The reverse attention mechanism swaps the roles of key and query, allowing the model to focus on the information of subsequent elements based on previous elements. This combination allows the model to fully utilize the information of all nodes in the sequence when calculating the representation of each feature, thereby improving the representation ability of the context. In order to further improve the flexibility of information flow, the attention gating mechanism is introduced: ; and is a learnable parameter, sigmoid activation function, Represents element-wise multiplication. Through the gating mechanism, the multi-head attention mechanism can adaptively choose to retain or suppress certain information.
[0054] The feedforward neural network performs nonlinear transformation on the output of the attention mechanism to further extract and process features. Next, the output of the self-attention is fed into the feedforward neural network: ; Feedforward neural networks usually contain multiple layers and activation functions (such as ReLU) to enable nonlinear transformations. The operation of each feedforward layer can be expressed as: ; in, , is the weight matrix, , is the bias term.
[0055] Each encoder layer also contains layer normalization and residual connections. Layer normalization ensures that the input of each layer maintains stable statistical properties: ; in, and are the mean and standard deviation, and is a learnable parameter. Layer normalization makes the output distribution more stable during each forward propagation and improves the convergence speed.
[0056] The residual connection directly jumps the input to the output, alleviating the gradient vanishing problem in deep networks. The encoder layers are stacked continuously, and this study stacked 12 layers, with each layer progressively extracting more abstract and semantically rich feature representations.
[0057] Feature discarding mechanism: In order to effectively reduce computational overhead and improve the expressiveness of the model, we use a discarding mechanism. By calculating the embedding vector The weight of each feature in determines which features are redundant in the task. The contribution of each feature is evaluated using indicators such as standard deviation and entropy: ; in, It is The weight of the feature, It is The value of the feature, is the total number of features.
[0058] Dynamically adjust the rejection threshold based on batch size: ; For each element in the feature, if , then the feature will be considered unimportant and set to zero.
[0059] Classification prediction: The category label initially added after being processed by the Transformer encoder Now it contains the global semantic information of the entire image. This vector will be passed as input to a simple multi-layer perceptron (MLP) classification head. The classification head usually consists of two fully connected layers with a non-linear activation function (GELU) in the middle. The final output layer uses Softmax activation to generate the probability distribution of each category.
[0060] Loss calculation and back propagation: The cross entropy loss function is used to calculate the difference between the model prediction and the true label. The back propagation algorithm calculates the gradient of the loss to the model parameters and updates the model parameters using Adam's optimizer.
[0061] 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 intelligent processing method of hepatic echinococcosis ultrasound images based on deep learning.
[0062] 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 processing method for ultrasonic images of hepatic echinococcosis.
[0063] The present invention uses the ADEN model to perform image preprocessing on the collected data, and then trains the DFEV-VIT model based on the classification data set after image preprocessing, which can greatly improve the diagnostic efficiency and accuracy and reduce the missed diagnosis and misdiagnosis of echinococcosis.
[0064] 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. Intelligent processing method of ultrasound images of hepatic echinococcosis based on deep learning, characterized by: The following steps are involved: S1. Data collection: Collect liver ultrasound imaging data; S2, using an adaptive denoising and enhancement model to perform image preprocessing on the liver ultrasound image data collected in step S1, and classifying and labeling the preprocessed image data to establish a classification data set, labeling the images as cystic echinococcosis, alveolar echinococcosis, and other liver lesions; S3, based on the classification data set, train the optimized VIT classification model DFEV-VIT; In step S2, the liver ultrasound image data collected in step S1 is preprocessed using an adaptive denoising and enhancement model, including: S21, evaluating the signal-to-noise ratio and suppressing noise on the image; S22, performing adaptive wavelet denoising on the image processed in step S21; S23, performing edge-preserving filter and non-local mean denoising on the image processed in step S22; S24, dynamically expanding the grayscale of the image processed in step S23; S25, performing dynamic block processing on the image processed in step S24; S26, setting an inter-block overlap module for the image processed in step S25; S27, performing contrast-limited histogram equalization on the image processed in step S26; S28, reconstructing the image processed in step S27; S29, performing image post-processing and optimization on the image processed in step S28; In step S3, based on the classification data set, the classification model DFEV-VIT is trained, including: S31, performing image preprocessing and segmentation on the classification data set; S32, embedding image blocks into the data processed in step S31; S33, performing position coding and category marking on the data processed in step S32; S34, using a Transformer encoder to process the data processed in step S33; S35, using a feature discarding mechanism to process features of the data processed in step S34; S36, performing classification prediction on the data processed in step S35; S37. Perform loss calculation and back propagation on the data processed in step S36.
2. The method for intelligent processing of ultrasonic images of hepatic echinococcosis based on deep learning according to claim 1, characterized in that: In step S21, signal-to-noise ratio evaluation and noise suppression include: The standard deviation method is used to evaluate the signal-to-noise ratio of the image and measure the speckle noise and signal strength in the image. The signal strength calculation is: calculate the average gray value of the image, which represents the strength of the signal. The expression of the average gray value is: ; in, is the total number of pixels in the region, It is The gray value of pixels; Calculation of speckle noise intensity: Select an area of 1 / 10 the size of the current image in the upper right corner of the image as the background, and calculate the standard deviation of this area: ; Calculation of signal-to-noise ratio: ; in, is the average value of the region; In step S22, adaptive wavelet denoising includes: First, for the image with a signal-to-noise ratio lower than 20 in step S21, adaptive wavelet denoising is used to remove noise; In this process, the image needs to be converted into the wavelet domain, and the part corresponding to the noise in the image wavelet coefficients needs to be removed by threshold processing; If the signal-to-noise ratio after denoising is higher than the set value, the current threshold is maintained; If the signal-to-noise ratio does not improve or decreases, the threshold value is dynamically adjusted based on the feedback; Finally, the denoised wavelet coefficients are converted back to the spatial domain using an inverse wavelet transform to generate an ultrasound image; In step S23, edge preserving filter and non-local mean denoising are performed, including: Apply non-local mean denoising to the image after wavelet denoising. For each pixel in the image to be processed, calculate the similarity by comparing it with other pixels in its neighborhood: ; in, is the pixel value, is the similarity control parameter, represents the difference of corresponding pixels, is the normalization factor, and the pixels are weighted averaged according to the weights calculated by the similarity to obtain the denoised pixel value: ; in, It's pixels The neighborhood set of ; After the non-local mean denoising is completed, the denoised image is processed using an edge-preserving filter to clarify edge and texture features: ; in, is the new grayscale value of the pixel at position x in the image after edge filtering. x and y are the coordinates of the processed pixel. They are Gaussian functions in the spatial domain and the grayscale domain, is the normalization factor.
3. The method for intelligent processing of ultrasonic images of hepatic echinococcosis based on deep learning according to claim 2, characterized in that: In step S24, the grayscale is dynamically expanded, including: Dynamically expand the grayscale of the denoised image, use the histogram equalization method to redistribute the grayscale value of the image, and use the linear mapping rule to gradually expand the pixels concentrated in the set grayscale range to the entire grayscale range; calculate the grayscale histogram of the original image to determine the grayscale value distribution, find the minimum and maximum grayscale values of the image, and convert them into a standard grayscale range through linear mapping, and apply the mapped values to all pixels in the image; In step S25, dynamic block processing includes: Dynamically adjust the size and shape of image blocks according to the texture of the image, and use local gradient and gray-level co-occurrence matrix to calculate the texture features of each area of the image; In step S26, setting an inter-block overlap module includes: An overlapping area is set between adjacent blocks, and the overlapping ratio ranges from 15% to 25%.
4. The method for intelligent processing of hepatic echinococcosis ultrasound images based on deep learning according to claim 3, characterized in that: In step S27, contrast-limited histogram equalization is performed, including: First, edge detection algorithms are used to identify features in the image by analyzing the edge graph of the image; Apply clustering algorithms to edge maps to divide the image into different regions; The adaptive denoising and enhancement model calculates the grayscale histogram of each region and limits the uniform distribution of the histogram according to the set dynamic truncation threshold. The calculation formula of the histogram is: ; in, Indicates grayscale The number of pixels, Indicates that the image is at position The gray value of Indicates the width of the image. Indicates the height of the image. Kronecker function, is the gray level, considered as a constant; The histogram is then processed according to a dynamic cutoff threshold, and the histogram of each region is limited in the following way: ; in, Represents the total number of pixels in the specific image region currently being processed. Indicates the frequency threshold; After completing the histogram equalization process, the adaptive denoising and enhancement model implements the regional merging operation, and the merging process is represented by the weighted average method: ; in, and are the equalized images of the left and right regions, respectively, and the weight factor The value range is 0 to 1.
5. The method for intelligent processing of ultrasonic images of hepatic echinococcosis based on deep learning according to claim 4, characterized in that: In step S28, image reconstruction includes: A gradient-guided interpolation method is used to eliminate artifacts produced by block processing; First, the gradient changes between adjacent blocks are analyzed, and then the edge-preserving interpolation method is used to combine the pixel values of adjacent blocks through weights to preserve the edge features of the image during the reconstruction process; The processed blocks are merged into a complete ultrasound image; In step S29, image post-processing and optimization include: Apply non-local means denoising to find similar pixels in the same area based on similarity and remove the remaining noise: ; in, is the pixel value after denoising, : Normalization coefficient, represents all pixel indices within the search window, Represents the weight, calculated by similarity measurement , is a smoothing parameter that controls the influence range of the weight; Apply an adaptive sharpening filter to sharpen only the edge areas of the image. The adaptive sharpening of the image is expressed as: ; in, Represents the pixel value after sharpening, Indicates at point The gradient value calculated at Represents the parameter that controls the sharpening strength; edge detection is achieved by calculating the gradient of the pixel, and the gradient expression of the pixel is: 。 6. The method for intelligent processing of hepatic echinococcosis ultrasound images based on deep learning according to claim 1, characterized in that: In step S31, image preprocessing and segmentation include: First, use the dynamic normalization method to perform mean normalization: ; in, is the input image at position The pixel value at and Local areas The mean and standard deviation of is a constant; The information entropy is used to evaluate the complexity of each image block and determine the priority of subsequent feature extraction. The information entropy expression of region A is: ; in, It is a region The probability distribution of pixel values in , is the number of possible pixel values; By evaluating the information entropy value, the size and shape of the image block can be dynamically selected. The image set is In this process, the block strategy follows the following principles: for information entropy For areas above the set value, select image blocks smaller than the contrast threshold; for information entropy For areas below the set value, select image blocks larger than the contrast threshold; In step S32, the image block is embedded, including: For each preprocessed and segmented image block , set up the embedding conversion module, which converts the original image block into a feature vector with semantic information through the attention mechanism: First, the input image block is transformed into Convert to query ,key Sum : ; By query raised With all keys Calculate the similarity score: ; in, is the dimension of the key; The scores are normalized by soft maximization to obtain the attention weights: ; Use attention weights to Perform weighted summation to obtain the final feature representation: 。 7. The method for intelligent processing of ultrasonic images of hepatic echinococcosis based on deep learning according to claim 6, characterized in that: In step S33, position coding and category labeling include: Set up a hybrid positional encoding model with learnable parameters and a periodic function: ; in The two-dimensional space coordinates of the corresponding image block, and Nonlinear mapping function, mapping To other dimensions, It is a bias composed of learning parameters, and outputs values of the same dimension as the input coordinates; Adaptive spatial weights are introduced to adjust the position encoding influence of different image blocks based on information entropy: ; in, is the output of the multi-layer perceptron that processes position encoding; the original single category label is expanded to feature aggregation, and the feature aggregation is expressed as , the multi-head self-attention mechanism of Vision Transformer is used to extract and map global features; In step S34, the Transformer encoder processes, including: The Transformer encoder consists of multiple stacked encoder layers, each of which consists of two key modules: a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism allows each image block to establish an interactive relationship with all other image blocks, adding an interactive bidirectional mode to the multi-head self-attention mechanism: ; ; The reverse attention mechanism swaps the roles of key and query; Introducing the attention gating mechanism: ; in, and is a learnable parameter, Activation function, Represents element-by-element multiplication; through the gating mechanism, the multi-head self-attention mechanism can adaptively choose to retain or suppress information; The feedforward neural network performs a nonlinear transformation on the output of the multi-head self-attention mechanism, and the output of the multi-head self-attention mechanism is fed into the feedforward neural network: ; The feedforward neural network consists of multiple feedforward layers and activation functions. The operation of each feedforward layer is expressed as: ; in, , is the weight matrix, , is the bias term; Each encoder layer also includes layer normalization and residual connections. Layer normalization ensures that the input of each layer maintains statistical properties: ; in, and are the mean and standard deviation, and is a learnable parameter; Residual connection is to skip the input to the output.
8. The method for intelligent processing of ultrasonic images of hepatic echinococcosis based on deep learning according to claim 7, characterized in that: In step S35, the feature rejection mechanism is used to process the feature, including: By calculating the embedding vector The weight of each feature in the dataset is calculated, and the contribution of each feature is evaluated using standard deviation and information entropy indicators: ; in, It is The weight of the feature, It is The value of the feature, is the total number of features; Dynamically adjust the rejection threshold based on batch size: ; For each element in the feature, if < , then the feature will be considered unimportant and set to zero; In step S36, classification prediction includes: After being processed by the Transformer encoder, the category tags are added Contains the global semantic information of the entire image, adding category tags The input is passed to the multi-head self-attention mechanism, which includes two fully connected layers. A nonlinear activation function is used between the two fully connected layers. The final output layer uses Softmax activation to generate the probability distribution of each category. In step S37, loss calculation and back propagation include: The difference between the model prediction and the true label is calculated using the cross entropy loss function, the backpropagation algorithm calculates the gradient of the loss with respect to the model parameters, and the optimizer is used to update the model parameters.
9. 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 processing method for hepatic echinococcosis ultrasound images as described in any one of claims 1 to 8.
10. 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 processing of hepatic echinococcosis ultrasound images based on deep learning as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Acoustic image texture feature extraction method based on multi-scale blurring
CN108875741A
Primary liver cancer diagnosis model construction method based on ultrasonic image
CN114822784A
Ultrasound image-based intraoperative guide monitoring
CN115239921A
Liver echinococcosis screening method and system based on flat scanning CT (Computed Tomography) and deep learning
CN116309266A
Breast nodule three-dimensional reconstruction method and system
CN119417988A
Cited By
Cross-domain fundus color radiography arteriovenous classification model and training method, system and application thereof
CN115171172A
Cross-domain fundus color photograph arteriovenous classification model, training method and system thereof and application
CN115171172B
Fatty liver lesion image analysis method based on color texture features
CN121861028A
A method for analyzing fatty liver lesion images based on color texture features
CN121861028B