CT image lossless compression and recovery method based on state space and diffusion model
Through the feature extraction and positive diffusion process of state space and diffusion model, the storage cost and image quality problems in thin-layer CT image storage and transmission are solved, lossless compression and efficient recovery are achieved, and the efficiency and readability of the image management system are improved.
Patent Information
- Application Number
- CN202510330711.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When storing and transmitting thin-layer CT images, there is a problem that the storage cost is high and the image quality is difficult to take into account. Directly storing thin-layer CT images occupies a large amount of storage space, and compressing it into thick-layer CT images will lead to the loss of some fine medical information, affecting the diagnostic value.
Using a method based on state space and diffusion model, through feature extraction and positive diffusion processes, thin layer CT images are compressed into virtual thick layer CT images, and a difference information vector is generated to preserve key information to achieve lossless compression.
It realizes efficient image compression, reduces storage space usage, and reduces transmission costs. At the same time, it can recover the original image quality without loss when needed, and improves diagnostic readability and efficiency.
Smart Images

Figure CN120259449A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning, and particularly relates to a method for lossless compression and restoration of CT images based on state space and diffusion models. Background Art
[0002] With the development of medical imaging technology, CT (Computed Tomography) technology has gradually developed two scanning modes: thin-slice CT and thick-slice CT. Thin-slice CT images can provide higher spatial resolution with smaller slice intervals, retaining more anatomical details to assist doctors in achieving more accurate diagnoses. Thick-slice CT images have larger slice intervals, reducing the amount of data, improving scanning efficiency, and reducing storage and transmission costs, which are suitable for routine examinations and rapid screenings.
[0003] In traditional medical image data storage technologies, directly storing thin-slice CT images to retain the high-resolution information of complete CT images is convenient for doctors' fine diagnoses, but it will occupy a large amount of storage space, resulting in increased storage pressure on the image management system. Compressing thin-slice CT images into thick-slice CT images for storage, although effectively reducing storage requirements and improving image transmission efficiency, will cause some fine medical information to be lost due to the increased slice interval.
[0004] Therefore, the above storage technologies have the problem of being difficult to balance storage costs and image quality. Their image compression methods lack intelligent optimization, which affects the readability and diagnostic value of CT images. Only storing thick-slice CT images, if doctors cannot obtain sufficient detailed information when reviewing the images, they need to rescan the patients, increasing the patients' radiation exposure and medical costs. Summary of the Invention
[0005] Based on this, it is necessary to provide a method for lossless compression and restoration of CT images based on state space and diffusion models that can efficiently compress CT images and support lossless restoration for the above technical problems.
[0006] In a first aspect, the present application provides a method for lossless compression of CT images based on state space and diffusion models, including:
[0007] Obtain thin-slice CT images;
[0008] Input the thin-slice CT images into the state space and diffusion model; the state space and diffusion model includes a state space model and a diffusion model;
[0009] Use the state space model to extract features from the thin-slice CT images to obtain high-dimensional image feature vectors;
[0010] Using a diffusion model to perform forward diffusion on the high-dimensional image feature vector to obtain a virtual thick-slice CT image, and determining the virtual thick-slice CT image as the compressed image of the thin-slice CT image;
[0011] Generating a difference information vector based on the information difference between the virtual thick-slice CT image and the thin-slice CT image.
[0012] In one embodiment, the state space and the diffusion model are trained through the following method:
[0013] Obtaining a thin-slice CT image dataset and a thick-slice CT image dataset;
[0014] Performing data preprocessing on the thin-slice CT image dataset and the thick-slice CT image dataset to obtain a training dataset in which the thin-slice CT images and the thick-slice CT images are paired one by one;
[0015] Learning the bidirectional mapping relationship between the thin-slice CT image and the thick-slice CT image based on the training dataset; the bidirectional mapping relationship includes the forward diffusion process;
[0016] Adjusting the parameters of the forward diffusion process according to the forward diffusion process in the bidirectional mapping relationship;
[0017] Determining the parameters of the forward diffusion process as the first model parameters of the state space and the diffusion model to obtain the state space and the diffusion model.
[0018] In one embodiment, learning the bidirectional mapping relationship between the thin-slice CT image and the thick-slice CT image based on the training dataset includes:
[0019] Using a state space model to perform long-range dependent feature extraction on a thin-slice CT image in the training dataset to obtain a high-dimensional image feature vector;
[0020] Constructing the forward diffusion process of the diffusion model based on the high-dimensional image feature vector and the corresponding thick-slice CT image in the training dataset to obtain a virtual thick-slice CT image and a difference information vector.
[0021] In one embodiment, the forward diffusion process includes the following steps:
[0022] The diffusion model gradually adds noise to the thin-slice CT image using the high-dimensional image feature to obtain a virtual thick-slice CT image;
[0023] Calculating the information difference between the virtual thick-slice CT image and the thin-slice CT image to obtain a difference information vector.
[0024] In one embodiment, adjusting the parameters of the forward diffusion process according to the forward diffusion process in the bidirectional mapping relationship includes:
[0025] Calculating the adversarial loss between the virtual thick-slice CT image and the corresponding thin-slice CT image;
[0026] Adjust the parameters of the forward diffusion process according to the adversarial loss until the visual quality of the virtual thick-layer CT image and the corresponding thick-layer CT image reaches a preset value.
[0027] In a second aspect, the present application provides a method for lossless restoration of CT images based on a state space and a diffusion model, including:
[0028] In response to obtaining a restoration instruction for a target thin-layer CT image, obtain the corresponding virtual thick-layer CT image and the difference information vector of the target thin-layer CT image; wherein, the virtual thick-layer CT image and the difference information vector are obtained by compressing the target thin-layer CT image through a method for lossless compression of CT images based on a state space and a diffusion model;
[0029] Input the virtual thick-layer CT image and the difference information vector into the state space and the diffusion model to obtain the restored target thin-layer CT image.
[0030] In one embodiment, the state space and the diffusion model obtain the restored target thin-layer CT image based on the following method:
[0031] Obtain the virtual thick-layer CT image and the difference information vector;
[0032] The spatial state model in the state space and the diffusion model extracts features from the virtual thick-layer CT image and analyzes the difference vector information to obtain preprocessed information;
[0033] The diffusion model in the state space and the diffusion model performs inverse diffusion on the virtual thick-layer CT image using the preprocessed information to obtain the restored target thin-layer CT image.
[0034] In one embodiment, the state space and the diffusion model are trained through the following method:
[0035] Learn the bidirectional mapping relationship between thin-layer CT images and thick-layer CT images according to the training data set; the bidirectional mapping relationship includes the inverse diffusion process;
[0036] Adjust the parameters of the inverse diffusion process according to the bidirectional mapping relationship;
[0037] Determine the parameters of the inverse diffusion process as the second model parameters of the state space and the diffusion model to obtain the state space and the diffusion model; the state space and the diffusion model include a conditional diffusion model.
[0038] In one embodiment, construct the inverse diffusion process of the diffusion model according to the virtual thick-layer CT image and the difference information vector to obtain the restored thin-layer CT image; wherein the virtual thick-layer CT image and the difference information vector are obtained by the forward diffusion process of the thin-layer CT image;
[0039] The inverse diffusion process includes the following steps:
[0040] The spatial state model analyzes the difference information vector and extracts features from the virtual thick-layer CT image to obtain preprocessed information;
[0041] The diffusion model gradually denoises the virtual thick-layer CT image to obtain the restored thin-layer CT image.
[0042] In one embodiment, the parameters of the inverse diffusion process are adjusted according to the bidirectional mapping relationship, including:
[0043] Calculate the per-pixel reconstruction loss between the restored thin-layer CT image and the corresponding thin-layer CT image in the training dataset;
[0044] Adjust the parameters of the inverse diffusion process according to the per-pixel reconstruction loss until the difference between the restored thin-layer CT image and the corresponding thin-layer CT image in the training dataset is less than the preset value.
[0045] The above CT image lossless compression and restoration method based on the state space and diffusion model inputs the thin-layer CT image into the state space model to extract the high-dimensional image feature vector, simplifies the data expression, and reduces the data processing volume. When using the diffusion model to generate the virtual thick-layer CT image by positive diffusion of the feature vector, the operation speed is faster, greatly improving the overall image compression efficiency and saving time costs. Generating the difference information vector based on the information difference between the virtual thick-layer CT image and the thin-layer CT image can retain the original information to the greatest extent, and can accurately restore the original thin-layer CT image during restoration, realizing lossless compression and ensuring that the image quality is not damaged. In terms of storage, it can significantly reduce the storage space occupancy and save the storage costs of hospitals and other institutions. During transmission, the smaller data volume of the virtual thick-layer CT speeds up the transmission speed, reduces the risk of data loss, and improves the stability and efficiency of image transmission in scenarios such as telemedicine and image sharing. Description of the Drawings
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0047] Figure 1 It is a schematic flowchart of the CT image lossless compression method based on the state space and diffusion model of the present invention;
[0048] Figure 2 It is a schematic flowchart of the CT image lossless restoration method based on the state space and diffusion model of the present invention;
[0049] Figure 3 It is a schematic diagram of the sub - steps of step S202;
[0050] Figure 4 It is a composition structure diagram of the CT image lossless compression device based on the state space and diffusion model of the present invention;
[0051] Figure 5 It is a composition structure diagram of the CT image lossless restoration device based on the state space and diffusion model of the present invention. Specific embodiments
[0052] In order to make the purpose, technical solutions and advantages of this application clearer, the following further details this application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain this application and are not used to limit this application.
[0053] In one embodiment, as Figure 1 shown, a CT image lossless compression method based on the state space and diffusion model is provided. In this embodiment, this method is exemplified by being applied to a terminal. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0054] S101. Obtain thin - layer CT images.
[0055] In the modern medical imaging examination process, thin - layer CT images are obtained through specific CT scanning devices. When the scanning layer thickness is set to a relatively thin parameter, such as 1 mm, the obtained images are thin - layer CT images. Exemplarily, a thin - layer CT scan with a layer thickness of 1 mm usually consists of 300 - 400 images. Therefore, thin - layer CT contains more information. Based on thin - layer CT, doctors can achieve more accurate diagnoses. While the number of images in a thick - layer CT scan with a layer thickness of 5 mm is only 20% of that of a 1 - mm thin - layer CT scan, which can effectively reduce the difficulty of CT image data storage and transmission. However, the disadvantage of thick - layer CT scans is that they contain much less information than thin - layer CT scans, and the details are not clear enough, which may cause difficulties for expert diagnoses, leading to misdiagnosis or other unforeseen problems.
[0056] S102. Input the thin - layer CT images into the state space and diffusion model; the state space and diffusion model includes a state space model and a diffusion model.
[0057] The state space model and the diffusion model work together to deeply process the input thin-slice CT images. Schematically, the state space model is a method for efficient sequence modeling by constructing hidden states to capture key information in long sequences, with linear computational complexity, thus enabling applications in high-resolution images. Further, the state space model extracts and memorizes the key information in the image by constructing hidden states, that is, it combs and generalizes the image features. When processing thin-slice CT images, the state space model integrates the feature information of tissues and organs at different positions in the image, associating spatially dispersed but intrinsically related information. Exemplarily, when processing thin-slice CT images of the lungs, the feature information belonging to the same pulmonary nodule on different slices is integrated together to form a more representative feature expression. In subsequent processing, the overall features of the image can be considered more comprehensively, avoiding the loss of important details due to local information processing.
[0058] Schematically, the diffusion model works based on the principles of probability theory and stochastic processes. Specifically, after receiving the high-dimensional image feature vector processed by the state space model, the diffusion model gradually "diffuses" the feature information of the image through the forward diffusion process, simulating the changes of data in different states. In this process, the diffusion model adjusts and transforms the image features according to a certain probability distribution, and finally generates a virtual thick-slice CT image. The forward diffusion process is a gradual change process. Through multiple iterations, the generated virtual thick-slice CT image not only retains the key information of the original thin-slice CT image but also conforms to the characteristics of thick-slice CT images.
[0059] S103. Use the state space model to extract features from the thin-slice CT image to obtain a high-dimensional image feature vector.
[0060] Schematically, the state space model regards thin-slice CT images as a spatio-temporal sequence data, and processes image information by constructing a series of state transition equations and observation equations. Specifically, the state space model divides thin-slice CT images into multiple local regions. For each local region, the model initializes a hidden state vector based on its pixel values and the correlation information of adjacent regions. This hidden state vector is used as an information container to store and update the feature information of the current region. The state space model continuously updates the hidden state according to the state transition equation, combining the current hidden state vector and the newly input image data, and gradually mines deeper and more comprehensive feature information in the image. Exemplarily, when processing thin-slice CT images of the lungs, the state transition equation updates the hidden state according to the previous hidden state information and the relationship between the current region and surrounding lung tissues, blood vessels and other structures, so as to capture the texture features of lung tissues, the boundary features between lesions and normal tissues, etc. Further, the observation equation is responsible for mapping the updated hidden state vector to the observation space to generate prediction data corresponding to the original image data. By continuously adjusting the parameters of the state transition equation and the observation equation, the difference between the prediction data and the actual image data is minimized. In this optimization process, the finally obtained hidden state vector is a high-dimensional image feature vector, which highly condenses the key feature information of thin-slice CT images, contains multi-scale features from local details to overall structures, and provides an important data basis for subsequent image processing.
[0061] S104. Perform forward diffusion on the high-dimensional image feature vector using a diffusion model to obtain a virtual thick-slice CT image, and determine the virtual thick-slice CT image as the compressed image of the thin-slice CT image.
[0062] The forward diffusion process of the diffusion model is based on the gradual evolution of the probability distribution, processes the high-dimensional image feature vector to generate a virtual thick-slice CT image, and completes the compression operation of the thin-slice CT image. Specifically, the high-dimensional image feature vector is the basic data containing the key information of the original thin-slice CT image. The diffusion model introduces noise and gradually perturbs the feature vector, that is, the original thin-slice CT image, according to a specific noise distribution law. As the forward diffusion process progresses, the noise accumulates continuously, and the distribution of the original thin-slice CT image gradually approaches the feature distribution of the thick-slice CT image, resulting in a virtual thick-slice CT image. The model reshapes and integrates the high-dimensional image feature vector by learning the relationships and dependencies between different features. Schematically, the local features of multiple slices in the thin-slice CT image are fused into more macroscopic and comprehensive features possessed by the thick-slice CT image through the diffusion process.
[0063] S105. Generate a difference information vector according to the information difference between the virtual thick-slice CT image and the thin-slice CT image.
[0064] The virtual thick-slice CT image is generated by a diffusion model. Although it retains the key information of the original thin-slice CT image, there are still differences between the virtual thick-slice CT image and the original thin-slice CT image in terms of resolution, detail display, etc. Schematically, the difference information vector is obtained by comparing the pixel values of the two. Specifically, starting from the spatial position correspondence relationship, each pixel or pixel region is analyzed. At the same spatial position, the difference between the pixel value of the thin-slice CT image and the pixel value of the virtual thick-slice CT image is calculated. Exemplarily, if at a certain spatial position, the pixel value of the thin-slice CT image is 100 and the pixel value of the virtual thick-slice CT image is 80, the difference at this position is 20. Such calculations are performed for all corresponding positions of the entire image, and these differences are sorted and arranged according to certain rules to form a vector, namely the difference information vector. The difference information vector records where the virtual thick-slice CT image loses the information of the thin-slice CT image and the degree of information loss, providing key supplementary information for subsequent image restoration.
[0065] In the above CT image lossless compression method based on the state space and diffusion model, the problem of being unable to model long-distance dependencies for CT images is solved by using the state space model, which helps to improve the image quality after CT image compression and restoration. The diffusion model flexibly transforms and reconstructs the image features by simulating the diffusion process of data, generating a virtual thick-slice CT image that meets the requirements, reducing the data volume and data redundancy. It not only improves the data processing efficiency but also alleviates the burden on subsequent storage and transmission, enhancing the efficiency of the entire image processing process. While reducing the storage cost, it retains basically usable image information for reference, solving the technical problems of existing image data compression methods that do not consider the information retention of the original data, resulting in unreadable compressed data and lack of information association with the original data.
[0066] In one embodiment, the state space and diffusion model are trained by the following method:
[0067] S21. Obtain a thin-slice CT image dataset and a thick-slice CT image dataset.
[0068] To train a model that can achieve lossless compression and restoration of CT images, a large number of thin-slice CT images and thick-slice CT images of different cases and different parts are required. Data is collected from the hospital image database, which covers various disease types and patients of different age groups to ensure that the model can adapt to complex clinical scenarios after training. Exemplarily, images of different parts such as the lungs, liver, and brain are collected, including images of healthy people and patients with diseases such as tumors and inflammation, enabling the model to learn image features in various situations.
[0069] S22. Preprocess the thin-slice CT image dataset and the thick-slice CT image dataset to obtain a training dataset in which the thin-slice CT images and the thick-slice CT images are paired one by one.
[0070] The originally collected image data has problems such as format differences, noise interference, and inconsistent sizes. Exemplarily, the format is unified into the standard DICOM format, the noise is removed using a filtering algorithm, and the image sizes are made consistent through operations such as image scaling and cropping. Then, according to the scanning parts of the images, patient information, etc., the thin-slice CT images and the thick-slice CT images are paired one by one to form a training dataset. Further, taking the thin-slice CT images with a slice thickness of 1 mm and the thick-slice CT images with a slice thickness of 5 mm as an example, each thick-slice CT image has corresponding multiple thin-slice CT images.
[0071] S23. Learn the bidirectional mapping relationship between the thin-slice CT images and the thick-slice CT images based on the training dataset; the bidirectional mapping relationship includes a forward diffusion process.
[0072] The forward diffusion process is constructed using an encoder-decoder structure. The forward diffusion process constructs a diffusion model using only the image as the input and uses the state space model as the basic computational unit.
[0073] During the training of the forward diffusion process, the model takes the thin-slice CT image as the input and outputs a virtual thick-slice CT image. Exemplarily, five consecutive thin-slice CT images are used as the input of the diffusion model, and the corresponding thick-slice CT image is used as the supervision signal to learn the forward diffusion process. The output includes a virtual thick-slice CT image and five difference information vectors, corresponding to different layers of the thin-slice CT respectively. The difference information vector is used to generally represent the information difference between each thin-slice CT image and the generated virtual thick-slice CT image.
[0074] S24. Adjust the parameters of the forward diffusion process according to the forward diffusion process in the bidirectional mapping relationship.
[0075] During the process of learning the bidirectional mapping relationship, the difference between the model output and the real image is measured by calculating the loss function. Schematically, calculate the adversarial loss between the virtual thick-slice CT image and the real thick-slice CT image. According to these loss values, use optimization algorithms such as gradient descent to backpropagate and adjust the parameters of the model in the forward diffusion process to continuously reduce the loss value and improve the accuracy of the model in compressing images. When the model undergoes multiple rounds of training and the loss value converges to a certain extent, that is, when the model is stable and accurate in compressing the thin-slice CT image to generate the virtual thick-slice CT image, fix the parameters of the forward diffusion process at this time.
[0076] S25. Determine the parameters of the forward diffusion process as the first model parameters of the state space and the diffusion model to obtain the state space and the diffusion model.
[0077] Taking the parameters of the forward diffusion process as the final model parameters of the state space and diffusion model for compressing the image, the obtained state space and diffusion model have the ability to losslessly compress CT images.
[0078] In one embodiment, learning the bidirectional mapping relationship between thin-slice CT images and thick-slice CT images based on the training dataset includes:
[0079] S31. Using the state space model to extract long-distance dependence features from a thin-slice CT image in the training dataset to obtain a high-dimensional image feature vector.
[0080] During the feature extraction process, the state space model analyzes the image pixel by pixel or region by region, and uses its internal state transition mechanism to associate the pixel information at the current position with the pixel information at a relatively distant position. The original two-dimensional or three-dimensional thin-slice CT image data is converted into a high-dimensional image feature vector, which highly condenses the key features of the image and contains multi-scale information from local details to overall structure, providing a rich data basis for subsequent image processing.
[0081] S32. Constructing the forward diffusion process of the diffusion model based on the high-dimensional image feature vector and the corresponding thick-slice CT image in the training dataset to obtain a virtual thick-slice CT image and a difference information vector.
[0082] The diffusion model gradually introduces noise. At the same time, referring to the corresponding thick-slice CT image in the training dataset, the model continuously adjusts the parameters in the diffusion process so that the generated virtual thick-slice CT image after a series of diffusion steps is similar to the real thick-slice CT image in terms of visual effect and information expression. During the process of generating the virtual thick-slice CT image, by comparing the original thin-slice CT image with the generated virtual thick-slice CT image, the difference information of each layer is calculated, and these difference information are organized into a difference information vector.
[0083] In one embodiment, the forward diffusion process includes the following steps:
[0084] S41. The diffusion model gradually adds noise to the thin-slice CT image using the high-dimensional image features to obtain a virtual thick-slice CT image.
[0085] Exemplarily, compressing 5 thin-slice CT images to generate a virtual thick-slice CT image, gradually adding noise H to the thin-slice CT image t =H global +α t ∈, where H t is the feature representation of the intermediate state of the diffusion process; α t is the noise control parameter, which changes with time t; ∈ is the Gaussian noise term, making the image features gradually approach the thick-slice CT image. Predicting the final virtual thick-slice CT image through a deep neural network where f θ is the neural network of the diffusion model; H T is the final state after the complete forward diffusion process.
[0086] S42. Calculate the information difference between the virtual thick-layer CT image and the thin-layer CT image to obtain a difference information vector.
[0087] Calculate the information difference between each thin-layer CT image and the virtual thick-layer CT image where V i is the difference information of the i-th thin-layer CT image relative to the virtual thick-layer CT image, and X i is the thin-layer CT image.
[0088] In one embodiment, adjust the parameters of the forward diffusion process according to the forward diffusion process in the bijective mapping relationship, including:
[0089] S51. Calculate the adversarial loss between the virtual thick-layer CT image and the corresponding thin-layer CT image.
[0090] S52. Adjust the parameters of the forward diffusion process according to the adversarial loss until the visual quality of the virtual thick-layer CT image and the corresponding thick-layer CT image reaches a preset value.
[0091] Adjust the parameters of the forward diffusion process through the adversarial loss to enable the virtual thick-layer CT to have a visual quality equivalent to that of the real thick-layer CT.
[0092] In one embodiment, as Figure 2 shown, a method for lossless restoration of CT images based on state space and diffusion model is provided. This embodiment is exemplified in the same application environment as the method for lossless compression of CT images based on state space and diffusion model, including the following steps:
[0093] S201. In response to obtaining a restoration instruction for a target thin-layer CT image, obtain the virtual thick-layer CT image and the difference information vector corresponding to the target thin-layer CT image; wherein, the virtual thick-layer CT image and the difference information vector are obtained by compressing the target thin-layer CT image by the method for lossless compression of CT images based on state space and diffusion model.
[0094] When the information provided by the virtual thick-layer CT cannot help doctors make accurate judgments or when detailed information is required due to surgeries or other needs, a request can be made to restore the thin-layer CT images. When the system receives the restoration instruction for the target thin-layer CT images, it will quickly locate and obtain the corresponding virtual thick-layer CT images and difference information vectors in the storage device according to the pre-set indexing or storage path rules. These data were saved in a specific storage format and association method during the previous compression process so that they can be accurately called during restoration.
[0095] The virtual thick-layer CT images serve as the basic framework, providing the general structure and main information of the images for the restoration process. The difference information vectors are used to fill the detail gaps between the virtual thick-layer CT images and the original thin-layer CT images. In the restoration algorithm, usually starting from the virtual thick-layer CT images, according to the information differences recorded at each position in the difference information vectors, the pixel values or features of the virtual thick-layer CT images are adjusted. Gradually, an image highly consistent with the original target thin-layer CT images is restored.
[0096] S202: Input the virtual thick-layer CT images and the difference information vectors into the state space and diffusion model to obtain the restored target thin-layer CT images.
[0097] Input the virtual thick-layer CT images and the difference information vectors into the state space and diffusion model, and perform image restoration based on the model's deep understanding and reconstruction ability of image features. The state space model takes the virtual thick-layer CT images and the difference information vectors as input data and reconstructs the hidden state. According to the characteristics of long-distance dependencies, it integrates the macroscopic structure information in the virtual thick-layer CT images and the detail difference information in the difference information vectors, and sorts out the internal connections between the image features. Exemplarily, for CT images of human bones, the state space model can combine the overall morphological features of the bones in the virtual thick-layer CT images with the fine structural difference information such as bone texture and trabeculae reflected in the difference information vectors to form a more comprehensive and accurate representation of image features.
[0098] The diffusion model restores the target thin-layer CT images through the inverse diffusion process. The inverse diffusion process is the opposite of the forward diffusion process. The inverse diffusion process gradually removes noise and restores the original details of the image. During the inverse diffusion process, the diffusion model adjusts the feature distribution of the virtual thick-layer CT images according to the information provided by the difference information vectors, making it gradually approach the feature distribution of the original thin-layer CT images. The finally output image is highly similar to the original thin-layer CT images in terms of pixel values, texture, structure, etc., thus achieving high-quality restoration of the image.
[0099] The above CT image lossless restoration method based on the state space and diffusion model obtains the restored target thin-slice CT image. The whole process is efficient and lossless, saving a large amount of storage space compared with directly storing the original thin-slice CT image. During the diagnosis process, doctors can flexibly use the virtual thick-slice CT image and the restored thin-slice CT image according to actual needs. The virtual thick-slice CT image can provide an overall image overview, helping doctors quickly understand the general situation of patients and conduct preliminary diagnosis and analysis. When details need to be focused on, the restored thin-slice CT image can be used to obtain more accurate information.
[0100] In one embodiment, as Figure 3 shown, the state space and diffusion model obtain the restored target thin-slice CT image based on the following method:
[0101] S301. Obtain the virtual thick-slice CT image and the difference information vector.
[0102] The system will quickly locate and extract the virtual thick-slice CT image and the difference information vector corresponding to the target thin-slice CT image from the storage device according to the preset storage index mechanism.
[0103] S302. The spatial state model in the state space and diffusion model extracts features from the virtual thick-slice CT image and analyzes the difference vector information to obtain the preprocessed information.
[0104] Schematically, the state space model has a unique ability to handle complex dependencies in long sequence data. For the virtual thick-slice CT image, it regards it as a spatial information sequence and captures key features in the image, such as the contours of organs and the textures of tissues, by constructing hidden states. At the same time, when analyzing the difference information vector, the state space model can understand the image detail change information represented by these differences. Exemplarily, the numerical changes in certain regions of the difference information vector may correspond to the edges or micro-lesion features of specific tissues in the original thin-slice CT image. The state space model generates preprocessed information containing the macroscopic structure and microscopic detail changes of the image by integrating these two parts of information, providing a richer data basis for subsequent image restoration.
[0105] S303. The diffusion model in the state space and diffusion model performs inverse diffusion on the virtual thick-slice CT image using the preprocessed information to obtain the restored target thin-slice CT image.
[0106] Using the preprocessing information generated by the state space model, the diffusion model performs an inverse operation on the virtual thick-layer CT image. The inverse diffusion process gradually removes the noise introduced in the forward diffusion process, i.e., simulates the detailed information lost during the process from thin-layer CT to virtual thick-layer CT, and adjusts the pixel values and feature distributions of the virtual thick-layer CT image according to the detail change instructions in the preprocessing information. Exemplarily, when processing a lung CT image, if the preprocessing information indicates that a certain area has richer texture details in the original thin-layer CT, the diffusion model will adjust the corresponding area of the virtual thick-layer CT image during the inverse diffusion process to increase the texture complexity, thereby gradually restoring an image highly similar to the original target thin-layer CT image.
[0107] In one embodiment, the state space and the diffusion model are trained by the following method:
[0108] S61. Learn the bidirectional mapping relationship between thin-layer CT images and thick-layer CT images based on the training dataset; the bidirectional mapping relationship includes the inverse diffusion process.
[0109] The training dataset is the same as the training dataset of the state space and the diffusion model during the training of the forward diffusion process. The inverse diffusion process takes the image and the difference information vector as inputs together to construct a conditional diffusion model. The difference between the diffusion model in the forward diffusion process and the conditional diffusion model in the inverse diffusion process is that the diffusion model will get the same output for the same input, while the conditional diffusion model will get different outputs for the same input when the conditions are different. In addition, the network structures of the diffusion model and the conditional diffusion model are the same, and both use the state space model as the basic computing unit.
[0110] During the training of the inverse diffusion process, taking the generated virtual thick-layer CT image and the difference information vector as inputs, the thin-layer CT image is restored. By continuously comparing the restored image with the real thin-layer CT image, the model gradually learns to accurately restore the details. Exemplarily, the generated virtual thick-layer CT image is used as the input of the diffusion model, and different conditions are used as matching inputs according to different target outputs. Therefore, the inverse diffusion process is a conditional diffusion system. Specifically, the difference information vector is used as a condition and input together with the virtual thick-layer CT image. When different difference information vectors are used as conditions, the diffusion model will get different outputs according to different input conditions. Further, when the difference information vector V(-2) is used as a condition, it corresponds to the first layer image of the thin-layer CT in the example figure.
[0111] S62. Adjust the parameters of the inverse diffusion process according to the bidirectional mapping relationship.
[0112] Similarly, during the process of learning the bidirectional mapping relationship, the difference between the model output and the real image is measured by calculating the loss function. For the inverse diffusion process, the pixel-by-pixel reconstruction loss between the restored thin-slice CT image and the real thin-slice CT image is calculated. Based on these loss values, optimization algorithms such as gradient descent are used to backpropagate and adjust the parameters of the model in the inverse diffusion process, so as to continuously reduce the loss value and improve the accuracy of the model in restoring the image. When the model has undergone multiple rounds of training and the loss value converges to a certain extent, that is, when the model performs stably and accurately in restoring the thin-slice CT image, the parameters of the inverse diffusion process at this time are fixed.
[0113] S63. Determine the parameters of the inverse diffusion process as the second model parameters of the state space and the diffusion model to obtain the state space and the diffusion model; the state space and the diffusion model include a conditional diffusion model.
[0114] Use the parameters of the inverse diffusion process as the final model parameters for performing the inverse diffusion process of the conditional diffusion model of the state space and the diffusion model. The obtained state space and diffusion model have the ability to losslessly restore CT images.
[0115] In one embodiment, an inverse diffusion process of the diffusion model is constructed based on the virtual thick-slice CT image and the difference information vector to obtain the restored thin-slice CT image; the virtual thick-slice CT image and the difference information vector are obtained by the forward diffusion process of the thin-slice CT image.
[0116] The forward diffusion process and the inverse diffusion process form a cycle. The forward diffusion process takes the original thin-slice CT image as input, generates a virtual thick-slice CT and the difference information vector corresponding to each layer of the original image; the inverse diffusion process takes the generated virtual thick-slice CT as input and the difference information vector as a condition to restore the original thin-slice CT image. During the training process, this cycle uses the adversarial loss between the virtual thick-slice CT image and the real thick-slice CT image and the pixel-by-pixel reconstruction loss between the restored thin-slice CT image and the real thin-slice CT image as supervision signals, and trains the network parameters of the forward diffusion process and the inverse diffusion process through a supervised learning strategy, so that the state space and the diffusion model finally have the ability to losslessly compress and restore CT images.
[0117] Based on the virtual thick-slice CT image, the diffusion model uses the difference information vector to gradually remove the noise introduced in the forward diffusion process and restore the details of the original thin-slice CT image. At the same time, referring to the corresponding thin-slice CT image in the training dataset, the model continuously adjusts the parameters in the diffusion process to ensure that the image quality of the restored thin-slice CT has no difference from the real thin-slice CT.
[0118] The inverse diffusion process includes the following steps:
[0119] S71. The spatial state model analyzes the difference information vector and extracts features from the virtual thick-layer CT image to obtain preprocessed information.
[0120] Obtain the global image feature H of the virtual thick-layer CT image thick , and optimize the representation to analyze the difference information vector through non-linear transformation where g is the feature extraction function of the state space model.
[0121] S72. The diffusion model gradually denoises the virtual thick-layer CT image to obtain the restored thin-layer CT image.
[0122] Taking the virtual thick-layer CT as the initial state and combining the difference information vector as the conditional input, perform inverse diffusion to restore 5 thin-layer CT images, that is where w i is the learned weight coefficient. The denoising process is where α t is the denoising step size, and Z t , is the current denoising state. Using different difference information vectors as conditions to guide the diffusion model to restore the corresponding thin-layer CT image: i where is the number of layers.
[0123] In one embodiment, adjust the parameters of the inverse diffusion process according to the bijective mapping relationship, including:
[0124] S81. Calculate the per-pixel reconstruction loss between the restored thin-layer CT image and the corresponding thin-layer CT image in the training dataset.
[0125] S82. Adjust the parameters of the inverse diffusion process according to the per-pixel reconstruction loss until the difference between the restored thin-layer CT image and the corresponding thin-layer CT image in the training dataset is less than the preset value.
[0126] Adjust the parameters of the inverse diffusion process through the per-pixel reconstruction loss to ensure that the image quality of the restored thin-layer CT has no difference from the real thin-layer CT.
[0127] The CT image lossless compression and restoration method based on the state space and diffusion model of the present application converts the target thin-layer CT into a virtual thick-layer CT and multiple differential information vectors through a forward diffusion process, and then saves them. When retrospective examination is required, the virtual thick-layer CT can be used for diagnosis first; if further detailed observation is needed, the original thin-layer CT can be restored by combining the virtual thick-layer CT and the differential information vectors for diagnosis. The virtual thick-layer CT image is the compressed image data, which retains the basic information in the original thin-layer CT image while reducing the data space occupancy to 20% of the original. Assuming that the space occupancy cost of thin-layer CT data with a layer thickness of 1 mm is 100%, then the space occupancy cost of the virtual thick-layer CT data with a layer thickness of 5 mm generated through the forward diffusion process is 20%, and the space occupancy cost of the differential information vectors is 5%, and a total of 75% of the storage and transmission costs can be saved.
[0128] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiment of the present application also provides a CT image lossless compression device based on the state space and diffusion model for implementing the above-mentioned CT image lossless compression method based on the state space and diffusion model. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the CT image lossless compression device based on the state space and diffusion model provided below can refer to the limitations on the CT image lossless compression method based on the state space and diffusion model in the above text, and will not be repeated here.
[0130] In an exemplary embodiment, as Figure 4 shown, a CT image lossless compression device based on the state space and diffusion model is provided, including:
[0131] A data acquisition module for acquiring thin-layer CT images;
[0132] A data transmission module for inputting the thin-layer CT image into the state space and diffusion model;
[0133] A feature extraction module, configured to extract features from thin-slice CT images by using a state space model to obtain a high-dimensional image feature vector;
[0134] An image lossless compression module, configured to perform forward diffusion on the high-dimensional image feature vector by using a diffusion model to obtain a virtual thick-slice CT image;
[0135] An image difference module, configured to generate a difference information vector according to the information difference between the virtual thick-slice CT image and the thin-slice CT image.
[0136] The embodiment of the present application further provides a CT image lossless recovery device based on a state space and a diffusion model for implementing the above-mentioned CT image lossless recovery method involving a state space and a diffusion model. In an exemplary embodiment, as Figure 5 shown, a CT image lossless recovery device based on a state space and a diffusion model is provided, including:
[0137] A data reading module, configured to obtain a virtual thick-slice CT image and a difference information vector corresponding to a target thin-slice CT image in response to obtaining a recovery instruction of the target thin-slice CT image;
[0138] An image recovery module, configured to input the virtual thick-slice CT image and the difference information vector into a state space and a diffusion model to obtain a recovered target thin-slice CT image.
[0139] In one of the embodiments, the data reading module is further configured to obtain a virtual thick-slice CT image and a difference information vector;
[0140] The image recovery module is further configured to extract features from the virtual thick-slice CT image and analyze the difference vector information to obtain preprocessing information;
[0141] The image recovery module is further configured to perform inverse diffusion on the virtual thick-slice CT image to obtain a recovered target thin-slice CT image.
[0142] In one embodiment, a computer device is provided, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0143] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0144] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The components described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0145] The above embodiments only represent several implementation manners of the embodiments of the present application. The descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the embodiments of the application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the embodiments of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the embodiments of the present application.
Claims
1. A lossless compression method for CT images based on state space and diffusion model, characterized in that, The method includes: Obtaining thin-slice CT images; Inputting the thin-slice CT images into a state space and diffusion model; the state space and diffusion model includes a state space model and a diffusion model; Using the state space model to extract features from the thin-slice CT images to obtain high-dimensional image feature vectors; Using the diffusion model to perform forward diffusion on the high-dimensional image feature vectors to obtain virtual thick-slice CT images, and determining the virtual thick-slice CT images as the compressed images of the thin-slice CT images; Generating a difference information vector based on the information difference between the virtual thick-slice CT images and the thin-slice CT images.
2. The method according to claim 1, wherein: The state space and diffusion model is trained by the following method: Obtaining a thin-slice CT image dataset and a thick-slice CT image dataset; Performing data preprocessing on the thin-slice CT image dataset and the thick-slice CT image dataset to obtain a training dataset in which the thin-slice CT images and the thick-slice CT images are paired one by one; Learning the bidirectional mapping relationship between the thin-slice CT images and the thick-slice CT images according to the training dataset; the bidirectional mapping relationship includes a forward diffusion process; Adjusting the parameters of the forward diffusion process according to the forward diffusion process in the bidirectional mapping relationship; Determining the parameters of the forward diffusion process as the first model parameters of the state space and diffusion model to obtain the state space and diffusion model.
3. The method according to claim 2, wherein The learning of the bidirectional mapping relationship between the thin-slice CT images and the thick-slice CT images according to the training dataset includes: Using the state space model to perform long-distance dependence feature extraction on a thin-slice CT image in the training dataset to obtain a high-dimensional image feature vector; Constructing the forward diffusion process of the diffusion model according to the high-dimensional image feature vector and the corresponding thick-slice CT image in the training dataset to obtain virtual thick-slice CT images and difference information vectors.
4. The method according to claim 3, wherein: The forward diffusion process includes the following steps: The diffusion model gradually adds noise to the thin-slice CT images using the high-dimensional image features to obtain virtual thick-slice CT images; Calculating the information difference between the virtual thick-slice CT images and the thin-slice CT images to obtain difference information vectors.
5. The method according to claim 4, characterized in that, The adjusting of the parameters of the forward diffusion process according to the forward diffusion process in the bidirectional mapping relationship includes: Calculating the adversarial loss between the virtual thick-slice CT images and the corresponding thin-slice CT images; Adjusting the parameters of the forward diffusion process according to the adversarial loss until the visual quality of the virtual thick-slice CT images and the corresponding thick-slice CT images reaches a preset value.
6. A lossless restoration method for CT images based on state space and diffusion model, characterized in that, The method includes: In response to obtaining a restoration instruction for a target thin-slice CT image, obtaining the virtual thick-slice CT image and the difference information vector corresponding to the target thin-slice CT image; wherein, the virtual thick-slice CT image and the difference information vector are obtained by compressing the target thin-slice CT image using the compression method according to claim 1; Inputting the virtual thick-slice CT image and the difference information vector into the state space and diffusion model to obtain the restored target thin-slice CT image.
7. The method according to claim 6, wherein The state space and diffusion model obtain the restored target thin-slice CT image based on the following method: Obtain the virtual thick-slice CT image and the difference information vector; The spatial state model in the state space and diffusion model extracts features from the virtual thick-slice CT image and analyzes the difference vector information to obtain preprocessed information; The diffusion model in the state space and diffusion model performs inverse diffusion on the virtual thick-slice CT image using the preprocessed information to obtain the restored target thin-slice CT image.
8. The method according to any one of claims 6 and 7, wherein: The state space and diffusion model is trained by the following method: Learn the bidirectional mapping relationship between the thin-slice CT image and the thick-slice CT image according to the training data set; the bidirectional mapping relationship includes the inverse diffusion process; Adjust the parameters of the inverse diffusion process according to the bidirectional mapping relationship; Determine the parameters of the inverse diffusion process as the second model parameters of the state space and diffusion model to obtain the state space and diffusion model; the state space and diffusion model includes a conditional diffusion model.
9. The method according to claim 8, wherein: Construct the inverse diffusion process of the diffusion model according to the virtual thick-slice CT image and the difference information vector to obtain the restored thin-slice CT image; wherein the virtual thick-slice CT image and the difference information vector are obtained by the forward diffusion process of the thin-slice CT image; The inverse diffusion process includes the following steps: The spatial state model analyzes the difference information vector and extracts features from the virtual thick-slice CT image to obtain preprocessed information; The diffusion model gradually denoises the virtual thick-slice CT image to obtain the restored thin-slice CT image.
10. The method according to claim 9, wherein The adjusting the parameters of the inverse diffusion process according to the bidirectional mapping relationship includes: Calculate the per-pixel reconstruction loss between the restored thin-slice CT image and the corresponding thin-slice CT image in the training data set; Adjust the parameters of the inverse diffusion process according to the per-pixel reconstruction loss until the difference between the restored thin-slice CT image and the corresponding thin-slice CT image in the training data set is less than a preset value.