Medical Image Local Enhancement Methods and Systems
By using soft mask images and iteratively optimized control parameter sets, the problem of lesion region enhancement effects in medical image local enhancement relying on segmentation accuracy and the lack of interpretability of deep learning was solved. Natural transitions in lesion regions and smooth transitions in background regions were achieved, improving the robustness and interpretability of the enhancement effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING CHUIYANGLIU HOSPITAL
- Filing Date
- 2026-05-11
- Publication Date
- 2026-07-31
AI Technical Summary
Existing medical image local enhancement techniques suffer from problems such as the enhancement effect of lesion areas depending on segmentation accuracy, leading to harsh boundaries and visual artifacts. Furthermore, end-to-end deep learning methods lack interpretability and medical authenticity, affecting clinical trust.
A soft mask image is used for lesion perception processing to generate a mask image containing lesion probability information. The mask image is then iteratively optimized by controlling the parameter set. By combining lesion region enhancement and background region suppression, adaptive local enhancement processing is achieved. Finally, the enhanced image is generated by adjusting the parameters driven by the quality feedback value.
It achieves a natural transition between the lesion area and a smooth transition between the background area, improving the robustness and interpretability of the enhancement effect and meeting the transparency requirements of medical diagnosis.
Smart Images

Figure CN122492537A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for local enhancement of medical images. Background Technology
[0002] Medical images play a crucial role in clinical diagnosis, but lesion areas often suffer from low contrast or blurred details. Local enhancement techniques aim to improve the visual quality of these areas, thereby assisting doctors in accurate diagnosis. Currently, medical image local enhancement techniques are mainly divided into two categories: 1. Enhancement methods based on traditional image processing or simple segmentation; 2. Enhancement methods based on end-to-end deep learning (such as GAN (Generative Adversarial Network)).
[0003] For the first method, a binary segmentation mask of the lesion is usually obtained first (e.g., the lesion area is marked as 1 and the background as 0), and then the lesion area is subjected to independent contrast stretching, sharpening, and other processing. Because its enhancement effect heavily depends on the accuracy of the initial segmentation, it has poor error tolerance; and the use of a binary mask inevitably leads to a harsh boundary between the enhanced area and the original background, which easily produces unnatural visual breaks after fusion, destroying the continuity of the anatomical structure; and, the binarization process discards the lesion probability prediction information of the lesion area and its boundary, which makes it impossible for the enhancement process to achieve a smooth transition based on the continuity of tissue characteristics, thus limiting the degree of refinement of the enhancement effect.
[0004] The second method involves training a deep neural network model to directly learn the complex mapping from the original image to the enhanced image. Figure 1 Feature extraction and image transformation are completed in one step. However, this enhancement process lacks interpretability, making it difficult for doctors to understand the rationale behind their decisions, resulting in low clinical trust. Furthermore, the model may alter the medical semantic authenticity of the image in pursuit of visual metrics (such as falsifying or erasing key details), which is unacceptable in clinical diagnosis. In addition, the model's stability is insufficient, and its ability to generalize to images outside the training data is weak, limiting the reliability of practical applications.
[0005] It is evident that current medical image local enhancement techniques suffer from the following problems: independent enhancement based on binary segmentation is prone to producing harsh boundaries and visual artifacts; the enhancement results generated by end-to-end deep learning methods have an opaque decision-making process and may alter the medical authenticity of the image, leading to questions about clinical trust and diagnostic reliability. Summary of the Invention
[0006] In view of the above problems, embodiments of the present invention provide a method and system for local enhancement of medical images that overcomes or at least partially solves the above problems.
[0007] In a first aspect, embodiments of the present invention provide a method for local enhancement of medical images, comprising: The medical image to be processed is subjected to lesion perception processing to generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence that the corresponding position belongs to a lesion. Initialize the control parameter set P0 and set the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameter for enhancing the lesion area and a second type of parameter for suppressing the background area. The sample image is enhanced according to the current control parameter set P_current to obtain an intermediate enhanced image, and the enhancement quality of the intermediate enhanced image is evaluated based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q. In response to the current state not meeting the preset stopping condition, with the goal of optimizing the quality feedback value Q, the current control parameter set P_current is adjusted to obtain an updated control parameter set P_update, and the updated control parameter set P_update is used as the current control parameter set P_current, and the step of enhancing the sample image according to the current control parameter set P_current is returned. In response to the current state satisfying the preset stop condition, the current control parameter set P_current is determined as the target control parameter set P_opt; Using the target control parameter set P_opt, the medical image to be processed is subjected to lesion region enhancement processing and background region suppression processing to obtain the enhanced image I_enhanced and the suppressed image I_suppressed. Based on the soft mask image corresponding to the medical image to be processed, the enhanced image I_enhanced and the suppressed image I_suppressed are fused at the pixel level to generate the final enhanced image I_final.
[0008] In a second aspect, embodiments of the present invention provide a medical image local enhancement system, comprising: The generation module is used to perform lesion perception processing on the medical image to be processed, and generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence that the corresponding position belongs to the lesion. The first processing module is used to initialize the control parameter set P0 and use the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameters for enhancing the lesion area and a second type of parameters for suppressing the background area. The second processing module is used to perform enhancement processing on the sample image according to the current control parameter set P_current to obtain an intermediate enhanced image, and evaluate the enhancement quality of the intermediate enhanced image based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q. The adjustment control module is used to respond to the current state not meeting the preset stop condition, with the goal of optimizing the quality feedback value Q, to adjust the current control parameter set P_current to obtain an updated control parameter set P_update, and to use the updated control parameter set P_update as the current control parameter set P_current, and to control the second processing module to continue to perform enhancement processing on the sample image according to the current control parameter set P_current; The determination module is used to determine the current control parameter set P_current as the target control parameter set P_opt in response to the current state meeting the preset stop condition; The processing and acquisition module is used to perform lesion region enhancement processing and background region suppression processing on the medical image to be processed using the target control parameter set P_opt, to obtain the enhanced image I_enhanced and the suppressed image I_suppressed. The fusion generation module is used to perform pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed based on the soft mask image corresponding to the medical image to be processed, to generate the final enhanced image I_final.
[0009] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0010] Fourthly, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the method described in the first aspect.
[0011] The technical solutions provided by the embodiments of the present invention have at least the following technical effects: By introducing soft mask images, the confidence gradient process of lesions from the core to the edge and then to the background is accurately depicted. Utilizing pixel-level continuous confidence information, an adaptive fusion mechanism based on linear weighting is constructed to enhance the effect in the lesion area to highlight details, enhance the suppression in the background area to reduce interference, and achieve a smooth transition in the transition area. This eliminates visual distortion caused by hard segmentation, preserves subtle information, and significantly improves the continuity and visual realism of anatomical structures.
[0012] The control parameter set is decomposed into a first type of parameter that enhances the lesion and a second type of parameter that suppresses the background. Local contrast enhancement and / or edge sharpening are performed on the lesion area, while noise suppression is performed on the background area. This dual-path collaboration achieves simultaneous optimization of the visual saliency of the lesion area and the purity of the background area. The quality index drives the achievement of a global optimal balance between enhancement and suppression intensity, avoiding artifacts caused by excessive enhancement of the lesion and preventing information loss caused by excessive smoothing of the background.
[0013] Based on a closed-loop feedback mechanism of parameter execution → effect evaluation → parameter adjustment, the quality feedback value under the current parameters is calculated during the iteration process, and the parameters are adjusted based on the quality feedback value. This enables a leap from static processing that relies on fixed empirical parameters to dynamic adjustment that can adaptively optimize. Faced with image differences of different devices, diseases or imaging conditions, the optimal parameter combination can be automatically found, which significantly improves the robustness and generalization ability of local enhancement.
[0014] This solution adopts a transparent architecture of perception-analysis-processing-fusion. The soft mask image intuitively displays the lesion location and confidence level, the iterative optimization process reveals the basis for parameter selection, and the specific processing and fusion methods are clear and explicit. This interpretable solution gives clinicians confidence in the enhanced results and meets the stringent requirements of medical diagnosis for process transparency. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A schematic diagram of a medical image local enhancement method provided by an embodiment of the present invention is shown; Figure 2 A schematic diagram illustrating a method for obtaining quality feedback values based on enhanced intermediate images, provided by an embodiment of the present invention, is shown. Figure 3 A schematic diagram illustrating the method for calculating a single-sample quality assessment value provided by an embodiment of the present invention is shown. Figure 4 A schematic diagram illustrating the method for updating a set of control parameters provided in an embodiment of the present invention is shown. Figure 5 This illustration shows a schematic diagram of a processing method for enhancing lesion regions and suppressing background regions in medical images based on a target control parameter set, provided by an embodiment of the present invention. Figure 6A schematic diagram of a medical image local enhancement system provided in an embodiment of the present invention is shown; Figure 7 A schematic diagram of the electronic device structure provided in an embodiment of the present invention is shown. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.
[0019] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0020] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0021] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.
[0022] Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0023] This invention provides a method for local enhancement of medical images, such as... Figure 1 As shown, the method includes: Step 101: Perform lesion perception processing on the medical image to be processed to generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence level that the corresponding position belongs to the lesion.
[0024] The medical image to be processed in this embodiment of the invention is, for example, a chest CT image. By locally enhancing, for example, a pneumonia lesion in the chest CT image, the lesion area can be highlighted while maintaining the naturalness of normal tissue, thereby assisting doctors in making a diagnosis.
[0025] For the medical image to be processed, lesion-aware processing is first performed before local enhancement to generate a soft mask image corresponding to the medical image. The soft mask image is a probability map containing lesion probability information, with pixel values being continuous values between 0 and 1, and each pixel value indicating the confidence that the corresponding location belongs to a lesion. Specifically, the closer the pixel value is to 1, the higher the probability that the location belongs to a lesion; the closer the pixel value is to 0, the higher the probability that the location belongs to normal background; when the pixel value is in the middle range, it corresponds to the lesion boundary or tissue transition area, reflecting the transition area between the lesion and normal tissue in the medical image. Compared with traditional binary masks (containing only 0 and 1), soft mask images preserve the gradual change information of the lesion's interior and boundaries, enabling a natural transition from the lesion to the background in subsequent enhancement processing, avoiding anatomical structure breaks caused by hard segmentation.
[0026] The specific process of step 101, which involves performing lesion perception processing on the medical image to be processed and generating a soft mask image containing lesion probability information, is as follows: The medical image to be processed is input into the lesion perception model, which is constructed using a deep learning-based image segmentation network. The image segmentation network adopts an encoder-decoder structure. The encoder extracts multi-scale features from the medical image to be processed in the input lesion perception model to obtain a multi-scale feature map. By integrating an attention mechanism into the decoder, multi-scale feature maps are weighted and fused to generate a fused feature map. The fused feature map is then processed to output a soft mask image with the same resolution as the input medical image to be processed.
[0027] The medical image to be processed is, for example, a raw axial CT image of the lungs, with a size of 512×512 pixels. This CT image is input into a pre-trained lesion perception model, which is built based on a deep learning image segmentation network and adopts a U-Net architecture with an attention mechanism (this architecture includes an encoder and a decoder). The lesion perception model takes the raw medical image as input, performs multi-scale feature extraction and upsampling reconstruction, and finally outputs a soft mask image with the same resolution as the input image.
[0028] The encoder extracts multi-scale features from the input CT image through convolution and downsampling operations to obtain multi-scale feature maps with different levels and resolutions. The decoder integrates an attention mechanism to dynamically weight and fuse the multi-scale feature maps to generate a fused feature map. Subsequently, the fused feature map is upsampled and reconstructed layer by layer to gradually restore the spatial resolution. Finally, the output is a soft mask image of lesion probability with the same resolution as the input CT image.
[0029] Specifically, the encoder employs a 5-stage structure, with each stage containing two 3×3 convolutional layers and a 2×2 max-pooling layer for downsampling. The encoder extracts multi-scale features step-by-step from the input 512×512 CT image: shallow features preserve high-resolution details (such as subtle ground-glass textures), while deep features contain low-resolution high-dimensional semantic information (such as the overall shape and location of lesions).
[0030] The decoder is symmetrical to the encoder. Each stage includes a 2×2 transposed convolution for upsampling, which is then concatenated with the feature map of the corresponding stage of the encoder (skip connection). The key improvement in this embodiment is the introduction of an attention gate mechanism (a spatial attention mechanism) before concatenation. The attention gate mechanism works as follows: at each stage of the decoder, the features of the current decoder layer are used as the query, and the features of the corresponding encoder layer are used as the key and value. An additive attention calculation generates a spatial attention weight map. This weight map is multiplied element-wise with the encoder features to obtain weighted encoder features, which strengthen the feature responses related to lesions and suppress background features, thereby improving the image segmentation network's ability to perceive lesion regions. The weighted encoder features are then concatenated with the upsampled decoder features along the channel dimension and input into subsequent convolutional layers. Finally, the last layer of the decoder uses a 1×1 convolution and a sigmoid activation function to compress the number of feature channels to 1, outputting a soft mask map of lesion probability at the same resolution (512×512) as the input image.
[0031] In the soft mask image output by the lesion perception model, each pixel's value is a floating-point number between 0 and 1, representing the confidence level that the corresponding location belongs to a lesion. For example, in a typical lobar pneumonia consolidation area, the central pixel value might be close to 0.95; in a ground-glass opacity area where the edges intersect with normal tissue, the pixel value might be between 0.4 and 0.7; while in clearly defined normal tissue areas, the pixel value is below 0.1. This soft mask image achieves a continuous and smooth probabilistic transition from the lesion core to the background.
[0032] Before performing local enhancement on the medical image to be processed, a set of control parameters needs to be generated and optimized through iterative processing. This generation and optimization is based on sample images, which are one or more pre-prepared medical images with corresponding soft mask images. These sample images are used to enable the control parameter set to learn the desired enhancement effect. The process of generating and optimizing the control parameter set is temporally independent of the lesion detection processing of the medical image to be processed; that is, it can be performed before or after lesion detection. This embodiment does not limit this. Steps 102 to 105 below describe the implementation process of optimizing the control parameter set through iterative processing.
[0033] Step 102: Initialize the control parameter set P0 and set the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameter for enhancing the lesion area and a second type of parameter for suppressing the background area.
[0034] The set of control parameters P0 is defined to include a first type of parameter and a second type of parameter. The first type of parameter is used to enhance the lesion area, such as including the contrast gain coefficient and / or edge sharpening intensity. The second type of parameter is used to suppress the background area, such as including the Gaussian smoothing standard deviation.
[0035] Optionally, initializing the control parameter set P0 includes: obtaining the soft mask image corresponding to the sample image; generating initial values for the first type of parameter and the second type of parameter based on the pixel distribution characteristics of the soft mask image corresponding to the sample image, thereby obtaining the initialized control parameter set P0; wherein the number of sample images is at least one, and the pixel distribution characteristics are the statistical aggregation characteristics of at least one soft mask image corresponding to at least one sample image.
[0036] When initializing the control parameter set P0, it is necessary to acquire the soft mask image corresponding to the sample image. For regions in the soft mask image where pixel values are greater than a preset threshold (e.g., 0.5), statistical analysis is performed, calculating the mean μ_i and standard deviation σ_i of the pixels within that region. When there are multiple sample images, the μ_i and σ_i of all samples are averaged to obtain statistical aggregate features such as μ_avg and σ_avg. Then, initial values for the first and second types of parameters are generated based on these statistical aggregate features.
[0037] As an example, for the first type of parameter: the initial value of the contrast gain coefficient is set to 1.0 + μ_avg, and the initial value of the edge sharpening intensity is set to 0.5 / (σ_avg+). ), To prevent division by zero by small constants, such as extremely small positive numbers. The physical meaning is as follows: a higher μ_avg indicates more typical features of the lesion area, thus requiring a larger initial contrast gain to highlight the difference between the lesion and the background; a smaller σ_avg indicates a more uniform pixel distribution within the lesion area, allowing for a larger initial sharpening intensity and the ability to achieve a higher sharpening level in subsequent optimizations to clearly delineate the lesion edges; a larger σ_avg indicates a dispersed probability distribution and complex texture within the area, requiring a moderate reduction in sharpening intensity to prevent over-enhancement and distortion of details.
[0038] The second type of parameter, the initial value of the Gaussian smoothing standard deviation, is set to 1.0 / (1.0 + μ_avg). Its physical meaning is as follows: the higher the μ_avg, the greater the distinction between the lesion and the background, requiring only slight smoothing of the background area (smaller Gaussian smoothing standard deviation) to preserve normal structure; the lower the μ_avg, the less obvious the lesion, requiring stronger background smoothing (larger Gaussian smoothing standard deviation) to suppress noise and highlight the lesion. It is important to note that the initial value of this second type of parameter is not directly determined by the statistical characteristics of the background area itself (such as the texture complexity or noise level), but rather by the required distinction between the lesion and the background. Since this distinction information is mainly contained within the lesion area—the higher the average confidence level μ_avg of the lesion area, the more typical the lesion, the greater the natural contrast between the lesion and the background, and the less suppression strength is required for the background; conversely, the lower the μ_avg, the less significant the lesion, requiring stronger background suppression to indirectly improve the visual discernibility of the lesion. Therefore, the features of high-confidence regions (corresponding to lesion regions) in the statistical soft mask image can effectively drive the initialization of the second type of parameters. Although the setting of the second type of parameters is based on lesion features, its physical meaning is to optimize the distinction between lesions and background by adjusting the background suppression intensity, which already implicitly considers background features.
[0039] After obtaining the control parameter set P0 through initialization, the control parameter set P0 is used as the current control parameter set P_current for subsequent iterative optimization.
[0040] Step 103: Perform enhancement processing on the sample image according to the current control parameter set P_current to obtain an intermediate enhanced image, and evaluate the enhancement quality of the intermediate enhanced image based on the soft mask image corresponding to the sample image to obtain the quality feedback value Q.
[0041] After obtaining the current control parameter set P_current, the sample image is enhanced according to the current control parameter set P_current to obtain an intermediate enhanced image. Then, the enhancement quality of the intermediate enhanced image is evaluated using the soft mask image corresponding to the sample image to obtain a quality feedback value Q. The obtained quality feedback value Q is used to quantify the enhancement effect of the current control parameter set on the sample image. Furthermore, the obtained quality feedback value Q serves as the basis for subsequent parameter adjustments, guiding the control parameter set to iteratively optimize towards a better enhancement effect.
[0042] Wherein, the number of sample images is at least one, and when enhancing the sample images to obtain intermediate enhanced images, and obtaining the quality feedback value Q based on the enhancement quality of the intermediate enhanced images, the process includes: Figure 2 The following process is shown: Step 201: Perform enhancement processing on at least one sample image according to the current control parameter set P_current to obtain at least one corresponding intermediate enhanced image.
[0043] Step 202: For each intermediate enhanced image, calculate the enhancement quality of the intermediate enhanced image based on the soft mask image of its corresponding sample image to obtain a single sample quality assessment value.
[0044] Step 203: Perform comprehensive processing on at least one single-sample quality assessment value corresponding to at least one intermediate enhanced image to generate a quality feedback value Q.
[0045] After obtaining the current control parameter set P_current, enhancement processing is performed on each sample image in at least one sample image based on the current control parameter set P_current to obtain an intermediate enhanced image corresponding to each sample image. The enhancement processing includes: according to the first type of parameters in the current control parameter set P_current, local contrast enhancement and / or edge sharpening are performed on the lesion region indicated by the corresponding soft mask image in the sample image to enhance the visual salience of the lesion region; according to the second type of parameters in the current control parameter set P_current, noise suppression processing is performed on the background region indicated by the corresponding soft mask image in the sample image to reduce background interference. The effects of the above enhancement and suppression processing are spatially modulated through the corresponding soft mask image, and pixel-level weighted fusion is performed based on the corresponding soft mask image to obtain the intermediate enhanced image. In the process of generating the intermediate enhanced image: in the region with a high corresponding mask value (lesion region), the enhancement effect is dominant; in the region with a low corresponding mask value (background region), the suppression effect is dominant; in the transition region with a moderate corresponding mask value, the two effects are fused according to the confidence ratio to achieve a natural and smooth transition from the lesion to the background.
[0046] Then, for each intermediate enhanced image, the enhancement quality of the intermediate enhanced image is calculated based on the soft mask image of the corresponding sample image, resulting in a single-sample quality assessment value for the intermediate enhanced image. After obtaining the single-sample quality assessment values for at least one sample image, these values are comprehensively processed to generate a quality feedback value Q. The comprehensive processing is as follows: when there is only one sample image, the single-sample quality assessment value is directly used as the quality feedback value Q; when there are at least two sample images, the average or weighted average of the at least two single-sample quality assessment values is taken to obtain the quality feedback value Q. The generated quality feedback value Q is used to quantify the enhancement effect of the current control parameter set P_current on the sample images and serves as the basis for subsequent parameter adjustments. A higher Q value indicates a better enhancement effect produced by the current control parameter set, i.e., a better control parameter set.
[0047] In one specific embodiment, the process of enhancing the sample image based on the current set of control parameters and calculating the single-sample quality assessment value is as follows: Based on the first type of parameters (including contrast gain coefficient and edge sharpening intensity), local enhancement is performed on the lesion region in the sample image (determined based on the corresponding soft mask image). Specifically, for each pixel position i within the lesion region, a local window (e.g., 15×15 pixels) is taken centered on i, and the local mean and local standard deviation of the pixels within the window are calculated to obtain local statistical information around the current pixel position, which serves as the basis for adaptive enhancement. For example, the local mean reflects the brightness level of the region and serves as the benchmark for contrast stretching, while the local standard deviation reflects the texture contrast of the region and is used to further guide the enhancement strategy within the lesion region. During contrast stretching, adaptive enhancement is performed for each pixel position based on the original pixel value, local mean, and contrast gain coefficient. For example, the difference between the original pixel value and the local mean is multiplied by the contrast gain coefficient, and the product is added back to the local mean to achieve adaptive enhancement. The stretching intensity is globally controlled by the contrast gain coefficient, and an execution factor based on the local standard deviation is introduced. This execution factor is positively correlated with the local standard deviation and is used to dynamically adjust the actual application intensity of the contrast gain coefficient at each pixel position. Specifically, for textured regions with large local standard deviations, a higher execution factor is used to fully utilize the contrast gain coefficient and highlight details. For flat regions with small local standard deviations, a lower execution factor is used to effectively suppress the intensity of contrast stretching and avoid excessive noise amplification. That is, the local standard deviation does not directly change the value of the contrast gain coefficient; instead, the execution factor controls whether the stretching intensity set by the coefficient is fully or partially applied. Finally, for example, the contrast gain coefficient is multiplied by the execution factor to serve as the actual enhancement weight for that pixel, thereby achieving adaptive enhancement for different textured regions. Based on the contrast stretching, a sharpening result controlled by the edge sharpening intensity is superimposed. This sharpening operation is independent of local statistics and is applied directly to the image to enhance the edge clarity of lesion areas. By performing contrast stretching on each pixel and superimposing the sharpening result controlled by the edge sharpening intensity, an enhanced image is obtained. In this image, the lesion area has been enhanced, while the background area has not undergone any enhancement operation and retains its original pixel values.
[0048] As a specific implementation of noise suppression, based on the second type of parameters (including the Gaussian smoothing standard deviation) and using a soft mask image to determine the background region, spatial adaptive Gaussian smoothing filtering is performed: for the background region of the sample image, Gaussian smoothing filtering is applied, with the smoothing intensity controlled by the Gaussian smoothing standard deviation, to effectively suppress background noise and subtle textures; for the lesion region of the sample image, no smoothing is performed, and the original pixel value at that location is directly retained to ensure that the lesion details are not blurred, thus obtaining a smoothed image. In this image, the background region has been smoothed and suppressed, while the lesion region retains its original clarity.
[0049] The two processing results are then fused pixel-wise using corresponding soft mask images. The enhanced image and the smoothed image are fused pixel-wise with the soft mask image as the weight to obtain the intermediate enhanced image. Specifically, the enhanced image and the smoothed image are fused pixel-wise using the soft mask image: for background regions (which have low mask values on the soft mask image), the smoothed image has a higher weight to suppress noise; for lesion regions (which have high mask values on the soft mask image), the enhanced image has a higher weight to preserve lesion details; for transition regions, the two are fused according to confidence level to achieve a natural transition.
[0050] When calculating the enhancement quality of the intermediate enhanced image, the soft mask image corresponding to the sample image is used as a guide to obtain the single-sample quality assessment value. In this embodiment, the single-sample quality assessment value is defined as the weighted sum of two sub-indicators: 1. Weighted Local Contrast (WLC): On the intermediate enhanced image, the local contrast of each pixel is calculated (e.g., the standard deviation of pixel values within a local window centered on that pixel). Then, using the pixel values of the soft mask image of the corresponding sample image as weights, the local contrast of all pixel locations is weighted and averaged to obtain the weighted local contrast index. This index is used to quantify the degree to which lesion areas are highlighted; a higher WLC value indicates a stronger visual salience of the lesion area after enhancement.
[0051] 2. Region Separation (RS): Based on the pixel values of the soft mask image corresponding to the sample image, the intermediate enhanced image is divided into Region 1 (corresponding to a high mask value) and Region 2 (corresponding to a low mask value). The average grayscale value of the pixels in each of these two regions is calculated, and the absolute value of the difference between the two is taken as the region separation. This metric is used to quantify the grayscale separability between the lesion region and the background region. The larger the RS value, the more obvious the distinction between the lesion region and the background region after enhancement processing.
[0052] The single-sample quality assessment value is obtained by weighted summation of the two sub-indicators mentioned above, such as single-sample quality assessment value = 0.7 × WLC + 0.3 × RS. The larger the single-sample quality assessment value, the better the enhancement effect of the current control parameter set on the single-sample image.
[0053] Furthermore, to further ensure the fidelity of the enhancement process for the background region, a structural fidelity constraint term can be introduced when calculating the single-sample quality assessment value. Specifically, the structural similarity measure (SSIM) of the background region (determined based on low-confidence pixels in the soft mask image) in the sample images before and after enhancement is calculated. If this value is lower than a preset structural fidelity threshold, it indicates that the enhancement process has caused excessive alteration to the normal anatomical structure of the background region. In this case, a penalty value related to the degree of deviation is deducted from the single-sample quality assessment value, thereby guiding the optimization process to improve the visual salience of the lesion while maintaining the anatomical realism of the background region as much as possible.
[0054] The quality feedback value Q is obtained by comprehensively processing at least one single-sample quality assessment value. It is used to quantify the enhancement effect of the current control parameter set P_current on at least one sample image and to provide a basis for subsequent parameter adjustments.
[0055] After step 103, it is determined whether the current state meets the preset stop condition. If the preset stop condition is not met, step 104 is executed. If the preset stop condition is met, step 105 is executed.
[0056] Step 104: In response to the current state not meeting the preset stop condition, with the goal of optimizing the quality feedback value Q, adjust the current control parameter set P_current to obtain the updated control parameter set P_update, and use the updated control parameter set P_update as the current control parameter set P_current, then return to step 103.
[0057] If the current state does not meet the preset stopping condition, it indicates that the enhancement effect of the current control parameter set P_current on the sample image has not met expectations and further optimization and adjustment are needed. The quality feedback value Q serves as the basis for subsequent parameter adjustments. The current control parameter set P_current is adjusted based on the quality feedback value Q. For example, with the goal of optimizing the quality feedback value Q, the parameter update increment is calculated, and the current control parameter set P_current is adjusted to obtain the updated control parameter set P_update. After obtaining the updated control parameter set P_update, it is used as the current control parameter set P_current, and the process returns to step 103 to continue enhancing the sample image based on the current control parameter set P_current (i.e., the updated control parameter set P_update), obtaining an intermediate enhanced image, evaluating the enhancement quality of the intermediate enhanced image, obtaining the quality feedback value Q, and identifying whether the current state meets the preset stopping condition. If the conditions are not met, proceed to step 104, adjust the current control parameter set P_current according to the quality feedback value Q to obtain the updated control parameter set P_update, and use the updated control parameter set P_update as the current control parameter set P_current. Return to step 103 to optimize the control parameter set by repeating the above operations. If the current state meets the preset stopping condition, proceed to step 105.
[0058] Step 105: In response to the current state satisfying the preset stop condition, determine the current control parameter set P_current as the target control parameter set P_opt.
[0059] If the current state meets the preset stopping condition, it indicates that the enhancement effect of the current control parameter set P_current on the sample image has met expectations. At this point, the iterative optimization of the control parameter set can be stopped, and the current control parameter set P_current is determined as the target control parameter set P_opt. The target control parameter set P_opt is the optimized control parameter set ultimately used for enhancing lesion areas and suppressing background areas in the medical image to be processed.
[0060] Step 106: Using the target control parameter set P_opt, perform lesion region enhancement processing and background region suppression processing on the medical image to be processed to obtain the enhanced image I_enhanced and the suppressed image I_suppressed.
[0061] After determining the target control parameter set P_opt, lesion region enhancement and background region suppression are performed on the medical image to be processed based on the target control parameter set P_opt. During enhancement, based on the first type of parameters in the target control parameter set P_opt (such as contrast gain coefficient and edge sharpening intensity), the same local contrast enhancement and edge sharpening operations as the aforementioned sample image enhancement are performed on the medical image to be processed, resulting in the enhanced image I_enhanced. During suppression, based on the second type of parameters in the target control parameter set P_opt (including Gaussian smoothing standard deviation) and the soft mask image of the medical image to be processed, Gaussian smoothing filtering is performed on the background region of the medical image to be processed, resulting in the suppressed image I_suppressed.
[0062] Step 107: Based on the soft mask image corresponding to the medical image to be processed, perform pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed to generate the final enhanced image I_final.
[0063] After obtaining the enhanced image I_enhanced and the suppressed image I_suppressed, for each pixel location in the medical image to be processed, the confidence value of that pixel location is obtained from the soft mask image corresponding to the medical image to be processed, the pixel value of that location is obtained from the enhanced image I_enhanced, and the pixel value of that location is obtained from the suppressed image I_suppressed. Based on the confidence value of that location and the pixel values obtained from I_enhanced and I_suppressed, pixel-level weighted fusion is performed to obtain the pixel value of that location in the final enhanced image. By calculating the pixel values of each pixel location in the medical image to be processed in the final enhanced image, the final enhanced image I_final is generated.
[0064] The aforementioned pixel-level weighted fusion mechanism takes the final pixel value from the enhanced image I_enhanced in the core area of the lesion to ensure high contrast and clear edges. In the background area, the final pixel value is mainly taken from the suppressed image I_suppressed to ensure uniform background and low noise. In the transition area between the lesion and the background, the final pixel value is a linear combination of I_enhanced and I_suppressed to achieve a natural and smooth transition from the lesion to the background and avoid harsh boundaries.
[0065] In the above embodiments of the present invention, a control parameter set including a first type of parameter and a second type of parameter is initialized to determine the current control parameter set. The sample image is then enhanced based on the current control parameter set to obtain an intermediate enhanced image. The enhancement quality of the intermediate enhanced image is evaluated to obtain a quality feedback value. If the current state does not meet a preset stopping condition, the current control parameter set is adjusted for iterative optimization. If the current state meets the preset stopping condition, the final target control parameter set is determined for subsequent enhancement processing of the medical image to be processed. Through this closed-loop optimization mechanism, the optimal control parameter set can be adaptively found, ensuring that the final applied parameters achieve stable and reliable enhancement effects on different medical images. After obtaining the target control parameter set and performing lesion perception processing on the medical image to be processed to generate a corresponding soft mask image, lesion region enhancement processing and background region suppression processing are performed on the medical image to be processed using the target control parameter set to obtain an enhanced image and a suppressed image. Based on the soft mask image corresponding to the medical image to be processed, pixel-level weighted fusion is performed on the enhanced image and the suppressed image to generate the final enhanced image. This fusion mechanism achieves seamless integration between the lesion area and the background area, enhancing the visual salience of the lesion while maintaining the anatomical realism and naturalness of the overall image.
[0066] The aforementioned implementation scheme is based on a cohesive whole comprised of precise soft mask image generation, closed-loop parameter optimization, differentiated processing of lesion and background regions, and probabilistic weighted fusion. The precise soft mask image, with its pixel-level continuous confidence, provides spatial guidance for differentiated processing and also provides a quantitative basis for quality assessment. The closed-loop optimization mechanism ensures that the processing parameters converge to the optimal state through an iterative process of parameter execution → effect evaluation → parameter adjustment. In each iteration, the higher the quality of the intermediate enhanced image, the more accurate the quality feedback value calculated based on that image, thus providing a more reliable basis for the next round of parameter optimization. This architecture fundamentally solves the dual dilemmas of rigid boundaries in traditional methods and the lack of transparency in deep learning, achieving a comprehensive improvement in accuracy, adaptability, and interpretability.
[0067] The following describes the implementation process for calculating the enhancement quality of intermediate enhanced images and obtaining a single-sample quality assessment value. In an optional embodiment of this application, for each intermediate enhanced image, the process of calculating the enhancement quality of the intermediate enhanced image and obtaining a single-sample quality assessment value based on the soft mask image of its corresponding sample image includes... Figure 3 The following steps are shown: Step 301: For each intermediate enhanced image, using the soft mask image of the corresponding sample image as the spatial weight, calculate the weighted information of the lesion region in the intermediate enhanced image. The weighted information includes weighted local contrast and / or weighted sharpness. Weighted local contrast is used to evaluate the degree of detail enhancement of the lesion region, and weighted sharpness is used to evaluate the sharpness of the edge of the lesion region.
[0068] After enhancing the sample image based on the current set of control parameters to obtain an intermediate enhanced image, the weighted information of the lesion region in the intermediate enhanced image is calculated using the soft mask image of the sample image as the spatial weight. The weighted information of the lesion region includes at least one of the following: weighted local contrast for evaluating the degree of detail enhancement of the lesion region, and weighted sharpness for evaluating the sharpness of the edges of the lesion region.
[0069] As a specific example, the process of calculating weighted local contrast is as follows: For each pixel location i in the intermediate enhanced image, a local window (e.g., 15×15 pixels) is taken centered on i, and the standard deviation σ(i) of the pixel values within this window is calculated as the local contrast of that pixel location. Using the pixel values of the soft mask image corresponding to the sample image as spatial weights, the local contrasts of all pixel locations are weighted and averaged to obtain the weighted local contrast.
[0070] The process of calculating weighted sharpness is as follows: For the intermediate enhanced image, calculate the sharpness value at each pixel location i. Commonly used sharpness metrics include: gradient magnitude, Laplacian value, and local standard deviation. Using the pixel values of the soft mask image corresponding to the sample image as spatial weights, the sharpness values at all pixel locations are weighted and averaged to obtain the weighted sharpness. Weighted sharpness reflects the intensity of grayscale changes within and at the boundaries of the lesion area. In the core area of the lesion, high sharpness indicates clear tissue structure; at the edge of the lesion, high sharpness indicates a distinct boundary.
[0071] It's important to note that while the calculation of weighted local contrast and weighted sharpness involves the entire image, by using the soft mask image as the spatial weight, the focus is actually on the lesion area, effectively suppressing the contribution of the background area. Weighted sharpness and weighted local contrast work synergistically; weighted local contrast focuses on the prominence of local textures, while weighted sharpness focuses on the clarity of edges. By maximizing weighted sharpness, the boundaries of the lesion area can be made sharper after enhancement, making it easier for doctors to observe the lesion's shape, outline, and relationship with surrounding tissues.
[0072] Step 302: For each intermediate enhanced image, calculate the separation degree between the pixel statistical features of the high-value region and the low-value region corresponding to the matched soft mask image. The high-value region is the region where the pixel value is greater than the first preset threshold, and the low-value region is the region where the pixel value is less than the second preset threshold. The high-value region corresponds to the lesion region, and the low-value region corresponds to the background region. The separation degree is used to evaluate the visual distinction between the lesion region and the background region.
[0073] The high-value region refers to the set of locations in the soft mask image where the pixel value is greater than the first preset threshold. The region in the intermediate enhanced image corresponding to this set is the lesion region. The low-value region refers to the set of locations in the soft mask image where the pixel value is less than the second preset threshold. The region in the intermediate enhanced image corresponding to this set is the background region.
[0074] The process of calculating the separation degree is as follows: Based on the soft mask image corresponding to the intermediate enhanced image, the intermediate enhanced image is divided into two regions: a high-confidence lesion region and a low-confidence background region. The high-confidence lesion region is the area on the intermediate enhanced image corresponding to pixels in the soft mask image with pixel values greater than a first preset threshold (e.g., 0.7), and this region represents the lesion region. The low-confidence background region is formed by the positions on the intermediate enhanced image corresponding to pixels in the soft mask image with pixel values less than a second preset threshold (e.g., 0.3), and this region represents the background region. The average grayscale value of pixels in these two regions on the intermediate enhanced image is calculated respectively, and the region separation degree is calculated based on the absolute value of the difference between the two. This index is used to evaluate the grayscale separability between the lesion region and the background region. The larger the index, the more obvious the difference in overall grayscale level between the lesion and the background after enhancement processing, and the easier it is for visual identification.
[0075] Step 303: Generate a single-sample quality assessment value based on weighted information and / or separation degree, wherein the single-sample quality assessment value is used to quantify the processing effect of the current control parameter set P_current on the single-sample image.
[0076] Steps 301 and 302 evaluate the enhancement quality of the intermediate enhanced image from different dimensions. They are logically independent and can be selected for execution based on actual evaluation needs. When calculating the single-sample quality evaluation value of the intermediate enhanced image, at least one of weighted information and separation can be used. Specifically, this includes the following cases: Scenario 1: Use weighted information as a single sample quality assessment value (step 302 can be omitted in this case). Weighted information can be generated based on at least one of weighted local contrast and weighted sharpness. If only a single indicator is used, then the indicator is directly used as the weighted information; if both weighted local contrast and weighted sharpness are used, then the two are weighted and summed to obtain the comprehensive weighted information.
[0077] Scenario 2: Use the separation degree as the single-sample quality assessment value (step 301 can be omitted in this case). In this case, the calculated separation degree is directly used as the single-sample quality assessment value.
[0078] Scenario 3: A single-sample quality assessment value is generated based on weighted information and separation. In this case, the weighted information and separation are summed in a weighted manner to obtain a comprehensive single-sample quality assessment value.
[0079] The single-sample quality assessment value quantifies the enhancement effect of the current set of control parameters on a single image; a higher single-sample quality assessment value indicates a better enhancement effect. As a specific example, the single-sample quality assessment value is generated by a linear weighted combination of weighted local contrast and separation. Where, single-sample quality assessment value = α Weighted local contrast + β Separation, α and β are preset weighting coefficients used to balance the prominence of local details with the separation of overall contrast. For example, α=0.6 and β=0.4.
[0080] It should be noted that, in order to further ensure the fidelity of the enhancement processing to the background region, a structural fidelity constraint term can be introduced when calculating the single-sample quality assessment value, as described above, and will not be elaborated further here.
[0081] In the above implementation scheme, for the intermediate enhanced image, the weighted information of the lesion region and / or the separation degree between the lesion region and the background region are calculated. Based on the weighted information and / or the separation degree, a single sample quality assessment value is generated to quantify the enhancement effect of the current control parameter set on the single sample image, and to provide an adjustment basis for the iterative optimization of the control parameter set.
[0082] The following describes the implementation process of adjusting the current control parameter set based on the quality feedback value. When adjusting the current control parameter set P_current with the goal of optimizing the quality feedback value Q to obtain the updated control parameter set P_update, this includes, for example... Figure 4 The following process is shown: Step 401: With the goal of maximizing the quality feedback value Q, the gradient optimization algorithm is used to calculate the gradient of the quality feedback value Q relative to each parameter in the current control parameter set P_current. The gradient indicates the adjustment direction and adjustment step size of each parameter.
[0083] Step 402: Update the current control parameter set P_current along the adjustment direction and adjustment step size indicated by the gradient, and generate the updated control parameter set P_update.
[0084] The following describes the implementation process of adjusting the current control parameter set based on the quality feedback value. When adjusting the current control parameter set P_current to obtain the updated control parameter set P_update with the goal of optimizing the quality feedback value Q, this embodiment uses a gradient optimization algorithm to achieve automatic parameter orientation adjustment. The specific process includes two stages: gradient calculation and parameter update.
[0085] Gradient Calculation Stage: The entire processing flow from parameter input to quality feedback value output can be regarded as a complex composite function, making it difficult to directly solve for the gradient. This embodiment uses the finite difference method to approximate the numerical gradient calculation. With the goal of maximizing the quality feedback value Q, for each parameter component in the current control parameter set (such as contrast gain coefficient, edge sharpening intensity, Gaussian smoothing standard deviation), the following operations are performed: 1. Apply a small positive perturbation Δ to the current parameter component, keeping other parameter components unchanged, to obtain the perturbed control parameter set; 2. Use the perturbed control parameter set to enhance at least one sample image, and calculate the corresponding quality feedback value (such as Q1) according to the aforementioned method (e.g., comprehensive processing of each single sample quality assessment value); 3. Calculate the gradient component of this parameter component, which is approximately (Q1 - Q) / Δ. Repeat the above process for all parameter components to obtain a complete gradient vector. This vector indicates the adjustment direction (positive or negative of the gradient) and the sensitivity of the adjustment (gradient magnitude), that is, the adjustment direction and adjustment step size of each parameter indicated by the gradient. The gradient vector indicates the direction in which the quality feedback value Q increases the fastest. In other words, the sign of the gradient indicates whether the parameter should be adjusted in the direction of increasing or decreasing to improve the Q value, and the magnitude of the gradient indicates the sensitivity of the parameter change to the effect of Q.
[0086] Parameter update phase: Based on the gradient ascent principle, the current control parameter set is updated. The updated control parameter set = current control parameter set + η The gradient vector, where η is the learning rate, is used to control the step size of parameter adjustment. In this embodiment, the learning rate is set to η = 0.05 for example. This update rule causes the parameters to be adjusted in the direction that increases the quality feedback value the fastest, that is, iterates in the direction of better enhancement effect.
[0087] Through the gradient optimization mechanism described above, the parameter space can be explored automatically and efficiently, gradually approaching the parameter combination that maximizes the enhancement effect of the lesion area, avoiding blind random search, and significantly improving optimization efficiency and convergence stability.
[0088] The following describes the conditions under which preset stopping conditions are met during the iterative optimization of the control parameter set. The preset stopping conditions include at least one of the following: The quality feedback value Q has reached the preset target threshold; The variation of the quality feedback value Q in consecutive preset rounds is lower than the preset variation threshold; The change in the control parameter set during consecutive preset rounds is lower than the preset parameter change threshold; The number of iterations has reached the preset maximum number of iterations.
[0089] During the optimization loop of the control parameter set, composite convergence conditions can be set. The following describes the conditions under which preset stopping conditions are met during the iterative optimization of the control parameter set. In this embodiment, the preset stopping conditions include at least one of the following, and the iteration process stops when any one of these conditions is met: 1. The quality feedback value Q reaches the preset target threshold. For example, when the quality feedback value Q exceeds a preset expected value (such as 0.95), it indicates that the enhancement effect has met the requirements, and the optimization iteration stops.
[0090] 2. The change in the quality feedback value Q over consecutive preset rounds is lower than a preset change threshold. Record the quality feedback value Q for consecutive iterations. If the relative change between two adjacent iterations is less than a change threshold (e.g., 0.5%), and this state is maintained for multiple consecutive iteration cycles (e.g., 3 times), then the quality index is determined to be stable, and the optimization iteration is stopped.
[0091] 3. The change in the control parameter set is lower than the preset parameter change threshold. Calculate the sum of the absolute values of the differences between all corresponding components of the current control parameter set and the previous control parameter set. If this sum is less than the preset parameter change threshold (e.g., 0.01) for multiple consecutive iterations (e.g., 3 consecutive iterations), it is determined that the parameters themselves are no longer being updated, and the optimization iteration is stopped.
[0092] 4. The number of iterations reaches the preset maximum number of iterations. When the number of iterations reaches the preset limit (e.g., 100 times), the loop is forcibly terminated to prevent it from getting stuck in an infinite loop or consuming too much computation time.
[0093] This multi-condition convergence judgment mechanism ensures the high efficiency of the iterative optimization process, enabling timely termination of iteration under different conditions to obtain the optimal set of control parameters that meet the requirements.
[0094] In an optional embodiment of the present invention, when performing lesion region enhancement processing and background region suppression processing on the medical image to be processed using the target control parameter set P_opt, it includes... Figure 5 The following steps are shown: Step 501: Based on the first type of parameters in the target control parameter set P_opt, perform local contrast enhancement and / or edge sharpening on the lesion region in the medical image to be processed. The lesion region is determined according to the number of pixels in the corresponding soft mask image that are greater than the first preset threshold.
[0095] Step 502: Based on the second type of parameters in the target control parameter set P_opt, perform noise suppression processing on the background region in the medical image to be processed. The background region is determined based on the number of pixels in the corresponding soft mask image that are less than the second preset threshold.
[0096] The specific implementation process of performing lesion region enhancement processing and background region suppression processing on the medical image to be processed (such as a lung CT image) using the target control parameter set P_opt is as follows: Lesion region enhancement stage: Based on the first type of parameters in the target control parameter set P_opt (including contrast gain coefficient and / or edge sharpening intensity), adaptive enhancement processing is performed on the lesion region in the medical image to be processed. The lesion region is determined according to the pixel location in the soft mask image corresponding to the medical image to be processed where the pixel value is greater than a first preset threshold (e.g., 0.7).
[0097] Taking the first type of parameters, which includes contrast gain coefficient and edge sharpening intensity, as an example, the following points are included when performing adaptive enhancement processing on lesion areas in medical images to be processed: 1. Local Contrast Enhancement: For each pixel within the lesion area, a local window (e.g., 15×15 pixels) is taken centered on that pixel, and the local mean and local standard deviation of the pixels within the window are calculated. Then, based on the contrast gain coefficient, the pixel is adaptively stretched. For example, the stretched pixel value = local mean + contrast gain coefficient × (original pixel - local mean). Wherein, when the original pixel is higher than the local mean, it is further brightened; when it is lower than the local mean, it is further darkened, thus amplifying local differences. The larger the contrast gain coefficient, the stronger the effect on local contrast enhancement, especially making previously inconspicuous low-contrast details (areas with small grayscale differences from the surrounding background) clearly discernible.
[0098] 2. Edge Sharpening: An unsharpened mask technique is used, with the sharpening intensity controlled by the edge sharpening strength, applied only to the lesion area. Specifically, the image content of the lesion area is first Gaussian blurred to obtain the low-frequency component. Then, the corresponding low-frequency component is subtracted from the original pixel value of the lesion area to extract high-frequency information. Finally, the high-frequency information is multiplied by the edge sharpening intensity and added back to the original pixel value of the lesion area. This operation makes the boundaries of the lesion area clearer and sharper, facilitating observation of the lesion morphology.
[0099] The enhancement operation described above is performed only on the lesion area; the pixel values of the background area remain unchanged. This results in the enhanced image I_enhanced, where the lesion area has been enhanced, and the background area retains its original pixel values.
[0100] Background region suppression processing stage: Based on the second type of parameters (including Gaussian smoothing standard deviation) in the target control parameter set P_opt, the background region in the medical image to be processed is subjected to smoothing filtering. The background region is determined according to the pixel positions in the soft mask image corresponding to the medical image to be processed where the pixel value is less than a second preset threshold (e.g., 0.3).
[0101] When suppressing background regions in medical images, the specific steps are as follows: Gaussian smoothing filter: Using the standard deviation of Gaussian smoothing as a parameter, a Gaussian filter is applied to the background area (determined based on the corresponding soft mask image). Gaussian smoothing filter suppresses the fine textures caused by noise or reconstruction algorithms, making the background area more uniform and reducing visual interference to lesion observation.
[0102] The above suppression operation is performed only on the background region; the pixel values of the lesion region remain unchanged. This results in the suppressed image I_suppressed, where the background region has been smoothed and suppressed, and the lesion region retains its original pixel values.
[0103] In the above implementation scheme, the lesion area in the medical image to be processed is locally contrast-enhanced and / or edge-sharpened to obtain an enhanced image. Background region suppression processing is then performed on the medical image to be processed to obtain a suppressed image. The two types of images obtained highlight the visual features of the lesion area and purify the background interference, respectively, providing a data foundation for subsequent pixel-level weighted fusion based on soft masks.
[0104] In another embodiment of the present invention, when performing pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed based on the soft mask image corresponding to the medical image to be processed, to generate the final enhanced image I_final, the following process is included: For each pixel position i in the enhanced image I_enhanced and the suppressed image I_suppressed, calculate the final pixel value I_final(i) based on the following formula, and generate the final enhanced image based on the final pixel value of each pixel position; I_final(i) = M(i) I_E(i) + (1 – M(i)) I_S(i) Where M(i) is the confidence level of the soft mask image corresponding to the medical image to be processed at pixel position i, I_E(i) is the pixel value of the enhanced image I_enhanced at pixel position i, and I_S(i) is the pixel value of the suppressed image I_suppressed at pixel position i.
[0105] The enhanced image I_enhanced is obtained by enhancing the lesion area; the suppressed image I_suppressed is obtained by suppressing the background area. The two images are exactly the same size, and each pixel position i has a corresponding pixel value in both images, denoted as I_E(i) and I_S(i) respectively.
[0106] For each pixel location i, obtain the confidence value M(i) of that location from the soft mask image, obtain the pixel value I_E(i) of that location from I_enhanced, obtain the pixel value I_S(i) of that location from I_suppressed, and calculate the pixel value of that location in the final enhanced image using the following formula: I_final(i) = M(i) I_E(i) + (1 – M(i)) I_S(i) After performing the above calculations on all pixel locations, the final enhanced image I_final is obtained. This fusion mechanism achieves an adaptive fusion effect where the lesion area is primarily enhanced, the background area is primarily suppressed, and the transition areas are smoothly connected.
[0107] Through the pixel-level weighted fusion mechanism based on soft mask images, the enhancement and suppression processes achieve strict local adaptation in the image: the lesion area is mainly enhanced to ensure clear details and sharp boundaries; the background area is mainly suppressed to ensure noise reduction and uniform texture; the transition area between the lesion and the background achieves a natural and smooth connection between the enhancement and suppression effects through continuous gradual changes in mask values, avoiding harsh visual boundaries.
[0108] As a specific example, the pixel-level fusion process described above is illustrated using the enhancement processing of a lung CT image. The medical image to be processed is an axial CT image of the lung. A corresponding soft mask image M has been generated using a lesion perception model, and the enhanced image I_enhanced and the suppressed image I_suppressed have been obtained based on the target control parameter set.
[0109] In the final image generation stage, the following fusion operation is performed for each pixel location i in the image: The confidence value M(i) for the pixel location is read from the soft mask image M. For example, M(i) is 0.65, indicating that there is a 65% confidence that the location belongs to a lesion. The pixel value I_E(i) for the pixel location is read from I_enhanced, and the pixel value I_S(i) for the pixel location is read from I_suppressed. Then, the pixel value of the pixel location in the final enhanced image = 0.65 × I_E(i) + 0.35 × I_S(i). After performing the above calculations for all pixel locations, the final enhanced image is obtained.
[0110] In the above implementation scheme, the confidence level in the soft mask image is used as the weight. Pixel values are extracted from the enhanced image and the suppressed image and then weighted at the pixel level for fusion. This can achieve a smooth transition between the enhancement and suppression effects, ensuring that the final enhanced image highlights the lesion details while maintaining the naturalness and realism of the background, thereby improving the overall visual quality and diagnostic reliability of the image.
[0111] The above embodiments are merely specific implementations of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
[0112] This invention also provides a medical image local enhancement system, such as... Figure 6 As shown, it includes: The generation module 61 is used to perform lesion perception processing on the medical image to be processed and generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence that the corresponding position belongs to the lesion. The first processing module 62 is used to initialize the control parameter set P0 and use the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameters for enhancing the lesion area and a second type of parameters for suppressing the background area. The second processing module 63 is used to perform enhancement processing on the sample image according to the current control parameter set P_current to obtain an intermediate enhanced image, and evaluate the enhancement quality of the intermediate enhanced image based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q. The adjustment control module 64 is used to adjust the current control parameter set P_current in response to the current state not meeting the preset stop condition, with the goal of optimizing the quality feedback value Q, to obtain an updated control parameter set P_update, and to use the updated control parameter set P_update as the current control parameter set P_current, and to control the second processing module 63 to continue to perform enhancement processing on the sample image according to the current control parameter set P_current; The determination module 65 is used to determine the current control parameter set P_current as the target control parameter set P_opt in response to the current state meeting the preset stop condition; The processing and acquisition module 66 is used to perform lesion region enhancement processing and background region suppression processing on the medical image to be processed using the target control parameter set P_opt, to obtain the enhanced image I_enhanced and the suppressed image I_suppressed. The fusion generation module 67 is used to perform pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed based on the soft mask image corresponding to the medical image to be processed, and generate the final enhanced image I_final.
[0113] Optionally, the first processing module includes: The acquisition submodule is used to acquire the soft mask image corresponding to the sample image; The generation submodule is used to generate initial values for the first type of parameters and the second type of parameters based on the pixel distribution features of the soft mask image corresponding to the sample image, so as to obtain the initialized control parameter set P0. The number of sample images is at least one, and the pixel distribution feature is the statistical aggregation feature of at least one soft mask image corresponding to at least one sample image.
[0114] Optionally, the second processing module includes: The processing and acquisition submodule is used to perform enhancement processing on at least one sample image according to the current control parameter set P_current, and obtain at least one corresponding intermediate enhanced image; The calculation submodule is used to calculate the enhancement quality of each intermediate enhanced image based on the soft mask image of its corresponding sample image, and obtain a single sample quality evaluation value. The processing and generation submodule is used to comprehensively process at least one single-sample quality assessment value corresponding to the at least one intermediate enhanced image to generate the quality feedback value Q.
[0115] Optionally, the computing submodule includes: The first computing unit is configured to, for each intermediate enhanced image, calculate weighted information of the lesion region in the intermediate enhanced image, using the soft mask image of the corresponding sample image as spatial weights. The weighted information includes weighted local contrast and / or weighted sharpness. The weighted contrast is used to evaluate the degree of detail enhancement in the lesion region, and the weighted sharpness is used to evaluate the sharpness of the edges of the lesion region; and / or The second calculation unit is used to calculate, for each intermediate enhanced image, the separation degree between the pixel statistical features of the high-value region and the low-value region corresponding to the matched soft mask image. The high-value region is the region where the pixel value is greater than a first preset threshold, and the low-value region is the region where the pixel value is less than a second preset threshold. The high-value region corresponds to the lesion region, and the low-value region corresponds to the background region. The separation degree is used to evaluate the visual distinction between the lesion region and the background region. The single-sample quality assessment value is generated based on the weighted information and / or the separation degree, and is used to quantify the processing effect of the current control parameter set P_current on the single-sample image.
[0116] Optionally, the adjustment control module includes: The calculation generation submodule is used to calculate the gradient of the quality feedback value Q relative to each parameter in the current control parameter set P_current with the goal of maximizing the quality feedback value Q, using a gradient optimization algorithm. The gradient indicates the adjustment direction and adjustment step size of each parameter. The adjustment generation submodule is used to update the current control parameter set P_current along the adjustment direction and adjustment step size indicated by the gradient, and generate the updated control parameter set P_update.
[0117] Optionally, the preset stop condition includes at least one of the following: The quality feedback value Q reaches the preset target threshold; The variation of the quality feedback value Q in consecutive preset rounds is lower than a preset variation threshold. The variation range of the control parameter set in consecutive preset rounds is lower than the preset parameter variation threshold; The number of iterations has reached the preset maximum number of iterations.
[0118] Optionally, the processing and acquisition module includes: The first processing submodule is used to perform local contrast enhancement and / or edge sharpening on the lesion region in the medical image to be processed based on the first type of parameters in the target control parameter set P_opt. The lesion region is determined according to the number of pixels in the corresponding soft mask image that are greater than a first preset threshold. The second processing submodule is used to perform noise suppression processing on the background region of the medical image to be processed based on the second type of parameters in the target control parameter set P_opt. The background region is determined according to the number of pixels in the corresponding soft mask image that are less than a second preset threshold.
[0119] Optionally, the generation module includes: The input submodule is used to input the medical image to be processed into the lesion perception model. The lesion perception model is constructed using a deep learning-based image segmentation network, and the image segmentation network adopts an encoder-decoder structure. The extraction submodule is used to extract multi-scale features from the medical image to be processed input to the lesion perception model through the encoder to obtain a multi-scale feature map; The output submodule is used to perform weighted fusion of the multi-scale feature maps through the decoder with integrated attention mechanism to generate a fused feature map, and to process the fused feature map to output a soft mask image with the same resolution as the input medical image to be processed.
[0120] Optionally, the fusion generation module is further configured to: For each pixel position i in the enhanced image I_enhanced and the suppressed image I_suppressed, the final pixel value I_final(i) is calculated based on the following formula, and the final enhanced image is generated based on the final pixel value of each pixel position. I_final(i) = M(i) I_E(i) + (1 – M(i)) I_S(i) Where M(i) is the confidence level of the soft mask image corresponding to the medical image to be processed at pixel position i, I_E(i) is the pixel value of the enhanced image I_enhanced at pixel position i, and I_S(i) is the pixel value of the suppressed image I_suppressed at pixel position i.
[0121] As the system implementation is basically similar to the method implementation, it is described in a relatively simple way. For relevant details, please refer to the description of the method implementation.
[0122] In one possible design, the above Figure 6 The medical image local enhancement system shown can be implemented as an electronic device, such as... Figure 7As shown, the electronic device may include: a memory 71, a processor 72, and a communication interface 73. The memory 71 stores executable code, which, when executed by the processor 72, enables the processor 72 to at least implement the medical image local enhancement method provided in the foregoing embodiments.
[0123] In addition, embodiments of the present invention provide a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, enables the processor to at least implement the medical image local enhancement method provided in the foregoing embodiments.
[0124] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of a necessary general-purpose hardware platform, or by a combination of hardware and software. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for local enhancement of medical images, characterized in that, include: The medical image to be processed is subjected to lesion perception processing to generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence that the corresponding position belongs to a lesion. Initialize the control parameter set P0 and set the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameter for enhancing the lesion area and a second type of parameter for suppressing the background area. The sample image is enhanced according to the current control parameter set P_current to obtain an intermediate enhanced image, and the enhancement quality of the intermediate enhanced image is evaluated based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q. In response to the current state not meeting the preset stopping condition, with the goal of optimizing the quality feedback value Q, the current control parameter set P_current is adjusted to obtain an updated control parameter set P_update, and the updated control parameter set P_update is used as the current control parameter set P_current, and the step of enhancing the sample image according to the current control parameter set P_current is returned. In response to the current state satisfying the preset stop condition, the current control parameter set P_current is determined as the target control parameter set P_opt; Using the target control parameter set P_opt, the medical image to be processed is subjected to lesion region enhancement processing and background region suppression processing to obtain the enhanced image I_enhanced and the suppressed image I_suppressed. Based on the soft mask image corresponding to the medical image to be processed, the enhanced image I_enhanced and the suppressed image I_suppressed are fused at the pixel level to generate the final enhanced image I_final.
2. The method according to claim 1, characterized in that, The initialization control parameter set P0 includes: Obtain the soft mask image corresponding to the sample image; Based on the pixel distribution features of the soft mask image corresponding to the sample image, initial values of the first type of parameters and the second type of parameters are generated to obtain the initialized control parameter set P0. The number of sample images is at least one, and the pixel distribution feature is the statistical aggregation feature of at least one soft mask image corresponding to at least one sample image.
3. The method according to claim 2, characterized in that, The step of enhancing the sample image according to the current control parameter set P_current to obtain an intermediate enhanced image, and evaluating the enhancement quality of the intermediate enhanced image based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q, includes: At least one sample image is enhanced according to the current control parameter set P_current to obtain at least one corresponding intermediate enhanced image; For each intermediate enhanced image, the enhancement quality of the intermediate enhanced image is calculated based on the soft mask image of its corresponding sample image, and a single sample quality evaluation value is obtained. The quality feedback value Q is generated by comprehensively processing at least one single-sample quality assessment value corresponding to the at least one intermediate enhanced image.
4. The method according to claim 3, characterized in that, For each intermediate enhanced image, based on the soft mask image of its corresponding sample image, the enhancement quality of the intermediate enhanced image is calculated to obtain a single-sample quality evaluation value, including: For each intermediate enhanced image, using the soft mask image of the corresponding sample image as spatial weights, weighted information of the lesion region in the intermediate enhanced image is calculated. This weighted information includes weighted local contrast and / or weighted sharpness. The weighted local contrast is used to evaluate the degree of detail enhancement in the lesion region, and the weighted sharpness is used to evaluate the sharpness of the edges of the lesion region; and / or For each intermediate enhanced image, the separation degree between the pixel statistical features of the high-value region and the low-value region corresponding to the matched soft mask image is calculated. The high-value region is the region where the pixel value is greater than a first preset threshold, and the low-value region is the region where the pixel value is less than a second preset threshold. The high-value region corresponds to the lesion region, and the low-value region corresponds to the background region. The separation degree is used to evaluate the visual distinction between the lesion region and the background region. The single-sample quality assessment value is generated based on the weighted information and / or the separation degree, and is used to quantify the processing effect of the current control parameter set P_current on the single-sample image.
5. The method according to claim 1, characterized in that, The step of adjusting the current control parameter set P_current to obtain the updated control parameter set P_update, with the goal of optimizing the quality feedback value Q, includes: With the goal of maximizing the quality feedback value Q, a gradient optimization algorithm is used to calculate the gradient of the quality feedback value Q relative to each parameter in the current control parameter set P_current. The gradient indicates the adjustment direction and adjustment step size of each parameter. The current control parameter set P_current is updated along the adjustment direction and adjustment step size indicated by the gradient, generating the updated control parameter set P_update.
6. The method according to claim 1, characterized in that, The preset stop condition includes at least one of the following: The quality feedback value Q reaches the preset target threshold; The variation of the quality feedback value Q in consecutive preset rounds is lower than a preset variation threshold. The variation range of the control parameter set in consecutive preset rounds is lower than the preset parameter variation threshold; The number of iterations has reached the preset maximum number of iterations.
7. The method according to any one of claims 1 to 6, characterized in that, The step of performing lesion region enhancement processing and background region suppression processing on the medical image to be processed using the target control parameter set P_opt includes: Based on the first type of parameters in the target control parameter set P_opt, local contrast enhancement and / or edge sharpening are performed on the lesion region in the medical image to be processed. The lesion region is determined according to the number of pixels in the corresponding soft mask image that are greater than a first preset threshold. Based on the second type of parameters in the target control parameter set P_opt, noise suppression processing is performed on the background region of the medical image to be processed. The background region is determined according to the number of pixels in the corresponding soft mask image that are less than a second preset threshold.
8. The method according to claim 1, characterized in that, The step of performing lesion perception processing on the medical image to be processed to generate a soft mask image containing lesion probability information includes: The medical image to be processed is input into the lesion perception model, which is constructed using a deep learning-based image segmentation network, and the image segmentation network adopts an encoder-decoder structure. The encoder extracts multi-scale features from the medical image to be processed, which is input into the lesion perception model, to obtain a multi-scale feature map. The decoder, which integrates an attention mechanism, performs weighted fusion of the multi-scale feature maps to generate a fused feature map, and processes the fused feature map to output a soft mask image with the same resolution as the input medical image to be processed.
9. The method according to claim 1, characterized in that, The step of performing pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed based on the soft mask image corresponding to the medical image to be processed, to generate the final enhanced image I_final, includes: For each pixel position i in the enhanced image I_enhanced and the suppressed image I_suppressed, the final pixel value I_final(i) is calculated based on the following formula, and the final enhanced image is generated based on the final pixel value of each pixel position. I_final(i)= M(i) I_E(i)+ (1 – M(i)) I_S(i) Where M(i) is the confidence level of the soft mask image corresponding to the medical image to be processed at pixel position i, I_E(i) is the pixel value of the enhanced image I_enhanced at pixel position i, and I_S(i) is the pixel value of the suppressed image I_suppressed at pixel position i.
10. A medical image local enhancement system, characterized in that, include: The generation module is used to perform lesion perception processing on the medical image to be processed, and generate a soft mask image containing lesion probability information. The pixel value of the soft mask image indicates the confidence that the corresponding position belongs to the lesion. The first processing module is used to initialize the control parameter set P0 and use the control parameter set P0 as the current control parameter set P_current. The control parameter set P0 includes a first type of parameters for enhancing the lesion area and a second type of parameters for suppressing the background area. The second processing module is used to perform enhancement processing on the sample image according to the current control parameter set P_current to obtain an intermediate enhanced image, and evaluate the enhancement quality of the intermediate enhanced image based on the soft mask image corresponding to the sample image to obtain a quality feedback value Q. The adjustment control module is used to respond to the current state not meeting the preset stop condition, with the goal of optimizing the quality feedback value Q, to adjust the current control parameter set P_current to obtain an updated control parameter set P_update, and to use the updated control parameter set P_update as the current control parameter set P_current, and to control the second processing module to continue to perform enhancement processing on the sample image according to the current control parameter set P_current; The determination module is used to determine the current control parameter set P_current as the target control parameter set P_opt in response to the current state meeting the preset stop condition; The processing and acquisition module is used to perform lesion region enhancement processing and background region suppression processing on the medical image to be processed using the target control parameter set P_opt, to obtain the enhanced image I_enhanced and the suppressed image I_suppressed. The fusion generation module is used to perform pixel-level weighted fusion of the enhanced image I_enhanced and the suppressed image I_suppressed based on the soft mask image corresponding to the medical image to be processed, to generate the final enhanced image I_final.