CN117455773A - Super-resolution food low-field nuclear magnetic image generation method and system - Google Patents
Super-resolution food low-field nuclear magnetic image generation method and system Download PDFInfo
- Publication number
- CN117455773A CN117455773A CN202311421172.1A CN202311421172A CN117455773A CN 117455773 A CN117455773 A CN 117455773A CN 202311421172 A CN202311421172 A CN 202311421172A CN 117455773 A CN117455773 A CN 117455773A
- Authority
- CN
- China
- Prior art keywords
- low
- noise
- image
- field nuclear
- resolution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 235000013305 food Nutrition 0.000 title claims abstract description 58
- 238000012549 training Methods 0.000 claims abstract description 22
- 230000005311 nuclear magnetism Effects 0.000 claims description 63
- 238000005070 sampling Methods 0.000 claims description 37
- 238000003062 neural network model Methods 0.000 claims description 29
- 238000013528 artificial neural network Methods 0.000 claims description 27
- 238000005481 NMR spectroscopy Methods 0.000 claims description 20
- 238000009826 distribution Methods 0.000 claims description 20
- 230000006870 function Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 6
- 238000013135 deep learning Methods 0.000 abstract description 5
- 238000009792 diffusion process Methods 0.000 abstract description 4
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 240000000851 Vaccinium corymbosum Species 0.000 description 4
- 235000003095 Vaccinium corymbosum Nutrition 0.000 description 4
- 235000017537 Vaccinium myrtillus Nutrition 0.000 description 4
- 235000021014 blueberries Nutrition 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000013527 convolutional neural network Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000035508 accumulation Effects 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000013421 nuclear magnetic resonance imaging Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4053—Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4046—Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10072—Tomographic images
- G06T2207/10088—Magnetic resonance imaging [MRI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/30—Assessment of water resources
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Magnetic Resonance Imaging Apparatus (AREA)
Abstract
The invention provides a super-resolution food low-field nuclear magnetic image generation method and a super-resolution food low-field nuclear magnetic image generation system, which belong to the technical field of deep learning and comprise the following steps: and applying the diffusion model to target image generation, and realizing super-resolution of the low-field nuclear magnetic image by iterative denoising. Firstly, combining a food low-resolution image and pure Gaussian noise to form a noise image, and inputting the noise image into a noise prediction model trained by different noise levels; and secondly, continuously and iteratively processing the noise image according to the predicted noise to finally obtain the super-resolution image with clear texture details. The invention solves the problems of easy collapse of the mode, overlarge parameter of the model and the like of the traditional method, thereby being capable of more stably training the model and generating the food low-field nuclear magnetic image with higher reliability.
Description
Technical Field
The invention relates to the technical field of deep learning, in particular to a super-resolution food low-field nuclear magnetic image generation method and system.
Background
Low field nuclear magnetic resonance (LF-NMR) is a technique that uses the interaction of nuclei in a magnetic field and radio frequency pulses to image at Low magnetic field strengths. Compared with the traditional high-field nuclear magnetic resonance imaging, the method has the advantages of low cost, small equipment volume, high imaging speed and the like. In recent years, low-field nuclear magnetic resonance has been a qualitative leap in research on food quality detection, and internal structural information and component information about food can be obtained by performing low-field nuclear magnetic resonance scanning on a sample. Such information can be used to evaluate the maturity, texture, internal decay level, pit size, etc. of the food product to assist in discriminating the quality of the fruit.
However, the lower magnetic field strength of LF-NMR results in weaker signal strength and poorer signal-to-noise ratio, and multiple signal accumulations are typically required to increase the signal strength and quality, resulting in increased sampling times. And meanwhile, long sampling time is also required for acquiring the high-resolution low-field nuclear magnetic resonance image with clear texture details. In order to reduce sampling time and improve equipment efficiency, super-resolution technology is introduced to process low-field nuclear magnetic resonance images of foods. Super-resolution techniques recover detailed features of a sampled object from a low-resolution image by exploiting local statistical properties (e.g., mean, variance, correlation, etc.) and prior knowledge in the image.
In the research of processing low-field nuclear magnetic resonance images by using a super-resolution technology, the traditional method mainly combines an interpolation algorithm and a restoration algorithm of the images. First, the low resolution image is up-sampled using an interpolation algorithm to increase the size of the image. The up-sampled image is then processed using a restoration algorithm to restore the details and edge information of the image loss. However, the conventional reconstruction method cannot utilize the advanced semantic information of the image, the image can be filled only through simple interpolation calculation, and detailed features of the complex image are difficult to clearly restore. In recent years, the image super-resolution method based on deep learning is far superior to the traditional method in performance, and the early methods based on convolutional neural networks, driven by a variational automatic encoder (Variational Auto Encoder, VAE) and driven by a generating countermeasure network (Generative Adversarial Networks, GAN) respectively have the problems of incapability of accurately restoring image details, huge model volumes, easy model collapse and easy mode collapse.
Disclosure of Invention
The invention provides a super-resolution food low-field nuclear magnetic image generation method and system, which are used for solving the defects that the accuracy is low, the details of images cannot be restored and the calculated amount is large in the prior art for processing food super-resolution images.
In a first aspect, the present invention provides a method for generating a super-resolution food low-field nuclear magnetic image, comprising:
collecting a low-field nuclear magnetism high-resolution image of a target food, and adding preset noise into the low-field nuclear magnetism high-resolution image to obtain a noisy low-field nuclear magnetism high-resolution image;
training an initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model;
and acquiring a low-field nuclear magnetism low-resolution image, and performing iterative sampling by using the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution to output a target super-resolution low-field nuclear magnetism image.
According to the method for generating the super-resolution food low-field nuclear magnetic image, provided by the invention, the low-field nuclear magnetic high-resolution image of the target food is acquired, and the preset noise is added into the low-field nuclear magnetic high-resolution image to obtain the noisy low-field nuclear magnetic high-resolution image, and the method comprises the following steps:
randomly sampling from standard normal distribution to generate Gaussian noise;
determining noise sequences and noise adding times of different noise adding degrees, wherein the length of the noise sequences is equal to the noise adding times;
and adding Gaussian noise with different noise adding degrees to the low-field nuclear magnetic high-resolution image according to the noise sequence and the noise adding times to obtain the noisy low-field nuclear magnetic high-resolution image.
According to the super-resolution food low-field nuclear magnetic image generation method provided by the invention, gaussian noise with different noise adding degrees is added to the low-field nuclear magnetic high-resolution image according to the noise sequence and the noise adding times, so that the noisy low-field nuclear magnetic high-resolution image is obtained, and the method comprises the following steps:
wherein,β i represents the noise adding degree of any noise sequence beta, X 0 Representing a low-field nuclear magnetic resonance high-resolution image, t representing the number of times of noise addition, E representing the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image.
According to the super-resolution food low-field nuclear magnetic image generation method provided by the invention, an initial Unet neural network is trained based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model, and the method comprises the following steps:
constructing the initial Unet neural network;
determining a low-field nuclear magnetic high-resolution image and a corresponding low-field nuclear magnetic low-resolution image in the training set;
the low-field nuclear magnetism high-resolution image is subjected to noise adding to obtain a noisy low-field nuclear magnetism high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times of the low-field nuclear magnetic high-resolution image into the initial Unet neural network, and outputting prediction noise;
and acquiring real noise, constructing a loss function according to the real noise and the predicted noise, and updating a network weight parameter by using back propagation by using the loss function to obtain the noise prediction neural network model.
According to the method for generating the super-resolution food low-field nuclear magnetic image, which is provided by the invention, the low-field nuclear magnetic low-resolution image is obtained, and according to the low-field nuclear magnetic low-resolution image and Gaussian noise of target resolution, iterative sampling is carried out by utilizing the noise prediction neural network model, and the target super-resolution low-field nuclear magnetic image is output, and the method comprises the following steps:
amplifying the low-field nuclear magnetism low-resolution image to target resolution through bicubic linear interpolation to obtain an amplified image;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, namely a Gaussian noise sample, and splicing the image sample and the amplified image in the channel dimension to obtain the noisy low-field nuclear magnetic resonance high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times to a noise prediction neural network model to obtain image noise;
according to the image noise and the noisy low-field nuclear magnetic high-resolution image, calculating to obtain an initial image;
according to the noisy low-field nuclear magnetic high-resolution image and the initial image, calculating to obtain the mean value and variance of the noisy low-field nuclear magnetic high-resolution image of the previous noise adding times;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, and calculating the previous noise-adding frequency band-noise low-field nuclear magnetism high-resolution image by using the image sample, the mean value and the variance;
and taking the previous noise-adding times with noise low-field nuclear magnetic high-resolution image as a new noise-adding low-field nuclear magnetic high-resolution image, and repeating iteration until the noise-adding times are 0, so as to obtain the target super-resolution low-field nuclear magnetic image.
According to the method for generating the super-resolution food low-field nuclear magnetic image, provided by the invention, an initial image is calculated according to the image noise and the noisy low-field nuclear magnetic high-resolution image, and the method comprises the following steps:
where E represents the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image,representing the initial image +.>β i Indicating the degree of any noise added to the noise sequence beta.
According to the super-resolution food low-field nuclear magnetic image generation method provided by the invention, the mean value and the variance of the previous noise-adding times with low-field nuclear magnetic high-resolution image are calculated according to the noise-adding low-field nuclear magnetic high-resolution image and the initial image, and the method comprises the following steps:
wherein μ represents the mean value, σ 2 Representing variance, alpha t =1-β t ,
According to the method for generating the super-resolution food low-field nuclear magnetic image provided by the invention, image samples with the same size as the target resolution are randomly sampled from standard normal distribution, and the image samples, the mean value and the variance are used for calculating to obtain the previous noise-adding frequency band-noise low-field nuclear magnetic high-resolution image, which comprises the following steps:
wherein X is t-1 Representing the previous noise-added frequency band-noise low-field nuclear magnetic high-resolution image, and Z represents randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution.
In a second aspect, the present invention also provides a super-resolution food low-field nuclear magnetic image generation system, including:
the noise adding module is used for collecting a low-field nuclear magnetism high-resolution image of the target food, adding preset noise to the low-field nuclear magnetism high-resolution image, and obtaining a low-field nuclear magnetism high-resolution image with noise;
the training module is used for training the initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model;
the sampling generation module is used for acquiring a low-field nuclear magnetism low-resolution image, and carrying out iterative sampling by utilizing the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution, so as to output a target super-resolution low-field nuclear magnetism image.
In a third aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements any one of the above-mentioned super-resolution food low-field nuclear magnetic image generation methods when executing the program.
The super-resolution food low-field nuclear magnetic image generation method and system provided by the invention solve the problems of easy mode collapse, overlarge model parameter and the like of the traditional method, so that a model can be trained more stably, a food low-field nuclear magnetic image with higher reliability can be generated, the super-resolution processing is carried out on the low-field nuclear magnetic image by means of the super-resolution processing method, the texture details of the acquired image can be greatly improved, and the acquisition efficiency of a low-field nuclear magnetic instrument is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a super-resolution food low-field nuclear magnetic image generation method provided by the invention;
FIG. 2 is a schematic flow chart of a training process provided by the present invention;
FIG. 3 is a flow chart of sample generation provided by the present invention;
fig. 4 is a schematic diagram of a partial blueberry low-field nuclear magnetic image sampling generation process provided by the invention;
FIG. 5 is a schematic diagram of the structure of the super-resolution food low-field nuclear magnetic image generation system provided by the invention;
fig. 6 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the popularization of deep learning in the image super-resolution method, the performance of the method is far superior to that of the traditional method, and the early methods based on a convolutional neural network, driven by a variational automatic encoder (Variational autoEncoder, VAE) and driven by a generating countermeasure network (Generative Adversarial Networks, GAN) respectively have the problems of incapability of accurately restoring image details, huge model volume, easy model collapse and easy mode collapse. Therefore, the invention aims to provide a super-resolution method based on a diffusion model, which solves the problems, so that super-resolution processing is performed on a low-field nuclear magnetic image more accurately and more rapidly, and the detail characteristics of an acquisition object are enhanced.
Fig. 1 is a schematic flow chart of a super-resolution food low-field nuclear magnetic image generation method according to an embodiment of the present invention, as shown in fig. 1, including:
step 100, collecting a low-field nuclear magnetism high-resolution image of a target food, and adding preset noise to the low-field nuclear magnetism high-resolution image to obtain a noisy low-field nuclear magnetism high-resolution image;
step 200, training an initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model;
and 300, acquiring a low-field nuclear magnetism low-resolution image, and performing iterative sampling by using the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution to output a target super-resolution low-field nuclear magnetism image.
Specifically, the method for super-resolution processing of the low-field nuclear magnetic image based on the diffusion model provided by the embodiment of the invention firstly collects and pre-processes low-field nuclear magnetic data, namely, the high-definition low-field nuclear magnetic image is changed into a noisy low-field nuclear magnetic image by step adding Gaussian noise obtained by sampling from standard normal distribution into a high-resolution image, so that the noisy low-field nuclear magnetic image is used as input to participate in the training of a next neural network. Then constructing and training an image super-resolution reconstruction model, and constructing a noise prediction neural network based on a Unet neural network, wherein the input of the neural network is a noisy image and the times of noise adding. And finally, iterative sampling to generate a super-resolution low-field nuclear magnetic image.
According to the invention, a deep learning method is innovatively introduced to process the food low-field nuclear magnetic resolution image in a super-resolution mode, an end-to-end super-resolution framework based on a diffusion model is constructed, a high-resolution image with clear texture details is obtained by inputting the blurred low-resolution image, the detail characteristics of a sampling object are enhanced, the internal structural information and component information of the food can be rapidly and nondestructively detected by depending on the characteristics of the low-field nuclear magnetic technology, the time cost for obtaining the clear high-resolution low-field nuclear magnetic image is greatly reduced, and the food quality detection efficiency is improved.
Based on the above embodiment, collecting a low-field nuclear magnetism high-resolution image of a target food, adding preset noise to the low-field nuclear magnetism high-resolution image, and obtaining a noisy low-field nuclear magnetism high-resolution image, including:
randomly sampling from standard normal distribution to generate Gaussian noise;
determining noise sequences and noise adding times of different noise adding degrees, wherein the length of the noise sequences is equal to the noise adding times;
and adding Gaussian noise with different noise adding degrees to the low-field nuclear magnetic high-resolution image according to the noise sequence and the noise adding times to obtain the noisy low-field nuclear magnetic high-resolution image.
Specifically, as shown in fig. 2, the image noise adding flow in the embodiment of the invention takes a blueberry picture as an example, and the high-definition low-field nuclear magnetic image is changed into a noisy low-field nuclear magnetic image by adding gaussian noise obtained by sampling from standard normal distribution to a low-field nuclear magnetic high-resolution image of blueberry in steps with the resolution of 256×256.
Random sampling from standard normal distribution to generate a Gaussian noise E, designating a group of sequences beta and the number of times t of noise addition, wherein the length of the sequences beta is the same as t, and each element in the sequences beta represents different noise addition degree and is used for changing the sequence beta to a high-resolution image X 0 Adding Gaussian noise with different degrees to finally obtain a noisy high-resolution image X t The calculation formula is as follows;
wherein,β i represents the noise adding degree of any noise sequence beta, X 0 Representing a low-field nuclear magnetic resonance high-resolution image, t representing the number of times of noise addition, E representing the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image.
Based on the above embodiment, training an initial uiet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model includes:
constructing the initial Unet neural network;
determining a low-field nuclear magnetic high-resolution image and a corresponding low-field nuclear magnetic low-resolution image in the training set;
the low-field nuclear magnetism high-resolution image is subjected to noise adding to obtain a noisy low-field nuclear magnetism high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times of the low-field nuclear magnetic high-resolution image into the initial Unet neural network, and outputting prediction noise;
and acquiring real noise, constructing a loss function according to the real noise and the predicted noise, and updating a network weight parameter by using back propagation by using the loss function to obtain the noise prediction neural network model.
Specifically, the training process of the embodiment of the invention comprises constructing a noise prediction neural network D based on a Unet neural network θ The input of the neural network is noisy image X t And the number of times of noise addition t.
Selecting a pair of images from the training set, namely a high-resolution image and a corresponding low-resolution image, and obtaining a noisy high-resolution image X after the high-resolution image is subjected to noise addition t Will noisy high resolution image X t And the number of times of adding noise t as input to the noise prediction neural network D θ In (1) to obtain D θ Predicted noise according to D θ Construction of noise prediction neural network D from predicted noise and truly added noise θ The average square error or the average absolute error of two noise distributions is directly used as the loss function, and the weight parameters in the network are updated by a back propagation method to obtain the trainingA good noise predictive neural network model.
Based on the above embodiment, a low-field nuclear magnetism low-resolution image is obtained, and according to the low-field nuclear magnetism low-resolution image and gaussian noise of a target resolution, iterative sampling is performed by using the noise prediction neural network model, and a target super-resolution low-field nuclear magnetism image is output, including:
amplifying the low-field nuclear magnetism low-resolution image to target resolution through bicubic linear interpolation to obtain an amplified image;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, namely a Gaussian noise sample, and splicing the image sample and the amplified image in the channel dimension to obtain the noisy low-field nuclear magnetic resonance high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times to a noise prediction neural network model to obtain image noise;
according to the image noise and the noisy low-field nuclear magnetic high-resolution image, calculating to obtain an initial image;
according to the noisy low-field nuclear magnetic high-resolution image and the initial image, calculating to obtain the mean value and variance of the noisy low-field nuclear magnetic high-resolution image of the previous noise adding times;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, and calculating the previous noise-adding frequency band-noise low-field nuclear magnetism high-resolution image by using the image sample, the mean value and the variance;
and taking the previous noise-adding times with noise low-field nuclear magnetic high-resolution image as a new noise-adding low-field nuclear magnetic high-resolution image, and repeating iteration until the noise-adding times are 0, so as to obtain the target super-resolution low-field nuclear magnetic image.
Specifically, as shown in fig. 3, the sample generation step in the embodiment of the present invention includes:
step 3.1, inputting a low-resolution image, and amplifying the image to target resolution by a conventional bicubic linear interpolation method;
step 3.2, randomly sampling from the standard normal distribution to generate a sample with the same size as the target resolution, and splicing the sample and the amplified image in the channel dimension to obtain a noisy image D t ;
Step 3.3, noisy image X t And the current time t is input into the noise prediction neural network D θ Obtaining noise E of the predicted image;
step 3.4, based on the predicted noise E and the noisy image X t Calculating an initial imageThe calculation formula is as follows:
where E represents the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image,representing the initial image +.>β i Indicating the degree of any noise added to the noise sequence beta.
Step 3.5, according to the noisy image X t And an initial imageCalculate X t-1 Mean and variance of images, mean μ and variance σ 2 The calculation formula of (2) is as follows:
wherein μ represents the mean value, σ 2 Representing variance, alpha t =1-β t ,
Step 3.6, randomly sampling from the standard normal distribution to generate a sample with the same size as the target resolution, multiplying the sample by the variance calculated in step 3.5 and adding the mean value to obtain X t-1 The image is calculated as follows:
where ε is the noise predicted in step 3.3, Z is the random sampling from a standard normal distribution to generate a sample of the same size as the target resolution, X t-1 Representing the previous noise-added times with noise low-field nuclear magnetism high-resolution image.
Step 3.7, X in step 3.6 t-1 Image as noisy image X t And executing the steps 3.3, 3.4, 3.5 and 3.6 again until t is 0, so as to obtain a final complete super-resolution image, taking a part of blueberry images shown in fig. 4 as an example.
The super-resolution food low-field nuclear magnetic image generation system provided by the invention is described below, and the super-resolution food low-field nuclear magnetic image generation system described below and the super-resolution food low-field nuclear magnetic image generation method described above can be correspondingly referred to each other.
Fig. 5 is a schematic structural diagram of a super-resolution food low-field nuclear magnetic image generating system according to an embodiment of the present invention, as shown in fig. 5, including: a noise adding module 51, a training module 52 and a sample generating module 53, wherein:
the noise adding module 51 is used for collecting a low-field nuclear magnetism high-resolution image of the target food, adding preset noise to the low-field nuclear magnetism high-resolution image, and obtaining a low-field nuclear magnetism high-resolution image with noise; the training module 52 is configured to train the initial uiet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model; the sampling generation module 53 is configured to obtain a low-field nuclear magnetic low-resolution image, and iteratively sample by using the noise prediction neural network model according to the low-field nuclear magnetic low-resolution image and the gaussian noise of the target resolution, and output a target super-resolution low-field nuclear magnetic image.
Fig. 6 illustrates a physical schematic diagram of an electronic device, as shown in fig. 6, which may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, and memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a super-resolution food low-field nuclear magnetic image generation method comprising: collecting a low-field nuclear magnetism high-resolution image of a target food, and adding preset noise into the low-field nuclear magnetism high-resolution image to obtain a noisy low-field nuclear magnetism high-resolution image; training an initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model; and acquiring a low-field nuclear magnetism low-resolution image, and performing iterative sampling by using the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution to output a target super-resolution low-field nuclear magnetism image.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method for generating a super-resolution food low-field nuclear magnetic image provided by the above methods, the method comprising: collecting a low-field nuclear magnetism high-resolution image of a target food, and adding preset noise into the low-field nuclear magnetism high-resolution image to obtain a noisy low-field nuclear magnetism high-resolution image; training an initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model; and acquiring a low-field nuclear magnetism low-resolution image, and performing iterative sampling by using the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution to output a target super-resolution low-field nuclear magnetism image.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A super-resolution food low-field nuclear magnetic image generation method is characterized by comprising the following steps:
collecting a low-field nuclear magnetism high-resolution image of a target food, and adding preset noise into the low-field nuclear magnetism high-resolution image to obtain a noisy low-field nuclear magnetism high-resolution image;
training an initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model;
and acquiring a low-field nuclear magnetism low-resolution image, and performing iterative sampling by using the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution to output a target super-resolution low-field nuclear magnetism image.
2. The method for generating a super-resolution food low-field nuclear magnetic image according to claim 1, wherein collecting a low-field nuclear magnetic high-resolution image of a target food, adding a predetermined noise to the low-field nuclear magnetic high-resolution image, and obtaining a noisy low-field nuclear magnetic high-resolution image, comprises:
randomly sampling from standard normal distribution to generate Gaussian noise;
determining noise sequences and noise adding times of different noise adding degrees, wherein the length of the noise sequences is equal to the noise adding times;
and adding Gaussian noise with different noise adding degrees to the low-field nuclear magnetic high-resolution image according to the noise sequence and the noise adding times to obtain the noisy low-field nuclear magnetic high-resolution image.
3. The method for generating a super-resolution food low-field nuclear magnetic image according to claim 2, wherein adding gaussian noise with different noise adding degrees to the low-field nuclear magnetic high-resolution image according to the noise sequence and the noise adding times to obtain the noisy low-field nuclear magnetic high-resolution image, comprising:
wherein,β i represents the noise adding degree of any noise sequence beta, X 0 Representing a low-field nuclear magnetic resonance high-resolution image, t representing the number of times of noise addition, E representing the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image.
4. The method for generating a super-resolution food low-field nuclear magnetic image according to claim 1, wherein training an initial une neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model comprises:
constructing the initial Unet neural network;
determining a low-field nuclear magnetic high-resolution image and a corresponding low-field nuclear magnetic low-resolution image in the training set;
the low-field nuclear magnetism high-resolution image is subjected to noise adding to obtain a noisy low-field nuclear magnetism high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times of the low-field nuclear magnetic high-resolution image into the initial Unet neural network, and outputting prediction noise;
and acquiring real noise, constructing a loss function according to the real noise and the predicted noise, and updating a network weight parameter by using back propagation by using the loss function to obtain the noise prediction neural network model.
5. The method for generating a super-resolution food low-field nuclear magnetic resonance image according to claim 1, wherein acquiring a low-field nuclear magnetic resonance low-resolution image, iteratively sampling by using the noise prediction neural network model according to the low-field nuclear magnetic resonance low-resolution image and gaussian noise of a target resolution, and outputting the target super-resolution low-field nuclear magnetic resonance image, comprises:
amplifying the low-field nuclear magnetism low-resolution image to target resolution through bicubic linear interpolation to obtain an amplified image;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, namely a Gaussian noise sample, and splicing the image sample and the amplified image in the channel dimension to obtain the noisy low-field nuclear magnetic resonance high-resolution image;
inputting the noisy low-field nuclear magnetic high-resolution image and the noise adding times to a noise prediction neural network model to obtain image noise;
according to the image noise and the noisy low-field nuclear magnetic high-resolution image, calculating to obtain an initial image;
according to the noisy low-field nuclear magnetic high-resolution image and the initial image, calculating to obtain the mean value and variance of the noisy low-field nuclear magnetic high-resolution image of the previous noise adding times;
randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution, namely a Gaussian noise sample, and calculating to obtain the previous noise-adding frequency noisy low-field nuclear magnetic high-resolution image by utilizing the image sample, the mean value and the variance;
and taking the previous noise-adding times with noise low-field nuclear magnetic high-resolution image as a new noise-adding low-field nuclear magnetic high-resolution image, and repeating iteration until the noise-adding times are 0, so as to obtain the target super-resolution low-field nuclear magnetic image.
6. The method of generating a super-resolution food low-field nuclear magnetic resonance image according to claim 5, wherein calculating an initial image from the image noise and the noisy low-field nuclear magnetic resonance high-resolution image comprises:
where E represents the generated Gaussian noise, X t Representing a noisy low field nuclear magnetic high resolution image,the initial image is represented and the image is displayed,β i indicating the degree of any noise added to the noise sequence beta.
7. The method for generating a super-resolution food low-field nuclear magnetic image according to claim 6, wherein calculating the mean and variance of the previous noisy low-field nuclear magnetic high-resolution image from the noisy low-field nuclear magnetic high-resolution image and the initial image comprises:
wherein μ represents the mean value, σ 2 Representing variance, alpha t =1-β t ,
8. The method of generating a super-resolution food low-field nuclear magnetic resonance image according to claim 7, wherein randomly sampling from a standard normal distribution to generate an image sample of the same size as the target resolution, and calculating the previous noise-added frequency band-noise low-field nuclear magnetic resonance high-resolution image using the image sample, the mean value and the variance, comprising:
wherein X is t-1 Representing the previous noise-added frequency band-noise low-field nuclear magnetic high-resolution image, and Z represents randomly sampling from standard normal distribution to generate an image sample with the same size as the target resolution.
9. A super-resolution food low-field nuclear magnetic image generation system, comprising:
the noise adding module is used for collecting a low-field nuclear magnetism high-resolution image of the target food, adding preset noise to the low-field nuclear magnetism high-resolution image, and obtaining a low-field nuclear magnetism high-resolution image with noise;
the training module is used for training the initial Unet neural network based on the noisy low-field nuclear magnetic high-resolution image to obtain a noise prediction neural network model;
the sampling generation module is used for acquiring a low-field nuclear magnetism low-resolution image, and carrying out iterative sampling by utilizing the noise prediction neural network model according to the low-field nuclear magnetism low-resolution image and Gaussian noise of target resolution, so as to output a target super-resolution low-field nuclear magnetism image.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the super-resolution food low-field nuclear magnetic image generation method according to any one of claims 1 to 8 when the program is executed by the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311421172.1A CN117455773A (en) | 2023-10-27 | 2023-10-27 | Super-resolution food low-field nuclear magnetic image generation method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311421172.1A CN117455773A (en) | 2023-10-27 | 2023-10-27 | Super-resolution food low-field nuclear magnetic image generation method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117455773A true CN117455773A (en) | 2024-01-26 |
Family
ID=89579511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311421172.1A Pending CN117455773A (en) | 2023-10-27 | 2023-10-27 | Super-resolution food low-field nuclear magnetic image generation method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117455773A (en) |
-
2023
- 2023-10-27 CN CN202311421172.1A patent/CN117455773A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111476717B (en) | Face image super-resolution reconstruction method based on self-attention generation countermeasure network | |
CN110074813B (en) | Ultrasonic image reconstruction method and system | |
CN109214989B (en) | Single image super resolution ratio reconstruction method based on Orientation Features prediction priori | |
Wei | Image super‐resolution reconstruction using the high‐order derivative interpolation associated with fractional filter functions | |
CN110675321A (en) | Super-resolution image reconstruction method based on progressive depth residual error network | |
CN109658468B (en) | Magnetic resonance parameter imaging method, device, equipment and storage medium | |
CN111127325B (en) | Satellite video super-resolution reconstruction method and system based on cyclic neural network | |
CN106169174B (en) | Image amplification method | |
CN111784570A (en) | Video image super-resolution reconstruction method and device | |
CN111080531A (en) | Super-resolution reconstruction method, system and device for underwater fish image | |
CN114998471B (en) | Magnetic particle imaging reconstruction method based on RecNet model | |
CN113160380A (en) | Three-dimensional magnetic resonance image super-resolution reconstruction method, electronic device and storage medium | |
CN112950480A (en) | Super-resolution reconstruction method integrating multiple receptive fields and dense residual attention | |
CN112435162A (en) | Terahertz image super-resolution reconstruction method based on complex field neural network | |
CN109544652B (en) | Nuclear magnetic resonance multi-weighted imaging method based on depth generation antagonistic neural network | |
CN117455770A (en) | Lightweight image super-resolution method based on layer-by-layer context information aggregation network | |
CN110136061B (en) | Resolution improving method and system based on depth convolution prediction and interpolation | |
CN111986079A (en) | Pavement crack image super-resolution reconstruction method and device based on generation countermeasure network | |
CN117455773A (en) | Super-resolution food low-field nuclear magnetic image generation method and system | |
CN108510464B (en) | Compressed sensing network based on block observation and full-image reconstruction method | |
CN115880158A (en) | Blind image super-resolution reconstruction method and system based on variational self-coding | |
CN115049781A (en) | Shale digital core three-dimensional reconstruction method based on deep learning | |
CN111524060B (en) | System, method, storage medium and device for blurring portrait background in real time | |
CN110648291B (en) | Unmanned aerial vehicle motion blurred image restoration method based on deep learning | |
CN111080730B (en) | Brain image decoding method and system based on cross-channel and space weighted convolution characteristics |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |