Color compensation method for assisted diagnosis and treatment of color blindness

By integrating Transformer and channel attention mechanism ECA in the diffusion model and adopting a jump sampling strategy, the color nature and computational complexity problems of the color compensation method in the existing technology are solved, and more efficient color feature extraction and more realistic color experience are achieved.

CN119887600APending Publication Date: 2025-04-25FUJIAN PROVINCIAL HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411955417.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing color compensation methods have shortcomings in color nature and computational complexity, and it is difficult to effectively improve the color experience of color blind patients.

Method used

The color blind-friendly image color compensation method based on diffusion model is adopted, and the color feature extraction ability is improved by integrating Transformer and channel attention mechanism ECA, and the model's inference efficiency is optimized through jump sampling strategy.

Benefits of technology

It significantly improves the recovery ability of color details, improves color contrast and visual nature, provides color blind patients with more realistic color experience, and improves the performance of color reconstruction technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887600A_ABST
    Figure CN119887600A_ABST
Patent Text Reader

Abstract

The invention provides a color compensation method for auxiliary diagnosis and treatment of color blindness. The method comprises the following steps: S1, constructing a color blindness friendly image color compensation model CFIR based on a diffusion model; s2, completing the training of a color-blindness friendly image color compensation model by using the color-blindness friendly image color compensation data set; s3, performing color reconstruction on the original image through the trained color blindness friendly image color compensation model, and generating an enhanced image conforming to the visual perception of a color blindness user; according to the method, by fusing Transform and a channel attention mechanism ECA, the color feature extraction capability is effectively improved, and the reasoning efficiency of the model is optimized through a jump sampling strategy. According to the method, color details can be better restored, the color contrast and the visual naturalness are improved, more vivid color experience is provided for color blindness patients, the blank and defects in the prior art can be made up, and the performance of the color reconstruction technology is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image quality enhancement, and in particular to a color compensation method for color blindness auxiliary diagnosis and treatment. Background Art

[0002] In recent years, the rapid development of multimedia technology has significantly improved the quality of visual experience. However, due to color vision defects, color blind patients have difficulty perceiving specific colors normally, which affects their daily life and visual experience. Existing color compensation methods are mainly divided into traditional methods and deep learning methods, but they have problems such as poor color naturalness and complex model calculation. The diffusion model has good generation stability and efficient computing performance in the field of image generation. Although it is widely used in image generation, its application in image enhancement for color blind patients is not yet mature. Summary of the invention

[0003] This paper proposes a color compensation method for color blindness auxiliary diagnosis and treatment. By integrating Transformer and channel attention mechanism ECA, the color feature extraction capability is effectively improved, and the reasoning efficiency of the model is optimized through the jump sampling strategy. This method can better restore color details, improve color contrast and visual naturalness, provide color blind patients with a more realistic color experience, make up for the gaps and deficiencies of existing technologies, and further improve the performance of color reconstruction technology.

[0004] The present invention adopts the following technical solutions.

[0005] A color compensation method for color blindness auxiliary diagnosis and treatment, comprising the following steps:

[0006] Step S1, constructing a color blindness friendly image color compensation model CFIR based on a diffusion model;

[0007] Step S2, using the color blindness-friendly image color compensation dataset to complete the training of the color blindness-friendly image color compensation model;

[0008] Step S3: reconstruct the color of the original image using the trained color blindness-friendly image color compensation model to generate an enhanced image that meets the visual perception of color blind users.

[0009] The method adopts a color blindness-friendly image color compensation method and system based on a diffusion model, improves the color feature extraction capability by fusing Transformer with the channel attention mechanism ECA, and optimizes the inference efficiency of the model through a skip sampling strategy to better restore color details, improve color contrast and visual naturalness, and enhance the realism of color experience for color blind patients.

[0010] The construction of the CFIR model specifically includes the following steps:

[0011] Step S11, constructing a forward diffusion process: In the forward diffusion process, assuming that the target image is a color blind patient-friendly image, its data distribution is x0~q(x0), and by gradually adding Gaussian noise, a series of degraded images x1, x2, ..., x T The scale of the noise added at each step is determined by the hyperparameter β t Control, β t It gradually increases with the increase of time t;

[0012] Specifically, the diffusion transfer equation for each step is shown below:

[0013]

[0014] x t is the image at time step t, β t represents the noise scale of this step, represents a normal distribution; in addition, based on the Markov chain and iterative relationship, x can be t To sample:

[0015]

[0016] in

[0017] Step S12, constructing a reverse denoising process: gradually removing noise from the noisy image through the conditional diffusion model to generate a color compensation image that meets the needs of color blind patients; the process first converts the noisy image x t The input image is concatenated with the conditional information c and then input into the network; the initial convolutional layer extracts preliminary features from the input image to obtain a high-dimensional feature representation; in order to better capture the information that changes over time during the diffusion process, the model embeds the diffusion time step t at different stages of feature extraction; at the same time, the Transformer-ECA module is combined with the subsequent U-Net architecture denoising network to enhance the extraction of key color features through the channel self-attention mechanism; in addition, in order to improve the denoising efficiency, the process adopts a jump sampling strategy to dynamically adjust the sampling time step to ensure efficient color restoration and enhancement effects while reducing the amount of calculation.

[0018] The Transformer-ECA module specifically performs the following steps: the Transformer-ECA module first performs convolution processing on the input image to extract preliminary high-dimensional features, and embeds time step information in the feature extraction process so that the model can dynamically adapt to changes in the diffusion process; then, the module processes the normalized feature map through the channel self-attention mechanism: the global feature representation of each channel is obtained through global average pooling, the channel attention weight is generated using one-dimensional convolution, and the important channels are activated and weighted by the sigmoid activation function to enhance the ability to capture key color features; then, the adjusted features are further extracted through a feedforward network to further extract deep information, and finally generate a feature representation with higher expressiveness, while maintaining computational efficiency while enhancing the color restoration effect, so that the model can better meet the color perception needs of color-blind users.

[0019] The jump sampling strategy specifically performs the following steps: the jump sampling strategy first generates multiple time step combinations by randomly initializing a population, each combination contains ten integers, and these integers represent the denoising time steps in the reverse diffusion process; reverse reasoning is performed using these time steps as denoising time points to generate a series of denoised images, and the peak signal-to-noise ratio value PSNR is calculated by comparing with the original image. The higher the PSNR, the better the denoising effect of the combination, and its PSNR value is used as the fitness value of the sampling combination; then, the strategy draws on the natural selection mechanism in the genetic algorithm to select a time step combination with high fitness for crossover and mutation operations to generate a new combination; the crossover operation simulates gene recombination by exchanging some elements in the two combinations to generate a new sampling sequence; the mutation operation simulates the mutation process in biological evolution by randomly changing some elements in the combination, thereby improving the population diversity and avoiding falling into the local optimum; after multiple iterations, the population gradually converges, and finally outputs the time step combination with the highest fitness as the optimal solution for jump sampling.

[0020] The step S2 trains the model by minimizing the loss function to ensure that the generated enhanced image that meets the visual perception of the color blind user is consistent with the target visual characteristics, which can be expressed as:

[0021]

[0022] where ∈ θ represents the noise predicted by the network, ∈ represents the noise actually added to the target image, t represents the time step, and c represents the conditional information, that is, the original image that is not easily distinguished by color blindness without color compensation.

[0023] The method includes the use of the following modules:

[0024] CFIR model building module, used to build a color blindness-friendly image color compensation model based on a diffusion model to achieve image color reconstruction;

[0025] A data set training module, used to train the CFIR model using a color blindness-friendly image color compensation data set to adapt it to the visual needs of color blind patients;

[0026] The color reconstruction module is used to input the original image into the trained CFIR model to generate an enhanced image that meets the perception of color-blind users;

[0027] The quality evaluation module is used to evaluate the color effect and visual quality of the enhanced image based on the evaluation indicators of peak signal-to-noise ratio PSNR, structural similarity SSIM, mean square error MSE and color difference CD.

[0028] The color compensation method compensates for colors that are difficult for color-blind patients to identify.

[0029] The method is executed based on an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When executing the program, the processor can implement various steps of the color compensation method for auxiliary diagnosis and treatment of color blindness.

[0030] The memory is a non-transitory computer-readable storage medium.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] The present invention achieves higher-precision capture and restoration of color features by integrating the Transformer-ECA module in the U-Net structure. The Transformer-ECA module uses the channel self-attention mechanism to enable the model to pay more attention to key color channels, significantly improving the color restoration effect, especially showing better color compensation effects for colors that are difficult for color blind patients to distinguish. In addition, the present invention introduces a jump sampling strategy, optimizes the time step selection of the denoising process, and reduces the amount of calculation, thereby improving the model reasoning efficiency while maintaining high-quality color restoration, and has better performance than the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0034] Attached Figure 1 It is a schematic diagram of the overall structure of the model of the embodiment of the present invention;

[0035] Attached Figure 2 is a schematic diagram of a Transformer-ECA module according to an embodiment of the present invention;

[0036] Attached Figure 3 It is a schematic diagram of the skip sampling strategy flow in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] As shown in the figure, a color compensation method for color blindness auxiliary diagnosis and treatment includes the following steps:

[0038] Step S1, constructing a color blindness friendly image color compensation model CFIR based on a diffusion model;

[0039] Step S2, using the color blindness-friendly image color compensation dataset to complete the training of the color blindness-friendly image color compensation model;

[0040] Step S3: reconstruct the color of the original image using the trained color blindness-friendly image color compensation model to generate an enhanced image that meets the visual perception of color blind users.

[0041] The method adopts a color blindness-friendly image color compensation method and system based on a diffusion model, improves the color feature extraction capability by fusing Transformer with the channel attention mechanism ECA, and optimizes the inference efficiency of the model through a skip sampling strategy to better restore color details, improve color contrast and visual naturalness, and enhance the realism of color experience for color blind patients.

[0042] The construction of the CFIR model specifically includes the following steps:

[0043] Step S11, constructing a forward diffusion process: In the forward diffusion process, assuming that the target image is a color blind patient-friendly image, its data distribution is x0~q(x0), and by gradually adding Gaussian noise, a series of degraded images x1, x2, ..., x T The scale of the noise added at each step is determined by the hyperparameter β t Control, β t It gradually increases with the increase of time t;

[0044] Specifically, the diffusion transfer equation for each step is shown below:

[0045]

[0046] x t is the image at time step t, β t represents the noise scale of this step, represents a normal distribution; in addition, based on the Markov chain and iterative relationship, x can be t To sample:

[0047]

[0048] in

[0049] Step S12, constructing a reverse denoising process: gradually removing noise from the noisy image through the conditional diffusion model to generate a color compensation image that meets the needs of color blind patients; the process first converts the noisy image x t The input image is concatenated with the conditional information c and then input into the network; the initial convolutional layer extracts preliminary features from the input image to obtain a high-dimensional feature representation; in order to better capture the information that changes over time during the diffusion process, the model embeds the diffusion time step t at different stages of feature extraction; at the same time, the Transformer-ECA module is combined with the subsequent U-Net architecture denoising network to enhance the extraction of key color features through the channel self-attention mechanism; in addition, in order to improve the denoising efficiency, the process adopts a jump sampling strategy to dynamically adjust the sampling time step to ensure efficient color restoration and enhancement effects while reducing the amount of calculation.

[0050] The Transformer-ECA module specifically performs the following steps: the Transformer-ECA module first performs convolution processing on the input image to extract preliminary high-dimensional features, and embeds time step information in the feature extraction process so that the model can dynamically adapt to changes in the diffusion process; then, the module processes the normalized feature map through the channel self-attention mechanism: the global feature representation of each channel is obtained through global average pooling, the channel attention weight is generated using one-dimensional convolution, and the important channels are activated and weighted by the sigmoid activation function to enhance the ability to capture key color features; then, the adjusted features are further extracted through a feedforward network to further extract deep information, and finally generate a feature representation with higher expressiveness, while maintaining computational efficiency while enhancing the color restoration effect, so that the model can better meet the color perception needs of color-blind users.

[0051] The jump sampling strategy specifically performs the following steps: the jump sampling strategy first generates multiple time step combinations by randomly initializing a population, each combination contains ten integers, and these integers represent the denoising time steps in the reverse diffusion process; reverse reasoning is performed using these time steps as denoising time points to generate a series of denoised images, and the peak signal-to-noise ratio value PSNR is calculated by comparing with the original image. The higher the PSNR, the better the denoising effect of the combination, and its PSNR value is used as the fitness value of the sampling combination; then, the strategy draws on the natural selection mechanism in the genetic algorithm to select a time step combination with high fitness for crossover and mutation operations to generate a new combination; the crossover operation simulates gene recombination by exchanging some elements in the two combinations to generate a new sampling sequence; the mutation operation simulates the mutation process in biological evolution by randomly changing some elements in the combination, thereby improving the population diversity and avoiding falling into the local optimum; after multiple iterations, the population gradually converges, and finally outputs the time step combination with the highest fitness as the optimal solution for jump sampling.

