Medical image preprocessing method and device based on Fourier domain adaptation
Through the Fourier domain adaptation method, DBSCAN clustering and spectral exchange technology are used to solve the problems of unstable reconstruction effect and loss of details in medical image domain adaptation, and improve the prediction effect and implementation efficiency of the deep learning model.
Patent Information
- Application Number
- CN202210016344.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-07
AI Technical Summary
Existing domain adaptation methods for medical images have unstable reconstruction effects and are prone to losing image details, making them difficult to apply in medical images. Especially in the training and prediction of deep learning models, they result in low model implementation efficiency and high local data annotation costs. question.
Using a method based on Fourier domain adaptation, the DBSCAN clustering algorithm is used to perform feature encoding and clustering on the target domain image data set, and the spectral neighborhood exchange parameters are used to exchange the low-frequency part of the source domain image data set, and Fourier inversion is performed. Transform to reconstruct the image data set, and filter out the target reconstructed image data set based on feature distance to ensure that the feature distribution is close without losing the original details.
It effectively solves the domain adaptation problem of medical images, improves the prediction effect of the deep learning model, avoids the loss of details during the reconstruction process, reduces the training time and computing resource requirements, and improves the efficiency of model implementation.
Smart Images

Figure CN114492599B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image preprocessing, and in particular to a medical image preprocessing method and device based on Fourier domain adaptation. Background Art
[0002] With the rapid development of artificial intelligence in the medical field, more and more deep learning models are being used in the diagnosis, classification and segmentation of medical images to provide doctors with auxiliary diagnosis suggestions, such as the diagnosis of fundus diabetic retinopathy. The application of deep learning models requires that the feature distribution of the test data set is consistent with that of the training data set in order to achieve the best prediction effect of the model. However, in the actual medical image generation process, due to the inconsistent generation standards adopted by various hospitals, such as the standard for the dosage of developer and the inconsistent equipment parameter settings resulting in image grayscale differences, the image data for the same patient is different between hospitals, and even between different data collection machines in the same hospital. When used to support artificial intelligence deep learning, the model parameters will also be different. The inconsistent data distribution of various hospitals requires deep learning models to be retrained using local medical image data when they are implemented in various hospitals, which brings difficulties such as low model implementation efficiency and high local data annotation costs.
[0003] In the computer field, this problem can be described as a domain adaptation problem for medical images. At present, the solutions to the traditional domain adaptation problem are mainly: 1) Difference-based domain adaptation methods, which usually use deep learning models to annotate unlabeled test data to form pseudo labels, use special methods to screen out high-quality pseudo labels and add them to the training set for two-stage training, and fine-tune the model network parameters to eliminate domain offset. 2) Adversarial-based domain adaptation methods, add domain discriminators to deep learning models for adversarial training to promote confusion between source and target domains. The domain discriminator classifies whether a data is from the source domain or the target domain. When it cannot distinguish, it means that the network has achieved domain adaptation. 3) Reconstruction-based domain adaptation methods, usually use newly trained generative adversarial networks (GANs) for style transfer, reconstruct test samples to training samples, so that the distribution of test data is close to the distribution of training data. Methods 1) and 2) both require modifications to the model structure or training process, which are labor-intensive and have poor scalability. Method 3) usually requires paired labeled data, and the image reconstruction effect of the generative adversarial network is unstable and prone to losing image details. Deep learning of medical images has the characteristics of small data volume, high annotation cost, and cannot tolerate the loss of image details. Therefore, the reconstruction domain adaptation method based on generative adversarial networks is difficult to be applied to the domain adaptation of medical images. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0005] To this end, the first object of the present invention is to propose a medical image preprocessing method based on Fourier domain adaptation to solve the domain adaptation problem of medical images in the prior art.
[0006] The second objective of the present invention is to provide a medical image preprocessing device based on Fourier domain adaptation.
[0007] The third objective of the present invention is to provide a terminal.
[0008] A fourth object of the present invention is to provide a non-transitory computer-readable storage medium.
[0009] To achieve the above-mentioned purpose, the first embodiment of the present invention proposes a medical image preprocessing method based on Fourier domain adaptation, comprising:
[0010] Obtain source domain image dataset and target domain image dataset;
[0011] Characterizing the target domain image data set to obtain a target domain feature set, clustering the target domain feature set using a DBSCAN clustering algorithm, and generating a target data set based on a cluster with the largest number of samples;
[0012] Set the spectral neighborhood exchange parameters;
[0013] Performing Fourier transform on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and using the spectral neighborhood exchange parameters to obtain the low-frequency part in the corresponding amplitude map, replacing the low-frequency part in the amplitude map of the source domain image dataset with the low-frequency part in the amplitude map of the target dataset, and performing inverse Fourier transform on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset;
[0014] The target reconstructed image dataset is screened out using the characteristic distance between the reconstructed image dataset and the target dataset.
[0015] The method of the embodiment of the present invention obtains a target data set based on a DBSCAN clustering algorithm and a target domain image data set. In this case, the DBSCAN clustering algorithm is introduced to select the most typical target domain samples to optimize the effect of feature migration. In addition, the low-frequency parts of the source domain image data set and the target data set are exchanged using Fourier forward and inverse transforms to obtain a reconstructed image data set. In this case, the feature distribution of the source domain data and the target domain data is brought closer, the details and texture of the original image will not be lost, and the reconstruction results are sorted based on the domain feature distance, thereby solving the domain adaptation problem of medical images.
[0016] In a medical image preprocessing method based on Fourier domain adaptation of an embodiment of the first aspect of the present invention, the characterization of the target domain image data set to obtain a target domain feature set includes: using a pre-trained unsupervised masked autoencoder to feature encode the target domain image data set to form a target domain feature set.
[0017] In a medical image preprocessing method based on Fourier domain adaptation in an embodiment of the first aspect of the present invention, after clustering the target domain feature set using the DBSCAN clustering algorithm, generating a target data set based on the cluster with the largest number of samples includes: introducing a density-based DBSCAN clustering algorithm, initializing two parameters: a scanning radius and a minimum number of included points; for feature data sample points that have not been visited in the target domain feature set, calculating the Manhattan distance between each feature data sample point and other feature data sample points; counting the number of samples within the scanning radius of the Manhattan distance, if the number of samples is greater than the minimum number of included points, the current feature data sample point and its nearby feature data sample points form a cluster, and recursively visit other feature data sample points in the cluster, if the number of samples is less than the minimum number of included points, marking the current feature data sample point as a noise point; after the target domain feature set is clustered, determining the cluster with the largest number of samples, and determining the central sample of the cluster with the largest number of samples through distance calculation, and using the central sample as the target data set.
[0018] In a medical image preprocessing method based on Fourier domain adaptation in an embodiment of the first aspect of the present invention, setting the spectral neighborhood exchange parameters includes: defining a mask and spectral neighborhood exchange parameters, the mask represents the spectral neighborhood area that needs to be replaced, and using the spectral neighborhood exchange parameters to determine the area range of the mask; setting the range of the spectral neighborhood exchange parameters and the number of randomly sampled samples within the range according to the characteristic offsets of the source domain image data set and the target data set.
[0019] In a medical image preprocessing method based on Fourier domain adaptation in an embodiment of the first aspect of the present invention, the use of the spectral neighborhood exchange parameters to obtain the corresponding low-frequency part in the amplitude map includes: according to the set range of the spectral neighborhood exchange parameters and the number of samples in the range, firstly selecting the maximum and minimum values of the range and adding them to the spectral neighborhood exchange parameter sample set, and then selecting the remaining number of samples from the range and adding them to the spectral neighborhood exchange parameter sample set; traversing the spectral neighborhood exchange parameter sample set, selecting spectral neighborhood exchange parameters to form a mask; and using the mask to obtain the low-frequency part in the amplitude map corresponding to the source domain image data set and the target data set.
[0020] In a medical image preprocessing method based on Fourier domain adaptation of an embodiment of the first aspect of the present invention, the selecting the remaining number of samples from the range and adding them to the spectral neighborhood exchange parameter sample set includes: selecting the remaining number of samples from the range using a non-equidistant random search algorithm and adding them to the spectral neighborhood exchange parameter sample set.
[0021] In a medical image preprocessing method based on Fourier domain adaptation in an embodiment of the first aspect of the present invention, the method of using the feature distance between the reconstructed image dataset and the target dataset to filter out a target reconstructed image dataset includes: characterizing the reconstructed image dataset to obtain a reconstructed feature set, calculating the Manhattan distance between the reconstructed feature set and the target dataset, sorting the Manhattan distances, and filtering out the reconstructed image with the closest distance as the target reconstructed image dataset.
[0022] To achieve the above-mentioned purpose, a second embodiment of the present invention proposes a medical image preprocessing device based on Fourier domain adaptation, comprising:
[0023] A data acquisition module, used to acquire a source domain image dataset and a target domain image dataset;
[0024] A data pre-processing module is used to characterize the target domain image data set to obtain a target domain feature set, cluster the target domain feature set using the DBSCAN clustering algorithm, and generate a target data set based on the cluster with the largest number of samples;
[0025] A parameter setting module, used to set the spectral neighborhood exchange parameters;
[0026] An image reconstruction module, used to perform Fourier transform on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and use the spectral neighborhood exchange parameters to obtain the low-frequency part in the corresponding amplitude map, replace the low-frequency part in the amplitude map of the source domain image dataset with the low-frequency part in the amplitude map of the target dataset, and perform inverse Fourier transform on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset;
[0027] The reconstruction result screening module is used to screen out a target reconstructed image dataset by using the characteristic distance between the reconstructed image dataset and the target dataset.
[0028] In the device of the embodiment of the present invention, the data pre-processing module obtains the target data set based on the DBSCAN clustering algorithm and the target domain image data set. In this case, the DBSCAN clustering algorithm is introduced to select the most typical target domain samples to optimize the effect of feature migration. In addition, the image reconstruction module uses Fourier forward and inverse transforms to exchange the low-frequency parts in the source domain image data set and the target data set to obtain a reconstructed image data set. In this case, the feature distribution of the source domain data and the target domain data is brought closer, and the details and texture of the original image will not be lost. Then, the reconstruction result screening module sorts the reconstruction results based on the domain feature distance, thereby solving the domain adaptation problem of medical images.
[0029] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a terminal, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a medical image preprocessing method based on Fourier domain adaptation according to the first aspect of the present invention.
[0030] In order to achieve the above-mentioned objectives, an embodiment of the fourth aspect of the present invention proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a medical image preprocessing method based on Fourier domain adaptation of an embodiment of the first aspect of the present invention.
[0031] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0033] Figure 1 A schematic flow chart of a medical image preprocessing method based on Fourier domain adaptation provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a flow chart of a method for generating a target data set provided by an embodiment of the present invention;
[0035] Figure 3 A schematic flow chart of a method for obtaining a low-frequency part provided in an embodiment of the present invention;
[0036] FIG4( a ) is a schematic diagram of an original image in a source domain image dataset provided by an embodiment of the present invention;
[0037] FIG4( b ) is a schematic diagram of a reconstructed image corresponding to FIG4( a );
[0038] FIG4( c ) is a schematic diagram of a target image corresponding to FIG4( a );
[0039] Figure 5 A schematic diagram of the structure of a medical image preprocessing device based on Fourier domain adaptation provided by an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention;
[0041] Figure 7 A schematic diagram of the structure of an operating system and a user space provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limitations on the present invention. Any process or method description in a flow chart or otherwise described herein may be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a custom logic function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, in which functions may be performed in a substantially simultaneous manner or in reverse order according to the functions involved, which should be understood by a person skilled in the art of the art to which the embodiments of the present invention belong.
[0043] The present invention is described in detail below with reference to specific embodiments.
[0044] Figure 1 A flowchart of a medical image preprocessing method based on Fourier domain adaptation provided by an embodiment of the present invention.
[0045] The embodiment of the present invention provides a medical image preprocessing method based on Fourier domain adaptation to solve the problem that the reconstruction effect is unstable and image details are easily lost when reconstructing pictures in the prior art, and it cannot be applied to the domain adaptive reconstruction of medical images, such as Figure 1 As shown, the medical image preprocessing method based on Fourier domain adaptation (can be referred to as preprocessing method for short) includes the following steps:
[0046] Step S101: Acquire a source domain image dataset and a target domain image dataset.
[0047] In step S101, the source domain image dataset is an original image dataset to be reconstructed. The source domain image dataset includes a plurality of original images to be reconstructed. The original images are, for example, original medical images. The source domain image dataset can be D s Indicates that each original image can be represented by x s The images in the source domain image dataset and the images in the target domain image dataset are of the same type. The target domain image dataset is an image dataset with the same or similar features as the deep learning model training set. The target domain image dataset can be represented by D t In this embodiment, the target domain image dataset serves as a reference, and the feature distribution of the original image to be reconstructed in the source domain image dataset is close to that of the target domain image dataset during subsequent reconstruction.
[0048] Step S102, characterizing the target domain image data set to obtain a target domain feature set, clustering the target domain feature set using the DBSCAN clustering algorithm, and generating a target data set based on the cluster with the largest number of samples.
[0049] In step S102, characterizing the target domain image dataset to obtain the target domain feature set specifically includes: using a pre-trained unsupervised masked autoencoder to characterize the target domain image dataset D t Perform feature encoding to form the target domain feature set. The target domain feature set can be represented by E t In other words, the unsupervised masked autoencoder uses a large-scale image dataset for pre-training. The target domain feature set includes multiple images after feature encoding.
[0050] In step S102, Figure 2 FIG. 1 is a flow chart of a method for generating a target data set provided by an embodiment of the present invention. Figure 2As shown, after clustering the target domain feature set using the DBSCAN clustering algorithm, generating a target data set based on the cluster with the largest number of samples specifically includes: introducing a density-based DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm, initializing two parameters, the scanning radius and the minimum number of included points (step S1021); for feature data sample points that have not been visited in the target domain feature set, calculating the Manhattan distance between each feature data sample point and other feature data sample points (step S1022); counting the number of samples within the scanning radius of the Manhattan distance, if the number of samples is greater than the minimum number of included points, the current feature data sample point and its nearby feature data sample points form a cluster, and recursively visit other feature data sample points in the cluster, if the number of samples is less than the minimum number of included points, marking the current feature data sample point as a noise point (step S1023); after the target domain feature set is clustered, determining the cluster with the largest number of samples, and determining the central sample of the cluster with the largest number of samples through distance calculation, and taking the central sample as the target data set (step S1024). The scanning radius in step S1021 can be represented by eps, the minimum number of included points can be represented by minPts, and the feature data sample points in step S1022 are the images after feature encoding. The target data set can include one or more target images (i.e., center samples), and each target image can be represented by x t In this case, the density-based DBSCAN clustering algorithm is introduced to select the most typical target domain samples, so that the selected target dataset can better represent the target domain image dataset D t , thus making the subsequent Fourier domain adaptive image reconstruction more effective.
[0051] In some other embodiments, the target data set may be selected as a reference from the cluster with the largest number of samples.
[0052] Step S103, setting spectral neighborhood exchange parameters.
[0053] In step S103, setting the spectral neighborhood exchange parameters specifically includes: defining a mask and spectral neighborhood exchange parameters, the mask represents the spectral neighborhood area to be replaced, and the spectral neighborhood exchange parameters are used to determine the area range of the mask; according to the characteristic offset of the source domain image dataset and the target dataset, the range of the spectral neighborhood exchange parameters and the number of randomly sampled samples within the range are set. The mask can be represented by the symbol M β, β is a spectral neighborhood exchange parameter, the range of β is from 0 to 1, and the number of randomly sampled samples within the range can be represented by n. In some embodiments, the range of n is from 2 to 20. In some embodiments, the range of the spectral neighborhood exchange parameter can be set manually, and in other embodiments, the range of the spectral neighborhood exchange parameter can be set automatically.
[0054] In step S103, it is assumed that the center of the image is the origin of the coordinate axis, the height of the image is 2H, the width is 2W, the height of the mask is 2h, and the width is 2w, where h = βH, w = βW, β∈(0,1). If the mask is centered at the origin, then the mask M β The area range is (-βH:βH,-βW:βW), the mask M β The values in the area are all 0, except for the mask M β The values of the areas outside the area range are all 0, and the mask M β The expression is:
[0055] M β (h,w)=1 (h,w)∈[-βH:βH,-βW:βW] .
[0056] Step S104, Fourier transform is performed on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and the low-frequency part in the corresponding amplitude map is obtained by using the spectral neighborhood exchange parameter, and the low-frequency part in the amplitude map of the source domain image dataset is replaced by the low-frequency part in the amplitude map of the target dataset, and Fourier inverse transform is performed on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset.
[0057] In step S104, the source domain image dataset D s The original image x to be reconstructed in s Perform fast Fourier transform to form an amplitude map and phase diagram For the target image x in the target dataset t Perform fast Fourier transform to form an amplitude map and phase diagram
[0058] In step S104, Figure 3 A schematic diagram of a flow chart of a method for obtaining a low-frequency part provided in an embodiment of the present invention, such as Figure 3As shown, using the spectral neighborhood exchange parameters to obtain the corresponding low-frequency part in the amplitude map includes: first, according to the set range of the spectral neighborhood exchange parameters and the number of samples in the range, respectively selecting the maximum and minimum values of the range to add to the spectral neighborhood exchange parameter sample set, and then selecting the remaining number of samples from the range to add to the spectral neighborhood exchange parameter sample set (step S1041); traversing the spectral neighborhood exchange parameter sample set, selecting the spectral neighborhood exchange parameters to form a mask (step S1042); using the mask to obtain the low-frequency part in the amplitude map corresponding to the source domain image data set and the target data set (step S1043). Among them, the spectral neighborhood exchange parameter sample set can be represented by S β Indicates that the number of samples in step S1041 is n, and the number of samples remaining after selecting the maximum value and the minimum value is n-2. When selecting the spectral neighborhood exchange parameters in step S1042, the parameters can be selected according to the requirements.
[0059] In some embodiments, selecting the remaining number of samples from the range and adding them to the spectral neighborhood exchange parameter sample set includes: selecting the remaining number of samples from the range using a non-equidistant random search algorithm and adding them to the spectral neighborhood exchange parameter sample set.
[0060] In step S104, the reconstructed image data set can be f Indicates that each reconstructed image in the reconstructed image dataset can be reconstructed using x f Represents the reconstructed image x f The expression is:
[0061]
[0062] In the formula, represents the inverse fast Fourier transform, Represents dot product.
[0063] Step S105 , selecting a target reconstructed image dataset by using the characteristic distance between the reconstructed image dataset and the target dataset.
[0064] In step S105, the target reconstructed image dataset is selected by using the characteristic distance between the reconstructed image dataset and the target dataset, including: characterizing the reconstructed image dataset to obtain a reconstructed characteristic set, calculating the Manhattan distance between the reconstructed characteristic set and the target dataset, sorting the Manhattan distances, and selecting the reconstructed image with the closest distance as the target reconstructed image dataset.
[0065] In step S105, the method of characterizing the reconstructed image dataset can refer to the method of characterizing the target domain image dataset. That is, the reconstructed image dataset is feature encoded using the pre-trained unsupervised masked autoencoder to form a reconstructed feature set. The reconstructed feature set can be represented by Ef express.
[0066] In step S105, sorting by Manhattan distance and selecting the reconstructed image with the closest distance as the target reconstructed image data set includes: sorting according to the shortest Manhattan distance from the reconstructed image to each cluster center, selecting the reconstructed image with the closest distance, selecting it as the target reconstructed image, and forming the target reconstructed image data set.
[0067] The preprocessing method proposed in the embodiment of the present invention is based on the Fourier domain adaptation algorithm. The Fourier domain adaptation is to exchange the low-frequency part of the amplitude of the source domain image data set and the target data set after the Fourier fast transform and then reconstruct to obtain the reconstructed image data set. In this case, while ensuring that the details and texture of the original image of the medical image are not lost, its feature distribution is close to the target domain, and the feature distribution of the source domain data and the target domain data are brought closer. In addition, in order to reduce the instability of the reconstruction effect brought by Fourier domain adaptation, and reduce the dependence on the selection of typical data in the target domain and the selection of the spectral neighborhood exchange parameter β, the preprocessing method of the present invention takes into account the Fourier domain adaptation to ensure that the texture details of the medical image are not lost, and improves the algorithm, introduces the DBSCAN clustering algorithm to select the most typical target domain sample to optimize the effect of feature migration, and randomly samples the spectral neighborhood exchange parameter β within a range, and selects the optimal result according to the feature clustering metric sorting of the reconstructed image sample and the target data set, optimizes the image reconstruction effect, and solves the domain adaptation problem of medical images. The present invention can be applied to the preprocessing method before deep learning of medical image data, so that the medical image does not lose the original detail texture information while improving the prediction effect of the deep learning model. In addition, the preprocessing method of the present invention does not require deep learning training, but only requires fast mathematical operations, which saves a lot of training time and requires less computing power resources.
[0068] In some other embodiments, the medical image preprocessing method based on Fourier domain adaptation may also include: displaying the original image in the source domain image data set, the reconstructed image in the reconstructed image data set, and the target image in the target data set. s 4(b) is a schematic diagram of the corresponding reconstructed image x of FIG4(a). f 4(c) is a schematic diagram of the target image x corresponding to FIG4(a). t Schematic diagram of . Figure 4(a) to Figure 4(a) It can be seen that the reconstructed image x f Compared to the original image x s The contrast is better and compared with the original image x s , reconstruct the image x f With the target image xt The characteristic distribution is closer.
[0069] In order to implement the above-mentioned embodiment, the present invention further proposes a medical image preprocessing device based on Fourier domain adaptation (which may be referred to as a preprocessing device for short).
[0070] Figure 5 A schematic diagram of the structure of a medical image preprocessing device based on Fourier domain adaptation provided in an embodiment of the present invention.
[0071] like Figure 5 As shown, the medical image preprocessing device 10 based on Fourier domain adaptation includes a data acquisition module 11, a data preprocessing module 12, a parameter setting module 13, an image reconstruction module 14 and a reconstruction result screening module 15.
[0072] In this embodiment, the data acquisition module 11 can be used to acquire a source domain image dataset and a target domain image dataset. The data pre-processing module 12 can be used to characterize the target domain image dataset to obtain a target domain feature set, and after clustering the target domain feature set using the DBSCAN clustering algorithm, generate a target dataset based on the cluster with the largest number of samples. The parameter setting module 13 can be used to set the spectral neighborhood exchange parameters. The image reconstruction module 14 can be used to perform Fourier transform on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and use the spectral neighborhood exchange parameters to obtain the low-frequency part in the corresponding amplitude map, replace the low-frequency part in the amplitude map of the source domain image dataset with the low-frequency part in the amplitude map of the target dataset, and perform Fourier inverse transform on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset. The reconstruction result screening module 15 can be used to screen out the target reconstructed image dataset using the feature distance between the reconstructed image dataset and the target dataset.
[0073] In this embodiment, the data acquisition module 11 is a medical image data input module of the preprocessing device 10. The data acquisition module 11 needs to input two sets of data, one of which is the original image data set D to be reconstructed. s (i.e., source domain image dataset), and the other is the target domain image dataset D with the same or similar features as the deep learning model training set. t .
[0074] In this embodiment, the data pre-processing module 12 characterizes the target domain image data set to obtain a target domain feature set E t Then, from the target domain feature set E t Select the target dataset from the dataset, and use x for each image in the target dataset. t Specifically, an unsupervised masked autoencoder pre-trained on a large-scale image dataset is introduced to the target domain image dataset Dt Perform feature encoding to form the target domain feature set E t The density-based DBSCAN clustering algorithm is introduced, and the two parameters of the scanning radius eps and the minimum number of included points minPts are initialized. t The unvisited feature data sample points in the target domain are calculated, and the Manhattan distance between the sample point and other sample points is calculated. The number of samples within the scanning radius eps is counted. If the number of samples is greater than the minimum number of included points minPts, the current sample point and its nearby sample points form a cluster and recursively visit other sample points in the cluster. If the number of samples is less than the minimum number of included points minPts, the sample point is marked as a noise point. t After clustering is completed, the cluster with the largest number of samples is determined, and the central sample of the cluster is determined by distance calculation, and the central sample is used as the selected target data set.
[0075] In this embodiment, the parameter setting module 13 is specifically used to define a mask M β , the mask M β represents the spectral domain area that needs to be exchanged (or replaced), β is the spectral neighborhood exchange parameter, assuming that the center of the image is the origin of the coordinate axis, then the mask M β Except for the region β∈(0,1) centered at the origin, all values in the region are 0. β The expression is:
[0076] M β (h,w)=1 (h,w)∈[-βH:βH,-βW:βW] .
[0077] In this embodiment, the parameter setting module 13 manually sets the range of the spectral neighborhood exchange parameter β (with a boundary of 0 to 1) according to the size of the feature offset of the source domain image dataset and the target dataset, and sets the number of samples n randomly sampled within the range, where n ranges from 2 to 20.
[0078] In this embodiment, the image reconstruction module 14 uses the spectral domain exchange parameter β to reconstruct the original image to be reconstructed in the source domain image dataset into the target domain, specifically including: s Select the original image x to be reconstructed s ; For the source domain image dataset D s The original image x to be reconstructed in s Perform fast Fourier transform to form an amplitude map and phase diagram For the target image x in the target dataset t Perform fast Fourier transform to form an amplitude map and phase diagram According to the range of the spectral neighborhood exchange parameter β set by the parameter setting module 13 and the number of samples n within the range, firstly, the maximum and minimum values of the β range are selected and added to the spectral neighborhood exchange parameter sample set S β Then, the remaining number of samples n-2 is selected from the β range using a non-equidistant random search algorithm and added to the spectral neighborhood exchange parameter sample set S β Middle; traverse the spectral neighborhood exchange parameter sample set S β , select the spectral neighborhood exchange parameter β to form the mask M β ; Use the mask to obtain the low-frequency part of the amplitude map corresponding to the source domain image data set and the target data set; exchange the low-frequency part of the amplitude map of the target image with the low-frequency part of the amplitude map of the original image to be reconstructed; perform inverse Fourier transform on the amplitude map and phase map of the replaced original image to obtain the reconstructed image x f , each reconstructed image x f Composed of reconstructed image dataset D f . Reconstruct the image x f The expression is:
[0079]
[0080] In the formula, represents the inverse fast Fourier transform, Represents dot product.
[0081] In this embodiment, the reconstruction result screening module 15 uses the shielded automatic encoder used in the data pre-processing module 12 to reconstruct the image data set D f Perform feature encoding to form the reconstruction feature set E f , and the target domain feature set E t The Manhattan distance of the cluster center (i.e., the central sample) after DBSCAN clustering is calculated, and the reconstructed image is sorted according to the shortest Manhattan distance from the cluster center. The reconstructed image with the closest distance is selected and used as the final reconstructed image (i.e., the target reconstructed image), and the final reconstructed image dataset is formed and saved.
[0082] The preprocessing device proposed in the embodiment of the present invention, the image reconstruction module 14 is based on the Fourier domain adaptation algorithm. The Fourier domain adaptation is to exchange the low-frequency part of the amplitude of the source domain image data set and the target data set after Fourier fast transformation and then reconstruct to obtain a reconstructed image data set. In this case, while ensuring that the details and texture of the original image of the medical image are not lost, its feature distribution is close to the target domain, and the feature distribution of the source domain data and the target domain data are closer. In addition, in order to reduce the instability of the reconstruction effect caused by Fourier domain adaptation, and reduce the dependence on the selection of typical data in the target domain and the selection of the spectral neighborhood exchange parameter β, the preprocessing method of the present invention improves the algorithm while taking into account Fourier domain adaptation to ensure that the texture details of the medical image are not lost. The data preprocessing module 12 introduces the DBSCAN clustering algorithm to select the most typical target domain samples to optimize the effect of feature migration, and randomly samples the spectral neighborhood exchange parameter β within a range. The reconstruction result screening module 15 selects the optimal result according to the feature clustering metric sorting of the reconstructed image samples and the target data set, optimizes the image reconstruction effect, and solves the domain adaptation problem of medical images. The present invention can be applied to the preprocessing method of medical image data before deep learning, so that the medical image can improve the prediction effect of the deep learning model without losing the original detail texture information. In addition, the preprocessing method of the present invention does not require deep learning training, but only requires fast mathematical operations, which saves a lot of training time and requires less computing power resources.
[0083] In some other embodiments, the preprocessing device 10 may further include a reconstruction result display module. The reconstruction result display module may be used to display the image. The displayed image may include the original image x in the source domain image dataset. s , the reconstructed image x in the reconstructed image dataset f and the target image x in the target dataset t .
[0084] It should be noted that the aforementioned explanation of the embodiment of the medical image preprocessing method based on Fourier domain adaptation is also applicable to the medical image preprocessing device based on Fourier domain adaptation of this embodiment, and will not be repeated here.
[0085] The embodiment of the present invention further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1-Figure 3 The medical image preprocessing method based on Fourier domain adaptation in the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 3 The specific description of the illustrated embodiment will not be repeated here.
[0086] Figure 6 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention; Figure 7 A schematic diagram of the structure of an operating system and a user space provided by an embodiment of the present invention.
[0087] Please refer to Figure 6 , which shows a block diagram of a terminal provided by an exemplary embodiment of the present invention. The terminal in the present invention may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150. The processor 110 loads and executes the above-mentioned Figure 1-Figure 3 The medical image preprocessing method based on Fourier domain adaptation in the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 3 The specific description of the illustrated embodiment will not be repeated here.
[0088] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions and processes data of the terminal 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0089] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems. The data storage area may also store data created by the terminal during use, such as a phone book, audio and video data, chat record data, etc.
[0090] See also Figure 7 As shown, the memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good operating results, the operating system allocates corresponding system resources to different third-party applications. However, different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0091] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0092] The input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are a touch display screen, which is used to receive touch operations on or near it by a user using any suitable object such as a finger or a touch pen, and to display the user interface of each application. The touch display screen is usually set on the front panel of the terminal. The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present invention.
[0093] In addition, those skilled in the art will appreciate that the structure of the terminal shown in the above drawings does not constitute a limitation on the terminal, and the terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module, and other components, which will not be described in detail here.
[0094] In the embodiment of the present invention, the execution subject of each step may be the terminal described above. Optionally, the execution subject of each step is the operating system of the terminal. The operating system may be an Android system, an IOS system, or other operating systems, which is not limited in the embodiment of the present invention.
[0095] The terminal of the embodiment of the present invention may also be equipped with a display device, which may be any device capable of realizing a display function, such as a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a liquid crystal display (LCD), a plasma display panel (PDP), etc. The user may use the display device on the terminal to view displayed text, images, videos and other information. The terminal may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, electronic clothing and other devices.
[0096] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0097] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0098] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0099] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0100] The units 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk or optical disk, etc., various media that can store program codes.
[0103] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0104] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. The present invention is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A medical image preprocessing method based on Fourier domain adaptation, characterized in that: include: Obtain source domain image dataset and target domain image dataset; Characterizing the target domain image data set to obtain a target domain feature set, clustering the target domain feature set using a DBSCAN clustering algorithm, and generating a target data set based on a cluster with the largest number of samples; Set the spectral neighborhood exchange parameters; Performing Fourier transform on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and using the spectral neighborhood exchange parameters to obtain the low-frequency part in the corresponding amplitude map, replacing the low-frequency part in the amplitude map of the source domain image dataset with the low-frequency part in the amplitude map of the target dataset, and performing inverse Fourier transform on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset; The target reconstructed image dataset is screened out using the characteristic distance between the reconstructed image dataset and the target dataset.
2. The method according to claim 1, characterized in that: The characterizing the target domain image data set to obtain a target domain feature set comprises: The target domain image dataset is feature encoded using a pre-trained unsupervised masked autoencoder to form a target domain feature set.
3. The method according to claim 1, characterized in that After clustering the target domain feature set using the DBSCAN clustering algorithm, generating a target data set based on the cluster with the largest number of samples includes: Introduce the density-based DBSCAN clustering algorithm and initialize the two parameters of scanning radius and minimum number of included points; For feature data sample points that have not been visited in the target domain feature set, calculating the Manhattan distance between each feature data sample point and other feature data sample points; Count the number of samples of the Manhattan distance within the scanning radius. If the number of samples is greater than the minimum number of included points, the current feature data sample point and its nearby feature data sample points form a cluster, and recursively access other feature data sample points in the cluster. If the number of samples is less than the minimum number of included points, mark the current feature data sample point as a noise point. After the target domain feature set is clustered, the cluster with the largest number of samples is determined, and the central sample of the cluster with the largest number of samples is determined by distance calculation, and the central sample is used as the target data set.
4. The method according to claim 1, characterized in that: The setting of the spectrum neighborhood exchange parameters includes: A mask and spectral neighborhood exchange parameters are defined, wherein the mask represents the spectral neighborhood area to be replaced, and the spectral neighborhood exchange parameters are used to determine the area range of the mask; According to the characteristic offsets of the source domain image dataset and the target dataset, the range of the spectral neighborhood exchange parameter and the number of randomly sampled samples within the range are set.
5. The method according to claim 4, characterized in that The obtaining of the low-frequency part in the corresponding amplitude diagram by using the spectral neighborhood exchange parameter comprises: According to the set range of the spectral neighborhood exchange parameter and the number of samples within the range, firstly, the maximum value and the minimum value of the range are respectively selected and added to the spectral neighborhood exchange parameter sample set, and then the remaining number of samples are selected from the range and added to the spectral neighborhood exchange parameter sample set; Traversing the spectral neighborhood exchange parameter sample set, and selecting spectral neighborhood exchange parameters to form a mask; The mask is used to obtain a low-frequency portion in an amplitude map corresponding to the source domain image dataset and the target dataset.
6. The method according to claim 5, characterized in that The selecting of the remaining number of samples from the range and adding them to the spectrum neighborhood exchange parameter sample set comprises: The remaining number of samples are selected from the range using a non-equidistant random search algorithm and added to the spectral neighborhood exchange parameter sample set.
7. The method according to claim 1, characterized in that The step of selecting the target reconstructed image dataset by using the characteristic distance between the reconstructed image dataset and the target dataset comprises: The reconstructed image data set is characterized to obtain a reconstructed feature set, the Manhattan distance between the reconstructed feature set and the target data set is calculated, the Manhattan distances are sorted, and the reconstructed image with the closest distance is selected as the target reconstructed image data set.
8. A medical image preprocessing device based on Fourier domain adaptation, characterized in that: include: A data acquisition module, used to acquire a source domain image dataset and a target domain image dataset; A data pre-processing module is used to characterize the target domain image data set to obtain a target domain feature set, cluster the target domain feature set using the DBSCAN clustering algorithm, and generate a target data set based on the cluster with the largest number of samples; A parameter setting module, used to set the spectral neighborhood exchange parameters; An image reconstruction module, used to perform Fourier transform on the images in the source domain image dataset and the target dataset respectively to obtain corresponding amplitude maps and phase maps, and use the spectral neighborhood exchange parameters to obtain the low-frequency part in the corresponding amplitude map, replace the low-frequency part in the amplitude map of the source domain image dataset with the low-frequency part in the amplitude map of the target dataset, and perform inverse Fourier transform on the amplitude map and phase map of the replaced source domain image dataset to obtain a reconstructed image dataset; The reconstruction result screening module is used to screen out a target reconstructed image dataset by using the characteristic distance between the reconstructed image dataset and the target dataset.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
