MRI medical image correction method, system and computer-readable storage medium based on convolutional neural network
By evaluating the quality of MRI image and using convolutional neural networks for lesion feature extraction and artifact repair, the problem of automatic identification of cerebral lacunar infarction lesions is solved, and the accuracy and efficiency of diagnosis are improved.
Patent Information
- Application Number
- CN202510151548.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-02-11
AI Technical Summary
In the prior art, cerebral lacunar infarction lesions are difficult to automatically identify in MRI images, which is limited by the doctor's subjectivity and time-consuming and labor-consuming. The quality of MRI images varies greatly, which affects the accuracy of diagnosis.
The MRI image quality was evaluated through signal-to-noise ratio, contrast and artifact index, and a convolutional neural network was used to extract lesions, detail enhancement and artifact repair, and a three-dimensional visual model was generated.
It realizes efficient and accurate lesion area identification and segmentation, reduces artificial intervention, improves image quality and diagnostic accuracy, and provides intelligent diagnostic auxiliary tools.
Smart Images

Figure CN119963681B_ABST
Abstract
Description
Technical field
[0001] The present invention relates to the field of medical image recognition technology, and in particular to a convolutional neural network-based MRI medical image correction method, system, and computer-readable storage medium. [Background Technology]
[0002] Lacunar infarction is a brain lesion caused by small vessel disease, primarily occurring in the basal ganglia, thalamus, or brainstem. Clinical symptoms typically present as mild neurological impairment or cognitive decline, and the lesions are small and dispersed, often going unnoticed. Lacunar infarction is a common ischemic cerebrovascular disease, particularly prevalent in patients with chronic conditions such as hypertension and diabetes, and its incidence increases with age.
[0003] Typically, lacunar infarction lesions are presented to medical personnel in the form of CT images or magnetic resonance imaging (MRI). Compared to CT images, MRI images are clearer and have a higher detection rate, making MRI medical images more popular. However, because lacunar infarction lesions are small, located deep in the brain, and easily obscured by other brain structures, manual identification by doctors is not only labor-intensive and time-consuming, but also highly influenced by subjective factors such as the doctor's level and experience, making misdiagnosis a common problem. [Summary of the invention]
[0004] In view of this, embodiments of the present invention provide a method, system, and computer-readable storage medium for MRI medical image correction based on convolutional neural networks.
[0005] In a first aspect, an embodiment of the present invention provides an MRI medical image correction method based on a convolutional neural network, the method comprising:
[0006] S1. Obtain brain MRI medical images, perform quality assessment using signal-to-noise index, contrast, and artifact intensity, and classify them into high-quality images, moderate-to-high-quality images, moderate-quality images, and low-quality images based on the quality assessment results, and perform preprocessing on each image.
[0007] S2. Extracting the lesion features of lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and locating the lesion area of the lacunar infarction;
[0008] S3. Enhance the details of the lacunar infarction lesion area, segment the lesion area and optimize the segmentation results;
[0009] S4. Perform artifact repair on the segmented image and generate a three-dimensional lesion visualization model based on the repaired image.
[0010] For the aspects and any possible implementation methods described above, a further implementation method is provided. Specifically, S1 includes:
[0011] Obtain a brain MRI medical image and calculate the signal-to-noise index. Where SNR represents the signal-to-noise index, μ I represents the signal mean, N represents the total number of image pixels, I(X) represents the gray value of pixel position X in the image, σ n represents the noise standard deviation, M represents the number of pixels in the background region, I b (X) represents the gray value of the pixels in the background region, μ b represents the gray mean of the background region, calculated by the mean of the pixels in the background region;
[0012] Calculate the contrast-to-noise index. Where CNR represents the contrast-to-noise index, μ l represents the mean of the lesion region, calculated by the gray mean of the pixels within the lesion region. The lesion region is obtained through manual annotation, μ b represents the mean of the background region; σ n represents the noise standard deviation;
[0013] Calculate the artifact index. Where P A (k) represents the power spectrum of the artifact region, represents the Fourier transform of the image in the frequency domain, F a represents the artifact frequency band, P t represents the overall power spectrum of the image, F t represents the complete frequency domain of the image; T represents the number of frequency domain points, the total number of sampling points in the image frequency domain;
[0014] Classify the calculated results of the signal-to-noise index, contrast-to-noise index, and artifact index into high-quality images, medium-high-quality images, medium-quality images, and low-quality images. Specifically, the high-quality image metrics: all metrics are within the high-quality range, and the high-quality range is SNR > 25, CNR > 5, AI < 0.05; the medium-high-quality image metrics: at least one metric meets the high-quality range, and at least one metric meets the medium-quality range; the medium-quality image metrics: all metrics are within the medium-quality range, and the medium-quality range is 15 < SNR ≤ 25, 3 ≤ CNR ≤ 5, 0.05 ≤ AI < 0.15; the low-quality image metrics: any one metric belongs to the low-quality range, and the low-quality range is SNR ≤ 15, CNR < 3, AI ≥ 0.15;
[0015] Perform preprocessing respectively.
[0016] For the aspects and any possible implementation manners described above, a further implementation manner is provided. The preprocessing performed separately specifically includes:
[0017] Preprocessing of high-quality images: Normalize the image gray values and perform adaptive histogram equalization;
[0018] Preprocessing of medium-to-high-quality images: If 15 < SNR ≤ 25, use non-local means filtering to remove noise; if 3 ≤ CNR ≤ 5, apply adaptive histogram equalization; if 0.05 ≤ AI < 0.15, use frequency-domain band-pass filtering to repair mild artifacts;
[0019] Preprocessing of medium-quality images: Mark the artifact regions in the frequency domain, generate an artifact mask, denoise the calibrated artifact regions, and perform adaptive histogram equalization on the denoised images;
[0020] Preprocessing of low-quality images: Analyze the results of the artifact index AI, detect the artifact regions in the frequency domain and generate an artifact mask, calculate the gradient intensity distribution to generate a noise mask, and output the artifact mask and the noise mask;
[0021] After preprocessing, perform image standardization operations uniformly.
[0022] For the aspects and any possible implementation manners described above, a further implementation manner is provided. S2 extracts the lesion features of lacunar infarction in the MRI medical image through a convolutional neural network and locates the lesion regions of lacunar infarction, which specifically includes:
[0023] Use multi-scale Gaussian filtering to extract background information from the preprocessed MRI medical image, calculate the residual maps at different scales, and adopt a weighted fusion strategy to fuse the residual maps of multiple scales to obtain the final noise residual map, R(x,y) = E(x,y) - G(x,y,γ), where R(x,y) represents the noise residual map, E(x,y) represents the input MRI medical image, G(x,y,γ) represents the result of the input image after Gaussian blur, and γ represents the scale parameter of Gaussian filtering;
[0024] Use an improved scale-invariant feature transform algorithm to detect key points in the final noise residual map and calculate the gradient histogram for each key point to generate a feature vector. The key point detection formula is: P i (x,y,δ) represents the key point at position (x,y) and scale δ, L(x,y,δ) represents the image value in the scale space, and Δδ represents the scale change amount;
[0025] Based on the key point matching results, the geometric consistency check method is used to eliminate false matches and mark the suspected lesion area. The geometric consistency check formula is defined as: (P i ,P j ) represents two pairs of matching key points, ‖P i -P j ‖ represents the Euclidean distance between two points, τ represents the distance threshold, θ i and θ j represents the direction angle of the key point, and Δθ represents the direction angle difference;
[0026] Use a sliding window to divide the image into multiple small blocks, calculate the similarity between the features of each small block and the neighboring area, and mark the area with high similarity as a potential lesion area;
[0027] Based on the lesion boundary information extracted from the marked potential lesion area, a boundary map is generated. The boundary map is then fused with the preprocessed MRI medical image to form a multi-channel input. A convolutional neural network based on the U-Net architecture is constructed and trained, combining the SE module with an attention mechanism. The convolutional neural network model identifies lacunar infarction lesions and outputs a global feature map containing lesion area information.
[0028] The output global features are fused with the local key point matching results to generate the final lesion area mask.
[0029] According to the above aspects and any possible implementation, an implementation is further provided, wherein the detail enhancement of the lacunar infarction lesion area in S3 specifically includes:
[0030] The generated lesion area mask is used to crop the residual maps at different scales, and the cropped residual maps are re-fused according to the weights to generate a local multi-scale residual map, where R c =R k ·M m , k∈{3,5,7}, R c Represents the cropped multi-scale residual map, R k Represents the residual map of the kth scale, M m represents the lesion area mask, α k Represents the weight of each scale, R l Represents the local multi-scale residual map;
[0031] The local multi-scale residual map and the global feature map are fused to generate a preliminary saliency map, and the gradient information in the global feature map is used to enhance the lesion boundary. The enhanced saliency map is normalized to the range of [0, 1], where S i =R l +λFg , S e =S i +η▽F g , S i represents the preliminary saliency map, F g represents the global feature map, λ represents the weight of the global feature map, S e represents the enhanced saliency map, η represents the gradient enhancement weight, ▽F g Represents the gradient information of the global feature map, calculated using the Sobel operator;
[0032] The saliency map is weightedly fused with the preprocessed MRI medical image pixel by pixel to obtain a fused image with a prominent lesion area, where I e =I·(1+δS f ), I represents the preprocessed MRI image, S f represents the normalized saliency map, I e represents the fused image, and δ represents the weighting factor of the saliency map.
[0033] According to the above aspects and any possible implementation, an implementation is further provided, wherein segmenting the lesion area and optimizing the segmentation result in S3 specifically includes:
[0034] Based on the threshold segmentation of the saliency map, a preliminary segmentation mask is generated, where M b represents the preliminary segmentation mask, T represents the segmentation threshold;
[0035] Morphological operations are applied to the fused image to optimize the morphological features of the lesion area. Edge noise is removed by erosion operation, using a 3×3 kernel and iterating 2 times. Small holes in the lesion area are repaired by dilation operation, using a 5×5 kernel and iterating 2 times. The edge area is smoothed using a morphological filter, using an elliptical kernel of size 5×5, to generate the final detail-enhanced image.
[0036] Combined with the final detail enhanced image, the preliminary mask is enhanced, and the preliminary segmentation result containing the lesion area is generated through the enhanced preliminary mask, where M e =M b ·(1+θI e ′), θ represents the enhancement weight, M e represents the enhanced preliminary segmentation mask, I e ′ represents the final detail-enhanced image;
[0037] The deep Q network is used to optimize the segmentation strategy, where the state s is defined t , the characteristics of the current segmentation result, including: the current segmentation mask M t , saliency map S f, fused image I e ;Action a t , the action space includes the following operations: adjust the boundary: boundary expansion or boundary contraction, smooth the area: boundary smoothing, adjust the segmentation threshold: increase or decrease the threshold; reward r t , r t =w1·r i +w2·r o , w1 and w2 represent weights, and S represents the current mask M t The total number of pixels, ΔM t Indicates the current segmentation mask M t The boundary gradient amplitude of
[0038] The constructed deep Q network structure is:
[0039] Input layer: The input dimension is 128x128x2, including the current segmentation mask and saliency map;
[0040] Hidden layer: two convolutional layers: convolution kernel size 3x3, number of channels 32 and 64 respectively, activation function is ReLU, one fully connected layer: mapping the convolution features to the action space;
[0041] Output layer: The action space size is 5, each action corresponds to a Q value, and the action corresponding to the maximum Q value is selected for execution;
[0042] DQN training and optimization:
[0043] Initialization: Randomly initialize the DQN network parameters, set the experience replay pool, and store the state, action, reward, and next state;
[0044] Training process: State initialization: From the enhanced preliminary segmentation mask M e Start with the initial state M t , action selection: in the current state s t , select action a based on ∈-greedy strategy t , environment interaction: perform action a t , get the next state s t+1 and reward r t , Experience replay: Sampling from the experience pool, updating the Q network parameters, the target Q value is: γ represents the discount factor, and the stopping condition is: reaching the maximum number of iterations or the segmentation result converges, maxQ(s t+1 ,a) means in the next state s t+1 , the maximum Q value of all possible actions a;
[0045] Output: Optimized segmentation mask M o The lesion area segmentation result after DQN optimization;
[0046] Use the optimized segmentation mask to generate the final segmentation image I s , where I s =M o I e .
[0047] According to the above aspects and any possible implementation, an implementation is further provided, wherein the performing of artifact repair on the segmented image in S4 specifically includes:
[0048] Obtain input images for training the Generative Adversarial Network (GAN), including the final segmented image and pre-processed MRI medical image I o , and mark artifact data;
[0049] Define the generator:
[0050] Input: The frequency domain of the final segmented image is generated by Fourier transform, where F(I s )=Φ(I s ), Φ(·) represents Fourier transform, F(I s ) indicates that it contains the frequency information of the image;
[0051] Architecture: The encoder part includes several convolutional layers to extract frequency domain features. The feature processing part focuses on artifact features through the attention mechanism module. The decoder part includes several deconvolution layers to reconstruct the repaired frequency domain features into the artifact-repaired frequency domain image.
[0052] Output: The frequency domain image of the artifact repaired outputs the repaired image, where I r =Φ -1 (F r ), F r Represents the frequency domain image of artifact repair, I r Indicates the repaired image;
[0053] Define the discriminator:
[0054] Input: Spatial domain input is the original image and the repaired image, and frequency domain input is Φ(I r ) and Φ(I o );
[0055] Architecture: The spatial domain branch extracts spatial features through three convolutional layers, and the frequency domain branch extracts frequency domain features through three convolutional layers. The fusion layer combines the spatial and frequency domain features through a fully connected layer to determine the authenticity of the restored image.
[0056] Output: discrimination result, used to measure the quality of the restored image;
[0057] Define the loss function:
[0058] The generator loss includes pixel difference, frequency domain difference and adversarial loss, where L g =ω1·‖I r -I o ‖1+ω2·||F r -F(I o )||2+ω3·L GAN , L GAN represents the adversarial loss, ω1, ω2, and ω3 represent weight hyperparameters;
[0059] The discriminator loss is the adversarial loss between the real image and the artifact repaired image, where L d = -Ε[log(D(I o ))]-Ε[log(1-D(I r ))],D(I o ) represents the authenticity judgment of the discriminator on the original image, D(I r ) represents the discriminator’s judgment on the authenticity of the restored image;
[0060] GAN training steps:
[0061] Initialization: Randomly initialize the parameters of the generator and discriminator, use the Adam optimizer, and set the learning rate to 10 -4 ;
[0062] Training process: Training the discriminator: input preprocessed MRI medical images and repaired images, and update the discriminator parameters; training the generator: optimize the generator through the adversarial loss fed back by the discriminator and the difference loss between the repaired image and the original image; alternately update the generator and discriminator until the loss function converges;
[0063] Output: Generate repaired image.
[0064] According to the above aspects and any possible implementation, an implementation is further provided, wherein generating a three-dimensional lesion visualization model based on the repaired image in S4 specifically includes:
[0065] Extract the lesion area based on the repaired image, stack the lesion area slice by slice, and generate three-dimensional voxel data;
[0066] Use the Marching Cubes algorithm to extract isosurfaces from 3D voxel data, generate a surface mesh of the 3D lesion model, color the 3D model, and map the colors based on the saliency map of the lesion area.
[0067] Generate a three-dimensional lesion visualization model.
[0068] In a second aspect, an embodiment of the present invention provides an MRI medical image correction system based on a convolutional neural network using the above method, the system comprising:
[0069] The preprocessing module is used to acquire brain MRI medical images, perform quality assessment based on signal-to-noise index, contrast, and artifact intensity, and classify them into high-quality images, medium-to-high-quality images, medium-quality images, and low-quality images based on the quality assessment results, and perform preprocessing on them respectively;
[0070] A lesion recognition module is used to extract the lesion features of cerebral lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and to locate the lesion area of cerebral lacunar infarction;
[0071] Enhanced segmentation module, used to enhance details of lacunar infarction lesions, segment the lesion area and optimize the segmentation results;
[0072] The visualization module is used to repair artifacts in the segmented image and generate a three-dimensional lesion visualization model based on the repaired image.
[0073] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein the computer instructions complete the steps described in the above method when executed by the processor.
[0074] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, completes the steps of the above method.
[0075] One of the above technical solutions has the following beneficial effects:
[0076] The present invention proposes an MRI medical image correction method, system and computer-readable storage medium based on convolutional neural networks. Through multiple processing steps such as MRI image quality assessment, lesion identification, segmentation, artifact repair, and three-dimensional visualization, compared with traditional methods, the present invention can more efficiently and accurately identify lesion areas, automatically calibrate lesions, optimize image segmentation results, and simultaneously remove artifacts, improve image quality, reduce human intervention, and maximize diagnostic accuracy. It realizes image processing and automatic diagnosis, and provides an efficient and accurate diagnostic auxiliary tool for cerebral lacunar infarction through intelligent image processing.
Brief Description of the Drawings
[0077] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0078] Figure 1 Schematic diagram of the flow of S1-S4 of the MRI medical image correction method based on convolutional neural network provided in an embodiment of the present invention;
[0079] Figure 2 This is a functional block diagram of the MRI medical image correction system based on convolutional neural networks provided by an embodiment of the present invention. [Specific implementation method]
[0080] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the embodiments described are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0081] Please refer to Figure 1 , which is a flow chart of the MRI medical image correction method S1-S4 based on convolutional neural network provided by an embodiment of the present invention, as shown Figure 1 As shown, the method includes the following steps:
[0082] S1. Obtain brain MRI medical images, perform quality assessment using signal-to-noise index, contrast, and artifact intensity, and classify them into high-quality images, moderate-to-high-quality images, moderate-quality images, and low-quality images based on the quality assessment results, and perform preprocessing on each image.
[0083] S2. Extracting the lesion features of lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and locating the lesion area of the lacunar infarction;
[0084] S3. Enhance the details of the lacunar infarction lesion area, segment the lesion area and optimize the segmentation results;
[0085] S4. Perform artifact repair on the segmented image and generate a three-dimensional lesion visualization model based on the repaired image.
[0086] The present invention uses multiple processing steps, including MRI image quality assessment, lesion identification, segmentation, artifact repair, and three-dimensional visualization. Compared with traditional methods, the present invention can more efficiently and accurately identify lesion areas, automatically calibrate lesions, optimize image segmentation results, and simultaneously remove artifacts, improve image quality, reduce human intervention, and maximize diagnostic accuracy. It realizes image processing and automatic diagnosis, and provides an efficient and accurate diagnostic auxiliary tool for cerebral lacunar infarction through intelligent image processing.
[0087] In a preferred embodiment of the present invention, the S1 specifically includes:
[0088] Obtain brain MRI medical images and calculate the signal-to-noise index. Among them, SNR represents the signal-to-noise ratio, μ I represents the signal mean, N represents the total number of pixels in the image, I(X) represents the grayscale value of the pixel position X in the image, σ n represents the noise standard deviation, M represents the number of pixels in the background area, and I b (X) represents the grayscale value of the background area pixel, μ b Represents the grayscale mean of the background area, which is calculated by the mean of the pixels in the background area;
[0089] Calculate the contrast-to-noise index, Where CNR represents the contrast-to-noise ratio, μ l It represents the mean value of the lesion area, which is calculated by the grayscale mean of the pixels in the lesion area. The lesion area is obtained by manual annotation, μ b represents the mean value of the background area; σ n represents the noise standard deviation;
[0090] Calculate the artifact index, Among them, P A (k) represents the power spectrum of the artifact area, Represents the Fourier transform of the image in the frequency domain, F a Indicates the artifact frequency band, P t Represents the overall power spectrum of the image, F t Represents the complete frequency domain of the image; T represents the number of frequency domain points, the total number of sampling points in the image frequency domain;
[0091] Classified as high-quality images, medium-high-quality images, medium-quality images, and low-quality images according to the calculation results of the signal-to-noise index, contrast-to-noise index, and artifact index. That is, the high-quality image metrics: all metrics are within the high-quality range, and the high-quality range is SNR > 25, CNR > 5, AI < 0.05; the medium-high-quality image metrics: at least one metric meets the high-quality range, and at least one metric meets the medium-quality range; the medium-quality image metrics: all metrics are within the medium-quality range, and the medium-quality range is 15 < SNR ≤ 25, 3 ≤ CNR ≤ 5, 0.05 ≤ AI < 0.15; the low-quality image metrics: any one metric belongs to the low-quality range, and the low-quality range is SNR ≤ 15, CNR < 3, AI ≥ 0.15;
[0092] Perform preprocessing separately.
[0093] The present invention performs quality assessment and grading on brain MRI medical images according to the signal-to-noise index, contrast-to-noise index, and artifact index. Among them, SNR can reflect the overall noise level of the image, CNR is used to measure the contrast difference between the lesion and the background area, and AI quantitatively evaluates the interference degree of artifacts on the image. Multiple indicators cooperate to improve the characterization accuracy of the MRI image quality, making the classification result more objective and accurate, thus facilitating targeted preprocessing of subsequent brain MRI medical images of different qualities. According to the calculation results of SNR, CNR, and AI, the image is automatically divided into four grades: high-quality images, medium-high-quality images, medium-quality images, and low-quality images. Each quality grade matches a corresponding denoising, enhancement, or band-pass filtering repair strategy. The flexible processing strategies adopted for different image qualities not only perform preliminary processing to improve the accuracy of subsequent analysis but also avoid overprocessing.
[0094] In a preferred embodiment of the present invention, the performing preprocessing separately specifically includes:
[0095] Preprocessing of high-quality images: Normalize the image gray value and perform adaptive histogram equalization;
[0096] Preprocessing of medium-high-quality images: If 15 < SNR ≤ 25, use non-local mean filtering to remove noise; if 3 ≤ CNR ≤ 5, apply adaptive histogram equalization; if 0.05 ≤ AI < 0.15, use frequency-domain band-pass filtering to repair mild artifacts;
[0097] Preprocessing of medium-quality images: Mark the artifact area in the frequency domain, generate an artifact mask, perform denoising processing on the calibrated artifact area, and perform adaptive histogram equalization on the denoised image;
[0098] Preprocessing of low-quality images: Through the artifact index AI analysis results, detect the artifact area in the frequency domain and generate an artifact mask, calculate the gradient intensity distribution to generate a noise mask, and output the artifact mask and noise mask;
[0099] After preprocessing, the images are uniformly normalized.
[0100] The embodiments of the present invention implement differentiated and targeted preprocessing strategies for high, medium-high, medium, and low quality images, and perform unified standardized operations after all images are processed, greatly improving the accuracy, automation, and robustness of subsequent lesion detection and analysis; and performing detailed processing on problems such as noise, insufficient contrast, and artifact interference that exist in images of different qualities, which not only fully retains useful information but also avoids invalid or excessive global operations, laying the foundation for the stability and accuracy of subsequent operations.
[0101] It should be noted that the image normalization operation may include adjusting the brightness and contrast of different images to a uniform range through grayscale normalization, normalizing the pixel values of the images to a uniform range, and performing mean and standard deviation normalization.
[0102] In a preferred embodiment of the present invention, the S2 extracts the lesion features of the lacunar infarction from the MRI medical image through a convolutional neural network and locates the lesion area of the lacunar infarction, specifically including:
[0103] Use multi-scale Gaussian filtering to extract background information from preprocessed MRI medical images, calculate residual maps at different scales, and use a weighted fusion strategy to fuse the residual maps of multiple scales to obtain the final noise residual map, R(x,y)=E(x,y)-G(x,y,γ), where R(x,y) represents the noise residual map, E(x,y) represents the input MRI medical image, G(x,y,γ) represents the result of Gaussian blurring the input image, and γ represents the scale parameter of the Gaussian filter;
[0104] The improved scale-invariant feature transformation algorithm is used to detect the key points in the final noise residual image, and the gradient histogram of each key point is calculated to generate a feature vector. The key point detection formula is: P i (x, y, δ) represents the key point at position (x, y) and scale δ, L(x, y, δ) represents the image value in the scale space, and Δδ represents the scale change;
[0105] Based on the key point matching results, the geometric consistency check method is used to eliminate false matches and mark the suspected lesion area. The geometric consistency check formula is defined as: (P i ,P j) represents two pairs of matching key points, ||P i -P j || represents the Euclidean distance between two points, τ represents the distance threshold, θ i and θ j represents the direction angle of the key point, and Δθ represents the direction angle difference;
[0106] Use a sliding window to divide the image into multiple small blocks, calculate the similarity between the features of each small block and the neighboring area, and mark the area with high similarity as a potential lesion area;
[0107] Based on the lesion boundary information extracted from the marked potential lesion area, a boundary map is generated. The boundary map is then fused with the preprocessed MRI medical image to form a multi-channel input. A convolutional neural network based on the U-Net architecture is constructed and trained, combining the SE module with an attention mechanism. The convolutional neural network model identifies lacunar infarction lesions and outputs a global feature map containing lesion area information.
[0108] The output global features are fused with the local key point matching results to generate the final lesion area mask.
[0109] The embodiment of the present invention performs Gaussian filtering of different scales on the pre-processed MRI medical image to obtain background estimation images at multiple scales, and then subtracts them from the original image to generate multiple residual images; and adopts a weighted fusion strategy to integrate the residual images of multiple scales into a final noise residual image, which not only retains the edge features of small lesions but also suppresses global noise as much as possible; compared with using only a single scale filter, it can more effectively highlight the tiny lesion information in the brain tissue; in the final noise residual image, the improved scale-invariant feature transform (SIFT) algorithm is used to detect key points and calculate the gradient histogram, which can maintain stable detection of feature points under changes in scale and rotation; compared with the traditional SIFT, the improved method The method is more suitable for areas with smooth changes and small grayscale differences on MRI images, reducing false feature points caused by noise, artifacts or excessive similarity of tissue edges, thereby improving the detection accuracy of lesion areas; based on the key point matching results, the geometric consistency verification method is used to double-check the distance and direction of paired key points, which can effectively eliminate the problems of non-real matching or cross-structure matching; compared with simple threshold screening or similarity-based filtering, geometric consistency verification can comprehensively consider the rationality of spatial layout, greatly reduce false detection caused by mismatching, and improve the reliability and specificity of marking potential lesion areas; around the suspected lesion area detected, a sliding window is further used to divide the image into several small blocks , calculate the similarity of small block features; automatically mark areas with high feature similarity as potential lesions, reducing the omission of local areas around defective tissues. This operation complements the key point feature detection and provides additional detection support for lesions that are difficult to detect at large scales or with fuzzy boundaries, further improving the perception of lacunar infarction lesions; the preprocessed MRI medical image and the lesion boundary map are fused into multi-channel input, which can realize parallel learning of grayscale features and boundary information in the convolutional neural network. Multi-channel fusion enables the network to pay attention to the local information of the lesion contour in the early feature extraction stage. The U-Net structure combined with the SE attention mechanism module can better allocate channel weights in the encoding-decoding process. In the process of CNN recognition, the attention to the lesion area is enhanced and background interference unrelated to the lesion is suppressed. The improved network can "attention" weighted the channel-level features while maintaining the advantages of the original U-Net snapshot connection, so that the lesion area identification is more accurate and the details are clearer; the global feature map output by the network is integrated with the local matching results previously obtained by key points and geometric consistency verification, combining the network's high-level semantic understanding of the overall lesion and the precise positioning ability of traditional feature detection. This fusion strategy can effectively compensate for the possible edge blur or small area omission in the CNN recognition process, ensuring that the lesion edge and subtle lesion sites can still be reliably detected and segmented, and ultimately generating a more complete and accurate lesion area mask.
[0110] In a preferred embodiment of the present invention, the convolutional neural network model construction method is as follows:
[0111] U-Net model construction:
[0112] Input layer: The input image size is 128x128x2, and the two channels contain boundary maps and preprocessed MRI medical images;
[0113] Encoder: The encoder consists of 4 convolutional blocks;
[0114] Each convolution block includes: convolution layer: each convolution layer uses a 3x3 convolution kernel and a ReLU activation function, and the number of convolutions gradually increases with the depth of the layer; maximum pooling layer: uses a 2x2 pooling kernel for downsampling; SE module: performs weighted adjustment on channel features; CBAM module: adds the CBAM module after the SE module; channel number setting: starting from the first layer, the number of channels of the convolution layer is 32, 64, 128, and 256 respectively;
[0115] The bottleneck layer includes: two 3x3 convolutional layers with 512 channels and ReLU activation function; SE module; CBAM module;
[0116] The decoder includes: upsampling layer: uses 2x2 upsampling; skip connection: fuses the feature map of the corresponding layer in the encoder; convolution layer: each upsampling is followed by two 3x3 convolution layers to extract features and further restore spatial information; SE module: SE module is applied after each convolution operation; CBAM module: CBAM module is applied after each convolution operation; channel number setting: starting from the bottleneck layer, the number of channels of the convolution layer is 256, 128, 64, and 32 respectively;
[0117] Output layer: Convolution layer: Use a 1x1 convolution layer to map all channel features into a single channel output; Activation function: The output passes through the Sigmoid activation function to limit the value of each pixel to the range of [0, 1], indicating 1 for the lesion area and 0 for the non-lesion area;
[0118] Loss function: A combined loss function combining the Dice loss function and the cross entropy loss function is used to optimize the performance of the model. The combined loss function is defined as L T =α·L D +β·L C , Among them, α represents the weight factor of Dice loss, β represents the weight factor of cross entropy loss, and L D represents the improved weighted Dice loss function, which is used to optimize the segmentation accuracy of the lesion area. Crepresents the improved weighted cross entropy loss function, which is used to optimize the pixel-by-pixel classification accuracy, N represents the total number of pixels in the image, and p i Represents the probability value of the i-th pixel predicted by the model, g i represents the value of the i-th pixel in the true label, w i Represents the weight factor, which controls the contribution of the i-th pixel to the loss;
[0119] Training: Use the Adam optimizer, set the initial learning rate, and gradually reduce it through learning rate decay; set the batch size to 16, use GPU acceleration for training, and set the number of training rounds to 80-100 rounds;
[0120] 20% of the training data is divided into validation sets to evaluate model performance;
[0121] The SE module is implemented through the following steps: global average pooling is performed on the input feature map to generate global features for each channel; the global features are weighted through two fully connected layers. The first fully connected layer reduces the number of channels to 1 / 16 of the original value and uses the ReLU activation function. The second fully connected layer restores the number of channels to the original value and uses the Sigmoid activation function; the weighted channel weights are multiplied element-by-element by the input feature map to complete the recalibration of the channel features.
[0122] The CBAM module is implemented through the following steps: Channel attention mechanism: perform global average pooling and global maximum pooling on the feature map to generate two channel descriptions respectively; input these two descriptions into the fully connected layer to generate channel weights, and use the Sigmoid activation function to normalize the weights; use the generated channel weights to weight the channels of the input feature map; Spatial attention mechanism: perform maximum pooling and average pooling on the feature map along the channel dimension to generate two spatial descriptions; generate spatial weights after processing the spatial description through the convolution layer, and use the Sigmoid activation function to normalize the spatial weights; use the generated spatial weights to weight each position of the feature map.
[0123] The embodiment of the present invention strengthens the allocation of attention to the lesion area at both the channel and spatial levels through the combination of the SE module and the CBAM module, greatly reducing the cases of missegmentation and missed segmentation, and ensuring that even small and scattered lacunar infarction lesions can be accurately captured; the jump connection of the U-Net structure ensures the retention of details during image segmentation, while the deep bottleneck features help the network understand the higher-level semantic environment of the lesion. The two complement each other and avoid the common boundary blur and structure loss problems under simple structures; the combined loss and weighting strategy can effectively combat the inherent disadvantage of the extremely small proportion of lesions in brain MRI, so that the network maintains sensitivity to these small target features, and improves the applicability and reliability in clinical diagnosis; due to the Adam optimizer and the appropriate learning rate decay strategy, the network can converge to a better solution faster, and at the same time show excellent consistency and stability on the verification set, which is conducive to its wide promotion to different MRI image data sets and hospital environments; therefore, the convolutional neural network model of the present invention has obvious advantages such as high accuracy, strong robustness, and fast convergence.
[0124] In a preferred embodiment of the present invention, the step S3 of enhancing details of the lacunar infarction lesion area specifically includes:
[0125] The generated lesion area mask is used to crop the residual maps at different scales, and the cropped residual maps are re-fused according to the weights to generate a local multi-scale residual map, where R c =R k ·M m , k∈{3,5,7}, R c Represents the cropped multi-scale residual map, R k Represents the residual map of the kth scale, M m represents the lesion area mask, α k Represents the weight of each scale, R l Represents the local multi-scale residual map;
[0126] The local multi-scale residual map and the global feature map are fused to generate a preliminary saliency map, and the gradient information in the global feature map is used to enhance the lesion boundary. The enhanced saliency map is normalized to the range of [0, 1], where S i =R l +λF g , S e =S i +η▽F g , S i represents the preliminary saliency map, F g represents the global feature map, λ represents the weight of the global feature map, S e represents the enhanced saliency map, η represents the gradient enhancement weight, ▽F gRepresents the gradient information of the global feature map, calculated using the Sobel operator;
[0127] The saliency map is weightedly fused with the preprocessed MRI medical image pixel by pixel to obtain a fused image with a prominent lesion area, where I e =I·(1+δS f ), I represents the preprocessed MRI image, S f represents the normalized saliency map, I e represents the fused image, and δ represents the weighting factor of the saliency map.
[0128] The embodiment of the present invention, through cropping and multi-scale fusion, performs multi-scale detail enhancement only on the lesion area, minimizes ineffective enhancement of normal brain tissue, and highlights the lesion details that are truly of diagnostic value; combines the local multi-scale residual map and the global feature map, and uses gradient information for boundary enhancement, which can take into account both subtle structures and overall layout, accurately highlight the lesions, and reduce boundary errors; the final output fused image is more readable for clinicians, and the lesion area is highlighted against the background of the original image, which can effectively shorten the time doctors spend looking for lesions and reduce the risk of missing small lesions.
[0129] In a preferred embodiment of the present invention, segmenting the lesion area and optimizing the segmentation result in S3 specifically includes:
[0130] Based on the threshold segmentation of the saliency map, a preliminary segmentation mask is generated, where M b represents the preliminary segmentation mask, T represents the segmentation threshold;
[0131] Morphological operations are applied to the fused image to optimize the morphological features of the lesion area. Edge noise is removed by erosion operation, using a 3×3 kernel and iterating 2 times. Small holes in the lesion area are repaired by dilation operation, using a 5×5 kernel and iterating 2 times. The edge area is smoothed using a morphological filter, using an elliptical kernel of size 5×5, to generate the final detail-enhanced image.
[0132] Combined with the final detail enhanced image, the preliminary mask is enhanced, and the preliminary segmentation result containing the lesion area is generated through the enhanced preliminary mask, where M e =M b ·(1+θI e ′), θ represents the enhancement weight, M e represents the enhanced preliminary segmentation mask, I e ′ represents the final detail-enhanced image;
[0133] The deep Q network is used to optimize the segmentation strategy, where the state s is defined t , the characteristics of the current segmentation result, including: the current segmentation mask Mt , saliency map S f , fused image I e ;Action a t , the action space includes the following operations: adjust the boundary: boundary expansion or boundary contraction, smooth the area: boundary smoothing, adjust the segmentation threshold: increase or decrease the threshold; reward r t , r t =w1·r i +w2·r o , w1 and w2 represent weights, and S represents the current mask M t The total number of pixels, ΔM t Indicates the current segmentation mask M t The boundary gradient amplitude of
[0134] The constructed deep Q network structure is:
[0135] Input layer: The input dimension is 128x128x2, including the current segmentation mask and saliency map;
[0136] Hidden layer: two convolutional layers: convolution kernel size 3x3, number of channels 32 and 64 respectively, activation function is ReLU, one fully connected layer: mapping the convolution features to the action space;
[0137] Output layer: The action space size is 5, each action corresponds to a Q value, and the action corresponding to the maximum Q value is selected for execution;
[0138] DQN training and optimization:
[0139] Initialization: Randomly initialize the DQN network parameters, set the experience replay pool, and store the state, action, reward, and next state;
[0140] Training process: State initialization: From the enhanced preliminary segmentation mask M e Start with the initial state M t , action selection: in the current state s t , select action a based on ∈-greedy strategy t , environment interaction: perform action a t , get the next state s t+1 and reward r t , Experience replay: Sampling from the experience pool, updating the Q network parameters, the target Q value is: γ represents the discount factor, and the stopping condition is: reaching the maximum number of iterations or the segmentation result converges, maxQ(s t+1 ,a) means in the next state s t+1 , the maximum Q value of all possible actions a;
[0141] Output: Optimized segmentation mask Mo The lesion area segmentation result after DQN optimization;
[0142] Use the optimized segmentation mask to generate the final segmentation image I s , where I s =M o I e .
[0143] The embodiment of the present invention uses morphological and threshold fusion to quickly remove noise, repair holes, and retain key lesion details. Because lacunar infarction lesions in different patients may have variable shapes, scattered sizes, and locations, the DQN strategy of the present invention can adaptively learn the optimal operation, and the morphological operation ensures the flexibility of correction. The overall process shows stronger robustness for lesions of various shapes and has excellent adaptability to lesions of different sizes and shapes. Among them, the present invention sets actions and is based on a reward function, so that the network can automatically select the optimal operation. The iterative process based on trial-feedback can adaptively improve the accuracy of segmentation boundaries, reducing missed segmentation areas and avoiding over-segmentation. The reward function comprehensively considers the current number of mask pixels and the boundary gradient amplitude. When the mask boundary fits the true contour of the lesion, its gradient amplitude is often high and the area is also within a reasonable range. If the mask is over-expanded or contracted, it will lead to a low gradient amplitude or a sudden change in area, thereby obtaining a lower reward. The lightweight DQN structure with two convolutional layers and one fully connected layer can not only fully extract the local features of the current mask and saliency map, but also speed up the training iteration speed, reduce the amount of calculation, and can be flexibly deployed in a conventional GPU environment. In the process of repeated interaction with the environment, DQN gradually converges to the global optimal or suboptimal segmentation strategy. Doctors or researchers do not need to manually set multiple corrosion / dilation or threshold fine-tuning, which reduces subjective errors. The generated segmentation results are more consistent and objective in different batches of images.
[0144] In a preferred embodiment of the present invention, performing artifact repair on the segmented image in S4 specifically includes:
[0145] Obtain input images for training the Generative Adversarial Network (GAN), including the final segmented image and pre-processed MRI medical image I o , and mark artifact data;
[0146] Define the generator:
[0147] Input: The frequency domain of the final segmented image is generated by Fourier transform, where F(I s )=Φ(I s ), Φ(·) represents Fourier transform, F(I s ) indicates that it contains the frequency information of the image;
[0148] Architecture: The encoder part includes several convolutional layers to extract frequency domain features. The feature processing part focuses on artifact features through the attention mechanism module. The decoder part includes several deconvolution layers to reconstruct the repaired frequency domain features into the artifact-repaired frequency domain image.
[0149] Output: The frequency domain image of the artifact repaired outputs the repaired image, where I r =Φ -1 (F r ), F r Represents the frequency domain image of artifact repair, I r Indicates the repaired image;
[0150] Define the discriminator:
[0151] Input: Spatial domain input is the original image and the repaired image, and frequency domain input is Φ(I r ) and Φ(I o );
[0152] Architecture: The spatial domain branch extracts spatial features through three convolutional layers, and the frequency domain branch extracts frequency domain features through three convolutional layers. The fusion layer combines the spatial and frequency domain features through a fully connected layer to determine the authenticity of the restored image.
[0153] Output: discrimination result, used to measure the quality of the restored image;
[0154] Define the loss function:
[0155] The generator loss includes pixel difference, frequency domain difference and adversarial loss, where L g =ω1·||I r -I o ||1+ω2·||F r -F(I o )||2+ω3·L GAN , L GAN represents the adversarial loss, ω1, ω2, and ω3 represent weight hyperparameters;
[0156] The discriminator loss is the adversarial loss between the real image and the artifact repaired image, where L d = -Ε[log(D(I o ))]-Ε[log(1-D(I r ))],D(I o ) represents the authenticity judgment of the discriminator on the original image, D(I r ) represents the discriminator’s judgment on the authenticity of the restored image;
[0157] GAN training steps:
[0158] Initialization: Randomly initialize the parameters of the generator and discriminator, use the Adam optimizer, and set the learning rate to 10 -4 ;
[0159] Training process: Training the discriminator: input preprocessed MRI medical images and repaired images, and update the discriminator parameters; training the generator: optimize the generator through the adversarial loss fed back by the discriminator and the difference loss between the repaired image and the original image; alternately update the generator and discriminator until the loss function converges;
[0160] Output: Generate repaired image.
[0161] The embodiment of the present invention uses GAN's dual repair mechanism in the frequency domain and spatial domain, and uses the attention module to perform refined learning on artifact features, which greatly reduces the interference of various forms of artifacts on the image, making the repaired image more realistic and with clearer details. Among them, the encoder part uses several convolutional layers to extract frequency domain features, and then uses the attention mechanism module to focus on the artifact frequency band to suppress or reconstruct the abnormal spectral components caused by the artifact; the decoder part then restores the repaired frequency domain features to the spatial domain through the inverse Fourier transform, ensuring that the artifacts are effectively removed or weakened while maximizing the retention of key information in the MRI image; the discriminator's dual discrimination of the spatial domain and frequency domain can avoid the repair deviation that may occur only in the spatial domain or only in the frequency domain, and improve the discrimination and correction capabilities of various types of artifacts; the repaired MRI image not only reduces noise and artifacts, but also retains the subtle features of the original lesions and brain structures; after GAN training is completed, images can be processed in batches without manually adjusting the filter parameters or bandpass range; it is universal for different types of MRI artifacts.
[0162] In a preferred embodiment of the present invention, generating a three-dimensional lesion visualization model based on the repaired image in S4 specifically includes:
[0163] Extract the lesion area based on the repaired image, stack the lesion area slice by slice, and generate three-dimensional voxel data;
[0164] Use the Marching Cubes algorithm to extract isosurfaces from 3D voxel data, generate a surface mesh of the 3D lesion model, color the 3D model, and map the colors based on the saliency map of the lesion area.
[0165] Generate a three-dimensional lesion visualization model.
[0166] An embodiment of the present invention generates a three-dimensional lesion visualization model based on the repaired MRI image. The three-dimensional model can help doctors understand the spatial distribution of lesions in the brain from multiple perspectives, facilitate the judgment of the relationship between lesions and key brain regions, blood vessels and other structures, and improve diagnostic accuracy and surgical planning accuracy.
[0167] It should be noted that, according to actual needs, other algorithms and methods can also be used to generate a three-dimensional lesion visualization model based on the repaired image.
[0168] The embodiments of the present invention further provide device embodiments for implementing the steps and methods in the above method embodiments.
[0169] Please refer to Figure 2 , which is a functional block diagram of the MRI medical image correction system based on convolutional neural network provided by an embodiment of the present invention, such as Figure 2 As shown, the MRI medical image correction system based on convolutional neural network includes:
[0170] The preprocessing module is used to acquire brain MRI medical images, perform quality assessment based on signal-to-noise index, contrast, and artifact intensity, and classify them into high-quality images, medium-to-high-quality images, medium-quality images, and low-quality images based on the quality assessment results, and perform preprocessing on them respectively;
[0171] A lesion recognition module is used to extract the lesion features of cerebral lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and to locate the lesion area of cerebral lacunar infarction;
[0172] Enhanced segmentation module, used to enhance details of lacunar infarction lesions, segment the lesion area and optimize the segmentation results;
[0173] The visualization module is used to repair artifacts in the segmented image and generate a three-dimensional lesion visualization model based on the repaired image.
[0174] Since each unit module in this embodiment can execute Figure 1 For the method shown in the embodiment, the part not described in detail in this embodiment can be referred to Figure 1 Related instructions.
[0175] In a preferred embodiment of the present invention, a computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, perform the steps of the above method.
[0176] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0177] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A convolutional neural network-based MRI medical image correction method, characterized in that: The method includes: S1. Obtain brain MRI medical images, conduct quality assessment based on signal-to-noise ratio, contrast, and artifact intensity, classify them into high-quality images, medium-high-quality images, medium-quality images, and low-quality images according to the quality assessment results, and perform preprocessing respectively; S2. Extract lesion features of cerebral lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and locate the lesion area of cerebral lacunar infarction; S3. Enhance the details of the cerebral lacunar infarction lesion area, segment the lesion area, and optimize the segmentation result; S4. Repair the artifacts in the segmented image, and generate a three-dimensional lesion visualization model based on the repaired image; The specific preprocessing respectively includes: Preprocessing of high-quality images: Normalize the image gray value and perform adaptive histogram equalization; Preprocessing of medium-high-quality images: If 15 < SNR ≤ 25, use non-local mean filtering to remove noise; if 3 ≤ CNR ≤ 5, apply adaptive histogram equalization; if 0.05 ≤ AI < 0.15, use frequency-domain band-pass filtering to repair mild artifacts; Preprocessing of medium-quality images: Mark the artifact area in the frequency domain, generate an artifact mask, denoise the marked artifact area, and perform adaptive histogram equalization on the denoised image; Preprocessing of low-quality images: Analyze the result of the artifact index AI, detect the artifact area in the frequency domain and generate an artifact mask, calculate the gradient intensity distribution to generate a noise mask, and output the artifact mask and the noise mask; Perform image standardization operation uniformly after preprocessing; The detailed enhancement of the cerebral lacunar infarction lesion area in S3 specifically includes: The generated lesion area mask is used to crop the residual maps at different scales, and the cropped residual maps are re-fused according to the weights to generate a local multi-scale residual map, where R c =R k ·M m , k∈{3,5,7}, R c Represents the cropped multi-scale residual map, R k Represents the residual map of the kth scale, M m represents the lesion area mask, α k Represents the weight of each scale, R l Represents the local multi-scale residual map; The local multi-scale residual map and the global feature map are fused to generate a preliminary saliency map, and the gradient information in the global feature map is used to enhance the lesion boundary. The enhanced saliency map is normalized to the range of [0, 1], where S i =R l +λF g , S i represents the preliminary saliency map, F g represents the global feature map, λ represents the weight of the global feature map, S e represents the enhanced saliency map, η represents the gradient enhancement weight, Represents the gradient information of the global feature map, calculated using the Sobel operator; The saliency map is weightedly fused with the preprocessed MRI medical image pixel by pixel to obtain a fused image with a prominent lesion area, where I e =I·(1+δ * S f ), I represents the preprocessed MRI image, S f represents the normalized saliency map, I e represents the fused image, δ * Represents the weighting factor of the saliency map.
2. The method according to claim 1, characterized in that S1 specifically includes: Obtain brain MRI medical images and calculate the signal-to-noise index. Among them, SNR represents the signal-to-noise ratio, μ I represents the signal mean, N represents the total number of pixels in the image, I(X) represents the grayscale value of the pixel position X in the image, σ n represents the noise standard deviation, M represents the number of pixels in the background area, and I b (X) represents the grayscale value of the background area pixel, μ b Represents the grayscale mean of the background area, which is calculated by the mean of the pixels in the background area; Calculate the contrast-to-noise index, Where CNR represents the contrast-to-noise ratio, μ l It represents the mean value of the lesion area, which is calculated by the grayscale mean of the pixels in the lesion area. The lesion area is obtained by manual annotation, μ b represents the mean value of the background area; σ n represents the noise standard deviation; Calculate the artifact index, Among them, P a (k) represents the power spectrum of the artifact area, Represents the Fourier transform of the image in the frequency domain, F a Indicates the artifact frequency band, P t Represents the overall power spectrum of the image, F t Represents the complete frequency domain of the image; T represents the number of frequency domain points, the total number of sampling points in the image frequency domain; Classify into high-quality images, medium-high-quality images, medium-quality images, and low-quality images according to the calculation results of the signal-to-noise ratio, contrast noise ratio, and artifact index. That is, the high-quality image index: all indexes are within the high-quality range, and the high-quality range is SNR > 25, CNR > 5, AI < 0.05; the medium-high-quality image index: at least 1 index meets the high-quality range and at least 1 index meets the medium-quality range; the medium-quality image index: all indexes are within the medium-quality range, and the medium-quality range is 15 < SNR ≤ 25, 3 ≤ CNR ≤ 5, 0.05 ≤ AI < 0.15; the low-quality image index: any one index belongs to the low-quality range, and the low-quality range is SNR ≤ 15, CNR < 3, AI ≥ 0.15; Perform preprocessing respectively.
3. The method according to claim 1, characterized in that S2 extracts the lesion features of cerebral lacunar infarction from the MRI medical images through a convolutional neural network and locates the lesion area of cerebral lacunar infarction, specifically including: Use multi-scale Gaussian filtering to extract background information from preprocessed MRI medical images, calculate residual maps at different scales, and use a weighted fusion strategy to fuse the residual maps of multiple scales to obtain the final noise residual map, R(x,y)=E(x,y)-G(x,y,γ), where R(x,y) represents the noise residual map, E(x,y) represents the input MRI medical image, G(x,y,γ) represents the result of Gaussian blurring the input image, and γ represents the scale parameter of the Gaussian filter; The improved scale-invariant feature transformation algorithm is used to detect the key points in the final noise residual image, and the gradient histogram of each key point is calculated to generate a feature vector. The key point detection formula is: P i (x, y, δ) represents the key point at position (x, y) and scale δ, L(x, y, δ) represents the image value in the scale space, and △δ represents the scale change; Based on the key point matching results, the geometric consistency check method is used to eliminate false matches and mark the suspected lesion area. The geometric consistency check formula is defined as: (P i ,P j ) represents two pairs of matching key points, ||P i -P j || represents the Euclidean distance between two points, τ represents the distance threshold, θ i and θ j represents the direction angle of the key point, and △θ represents the direction angle difference; Use a sliding window to divide the image into multiple small blocks, calculate the similarity between the features of each small block and the neighboring area, and mark the area with high similarity as a potential lesion area; Based on the lesion boundary information extracted from the marked potential lesion area, a boundary map is generated. This boundary map is then fused with the preprocessed MRI medical image to form a multi-channel input. A convolutional neural network based on the U-Net architecture is constructed and trained, incorporating the SE module and introducing an attention mechanism. The convolutional neural network model identifies lacunar infarction lesions and outputs a global feature map containing lesion area information. The output global features are fused with the local key point matching results to generate the final lesion area mask.
4. The method according to claim 1, wherein Segmenting the lesion area and optimizing the segmentation results in S3 specifically include: Based on the threshold segmentation of the saliency map, a preliminary segmentation mask is generated, where M b represents the preliminary segmentation mask, T represents the segmentation threshold; Morphological operations are applied to the fused image to optimize the morphological features of the lesion area. Edge noise is removed by erosion operation, using a 3×3 kernel and iterating 2 times. Small holes in the lesion area are repaired by dilation operation, using a 5×5 kernel and iterating 2 times. The edge area is smoothed using a morphological filter, using an elliptical kernel of size 5×5, to generate the final detail-enhanced image. Combined with the final detail enhanced image, the preliminary mask is enhanced, and the preliminary segmentation result containing the lesion area is generated through the enhanced preliminary mask, where M e =M b ·(1+θI e ′), θ represents the enhancement weight, M e represents the enhanced preliminary segmentation mask, I e ′ represents the final detail-enhanced image; The deep Q network is used to optimize the segmentation strategy, where the state s is defined t , the characteristics of the current segmentation result, including: the current segmentation mask M t , saliency map S f , fused image I e ;Action a t , the action space includes the following operations: adjust the boundary: boundary expansion or boundary contraction, smooth the area: boundary smoothing, adjust the segmentation threshold: increase or decrease the threshold; reward r t , r t =w1·r i +w2·r o , w1 and w2 represent weights, and S represents the current mask M t The total number of pixels, ΔM t Indicates the current segmentation mask M t The boundary gradient amplitude of The constructed deep Q network structure is: Input layer: The input dimension is 128x128x2, including the current segmentation mask and saliency map; Hidden layer: two convolutional layers: convolution kernel size 3x3, number of channels 32 and 64 respectively, activation function is ReLU, one fully connected layer: mapping the convolution features to the action space; Output layer: The action space size is 5, each action corresponds to a Q value, and the action corresponding to the maximum Q value is selected for execution; DQN training and optimization: Initialization: Randomly initialize the DQN network parameters, set the experience replay pool, and store the state, action, reward, and next state; Training process: State initialization: From the enhanced preliminary segmentation mask M e Start with the initial state M t , action selection: in the current state s t , select action a based on ∈-greedy strategy t , environment interaction: perform action a t , get the next state s t+1 and reward r t , Experience replay: Sampling from the experience pool, updating the Q network parameters, the target Q value is: γ represents the discount factor, and the stopping condition is: reaching the maximum number of iterations or the segmentation result converges, maxQ(s t+1 ,a) means in the next state s t+1 , the maximum Q value of all possible actions a; Output: Optimized segmentation mask M o The lesion area segmentation result after DQN optimization; Use the optimized segmentation mask to generate the final segmentation image I s , where I s =M o I e .
5. The method according to claim 4, characterized in that In S4, artifact repair is performed on the segmented image, specifically including: Obtain input images for training the Generative Adversarial Network (GAN), including the final segmented image and pre-processed MRI medical image I o , and mark artifact data; Define the generator: Input: The frequency domain of the final segmented image is generated by Fourier transform, where F(I s )=Φ(I s ), Φ(·) represents Fourier transform, F(I s ) indicates that it contains the frequency information of the image; Architecture: The encoder part includes several convolutional layers to extract frequency domain features. The feature processing part focuses on artifact features through the attention mechanism module. The decoder part includes several deconvolution layers to reconstruct the repaired frequency domain features into the artifact-repaired frequency domain image. Output: The frequency domain image of the artifact repaired outputs the repaired image, where I r =Φ -1 (F r ), F r Represents the frequency domain image of artifact repair, I r Indicates the repaired image; Define the discriminator: Input: Spatial domain input is the original image and the repaired image, and frequency domain input is Φ(I r ) and Φ(I o ); Architecture: The spatial domain branch extracts spatial features through three convolutional layers, and the frequency domain branch extracts frequency domain features through three convolutional layers. The fusion layer combines the spatial and frequency domain features through a fully connected layer to determine the authenticity of the restored image. Output: discrimination result, used to measure the quality of the restored image; Define the loss function: The generator loss includes pixel difference, frequency domain difference and adversarial loss, where L g =ω1·||I r -I o ||1+ω2·‖F r -F(I o )||2+ω3·L GAN , L GAN represents the adversarial loss, ω1, ω2, and ω3 represent weight hyperparameters; The discriminator loss is the adversarial loss between the real image and the artifact repaired image, where L d = -Ε[log(D(I o ))]-Ε[log(1-D(I r ))],D(I o ) represents the authenticity judgment of the discriminator on the original image, D(I r ) represents the discriminator’s judgment on the authenticity of the restored image; GAN training steps: Initialization: Randomly initialize the parameters of the generator and discriminator, use the Adam optimizer, and set the learning rate to 10 -4 ; Training process: Training the discriminator: input preprocessed MRI medical images and repaired images, and update the discriminator parameters; training the generator: optimize the generator through the adversarial loss fed back by the discriminator and the difference loss between the repaired image and the original image; alternately update the generator and discriminator until the loss function converges; Output: Generate repaired image.
6. The method according to claim 5, characterized in that The S4 generates a three-dimensional lesion visualization model based on the repaired image, specifically including: Extract the lesion area based on the repaired image, stack the lesion area slice by slice, and generate three-dimensional voxel data; Use the Marching Cubes algorithm to extract isosurfaces from 3D voxel data, generate a surface mesh of the 3D lesion model, color the 3D model, and map the colors based on the saliency map of the lesion area. Generate a three-dimensional lesion visualization model.
7. An MRI medical image correction system based on a convolutional neural network using the method according to any one of claims 1 to 6, characterized in that: include: The preprocessing module is used to acquire brain MRI medical images, perform quality assessment based on signal-to-noise index, contrast, and artifact intensity, and classify them into high-quality images, medium-to-high-quality images, medium-quality images, and low-quality images based on the quality assessment results, and perform preprocessing on them respectively; A lesion recognition module is used to extract the lesion features of cerebral lacunar infarction from the preprocessed MRI medical images through a convolutional neural network, and to locate the lesion area of cerebral lacunar infarction; Enhanced segmentation module, used to enhance details of lacunar infarction lesions, segment the lesion area and optimize the segmentation results; The visualization module is used to repair artifacts in the segmented image and generate a three-dimensional lesion visualization model based on the repaired image.
8. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Artifact correction method of cardiac coronary artery image, and readable storage medium
CN111223158A
Method and equipment for detecting surface defects of power battery module
CN115690013A