[0052] The step S2 trains the model by minimizing the loss function to ensure that the generated enhanced image that meets the visual perception of the color blind user is consistent with the target visual characteristics, which can be expressed as:

[0053]

[0054] where ∈ θ represents the noise predicted by the network, ∈ represents the noise actually added to the target image, t represents the time step, and c represents the conditional information, that is, the original image that is not easily distinguished by color blindness without color compensation.

[0055] The method includes the use of the following modules:

[0056] CFIR model building module, used to build a color blindness-friendly image color compensation model based on a diffusion model to achieve image color reconstruction;

[0057] A data set training module, used to train the CFIR model using a color blindness-friendly image color compensation data set to adapt it to the visual needs of color blind patients;

[0058] The color reconstruction module is used to input the original image into the trained CFIR model to generate an enhanced image that meets the perception of color-blind users;

[0059] The quality evaluation module is used to evaluate the color effect and visual quality of the enhanced image based on the evaluation indicators of peak signal-to-noise ratio PSNR, structural similarity SSIM, mean square error MSE and color difference CD.

[0060] The color compensation method compensates for colors that are difficult for color-blind patients to identify.

[0061] The method is executed based on an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When executing the program, the processor can implement various steps of the color compensation method for auxiliary diagnosis and treatment of color blindness.

[0062] The memory is a non-transitory computer-readable storage medium.

[0063] Example:

[0064] refer to Figure 1-3 The present invention proposes a color compensation method for color blindness auxiliary diagnosis and treatment, which specifically includes the following steps:

[0065] Step S1, constructing a colorblind-friendly image color compensation model (Colorblind-Friendly Image Recoloring, CFIR) based on a diffusion model;

[0066] Step S2, using the color blindness-friendly image color compensation dataset to complete the training of the color blindness-friendly image color compensation model;

[0067] Step S3: reconstruct the color of the original image using the trained color blindness-friendly image color compensation model to generate an enhanced image that meets the visual perception of color blind users.

[0068] In this embodiment, Figure 1 As shown, the construction of the CFIR model specifically includes the following steps:

[0069] Step S11, constructing a forward diffusion process: In the forward diffusion process, assuming that the data distribution of the target image (i.e., the color blind patient-friendly image) is x0~q(x0), a series of degraded images x1, x2, ..., x0 are generated by gradually adding Gaussian noise. T The scale of the noise added at each step is determined by the hyperparameter β t Control, β t As time t increases, it gradually increases. Specifically, the diffusion transfer equation for each step is as follows:

[0070]

[0071] x t is the image at time step t, β t represents the noise scale of this step, represents a normal distribution. In addition, based on the Markov chain and iterative relationship, x can be t To sample:

[0072]

[0073] in

[0074] Step S12: Construct a reverse denoising process: gradually remove noise from the noisy image through the conditional diffusion model to generate a color compensation image that meets the needs of color blind patients. t The input image is concatenated with the conditional information c and then input into the network. The input image is subjected to the initial convolutional layer to extract preliminary features and obtain a high-dimensional feature representation. In order to better capture the information that changes over time during the diffusion process, the model embeds the diffusion time step t at different stages of feature extraction. At the same time, the Transformer-ECA module is combined with the subsequent U-Net architecture denoising network to enhance the extraction of key color features through the channel self-attention mechanism. In addition, in order to improve the denoising efficiency, the process adopts a jump sampling strategy to dynamically adjust the sampling time step to ensure efficient color restoration and enhancement while reducing the amount of calculation.

[0075] In this embodiment, Figure 2 As shown, the Transformer-ECA module specifically performs the following steps: The Transformer-ECA module first performs convolution processing on the input image to extract preliminary high-dimensional features, and embeds time step information in the feature extraction process so that the model can dynamically adapt to changes in the diffusion process. Then, the module processes the normalized feature map through the channel self-attention mechanism: the global feature representation of each channel is obtained through global average pooling, the channel attention weight is generated using one-dimensional convolution, and the important channels are activated and weighted by the sigmoid activation function to enhance the ability to capture key color features. Subsequently, the adjusted features are further extracted through the feedforward network to further extract deep information, and finally generate a feature representation with higher expressiveness, thereby maintaining computational efficiency while enhancing the color restoration effect, so that the model can better meet the color perception needs of color-blind users.

[0076] In this embodiment, Figure 3As shown in FIG. 1 , the jump sampling strategy specifically performs the following steps: The jump sampling strategy first generates multiple time step combinations by randomly initializing a population, each combination contains ten integers, and these integers represent the denoising time steps in the reverse diffusion process. By using these time steps as the denoising time points for reverse reasoning, a series of denoised images can be generated, and the peak signal-to-noise ratio (PSNR) value can be calculated by comparing with the original image. The higher the PSNR, the better the denoising effect of the combination, so the PSNR value is used as the fitness value of the sampling combination. Subsequently, the strategy draws on the natural selection mechanism in the genetic algorithm to select a time step combination with higher fitness for crossover and mutation operations to generate a new combination. The crossover operation simulates gene recombination by exchanging some elements in the two combinations to generate a new sampling sequence; the mutation operation simulates the mutation process in biological evolution by randomly changing some elements in the combination, thereby improving the population diversity and avoiding falling into the local optimum. After multiple iterations, the population gradually converges, and finally outputs the time step combination with the highest fitness as the optimal solution for jump sampling.

[0077] In this embodiment, the data set in step S2 is a public data set. The data set is made as follows: first, find the color pairs that color blind patients cannot distinguish based on the abnormal visual simulation image, retrieve and download relevant images on the Internet, and then perform abnormal visual simulation to screen out images whose color information color blind patients cannot completely distinguish. Next, use an algorithm that is good at processing abnormal visual images to perform color compensation on these images, and filter out images with poor results. Finally, compare the original image with the abnormal visual simulation image after color compensation, and screen out images in which patients can normally recognize color information, forming a data set containing 3084 image pairs.

[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0082] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0083] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

[0084] The present invention is not limited to the above-mentioned optimal implementation mode. Anyone can derive other various forms of color compensation methods and systems for color blind patients under the inspiration of the present invention. All equal changes and modifications made within the scope of the invention application of the present invention should fall within the scope of the present invention.

Claims

1. A color compensation method for color blindness auxiliary diagnosis and treatment, characterized by: The following steps are involved: Step S1, constructing a color blindness friendly image color compensation model CFIR based on a diffusion model; Step S2, using the color blindness-friendly image color compensation dataset to complete the training of the color blindness-friendly image color compensation model; Step S3: reconstruct the color of the original image using the trained color blindness-friendly image color compensation model to generate an enhanced image that meets the visual perception of color blind users.

2. A color compensation method for color blindness auxiliary diagnosis and treatment according to claim 1, characterized in that: The method adopts a color blindness-friendly image color compensation method and system based on a diffusion model, improves the color feature extraction capability by fusing Transformer with the channel attention mechanism ECA, and optimizes the inference efficiency of the model through a skip sampling strategy to better restore color details, improve color contrast and visual naturalness, and enhance the realism of color experience for color blind patients.

3. A color compensation method for color blindness auxiliary diagnosis and treatment according to claim 2, characterized in that: The construction of the CFIR model specifically includes the following steps: Step S11, constructing a forward diffusion process: In the forward diffusion process, assuming that the target image is a color blind patient-friendly image, its data distribution is x0~q(x0), and by gradually adding Gaussian noise, a series of degraded images x1, x2, ..., x T The scale of the noise added at each step is determined by the hyperparameter β t Control, β t It gradually increases with the increase of time t; Specifically, the diffusion transfer equation for each step is shown below: x t is the image at time step t, β t represents the noise scale of this step, represents a normal distribution; in addition, based on the Markov chain and iterative relationship, x can be t To take a sample: among them a t =1-β t , Step S12, constructing a reverse denoising process: gradually removing noise from the noisy image through the conditional diffusion model to generate a color compensation image that meets the needs of color blind patients; the process first converts the noisy image x t The input image is concatenated with the conditional information c and then input into the network; the initial convolutional layer extracts preliminary features from the input image to obtain a high-dimensional feature representation; in order to better capture the information that changes over time during the diffusion process, the model embeds the diffusion time step t at different stages of feature extraction; at the same time, the Transformer-ECA module is combined with the subsequent U-Net architecture denoising network to enhance the extraction of key color features through the channel self-attention mechanism; in addition, in order to improve the denoising efficiency, the process adopts a jump sampling strategy to dynamically adjust the sampling time step to ensure efficient color restoration and enhancement effects while reducing the amount of calculation.

4. A color compensation method for color blindness auxiliary diagnosis and treatment according to claim 3, characterized in that: The Transformer-ECA module specifically performs the following steps: the Transformer-ECA module first performs convolution processing on the input image to extract preliminary high-dimensional features, and embeds time step information in the feature extraction process so that the model can dynamically adapt to changes in the diffusion process; then, the module processes the normalized feature map through the channel self-attention mechanism: the global feature representation of each channel is obtained through global average pooling, the channel attention weight is generated by one-dimensional convolution, and the important channels are activated and weighted by sigmoid activation function to enhance the ability to capture key color features; Subsequently, the adjusted features are further extracted through a feedforward network to further extract deep information, ultimately generating a feature representation with higher expressiveness, thereby enhancing the color restoration effect while maintaining computational efficiency, allowing the model to better meet the color perception needs of color-blind users.

5. The color compensation method for color blindness auxiliary diagnosis and treatment according to claim 3, characterized in that: The jump sampling strategy specifically performs the following steps: the jump sampling strategy first generates multiple time step combinations by randomly initializing a population, each combination contains ten integers, and the integers represent the denoising time steps in the back diffusion process; Using these time steps as denoising time points, reverse reasoning is performed to generate a series of denoised images, and the peak signal-to-noise ratio (PSNR) is calculated by comparing with the original image. The higher the PSNR, the better the denoising effect of the combination, and its PSNR value is used as the fitness value of the sampling combination; then, the strategy draws on the natural selection mechanism in the genetic algorithm to select time step combinations with high fitness for crossover and mutation operations to generate new combinations; the crossover operation simulates gene recombination by exchanging some elements in the two combinations to generate a new sampling sequence; the mutation operation simulates the mutation process in biological evolution by randomly changing some elements in the combination, thereby improving population diversity and avoiding falling into local optimality; after multiple iterations, the population gradually converges, and finally outputs the time step combination with the highest fitness as the optimal solution for jump sampling.

6. A color compensation method for color blindness auxiliary diagnosis and treatment according to claim 2, characterized in that: The step S2 trains the model by minimizing the loss function to ensure that the generated enhanced image that meets the visual perception of the color blind user is consistent with the target visual characteristics, which can be expressed as: where ∈ θ represents the noise predicted by the network, ∈ represents the noise actually added to the target image, t represents the time step, and c represents the conditional information, that is, the original image that is not easily distinguished by color blindness without color compensation.

7. The color compensation method for color blindness auxiliary diagnosis and treatment according to claim 2, characterized in that: The method includes the use of the following modules: CFIR model building module, used to build a color blindness-friendly image color compensation model based on a diffusion model to achieve image color reconstruction; A data set training module, used for training the CFIR model using a color blindness-friendly image color compensation data set to adapt it to the visual needs of color blind patients; The color reconstruction module is used to input the original image into the trained CFIR model to generate an enhanced image that meets the perception of color-blind users; The quality evaluation module is used to evaluate the color effect and visual quality of the enhanced image based on the evaluation indicators of peak signal-to-noise ratio PSNR, structural similarity SSIM, mean square error MSE and color difference CD.

8. The color compensation method for color blindness auxiliary diagnosis and treatment according to claim 7, characterized in that: The color compensation method compensates for colors that are difficult for color-blind patients to distinguish.

9. A color compensation method for color blindness auxiliary diagnosis and treatment according to any one of claims 1 to 6, characterized in that: The method is executed based on an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When executing the program, the processor can implement various steps of the color compensation method for auxiliary diagnosis and treatment of color blindness.

10. The color compensation method for color blindness auxiliary diagnosis and treatment according to claim 8, characterized in that: The memory is a non-transitory computer-readable storage medium.