WO2021184576A1 - Medical image generation method and apparatus, electronic device and medium - Google Patents

Medical image generation method and apparatus, electronic device and medium Download PDF

Info

Publication number
WO2021184576A1
WO2021184576A1 PCT/CN2020/098947 CN2020098947W WO2021184576A1 WO 2021184576 A1 WO2021184576 A1 WO 2021184576A1 CN 2020098947 W CN2020098947 W CN 2020098947W WO 2021184576 A1 WO2021184576 A1 WO 2021184576A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
medical image
sample
standard
discrimination
Prior art date
Application number
PCT/CN2020/098947
Other languages
French (fr)
Chinese (zh)
Inventor
王俊
张丞
高鹏
谢国彤
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021184576A1 publication Critical patent/WO2021184576A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device, and computer-readable storage medium for generating medical images.
  • the inventor realizes that the current generation of medical images needs to rely on medical experts with a high level of professional knowledge to manually screen a large number of samples, and then input them into a pre-built model for training, resulting in a lot of waste of human resources.
  • This application provides a method, device, electronic device, and computer-readable storage medium for generating medical images.
  • a method for generating medical images includes:
  • the effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set.
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • This application also provides a device for generating medical images, which includes:
  • the image preprocessing module is used to obtain an original medical image, perform conversion processing on the original medical image to obtain an initial medical image, and perform cell enhancement processing on the initial medical image to obtain a standard medical image;
  • the first sample image generation module is used to obtain the distribution data of each pixel information in the standard medical image, and use an image generation model to generate multiple first sample images similar to the standard medical image according to the distribution data, Obtain the first sample image set;
  • the effective information calculation module is used to calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount
  • the arrangement sequence selects K first sample images corresponding to the effective amount of information from the first sample image set to obtain an effective image set;
  • the image discrimination module is used to input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain the discrimination result, and adjust the image according to the discrimination result.
  • the parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard
  • the image generation model generates a second sample image set, and generates a final medical image according to the second sample image.
  • This application also provides an electronic device, which includes:
  • Memory storing at least one instruction
  • the processor executes the instructions stored in the memory to implement the following steps:
  • the effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set.
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • the present application also provides a computer-readable storage medium in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the following steps:
  • the effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set.
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • FIG. 1 is a schematic flowchart of a method for generating a medical image provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of modules of a method for generating medical images provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of the internal structure of an electronic device of a method for generating a medical image provided by an embodiment of the application;
  • This application provides a method for generating medical images.
  • FIG. 1 it is a schematic flowchart of a method for generating a medical image provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the method for generating medical images includes:
  • the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
  • the conversion processing of the original medical image to obtain the initial medical image includes:
  • the contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  • said converting the original medical image to gray value to obtain the original gray image includes:
  • All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
  • the gray value conversion formula is:
  • R, G, B are the three components of the pixels in the original medical image
  • Gray is the gray value obtained by conversion.
  • the performing noise reduction processing on the original gray image to obtain the noise reduction gray image includes:
  • the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
  • the embodiment of the present application uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
  • f(x,y) is the original grayscale image
  • g(x,y) is the denoising grayscale image
  • W is a two-dimensional sliding template
  • j and k are on the boundary of the two-dimensional sliding template
  • the coordinates of the pixel; med is the noise reduction processing operation.
  • performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image includes:
  • the contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
  • a contrast stretching method may be used to enhance the contrast of the transformed grayscale image.
  • the contrast stretching method is also called gray scale stretching.
  • the embodiment of the application uses the piecewise linear transformation function in the contrast stretching method to perform gray-scale stretching for specific regions in the original gray-scale image according to actual needs, thereby enhancing the contrast of the transformed gray-scale image, and obtaining the original medical image.
  • performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
  • a is the linear slope
  • b is the intercept of D b on the Y axis
  • D a represents the gray value of the input transformed gray image
  • D b represents the gray value of the output initial medical image.
  • the embodiment of the present application can obtain the standard medical image with different standard offset values by taking different values for the preset standard offset of the Gaussian function. Linear enhancement filtering of cells.
  • the linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
  • the embodiment of the application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
  • I is the initial medical image
  • G(x, y, z) is a Gaussian function
  • x, y, z are the parameters of the Gaussian function
  • is the standard offset of the Gaussian function
  • Symbol for reciprocal operation To find the convolution operation symbol.
  • the matrix H is obtained by taking different values of the standard offset of the Gaussian function:
  • the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
  • the enhancement filtering performs cell enhancement on the initial medical image.
  • the initial medical image is calculated as described above, the size of the standard offset is adjusted to be equal to the actual width of the cells in the initial medical image, and the optimal linear enhancement filter is obtained. Furthermore, cell enhancement is performed on the initial medical image to obtain the standard medical image.
  • the existing munpy (Numerical Python, digital python) method can be used to obtain the distribution data of each pixel information in the standard medical image.
  • the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
  • the image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
  • the S3 includes:
  • the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  • sample generation loss function F includes:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • the image generation model is used to generate multiple first sample images to obtain the first sample image set.
  • each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set generated by S3 is still insufficient to meet the requirements of medical research, and the following S4 needs to be further performed for screening.
  • the following effective information amount calculation formula is used to calculate the effective information amount R of each first sample image in the first sample image set:
  • the number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
  • the embodiment of the present application arranges the effective amount of information in the first sample image set in order from most to least, and selects the k with the most effective amount of information from the arrangement.
  • the first sample image, the effective image set is obtained.
  • the image discrimination model is a convolutional neural network for image discrimination.
  • the mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a”, then the image generation model The corresponding parameter also becomes "a".
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the discrimination result is adjusted according to the discrimination result.
  • the parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, including:
  • the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
  • the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
  • the discriminant loss function Y is as follows:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • the above-mentioned embodiment of the application uses the image generation model to generate multiple first sample images similar to the standard medical image, and realizes the preliminary training of the image generation model.
  • the first sample image can be generated for subsequent use; further, the effective information amount calculation is performed on the first sample image set, and K effective information is selected from the first sample image set according to the order of the effective information amount.
  • the first sample image corresponding to the amount of information obtains an effective image set to filter out medical images containing more effective information, which further guarantees the quality of subsequent image generation, and also avoids manual screening of samples one by one;
  • the image set and the standard medical image are input into the image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained.
  • the parameters of the image discrimination model are adjusted according to the discrimination result, and the image discrimination is used
  • the constraint relationship between the model and the image generation model further adjusts the parameters of the image generation model to realize the retraining of the image generation model and ensure the accuracy of the image generation model during image generation. Therefore, the medical image generation method, device, and computer-readable storage medium proposed in this application can automatically screen the first sample images in batches, and automatically train accurate medical image models to generate the final medical images. Save a lot of human resources.
  • FIG. 2 it is a functional block diagram of the medical image generation method device of the present application.
  • the medical image generation method 100 described in this application can be installed in an electronic device.
  • the medical image generation method device may include an image preprocessing module 101, a first sample image generation module 102, an effective information calculation module 103, and an image discrimination module 104.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the image preprocessing module 101 is configured to obtain an original medical image, perform conversion processing on the original medical image to obtain an initial medical image, and perform cell enhancement processing on the initial medical image to obtain a standard medical image;
  • the first sample image generation module 102 is used to obtain distribution data of each pixel information in the standard medical image, and generate multiple first images similar to the standard medical image by using an image generation model according to the distribution data. This image, get the first sample image set;
  • the effective information calculation module 103 is configured to calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount.
  • the arrangement order of the information amount selects K first sample images corresponding to the effective information amount from the first sample image set to obtain an effective image set;
  • the image discrimination module 104 is configured to input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and obtain a discrimination result, according to the discrimination As a result, the parameters of the image discrimination model are adjusted until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters.
  • each module of the medical image generation method device is as follows:
  • the image preprocessing module 101 obtains an original medical image, performs conversion processing on the original medical image to obtain an original medical image, and performs cell enhancement processing on the original medical image to obtain a standard medical image.
  • the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
  • the image preprocessing module 101 performs conversion processing on the original medical image to obtain an initial medical image, including:
  • the contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  • the image preprocessing module 101 converts the gray value of the original medical image to obtain the original gray image, including:
  • All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
  • the gray value conversion formula is:
  • R, G, B are the three components of the pixels in the original medical image
  • Gray is the gray value obtained by conversion.
  • the image preprocessing module 101 performs noise reduction processing on the original gray image to obtain a noise reduction gray image, including:
  • the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
  • the image preprocessing module 101 uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
  • f(x,y) is the original grayscale image
  • g(x,y) is the denoising grayscale image
  • W is a two-dimensional sliding template
  • j and k are on the boundary of the two-dimensional sliding template
  • the coordinates of the pixel; med is the noise reduction processing operation.
  • the image preprocessing module 101 performs geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image, including:
  • the contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
  • the image preprocessing module 101 may adopt a contrast stretching method to enhance the contrast of the transformed grayscale image.
  • the contrast stretching method is also called gray scale stretching.
  • the image preprocessing module 101 of the embodiment of the present application uses the piecewise linear transformation function in the contrast stretching method to perform grayscale stretching for a specific region in the original grayscale image according to actual needs, thereby enhancing the transformed grayscale
  • the contrast of the figure, the initial medical image is obtained.
  • performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
  • the image preprocessing module 101 uses the following piecewise linear transformation function formula to perform contrast enhancement on the transformed grayscale image to obtain the initial medical image:
  • a is the linear slope
  • b is the intercept of D b on the Y axis
  • D a represents the gray value of the input transformed gray image
  • D b represents the gray value of the output initial medical image.
  • the image preprocessing module 101 described in this embodiment of the application can obtain different standard deviations of the standard medical image by taking different values for the standard deviation of the preset Gaussian function.
  • the linear enhancement filter applied to the cell under the measurement value can obtain different standard deviations of the standard medical image by taking different values for the standard deviation of the preset Gaussian function.
  • the linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
  • the image preprocessing module 101 of the embodiment of the present application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
  • I is the initial medical image
  • G(x, y, z) is a Gaussian function
  • x, y, z are the parameters of the Gaussian function
  • is the standard offset of the Gaussian function
  • Symbol for reciprocal operation To find the convolution operation symbol.
  • the image preprocessing module 101 of the embodiment of the present application obtains the matrix H by taking different values of the standard offset of the Gaussian function:
  • the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
  • the enhancement filtering performs cell enhancement on the initial medical image.
  • the image preprocessing module 101 of the embodiment of the present application calculates the initial medical image as described above, adjusts the size of the standard offset to be equal to the actual width of the cells in the initial medical image, and obtains the The best linear enhancement filtering is used to achieve cell enhancement of the initial medical image to obtain the standard medical image.
  • the first sample image generating module 102 obtains the distribution data of each pixel information in the standard medical image, and uses an image generation model to generate a plurality of first sample images similar to the standard medical image according to the distribution data, Get the first sample image set.
  • the first sample image generating module 102 described in this embodiment of the present application can use existing munpy (Numerical Python, digital python) methods to obtain the distribution data of each pixel information in the standard medical image.
  • existing munpy Numerical Python, digital python
  • the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
  • the image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
  • the first sample image generation module 102 obtains the distribution data of each pixel information in the standard medical image, and generates a plurality of first images similar to the standard medical image by using an image generation model according to the distribution data.
  • the first sample image set obtained includes:
  • the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  • sample generation loss function F includes:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • the image generation model is used to generate multiple first sample images to obtain the first sample image set.
  • each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set is still insufficient to meet the requirements of medical research, and further screening is required.
  • the effective information calculation module 103 calculates the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount
  • the arrangement sequence selects K first sample images corresponding to the effective amount of information from the first sample image set to obtain an effective image set.
  • the effective information calculation module 103 described in the embodiment of the present application uses the following effective information amount calculation formula to calculate the effective information amount R of each first sample image in the first sample image set:
  • the number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
  • the effective information calculation module 103 described in this embodiment of the present application arranges the effective information amount in the first sample image set in order from most to least, and selects effective information from the arrangement The k first sample images with the largest amount are obtained to obtain the effective image set.
  • the image discrimination module 104 inputs the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtains a discrimination result, and adjusts the image according to the discrimination result.
  • the parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard
  • the image generation model generates a second sample image set, and generates a final medical image according to the second sample image.
  • the image discrimination model is a convolutional neural network for image discrimination.
  • the mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a”, then the image generation model The corresponding parameter also becomes "a".
  • the image discrimination module 104 inputs the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and obtains the discrimination result according to the The discrimination result adjusts the parameters of the image discrimination model until the discrimination result meets the preset requirements, and the parameters of the image discrimination model at this time are obtained, including:
  • the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
  • the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
  • the discriminant loss function Y is as follows:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • FIG. 3 it is a schematic diagram of the structure of an electronic device that implements the method for generating a medical image in the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a training program 12 of the medical image model. .
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the training program 12 of the medical image model, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The medical image generation program 12, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the medical image generation method program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
  • the effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set.
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
  • the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  • the integrated module/unit of the electronic device 1 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 storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile Hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
  • the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
  • Step 1 Obtain an original medical image, and perform conversion processing on the original medical image to obtain an initial medical image.
  • the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
  • the conversion processing of the original medical image to obtain the initial medical image includes:
  • the contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  • said converting the original medical image to gray value to obtain the original gray image includes:
  • All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
  • the gray value conversion formula is:
  • R, G, B are the three components of the pixels in the original medical image
  • Gray is the gray value obtained by conversion.
  • the performing noise reduction processing on the original gray image to obtain the noise reduction gray image includes:
  • the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
  • the embodiment of the present application uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
  • f(x,y) is the original grayscale image
  • g(x,y) is the denoising grayscale image
  • W is a two-dimensional sliding template
  • j and k are on the boundary of the two-dimensional sliding template
  • the coordinates of the pixel; med is the noise reduction processing operation.
  • performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image includes:
  • the contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
  • a contrast stretching method may be used to enhance the contrast of the transformed grayscale image.
  • the contrast stretching method is also called gray scale stretching.
  • the embodiment of the application uses the piecewise linear transformation function in the contrast stretching method to perform gray-scale stretching for specific regions in the original gray-scale image according to actual needs, thereby enhancing the contrast of the transformed gray-scale image, and obtaining the original medical image.
  • performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
  • a is the linear slope
  • b is the intercept of D b on the Y axis
  • D a represents the gray value of the input transformed gray image
  • D b represents the gray value of the output initial medical image.
  • Step 2 Perform cell enhancement processing on the initial medical image to obtain a standard medical image.
  • the embodiment of the present application takes different values for the standard offset of the preset Gaussian function to obtain the standard medical image suitable for different standard offset values.
  • the linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
  • the embodiment of the application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
  • I is the initial medical image
  • G(x, y, z) is a Gaussian function
  • x, y, z are the parameters of the Gaussian function
  • is the standard offset of the Gaussian function
  • Symbol for reciprocal operation To find the convolution operation symbol.
  • the matrix H is obtained by taking different values of the standard offset of the Gaussian function:
  • the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
  • the enhancement filtering performs cell enhancement on the initial medical image.
  • the initial medical image is calculated as described above, the size of the standard offset is adjusted to be equal to the actual width of the cells in the initial medical image, and the optimal linear enhancement filter is obtained. Furthermore, cell enhancement is performed on the initial medical image to obtain the standard medical image.
  • Step 3 Obtain the distribution data of each pixel information in the standard medical image, and use the image generation model to generate multiple first sample images similar to the standard medical image according to the distribution data to obtain a first sample image set .
  • the existing munpy (Numerical Python, digital python) method can be used to obtain the distribution data of each pixel information in the standard medical image.
  • the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
  • the image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
  • the step three includes:
  • the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  • sample generation loss function F includes:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • the image generation model is used to generate multiple first sample images to obtain the first sample image set.
  • step 3 only part of each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set generated in step 3 is still insufficient to meet the requirements of medical research, and the following step 4 needs to be further performed for screening.
  • Step 4 Calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set.
  • K first sample images corresponding to the effective amount of information are selected to obtain an effective image set.
  • the following effective information amount calculation formula is used to calculate the effective information amount R of each first sample image in the first sample image set:
  • the number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
  • the embodiment of the present application arranges the effective amount of information in the first sample image set in order from most to least, and selects the k with the most effective amount of information from the arrangement.
  • the first sample image, the effective image set is obtained.
  • Step 5 Input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain a discrimination result, and adjust the image discrimination according to the discrimination result
  • the parameters of the model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard image generation model To generate a second sample image set, and generate a final medical image according to the second sample image.
  • the image discrimination model is a convolutional neural network for image discrimination.
  • the mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a”, then the image generation model The corresponding parameter also becomes "a".
  • the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the discrimination result is adjusted according to the discrimination result.
  • the parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, including:
  • the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
  • the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
  • the discriminant loss function Y is as follows:
  • E[] is the expected value operation
  • Lc is the expected value of the similarity between the first sample image and the standard medical image
  • Ls is the expected value of the effective information in the standard medical image
  • Xreal is the expected value Standard medical image
  • Xfake is the first sample image
  • C is the effective amount of information in the first sample image
  • S is the effective amount of information in the standard medical image.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, 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 may be implemented in the form of hardware plus software functional modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

Disclosed is a medical image generation method, relating to artificial intelligence and wise information technology of med. Said method comprises: acquiring an original medical image and pre-processing same to obtain a standard medical image; according to the standard medical image, generating a first sample image set by using a medical image generation model; and performing valid information quantity calculation on the first sample image set, and selecting first sample images corresponding to K valid information quantities, so as to obtain a valid image set, inputting, for determination, the valid image set and the standard medical image into an image determination model having a relationship of mutual constraint with the image generation model, so as to obtain a determination result, adjusting parameters of the image determination model according to the determination result, so as to obtain a standard image generation model, and inputting the original medical image into the standard image generation model to generate a final medical image. The problem of medical image model training consuming a lot of human resources can be solved.

Description

医学图像的生成方法、装置、电子设备及介质Medical image generation method, device, electronic equipment and medium
本申请要求于2020年3月17日提交中国专利局、申请号为CN 202010186679.3,发明名称为“医学图像的生成方法、装置、电子设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on March 17, 2020, the application number is CN 202010186679.3, and the invention title is "Medical Image Generation Method, Apparatus, Electronic Equipment, and Medium". The entire content of the application is approved The reference is incorporated in this application.
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种医学图像的生成方法、装置、电子设备及计算机可读存储介质。This application relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device, and computer-readable storage medium for generating medical images.
背景技术Background technique
随着科技的发展,医疗水平也越来越高,在医疗健康领域,医学图像对于研究病情,预测疾病和医疗科技发展都有着重大的意义。然而,含有足够多的医疗信息的医学图像数量较少,需求量却很大,所以如何训练出高效精确的医学图像的生成模型,以生成更多医学图像,越来越重要。With the development of science and technology, the level of medical care is getting higher and higher. In the field of medical and health, medical images are of great significance for studying disease conditions, predicting diseases and developing medical technology. However, the number of medical images containing enough medical information is small and the demand is great. Therefore, how to train an efficient and accurate medical image generation model to generate more medical images is becoming more and more important.
发明人意识到目前医学图像的生成需要依赖于专业知识水平很高的医疗专家对大量样本进行人工筛选,再输入进预先构建的模型进行训练,造成了大量人力资源的浪费。The inventor realizes that the current generation of medical images needs to rely on medical experts with a high level of professional knowledge to manually screen a large number of samples, and then input them into a pre-built model for training, resulting in a lot of waste of human resources.
发明内容Summary of the invention
本申请提供一种医学图像的生成方法、装置、电子设备及计算机可读存储介质。This application provides a method, device, electronic device, and computer-readable storage medium for generating medical images.
本申请提供的一种医学图像的生成方法,包括:A method for generating medical images provided by this application includes:
获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
本申请还提供一种医学图像的生成装置,所述装置包括:This application also provides a device for generating medical images, which includes:
图像预处理模块,用于获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像,对所述初始医学图像进行细胞增强处理,得到标准医学图像;The image preprocessing module is used to obtain an original medical image, perform conversion processing on the original medical image to obtain an initial medical image, and perform cell enhancement processing on the initial medical image to obtain a standard medical image;
第一样本图像生成模块,用于获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;The first sample image generation module is used to obtain the distribution data of each pixel information in the standard medical image, and use an image generation model to generate multiple first sample images similar to the standard medical image according to the distribution data, Obtain the first sample image set;
有效信息计算模块,用于对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information calculation module is used to calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount The arrangement sequence selects K first sample images corresponding to the effective amount of information from the first sample image set to obtain an effective image set;
图像判别模块,用于将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The image discrimination module is used to input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain the discrimination result, and adjust the image according to the discrimination result. The parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard The image generation model generates a second sample image set, and generates a final medical image according to the second sample image.
本申请还提供一种电子设备,所述电子设备包括:This application also provides an electronic device, which includes:
存储器,存储至少一个指令;及Memory, storing at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:The processor executes the instructions stored in the memory to implement the following steps:
获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:The present application also provides a computer-readable storage medium in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the following steps:
获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
附图说明Description of the drawings
图1为本申请一实施例提供的医学图像的生成方法的流程示意图;FIG. 1 is a schematic flowchart of a method for generating a medical image provided by an embodiment of the application;
图2为本申请一实施例提供的医学图像的生成方法的模块示意图;2 is a schematic diagram of modules of a method for generating medical images provided by an embodiment of the application;
图3为本申请一实施例提供的医学图像的生成方法的电子设备的内部结构示意图;3 is a schematic diagram of the internal structure of an electronic device of a method for generating a medical image provided by an embodiment of the application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请提供一种医学图像的生成方法。参照图1所示,为本申请一实施例提供的医学 图像的生成方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a method for generating medical images. Referring to FIG. 1, it is a schematic flowchart of a method for generating a medical image provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,医学图像的生成方法包括:In this embodiment, the method for generating medical images includes:
S1、获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像。S1. Obtain an original medical image, perform conversion processing on the original medical image, and obtain an initial medical image.
本申请实施例中,所述原始医学图像可以是医院存储的b超图片,彩超图片等。In the embodiment of the present application, the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
本申请实施例中,所述对所述原始医学图像进行转换处理,得到初始医学图像,包括:In the embodiment of the present application, the conversion processing of the original medical image to obtain the initial medical image includes:
将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
其中,所述将所述原始医学图像进行灰度值转换,得到原始灰度图,包括:Wherein, said converting the original medical image to gray value to obtain the original gray image includes:
将所述原始医学图像中的所有像素输入至一个灰度值转换公式中进行灰度值转换,根据转换后的灰度值生成所述原始灰度图。All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
其中,所述灰度值转换公式为:Wherein, the gray value conversion formula is:
Gray=0.30*R+0.59*G+0.11*BGray=0.30*R+0.59*G+0.11*B
其中R,G,B为所述包原始医学图像中的像素的三分量,Gray为转换得到的灰度值。Wherein R, G, B are the three components of the pixels in the original medical image, and Gray is the gray value obtained by conversion.
进一步地,本申请实施例中,所述将所述原始灰度图进行降噪处理,得到降噪灰度图,包括:Further, in the embodiment of the present application, the performing noise reduction processing on the original gray image to obtain the noise reduction gray image includes:
将所述原始灰度图中任一像素点的像素值用该像素点的一个邻域中各像素点的像素值的中值代替,让所述任一像素点周围的像素值接近的真实值,从而消除孤立的噪声点。Replace the pixel value of any pixel in the original grayscale image with the median value of each pixel in a neighborhood of the pixel, so that the pixel value around any pixel is close to the true value , Thereby eliminating isolated noise points.
详细地,所述邻域可以是预设的圆形结构的二维滑动模板,将所述二维滑动模板内像素按照像素值的大小进行排序,生成单调上升(或下降)的二维数据序列,以找到所述邻域中各像素点的像素值的中值。In detail, the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
详细地,本申请实施例利用如下计算公式,对所述原始灰度图进行降噪处理,得到所述降噪灰度图:In detail, the embodiment of the present application uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
g(x,y)=med{f(x-j,y-k),(j,k∈W)}g(x,y)=med{f(x-j,y-k),(j,k∈W)}
其中,f(x,y)为所述原始灰度图;g(x,y)为所述降噪灰度图,W为二维滑动模板;j、k为所述二维滑动模版边界上像素点的坐标;med为降噪处理运算。Wherein, f(x,y) is the original grayscale image; g(x,y) is the denoising grayscale image, W is a two-dimensional sliding template; j and k are on the boundary of the two-dimensional sliding template The coordinates of the pixel; med is the noise reduction processing operation.
进一步地,所述将所述降噪灰度图进行几何变换处理,得到变换灰度图,包括:Further, performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image includes:
对所述降噪灰度图通过平移、转置、镜像、旋转、缩放等几何变换处理,改正所述原始医学图像获取过程中产生的系统误差和仪器位置产生的随机误差;几何变换处理完成后,得到所述变换灰度图。Perform geometric transformation processing such as translation, transposition, mirroring, rotation, and scaling on the denoising grayscale image to correct the system error generated during the acquisition of the original medical image and the random error generated by the position of the instrument; after the geometric transformation processing is completed , To obtain the transformed gray scale image.
所述对比度指的是图像中像素点亮度最大值与最小值之间的对比。The contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
本申请实施例可以采用对比度拉伸方法对所述变换灰度图进行对比度增强。In this embodiment of the present application, a contrast stretching method may be used to enhance the contrast of the transformed grayscale image.
所述对比度拉伸方法也叫作灰度拉伸。本申请实施例使用对比度拉伸方法中的分段线性变换函数,根据实际需求针对所述原始灰度图中特定区域进行灰度拉伸,进而增强所述变换灰度图的对比度,得到初始医学图像。详细地,所述将所述变换灰度图进行对比度增强,得到初始医学图像,包括:The contrast stretching method is also called gray scale stretching. The embodiment of the application uses the piecewise linear transformation function in the contrast stretching method to perform gray-scale stretching for specific regions in the original gray-scale image according to actual needs, thereby enhancing the contrast of the transformed gray-scale image, and obtaining the original medical image. In detail, performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
利用下述分段线性变换函数公式将所述变换灰度图进行对比度增强,得到所述初始医学图像:Use the following piecewise linear transformation function formula to perform contrast enhancement on the transformed grayscale image to obtain the initial medical image:
D b=f(D a)=a*D a+b D b =f(D a )=a*D a +b
其中a为线性斜率,b为D b在Y轴上的截距,D a代表输入所述变换灰度图的灰度值,D b代表输出所述初始医学图像的灰度值。 Where a is the linear slope, b is the intercept of D b on the Y axis, D a represents the gray value of the input transformed gray image, and D b represents the gray value of the output initial medical image.
S2、对所述初始医学图像进行细胞增强处理,得到标准医学图像。S2. Perform cell enhancement processing on the initial medical image to obtain a standard medical image.
考虑到细胞都是以线状的形态出现,本申请实施例通过对预设的高斯函数的标准偏移 量取不同的值可以获得所述标准医学图像不同标准偏移量取值下的适用于细胞的线性增强滤波。Taking into account that the cells appear in a linear form, the embodiment of the present application can obtain the standard medical image with different standard offset values by taking different values for the preset standard offset of the Gaussian function. Linear enhancement filtering of cells.
所述线性增强滤波可用来对所述初始医学图像进行细胞增强。The linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
本申请实施例根据所述高斯函数的卷积性质,计算所述初始医学图像与二阶高斯函数的卷积得到所述标准医学图像的尺度空间导数I abcAccording to the convolution property of the Gaussian function, the embodiment of the application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
Figure PCTCN2020098947-appb-000001
Figure PCTCN2020098947-appb-000001
Figure PCTCN2020098947-appb-000002
Figure PCTCN2020098947-appb-000002
其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
Figure PCTCN2020098947-appb-000003
为求偏倒数运算符号
Figure PCTCN2020098947-appb-000004
为求卷积运算符号。
Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
Figure PCTCN2020098947-appb-000003
Symbol for reciprocal operation
Figure PCTCN2020098947-appb-000004
To find the convolution operation symbol.
进一步地,本申请实施例通过对所述高斯函数的标准偏移量的不同取值,得到矩阵H:Further, in the embodiment of the present application, the matrix H is obtained by taking different values of the standard offset of the Gaussian function:
Figure PCTCN2020098947-appb-000005
Figure PCTCN2020098947-appb-000005
其中,矩阵中的元素为不同标准偏移量取值下所述尺度空间导数I abc的值。 Wherein, the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
由高斯函数的线形特点可以得知,当且仅当高斯函数的标准偏移量σ的大小刚好等于细胞的实际宽度的时候,可得到最佳的线性增强滤波,并利用所述最佳的线性增强滤波对所述初始医学图像进行细胞增强。It can be known from the linear characteristics of the Gaussian function that if and only when the standard offset σ of the Gaussian function is exactly equal to the actual width of the cell, the best linear enhancement filter can be obtained, and the best linearity can be used. The enhancement filtering performs cell enhancement on the initial medical image.
综上所述,本申请实施例将所述初始医学图像进行如上计算,调整所述标准偏移量的大小等于所述初始医学图像中细胞的实际宽度,得到所述最佳的线性增强滤波,进而实现对所述初始医学图像进行细胞增强,得到所述标准医学图像。In summary, in the embodiment of the present application, the initial medical image is calculated as described above, the size of the standard offset is adjusted to be equal to the actual width of the cells in the initial medical image, and the optimal linear enhancement filter is obtained. Furthermore, cell enhancement is performed on the initial medical image to obtain the standard medical image.
S3、获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集。S3. Obtain distribution data of each pixel information in the standard medical image, and generate a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set.
本申请实施例可用现有的munpy(Numerical Python,数字蟒蛇)等方法来获取所述标准医学图像中各像素信息的分布数据。In the embodiment of the present application, the existing munpy (Numerical Python, digital python) method can be used to obtain the distribution data of each pixel information in the standard medical image.
本申请实施例中,所述图像生成模型是一个用服从特定分布的噪声构建的样本卷积神经网络。In the embodiment of the present application, the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
所述图像生成模型可以根据所述分布数据利用预设的图像生成模型生成多张与所述标准医学图的第一样本图像,得到第一样本图像集。The image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
详细的,所述S3包括:Specifically, the S3 includes:
构建样本生成损失函数F;Construct sample generation loss function F;
将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的 参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
其中,所述样本生成损失函数F包括:Wherein, the sample generation loss function F includes:
F=Lc-LsF=Lc-Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
本申请实施例利用所述图像生成模型生成多张第一样本图像,得到所述第一样本图像集。In this embodiment of the application, the image generation model is used to generate multiple first sample images to obtain the first sample image set.
详细地,所述标准医学图像的各像素信息中仅有部分含有对医疗有帮助的有效信息,所以生成的所述第一样本图像的各像素信息中也仅有部分包含所述有效信息。因此,利用S3生成的第一样本图像集中包含的有效信息仍不足以满足医学研究要求,需要进一步地执行下述的S4进行筛选。In detail, only part of each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set generated by S3 is still insufficient to meet the requirements of medical research, and the following S4 needs to be further performed for screening.
S4、对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集。S4. Calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the order of the effective information amount from the The K first sample images corresponding to the effective amount of information are selected from the first sample image set to obtain the effective image set.
详细的,本申请实施例中利用如下有效信息量计算公式计算所述第一样本图像集中每个第一样本图像的有效信息量R:Specifically, in the embodiment of the present application, the following effective information amount calculation formula is used to calculate the effective information amount R of each first sample image in the first sample image set:
Figure PCTCN2020098947-appb-000006
Figure PCTCN2020098947-appb-000006
其中,b为所述第一样本图像中含有有效信息的像素个数;a为所述第一样本图像中像素的总个数。Wherein, b is the number of pixels containing valid information in the first sample image; a is the total number of pixels in the first sample image.
所述第一样本图像中含有有效信息的像素个数可以用现有的图像识别技术进行识别获取。The number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
进一步地,当计算完成后,本申请实施例将所述第一样本图像集中有效信息量按照从多到少的顺序进行排列,并从所述排列中选择有效信息量最多的k个所述第一样本图像,得到所述有效图像集。Further, after the calculation is completed, the embodiment of the present application arranges the effective amount of information in the first sample image set in order from most to least, and selects the k with the most effective amount of information from the arrangement. The first sample image, the effective image set is obtained.
S5、将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。S5. Input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain a discrimination result, and adjust the image discrimination model according to the discrimination result Until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard image generation model, A second sample image set is generated, and a final medical image is generated according to the second sample image.
详细地,所述图像判别模型是一个用于图像判别的卷积神经网络。In detail, the image discrimination model is a convolutional neural network for image discrimination.
所述互相约束关系指的是所述图像生成模型和所述图像判别模型的损失函数中的参数相同,并且同步变化,例如,图像判别模型的其中一个参数变成“a”,则图像生成模型对应的参数也变成“a”。The mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a", then the image generation model The corresponding parameter also becomes "a".
详细的,所述将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,包括:Specifically, the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the discrimination result is adjusted according to the discrimination result. The parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, including:
构建判别损失函数Y,利用所述判别损失函数Y对所述图像判别模型进行约束;Construct a discriminant loss function Y, and use the discriminant loss function Y to constrain the image discriminant model;
将所述标准医学图像和所述有效图像集输入至所述图像判别模型,生成所述最终医学 图像集;Inputting the standard medical image and the effective image set to the image discrimination model to generate the final medical image set;
将所述最终医学图像集和所述有效图像集输入到所述判别损失函数Y进行损失计算,得到损失函数值q;Input the final medical image set and the effective image set to the discriminant loss function Y for loss calculation to obtain a loss function value q;
当所述损失函数值q大于或等于预设的损失阈值n时,说明所述图像判别模型生成的最终医学图像集和有效图像集不相似,则调整所述图像判别模型的参数,重新生所述最终医学图像;When the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
当所述损失函数值q小于所述损失阈值n时,说明所述图像判别模型生成的最终医学图像集和所述有效图像集相似,则完成训练,得到此时所述图像判别模型参数。When the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
其中,所述判别损失函数Y如下:Wherein, the discriminant loss function Y is as follows:
Y=Lc+LsY=Lc+Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
进一步地,将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。本申请上述实施例根据标准医学图像中各像素信息的分布数据,利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,实现了对图像生成模型的初步训练,让其可以产生第一样本图像以便后续使用;进一步地,对所述第一样本图像集进行有效信息量计算,依照有效信息量的排列顺序,从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集,以筛选出了含有更多有效信息的医学图像,进一步保证了后续图像生成质量,同时也避免了人工进行逐个筛选样本;将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据判别结果调整所述图像判别模型的参数,利用所述图像判别模型与所述图像生成模型的约束关系,进一步调整所述图像生成模型的参数,实现了对所述图像生成模型的再次训练,保证了图像生成模型在图像生成时的精确度。因此本申请提出的医学图像的生成方法、装置及计算机可读存储介质,可以实现自动批量的对第一样本图像进行筛选,并自动化的训练出精确的医学图像模型,生成最终的医学图像,节省了大量人力资源。Further, the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image. According to the distribution data of each pixel information in the standard medical image, the above-mentioned embodiment of the application uses the image generation model to generate multiple first sample images similar to the standard medical image, and realizes the preliminary training of the image generation model. The first sample image can be generated for subsequent use; further, the effective information amount calculation is performed on the first sample image set, and K effective information is selected from the first sample image set according to the order of the effective information amount. The first sample image corresponding to the amount of information obtains an effective image set to filter out medical images containing more effective information, which further guarantees the quality of subsequent image generation, and also avoids manual screening of samples one by one; The image set and the standard medical image are input into the image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained. The parameters of the image discrimination model are adjusted according to the discrimination result, and the image discrimination is used The constraint relationship between the model and the image generation model further adjusts the parameters of the image generation model to realize the retraining of the image generation model and ensure the accuracy of the image generation model during image generation. Therefore, the medical image generation method, device, and computer-readable storage medium proposed in this application can automatically screen the first sample images in batches, and automatically train accurate medical image models to generate the final medical images. Save a lot of human resources.
如图2所示,是本申请医学图像的生成方法装置的功能模块图。As shown in Figure 2, it is a functional block diagram of the medical image generation method device of the present application.
本申请所述医学图像的生成方法100可以安装于电子设备中。根据实现的功能,所述医学图像的生成方法装置可以包括图像预处理模块101、第一样本图像生成模块102、有效信息计算模块103和图像判别模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The medical image generation method 100 described in this application can be installed in an electronic device. According to the realized functions, the medical image generation method device may include an image preprocessing module 101, a first sample image generation module 102, an effective information calculation module 103, and an image discrimination module 104. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述图像预处理模块101,用于获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像,对所述初始医学图像进行细胞增强处理,得到标准医学图像;The image preprocessing module 101 is configured to obtain an original medical image, perform conversion processing on the original medical image to obtain an initial medical image, and perform cell enhancement processing on the initial medical image to obtain a standard medical image;
所述第一样本图像生成模块102,用于获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;The first sample image generation module 102 is used to obtain distribution data of each pixel information in the standard medical image, and generate multiple first images similar to the standard medical image by using an image generation model according to the distribution data. This image, get the first sample image set;
所述有效信息计算模块103,用于对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information calculation module 103 is configured to calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount. The arrangement order of the information amount selects K first sample images corresponding to the effective information amount from the first sample image set to obtain an effective image set;
所述图像判别模块104,用于将所述有效图像集和所述标准医学图像输入至与所述图 像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型。The image discrimination module 104 is configured to input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and obtain a discrimination result, according to the discrimination As a result, the parameters of the image discrimination model are adjusted until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters.
详细地,所述医学图像的生成方法装置各模块的具体实施步骤如下:In detail, the specific implementation steps of each module of the medical image generation method device are as follows:
所述图像预处理模块101获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像,对所述初始医学图像进行细胞增强处理,得到标准医学图像。The image preprocessing module 101 obtains an original medical image, performs conversion processing on the original medical image to obtain an original medical image, and performs cell enhancement processing on the original medical image to obtain a standard medical image.
本申请实施例中,所述原始医学图像可以是医院存储的b超图片,彩超图片等。In the embodiment of the present application, the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
本申请实施例中,所述图像预处理模块101对所述原始医学图像进行转换处理,得到初始医学图像,包括:In the embodiment of the present application, the image preprocessing module 101 performs conversion processing on the original medical image to obtain an initial medical image, including:
将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
其中,所述图像预处理模块101将所述原始医学图像进行灰度值转换,得到原始灰度图,包括:Wherein, the image preprocessing module 101 converts the gray value of the original medical image to obtain the original gray image, including:
将所述原始医学图像中的所有像素输入至一个灰度值转换公式中进行灰度值转换,根据转换后的灰度值生成所述原始灰度图。All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
其中,所述灰度值转换公式为:Wherein, the gray value conversion formula is:
Gray=0.30*R+0.59*G+0.11*BGray=0.30*R+0.59*G+0.11*B
其中R,G,B为所述包原始医学图像中的像素的三分量,Gray为转换得到的灰度值。Wherein R, G, B are the three components of the pixels in the original medical image, and Gray is the gray value obtained by conversion.
进一步地,本申请实施例中,所述图像预处理模块101将所述原始灰度图进行降噪处理,得到降噪灰度图,包括:Further, in the embodiment of the present application, the image preprocessing module 101 performs noise reduction processing on the original gray image to obtain a noise reduction gray image, including:
将所述原始灰度图中任一像素点的像素值用该像素点的一个邻域中各像素点的像素值的中值代替,让所述任一像素点周围的像素值接近的真实值,从而消除孤立的噪声点。Replace the pixel value of any pixel in the original grayscale image with the median value of each pixel in a neighborhood of the pixel, so that the pixel value around any pixel is close to the true value , Thereby eliminating isolated noise points.
详细地,所述邻域可以是预设的圆形结构的二维滑动模板,将所述二维滑动模板内像素按照像素值的大小进行排序,生成单调上升(或下降)的二维数据序列,以找到所述邻域中各像素点的像素值的中值。In detail, the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
详细地,所述图像预处理模块101利用如下计算公式,对所述原始灰度图进行降噪处理,得到所述降噪灰度图:In detail, the image preprocessing module 101 uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
g(x,y)=med{f(x-j,y-k),(j,k∈W)}g(x,y)=med{f(x-j,y-k),(j,k∈W)}
其中,f(x,y)为所述原始灰度图;g(x,y)为所述降噪灰度图,W为二维滑动模板;j、k为所述二维滑动模版边界上像素点的坐标;med为降噪处理运算。Wherein, f(x,y) is the original grayscale image; g(x,y) is the denoising grayscale image, W is a two-dimensional sliding template; j and k are on the boundary of the two-dimensional sliding template The coordinates of the pixel; med is the noise reduction processing operation.
进一步地,所述图像预处理模块101将所述降噪灰度图进行几何变换处理,得到变换灰度图,包括:Further, the image preprocessing module 101 performs geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image, including:
对所述降噪灰度图通过平移、转置、镜像、旋转、缩放等几何变换处理,改正所述原始医学图像获取过程中产生的系统误差和仪器位置产生的随机误差;几何变换处理完成后,得到所述变换灰度图。Perform geometric transformation processing such as translation, transposition, mirroring, rotation, and scaling on the denoising grayscale image to correct the system error generated during the acquisition of the original medical image and the random error generated by the position of the instrument; after the geometric transformation processing is completed , To obtain the transformed gray scale image.
所述对比度指的是图像中像素点亮度最大值与最小值之间的对比。The contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
所述图像预处理模块101可以采用对比度拉伸方法对所述变换灰度图进行对比度增强。The image preprocessing module 101 may adopt a contrast stretching method to enhance the contrast of the transformed grayscale image.
所述对比度拉伸方法也叫作灰度拉伸。本申请实施例所述图像预处理模块101使用对比度拉伸方法中的分段线性变换函数,根据实际需求针对所述原始灰度图中特定区域进行灰度拉伸,进而增强所述变换灰度图的对比度,得到初始医学图像。详细地,所述将所述变换灰度图进行对比度增强,得到初始医学图像,包括:The contrast stretching method is also called gray scale stretching. The image preprocessing module 101 of the embodiment of the present application uses the piecewise linear transformation function in the contrast stretching method to perform grayscale stretching for a specific region in the original grayscale image according to actual needs, thereby enhancing the transformed grayscale The contrast of the figure, the initial medical image is obtained. In detail, performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
所述图像预处理模块101利用下述分段线性变换函数公式将所述变换灰度图进行对比度增强,得到所述初始医学图像:The image preprocessing module 101 uses the following piecewise linear transformation function formula to perform contrast enhancement on the transformed grayscale image to obtain the initial medical image:
D b=f(D a)=a*D a+b D b =f(D a )=a*D a +b
其中a为线性斜率,b为D b在Y轴上的截距,D a代表输入所述变换灰度图的灰度值,D b代表输出所述初始医学图像的灰度值。 Where a is the linear slope, b is the intercept of D b on the Y axis, D a represents the gray value of the input transformed gray image, and D b represents the gray value of the output initial medical image.
考虑到细胞都是以线状的形态出现,本申请实施例所述图像预处理模块101通过对预设的高斯函数的标准偏移量取不同的值可以获得所述标准医学图像不同标准偏移量取值下的适用于细胞的线性增强滤波。Considering that the cells appear in a linear form, the image preprocessing module 101 described in this embodiment of the application can obtain different standard deviations of the standard medical image by taking different values for the standard deviation of the preset Gaussian function. The linear enhancement filter applied to the cell under the measurement value.
所述线性增强滤波可用来对所述初始医学图像进行细胞增强。The linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
本申请实施例所述图像预处理模块101根据所述高斯函数的卷积性质,计算所述初始医学图像与二阶高斯函数的卷积得到所述标准医学图像的尺度空间导数I abcAccording to the convolution property of the Gaussian function, the image preprocessing module 101 of the embodiment of the present application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
Figure PCTCN2020098947-appb-000007
Figure PCTCN2020098947-appb-000007
Figure PCTCN2020098947-appb-000008
Figure PCTCN2020098947-appb-000008
其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
Figure PCTCN2020098947-appb-000009
为求偏倒数运算符号
Figure PCTCN2020098947-appb-000010
为求卷积运算符号。
Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
Figure PCTCN2020098947-appb-000009
Symbol for reciprocal operation
Figure PCTCN2020098947-appb-000010
To find the convolution operation symbol.
进一步地,本申请实施例所述图像预处理模块101通过对所述高斯函数的标准偏移量的不同取值,得到矩阵H:Further, the image preprocessing module 101 of the embodiment of the present application obtains the matrix H by taking different values of the standard offset of the Gaussian function:
Figure PCTCN2020098947-appb-000011
Figure PCTCN2020098947-appb-000011
其中,矩阵中的元素为不同标准偏移量取值下所述尺度空间导数I abc的值。 Wherein, the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
由高斯函数的线形特点可以得知,当且仅当高斯函数的标准偏移量σ的大小刚好等于细胞的实际宽度的时候,可得到最佳的线性增强滤波,并利用所述最佳的线性增强滤波对所述初始医学图像进行细胞增强。It can be known from the linear characteristics of the Gaussian function that if and only when the standard offset σ of the Gaussian function is exactly equal to the actual width of the cell, the best linear enhancement filter can be obtained, and the best linearity can be used. The enhancement filtering performs cell enhancement on the initial medical image.
综上所述,本申请实施例所述图像预处理模块101将所述初始医学图像进行如上计算,调整所述标准偏移量的大小等于所述初始医学图像中细胞的实际宽度,得到所述最佳的线性增强滤波,进而实现对所述初始医学图像进行细胞增强,得到所述标准医学图像。In summary, the image preprocessing module 101 of the embodiment of the present application calculates the initial medical image as described above, adjusts the size of the standard offset to be equal to the actual width of the cells in the initial medical image, and obtains the The best linear enhancement filtering is used to achieve cell enhancement of the initial medical image to obtain the standard medical image.
所述第一样本图像生成模块102获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集。The first sample image generating module 102 obtains the distribution data of each pixel information in the standard medical image, and uses an image generation model to generate a plurality of first sample images similar to the standard medical image according to the distribution data, Get the first sample image set.
本申请实施例所述第一样本图像生成模块102可用现有的munpy(Numerical Python,数字蟒蛇)等方法来获取所述标准医学图像中各像素信息的分布数据。The first sample image generating module 102 described in this embodiment of the present application can use existing munpy (Numerical Python, digital python) methods to obtain the distribution data of each pixel information in the standard medical image.
本申请实施例中,所述图像生成模型是一个用服从特定分布的噪声构建的样本卷积神经网络。In the embodiment of the present application, the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
所述图像生成模型可以根据所述分布数据利用预设的图像生成模型生成多张与所述标准医学图的第一样本图像,得到第一样本图像集。The image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
详细的,所述第一样本图像生成模块102获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集包括:In detail, the first sample image generation module 102 obtains the distribution data of each pixel information in the standard medical image, and generates a plurality of first images similar to the standard medical image by using an image generation model according to the distribution data. In this image, the first sample image set obtained includes:
构建样本生成损失函数F;Construct sample generation loss function F;
将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
其中,所述样本生成损失函数F包括:Wherein, the sample generation loss function F includes:
F=Lc-LsF=Lc-Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
本申请实施例利用所述图像生成模型生成多张第一样本图像,得到所述第一样本图像集。In this embodiment of the application, the image generation model is used to generate multiple first sample images to obtain the first sample image set.
详细地,所述标准医学图像的各像素信息中仅有部分含有对医疗有帮助的有效信息,所以生成的所述第一样本图像的各像素信息中也仅有部分包含所述有效信息。因此,第一样本图像集中包含的有效信息仍不足以满足医学研究要求,需要进一步地进行筛选。In detail, only part of each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set is still insufficient to meet the requirements of medical research, and further screening is required.
所述有效信息计算模块103对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集。The effective information calculation module 103 calculates the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount The arrangement sequence selects K first sample images corresponding to the effective amount of information from the first sample image set to obtain an effective image set.
详细的,本申请实施例所述有效信息计算模块103利用如下有效信息量计算公式计算所述第一样本图像集中每个第一样本图像的有效信息量R:In detail, the effective information calculation module 103 described in the embodiment of the present application uses the following effective information amount calculation formula to calculate the effective information amount R of each first sample image in the first sample image set:
Figure PCTCN2020098947-appb-000012
Figure PCTCN2020098947-appb-000012
其中,b为所述第一样本图像中含有有效信息的像素个数;a为所述第一样本图像中像素的总个数。Wherein, b is the number of pixels containing valid information in the first sample image; a is the total number of pixels in the first sample image.
所述第一样本图像中含有有效信息的像素个数可以用现有的图像识别技术进行识别获取。The number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
进一步地,当计算完成后,本申请实施例所述有效信息计算模块103将所述第一样本图像集中有效信息量按照从多到少的顺序进行排列,并从所述排列中选择有效信息量最多的k个所述第一样本图像,得到所述有效图像集。Further, after the calculation is completed, the effective information calculation module 103 described in this embodiment of the present application arranges the effective information amount in the first sample image set in order from most to least, and selects effective information from the arrangement The k first sample images with the largest amount are obtained to obtain the effective image set.
所述图像判别模块104将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The image discrimination module 104 inputs the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtains a discrimination result, and adjusts the image according to the discrimination result. The parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard The image generation model generates a second sample image set, and generates a final medical image according to the second sample image.
详细地,所述图像判别模型是一个用于图像判别的卷积神经网络。In detail, the image discrimination model is a convolutional neural network for image discrimination.
所述互相约束关系指的是所述图像生成模型和所述图像判别模型的损失函数中的参数相同,并且同步变化,例如,图像判别模型的其中一个参数变成“a”,则图像生成模型对应的参数也变成“a”。The mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a", then the image generation model The corresponding parameter also becomes "a".
详细的,所述所述图像判别模块104将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据 所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,包括:In detail, the image discrimination module 104 inputs the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and obtains the discrimination result according to the The discrimination result adjusts the parameters of the image discrimination model until the discrimination result meets the preset requirements, and the parameters of the image discrimination model at this time are obtained, including:
构建判别损失函数Y,利用所述判别损失函数Y对所述图像判别模型进行约束;Construct a discriminant loss function Y, and use the discriminant loss function Y to constrain the image discriminant model;
将所述标准医学图像和所述有效图像集输入至所述图像判别模型,生成所述最终医学图像集;Inputting the standard medical image and the effective image set to the image discrimination model to generate the final medical image set;
将所述最终医学图像集和所述有效图像集输入到所述判别损失函数Y进行损失计算,得到损失函数值q;Input the final medical image set and the effective image set to the discriminant loss function Y for loss calculation to obtain a loss function value q;
当所述损失函数值q大于或等于预设的损失阈值n时,说明所述图像判别模型生成的最终医学图像集和有效图像集不相似,则调整所述图像判别模型的参数,重新生所述最终医学图像;When the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
当所述损失函数值q小于所述损失阈值n时,说明所述图像判别模型生成的最终医学图像集和所述有效图像集相似,则完成训练,得到此时所述图像判别模型参数。When the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
其中,所述判别损失函数Y如下:Wherein, the discriminant loss function Y is as follows:
Y=Lc+LsY=Lc+Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
进一步地,将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。Further, the original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
如图3所示,是本申请实现医学图像的生成方法的电子设备的结构示意图。As shown in FIG. 3, it is a schematic diagram of the structure of an electronic device that implements the method for generating a medical image in the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如所述医学图像模型的训练程序12。The electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a training program 12 of the medical image model. .
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如医学图像模型的训练程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the training program 12 of the medical image model, etc., but also to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行医学图像的生成程序12等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc. The processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The medical image generation program 12, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构 并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may also include a user interface. The user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的医学图像的生成方法程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The medical image generation method program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
具体地,所述处理器10对上述指令的具体实现方法可参考图2对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instructions by the processor 10, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 2, which will not be repeated here.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读存储介质可以是非易失性,也可以是易失性,所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated module/unit of the electronic device 1 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 storage medium. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile Hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
步骤一、获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像。Step 1: Obtain an original medical image, and perform conversion processing on the original medical image to obtain an initial medical image.
本申请实施例中,所述原始医学图像可以是医院存储的b超图片,彩超图片等。In the embodiment of the present application, the original medical image may be a b-ultrasound image, a color ultrasound image, etc. stored in a hospital.
本申请实施例中,所述对所述原始医学图像进行转换处理,得到初始医学图像,包括:In the embodiment of the present application, the conversion processing of the original medical image to obtain the initial medical image includes:
将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
其中,所述将所述原始医学图像进行灰度值转换,得到原始灰度图,包括:Wherein, said converting the original medical image to gray value to obtain the original gray image includes:
将所述原始医学图像中的所有像素输入至一个灰度值转换公式中进行灰度值转换,根据转换后的灰度值生成所述原始灰度图。All pixels in the original medical image are input into a gray value conversion formula for gray value conversion, and the original gray image is generated according to the converted gray value.
其中,所述灰度值转换公式为:Wherein, the gray value conversion formula is:
Gray=0.30*R+0.59*G+0.11*BGray=0.30*R+0.59*G+0.11*B
其中R,G,B为所述包原始医学图像中的像素的三分量,Gray为转换得到的灰度值。Wherein R, G, B are the three components of the pixels in the original medical image, and Gray is the gray value obtained by conversion.
进一步地,本申请实施例中,所述将所述原始灰度图进行降噪处理,得到降噪灰度图,包括:Further, in the embodiment of the present application, the performing noise reduction processing on the original gray image to obtain the noise reduction gray image includes:
将所述原始灰度图中任一像素点的像素值用该像素点的一个邻域中各像素点的像素值的中值代替,让所述任一像素点周围的像素值接近的真实值,从而消除孤立的噪声点。Replace the pixel value of any pixel in the original grayscale image with the median value of each pixel in a neighborhood of the pixel, so that the pixel value around any pixel is close to the true value , Thereby eliminating isolated noise points.
详细地,所述邻域可以是预设的圆形结构的二维滑动模板,将所述二维滑动模板内像素按照像素值的大小进行排序,生成单调上升(或下降)的二维数据序列,以找到所述邻域中各像素点的像素值的中值。In detail, the neighborhood may be a two-dimensional sliding template with a preset circular structure, and the pixels in the two-dimensional sliding template are sorted according to the size of the pixel value to generate a monotonically rising (or falling) two-dimensional data sequence , To find the median value of the pixel value of each pixel in the neighborhood.
详细地,本申请实施例利用如下计算公式,对所述原始灰度图进行降噪处理,得到所述降噪灰度图:In detail, the embodiment of the present application uses the following calculation formula to perform noise reduction processing on the original gray image to obtain the noise reduction gray image:
g(x,y)=med{f(x-j,y-k),(j,k∈W)}g(x,y)=med{f(x-j,y-k),(j,k∈W)}
其中,f(x,y)为所述原始灰度图;g(x,y)为所述降噪灰度图,W为二维滑动模板;j、k为所述二维滑动模版边界上像素点的坐标;med为降噪处理运算。Wherein, f(x,y) is the original grayscale image; g(x,y) is the denoising grayscale image, W is a two-dimensional sliding template; j and k are on the boundary of the two-dimensional sliding template The coordinates of the pixel; med is the noise reduction processing operation.
进一步地,所述将所述降噪灰度图进行几何变换处理,得到变换灰度图,包括:Further, performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image includes:
对所述降噪灰度图通过平移、转置、镜像、旋转、缩放等几何变换处理,改正所述原始医学图像获取过程中产生的系统误差和仪器位置产生的随机误差;几何变换处理完成后,得到所述变换灰度图。Perform geometric transformation processing such as translation, transposition, mirroring, rotation, and scaling on the denoising grayscale image to correct the system error generated during the acquisition of the original medical image and the random error generated by the position of the instrument; after the geometric transformation processing is completed , To obtain the transformed gray scale image.
所述对比度指的是图像中像素点亮度最大值与最小值之间的对比。The contrast refers to the contrast between the maximum and minimum brightness of pixels in an image.
本申请实施例可以采用对比度拉伸方法对所述变换灰度图进行对比度增强。In this embodiment of the present application, a contrast stretching method may be used to enhance the contrast of the transformed grayscale image.
所述对比度拉伸方法也叫作灰度拉伸。本申请实施例使用对比度拉伸方法中的分段线性变换函数,根据实际需求针对所述原始灰度图中特定区域进行灰度拉伸,进而增强所述变换灰度图的对比度,得到初始医学图像。详细地,所述将所述变换灰度图进行对比度增强,得到初始医学图像,包括:The contrast stretching method is also called gray scale stretching. The embodiment of the application uses the piecewise linear transformation function in the contrast stretching method to perform gray-scale stretching for specific regions in the original gray-scale image according to actual needs, thereby enhancing the contrast of the transformed gray-scale image, and obtaining the original medical image. In detail, performing contrast enhancement on the transformed grayscale image to obtain an initial medical image includes:
利用下述分段线性变换函数公式将所述变换灰度图进行对比度增强,得到所述初始医学图像:Use the following piecewise linear transformation function formula to perform contrast enhancement on the transformed grayscale image to obtain the initial medical image:
D b=f(D a)=a*D a+b D b =f(D a )=a*D a +b
其中a为线性斜率,b为D b在Y轴上的截距,D a代表输入所述变换灰度图的灰度值,D b代表输出所述初始医学图像的灰度值。 Where a is the linear slope, b is the intercept of D b on the Y axis, D a represents the gray value of the input transformed gray image, and D b represents the gray value of the output initial medical image.
步骤二、对所述初始医学图像进行细胞增强处理,得到标准医学图像。Step 2: Perform cell enhancement processing on the initial medical image to obtain a standard medical image.
考虑到细胞都是以线状的形态出现,本申请实施例通过对预设的高斯函数的标准偏移量取不同的值可以获得所述标准医学图像不同标准偏移量取值下的适用于细胞的线性增强滤波。Considering that the cells appear in a linear form, the embodiment of the present application takes different values for the standard offset of the preset Gaussian function to obtain the standard medical image suitable for different standard offset values. Linear enhancement filtering of cells.
所述线性增强滤波可用来对所述初始医学图像进行细胞增强。The linear enhancement filtering can be used to perform cell enhancement on the initial medical image.
本申请实施例根据所述高斯函数的卷积性质,计算所述初始医学图像与二阶高斯函数的卷积得到所述标准医学图像的尺度空间导数I abcAccording to the convolution property of the Gaussian function, the embodiment of the application calculates the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the standard medical image:
Figure PCTCN2020098947-appb-000013
Figure PCTCN2020098947-appb-000013
Figure PCTCN2020098947-appb-000014
Figure PCTCN2020098947-appb-000014
其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
Figure PCTCN2020098947-appb-000015
为求偏倒数运算符号
Figure PCTCN2020098947-appb-000016
为求卷积运算符号。
Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
Figure PCTCN2020098947-appb-000015
Symbol for reciprocal operation
Figure PCTCN2020098947-appb-000016
To find the convolution operation symbol.
进一步地,本申请实施例通过对所述高斯函数的标准偏移量的不同取值,得到矩阵H:Further, in the embodiment of the present application, the matrix H is obtained by taking different values of the standard offset of the Gaussian function:
Figure PCTCN2020098947-appb-000017
Figure PCTCN2020098947-appb-000017
其中,矩阵中的元素为不同标准偏移量取值下所述尺度空间导数I abc的值。 Wherein, the elements in the matrix are the values of the scale space derivative I abc under different standard offset values.
由高斯函数的线形特点可以得知,当且仅当高斯函数的标准偏移量σ的大小刚好等于细胞的实际宽度的时候,可得到最佳的线性增强滤波,并利用所述最佳的线性增强滤波对所述初始医学图像进行细胞增强。It can be known from the linear characteristics of the Gaussian function that if and only when the standard offset σ of the Gaussian function is exactly equal to the actual width of the cell, the best linear enhancement filter can be obtained, and the best linearity can be used. The enhancement filtering performs cell enhancement on the initial medical image.
综上所述,本申请实施例将所述初始医学图像进行如上计算,调整所述标准偏移量的大小等于所述初始医学图像中细胞的实际宽度,得到所述最佳的线性增强滤波,进而实现对所述初始医学图像进行细胞增强,得到所述标准医学图像。In summary, in the embodiment of the present application, the initial medical image is calculated as described above, the size of the standard offset is adjusted to be equal to the actual width of the cells in the initial medical image, and the optimal linear enhancement filter is obtained. Furthermore, cell enhancement is performed on the initial medical image to obtain the standard medical image.
步骤三、获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集。Step 3: Obtain the distribution data of each pixel information in the standard medical image, and use the image generation model to generate multiple first sample images similar to the standard medical image according to the distribution data to obtain a first sample image set .
本申请实施例可用现有的munpy(Numerical Python,数字蟒蛇)等方法来获取所述标准医学图像中各像素信息的分布数据。In the embodiment of the present application, the existing munpy (Numerical Python, digital python) method can be used to obtain the distribution data of each pixel information in the standard medical image.
本申请实施例中,所述图像生成模型是一个用服从特定分布的噪声构建的样本卷积神经网络。In the embodiment of the present application, the image generation model is a sample convolutional neural network constructed with noise that obeys a specific distribution.
所述图像生成模型可以根据所述分布数据利用预设的图像生成模型生成多张与所述标准医学图的第一样本图像,得到第一样本图像集。The image generation model may use a preset image generation model to generate a plurality of first sample images with the standard medical image according to the distribution data to obtain a first sample image set.
详细的,所述步骤三包括:Specifically, the step three includes:
构建样本生成损失函数F;Construct sample generation loss function F;
将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
其中,所述样本生成损失函数F包括:Wherein, the sample generation loss function F includes:
F=Lc-LsF=Lc-Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
本申请实施例利用所述图像生成模型生成多张第一样本图像,得到所述第一样本图像集。In this embodiment of the application, the image generation model is used to generate multiple first sample images to obtain the first sample image set.
详细地,所述标准医学图像的各像素信息中仅有部分含有对医疗有帮助的有效信息,所以生成的所述第一样本图像的各像素信息中也仅有部分包含所述有效信息。因此,利用步骤三生成的第一样本图像集中包含的有效信息仍不足以满足医学研究要求,需要进一步地执行下述的步骤四进行筛选。In detail, only part of each pixel information of the standard medical image contains effective information helpful to medical treatment, so only part of each pixel information of the generated first sample image also contains the effective information. Therefore, the effective information contained in the first sample image set generated in step 3 is still insufficient to meet the requirements of medical research, and the following step 4 needs to be further performed for screening.
步骤四、对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集。Step 4: Calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. In the first sample image set, K first sample images corresponding to the effective amount of information are selected to obtain an effective image set.
详细的,本申请实施例中利用如下有效信息量计算公式计算所述第一样本图像集中每个第一样本图像的有效信息量R:Specifically, in the embodiment of the present application, the following effective information amount calculation formula is used to calculate the effective information amount R of each first sample image in the first sample image set:
Figure PCTCN2020098947-appb-000018
Figure PCTCN2020098947-appb-000018
其中,b为所述第一样本图像中含有有效信息的像素个数;a为所述第一样本图像中像素的总个数。Wherein, b is the number of pixels containing valid information in the first sample image; a is the total number of pixels in the first sample image.
所述第一样本图像中含有有效信息的像素个数可以用现有的图像识别技术进行识别获取。The number of pixels containing valid information in the first sample image can be recognized and acquired by using existing image recognition technology.
进一步地,当计算完成后,本申请实施例将所述第一样本图像集中有效信息量按照从多到少的顺序进行排列,并从所述排列中选择有效信息量最多的k个所述第一样本图像,得到所述有效图像集。Further, after the calculation is completed, the embodiment of the present application arranges the effective amount of information in the first sample image set in order from most to least, and selects the k with the most effective amount of information from the arrangement. The first sample image, the effective image set is obtained.
步骤五、将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。Step 5. Input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain a discrimination result, and adjust the image discrimination according to the discrimination result The parameters of the model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard image generation model To generate a second sample image set, and generate a final medical image according to the second sample image.
详细地,所述图像判别模型是一个用于图像判别的卷积神经网络。In detail, the image discrimination model is a convolutional neural network for image discrimination.
所述互相约束关系指的是所述图像生成模型和所述图像判别模型的损失函数中的参数相同,并且同步变化,例如,图像判别模型的其中一个参数变成“a”,则图像生成模型对应的参数也变成“a”。The mutual constraint relationship means that the parameters in the loss function of the image generation model and the image discrimination model are the same and change synchronously. For example, if one of the parameters of the image discrimination model becomes "a", then the image generation model The corresponding parameter also becomes "a".
详细的,所述将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,包括:Specifically, the effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the discrimination result is adjusted according to the discrimination result. The parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, including:
构建判别损失函数Y,利用所述判别损失函数Y对所述图像判别模型进行约束;Construct a discriminant loss function Y, and use the discriminant loss function Y to constrain the image discriminant model;
将所述标准医学图像和所述有效图像集输入至所述图像判别模型,生成所述最终医学图像集;Inputting the standard medical image and the effective image set to the image discrimination model to generate the final medical image set;
将所述最终医学图像集和所述有效图像集输入到所述判别损失函数Y进行损失计算,得到损失函数值q;Input the final medical image set and the effective image set to the discriminant loss function Y for loss calculation to obtain a loss function value q;
当所述损失函数值q大于或等于预设的损失阈值n时,说明所述图像判别模型生成的最终医学图像集和有效图像集不相似,则调整所述图像判别模型的参数,重新生所述最终医学图像;When the loss function value q is greater than or equal to the preset loss threshold n, it means that the final medical image set generated by the image discriminant model is not similar to the effective image set, and the parameters of the image discriminant model are adjusted to regenerate the image. State the final medical image;
当所述损失函数值q小于所述损失阈值n时,说明所述图像判别模型生成的最终医学 图像集和所述有效图像集相似,则完成训练,得到此时所述图像判别模型参数。When the loss function value q is less than the loss threshold n, it means that the final medical image set generated by the image discrimination model is similar to the effective image set, and training is completed to obtain the image discrimination model parameters at this time.
其中,所述判别损失函数Y如下:Wherein, the discriminant loss function Y is as follows:
Y=Lc+LsY=Lc+Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
具体地,所述计算机程序被处理器执行时实现的方法步骤可参考图2对应实施例中相关步骤的描述,在此不赘述。Specifically, for the method steps implemented when the computer program is executed by the processor, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 2, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, 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 may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to indicate names, and do not indicate any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种医学图像的生成方法,其中,所述方法包括:A method for generating medical images, wherein the method includes:
    获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
    对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
    获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
    对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
    将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
    将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  2. 如权利要求1所述的医学图像的生成方法,其中,所述对所述原始医学图像进行转换处理,得到初始医学图像,包括:5. The method for generating medical images according to claim 1, wherein said converting the original medical image to obtain the initial medical image comprises:
    将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
    将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
    将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
    将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  3. 如权利要求1所述的医学图像的生成方法,其中,所述对所述初始医学图像进行细胞增强处理,得到标准医学图像,包括:The method for generating medical images according to claim 1, wherein said performing cell enhancement processing on the initial medical image to obtain a standard medical image comprises:
    利用如下计算公式计算所述初始医学图像与二阶高斯函数的卷积,得到所述初始医学图像的尺度空间导数I abcThe following calculation formula is used to calculate the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the initial medical image:
    Figure PCTCN2020098947-appb-100001
    Figure PCTCN2020098947-appb-100001
    Figure PCTCN2020098947-appb-100002
    Figure PCTCN2020098947-appb-100002
    其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
    Figure PCTCN2020098947-appb-100003
    为求偏倒数运算符号
    Figure PCTCN2020098947-appb-100004
    为求卷积运算符号;
    Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
    Figure PCTCN2020098947-appb-100003
    Symbol for reciprocal operation
    Figure PCTCN2020098947-appb-100004
    To find the convolution operation symbol;
    根据所述尺度空间导数I abc对所述初始医学图像进行细胞增强,得到所述标准医学图像。 Perform cell enhancement on the initial medical image according to the scale space derivative I abc to obtain the standard medical image.
  4. 如权利要求1所述的医学图像的生成方法,其中,所述获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集,包括:The method for generating a medical image according to claim 1, wherein said acquiring distribution data of each pixel information in said standard medical image, and generating a plurality of images similar to said standard medical image using an image generation model according to said distribution data The first sample image of, the first sample image set is obtained, including:
    构建样本生成损失函数F;Construct sample generation loss function F;
    将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
    将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
    当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
    当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  5. 如权利要求4所述的医学图像的生成方法,其中,所述样本生成损失函数F包括:5. The medical image generation method according to claim 4, wherein the sample generation loss function F comprises:
    F=Lc-LsF=Lc-Ls
    Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
    Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
    其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
  6. 如权利要求1所述的医学图像的生成方法,其中,所述将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,包括:5. The medical image generation method according to claim 1, wherein said inputting said effective image set and said standard medical image into an image discrimination model which has a mutual constraint relationship with said image generation model for image discrimination, Obtain the discrimination result, adjust the parameters of the image discrimination model according to the discrimination result, until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, including:
    构建判别损失函数Y;Construct the discriminative loss function Y;
    将所述标准医学图像和所述有效图像集输入至所述图像判别模型,生成所述最终医学图像集;Inputting the standard medical image and the effective image set to the image discrimination model to generate the final medical image set;
    将所述最终医学图像集和所述有效图像集输入到所述判别损失函数Y进行损失计算,得到损失函数值q;Input the final medical image set and the effective image set to the discriminant loss function Y for loss calculation to obtain a loss function value q;
    当所述损失函数值q大于或等于预设的损失阈值n时,调整所述图像判别模型的参数,重新生所述最终医学图像;When the loss function value q is greater than or equal to the preset loss threshold n, adjust the parameters of the image discrimination model to regenerate the final medical image;
    当所述损失函数值q小于所述损失阈值n时,得到此时所述图像判别模型的参数。When the loss function value q is less than the loss threshold n, the parameters of the image discrimination model at this time are obtained.
  7. 如权利要求6所述的医学图像的生成方法,其中,所述判别损失函数Y包括:8. The method for generating medical images according to claim 6, wherein the discriminant loss function Y comprises:
    Y=Lc+LsY=Lc+Ls
    Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
    Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
    其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
  8. 一种医学图像的生成装置,其中,所述装置包括:A medical image generation device, wherein the device includes:
    图像预处理模块,用于获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像,对所述初始医学图像进行细胞增强处理,得到标准医学图像;The image preprocessing module is used to obtain an original medical image, perform conversion processing on the original medical image to obtain an initial medical image, and perform cell enhancement processing on the initial medical image to obtain a standard medical image;
    第一样本图像生成模块,用于获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;The first sample image generation module is used to obtain the distribution data of each pixel information in the standard medical image, and use an image generation model to generate multiple first sample images similar to the standard medical image according to the distribution data, Obtain the first sample image set;
    有效信息计算模块,用于对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information calculation module is used to calculate the effective information amount of the first sample image set to obtain the effective information amount of each first sample image in the first sample image set, according to the effective information amount The arrangement sequence selects K first sample images corresponding to the effective amount of information from the first sample image set to obtain an effective image set;
    图像判别模块,用于将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The image discrimination module is used to input the effective image set and the standard medical image into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, obtain the discrimination result, and adjust the image according to the discrimination result. The parameters of the image discrimination model, until the discrimination result meets the preset requirements, the parameters of the image discrimination model at this time are obtained, and the standard image generation model is obtained according to the parameters; the original medical image is input to the standard The image generation model generates a second sample image set, and generates a final medical image according to the second sample image.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with 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 the following steps:
    获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
    对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
    获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
    对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
    将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
    将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  10. 如权利要求9所述的电子设备,其中,所述对所述原始医学图像进行转换处理,得到初始医学图像,包括:9. The electronic device according to claim 9, wherein said performing conversion processing on said original medical image to obtain an initial medical image comprises:
    将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
    将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
    将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
    将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  11. 如权利要求9所述的电子设备,其中,所述对所述初始医学图像进行细胞增强处理,得到标准医学图像,包括:9. The electronic device according to claim 9, wherein said performing cell enhancement processing on said initial medical image to obtain a standard medical image comprises:
    利用如下计算公式计算所述初始医学图像与二阶高斯函数的卷积,得到所述初始医学图像的尺度空间导数I abcThe following calculation formula is used to calculate the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the initial medical image:
    Figure PCTCN2020098947-appb-100005
    Figure PCTCN2020098947-appb-100005
    Figure PCTCN2020098947-appb-100006
    Figure PCTCN2020098947-appb-100006
    其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
    Figure PCTCN2020098947-appb-100007
    为求偏倒数运算符号
    Figure PCTCN2020098947-appb-100008
    为求卷积运算符号;
    Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
    Figure PCTCN2020098947-appb-100007
    Symbol for reciprocal operation
    Figure PCTCN2020098947-appb-100008
    To find the convolution operation symbol;
    根据所述尺度空间导数I abc对所述初始医学图像进行细胞增强,得到所述标准医学图像。 Perform cell enhancement on the initial medical image according to the scale space derivative I abc to obtain the standard medical image.
  12. 如权利要求9所述的电子设备,其中,所述获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集,包括:The electronic device according to claim 9, wherein the acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first images similar to the standard medical image using an image generation model according to the distribution data Sample images to obtain the first sample image set, including:
    构建样本生成损失函数F;Construct sample generation loss function F;
    将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
    将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
    当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
    当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  13. 如权利要求12所述的电子设备,其中,所述样本生成损失函数F包括:The electronic device according to claim 12, wherein the sample generation loss function F comprises:
    F=Lc-LsF=Lc-Ls
    Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
    Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
    其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
  14. 如权利要求9所述的电子设备,其中,所述将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,包括:The electronic device according to claim 9, wherein said inputting said effective image set and said standard medical image into an image discrimination model which has a mutual constraint relationship with said image generation model for image discrimination, and obtaining a discrimination result , Adjusting the parameters of the image discrimination model according to the discrimination result, until the discrimination result meets the preset requirements, obtaining the parameters of the image discrimination model at this time, including:
    构建判别损失函数Y;Construct the discriminative loss function Y;
    将所述标准医学图像和所述有效图像集输入至所述图像判别模型,生成所述最终医学图像集;Inputting the standard medical image and the effective image set to the image discrimination model to generate the final medical image set;
    将所述最终医学图像集和所述有效图像集输入到所述判别损失函数Y进行损失计算,得到损失函数值q;Input the final medical image set and the effective image set to the discriminant loss function Y for loss calculation to obtain a loss function value q;
    当所述损失函数值q大于或等于预设的损失阈值n时,调整所述图像判别模型的参数,重新生所述最终医学图像;When the loss function value q is greater than or equal to the preset loss threshold n, adjust the parameters of the image discrimination model to regenerate the final medical image;
    当所述损失函数值q小于所述损失阈值n时,得到此时所述图像判别模型的参数。When the loss function value q is less than the loss threshold n, the parameters of the image discrimination model at this time are obtained.
  15. 如权利要求14所述的电子设备,其中,所述判别损失函数Y包括:The electronic device according to claim 14, wherein the discriminant loss function Y comprises:
    Y=Lc+LsY=Lc+Ls
    Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
    Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
    其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the following steps:
    获取原始医学图像,对所述原始医学图像进行转换处理,得到初始医学图像;Acquiring an original medical image, performing conversion processing on the original medical image, to obtain an initial medical image;
    对所述初始医学图像进行细胞增强处理,得到标准医学图像;Performing cell enhancement processing on the initial medical image to obtain a standard medical image;
    获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集;Acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of first sample images similar to the standard medical image by using an image generation model according to the distribution data to obtain a first sample image set;
    对所述第一样本图像集进行有效信息量计算,得到所述第一样本图像集中每个第一样本图像的有效信息量,依照所述有效信息量的排列顺序从所述第一样本图像集中选择K个有效信息量对应的第一样本图像,得到有效图像集;The effective information amount calculation is performed on the first sample image set to obtain the effective information amount of each first sample image in the first sample image set. Select K first sample images corresponding to the effective amount of information from the sample image set to obtain an effective image set;
    将所述有效图像集和所述标准医学图像输入至与所述图像生成模型有互相约束关系的图像判别模型中进行图像判别,得到判别结果,根据所述判别结果调整所述图像判别模型的参数,直到所述判别结果满足预设要求时,得到此时所述图像判别模型的参数,根据所述参数得到标准图像生成模型;The effective image set and the standard medical image are input into an image discrimination model that has a mutual constraint relationship with the image generation model for image discrimination, and the discrimination result is obtained, and the parameters of the image discrimination model are adjusted according to the discrimination result , Until the discrimination result meets the preset requirements, obtain the parameters of the image discrimination model at this time, and obtain the standard image generation model according to the parameters;
    将所述原始医学图像输入至所述标准图像生成模型,生成第二样本图像集,根据所述第二样本图像生成最终的医学图像。The original medical image is input to the standard image generation model, a second sample image set is generated, and a final medical image is generated according to the second sample image.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述对所述原始医学图像进行转换处理,得到初始医学图像,包括:15. The computer-readable storage medium according to claim 16, wherein said converting the original medical image to obtain the initial medical image comprises:
    将所述原始医学图像进行灰度值转换,得到原始灰度图;Converting the original medical image to a gray value to obtain an original gray image;
    将所述原始灰度图进行降噪处理,得到降噪灰度图;Performing noise reduction processing on the original gray image to obtain a noise reduction gray image;
    将所述降噪灰度图进行几何变换处理,得到变换灰度图;Performing geometric transformation processing on the noise reduction grayscale image to obtain a transformed grayscale image;
    将所述变换灰度图进行对比度增强,得到所述初始医学图像。The contrast enhancement of the transformed grayscale image is performed to obtain the initial medical image.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述对所述初始医学图像进 行细胞增强处理,得到标准医学图像,包括:16. The computer-readable storage medium of claim 16, wherein said performing cell enhancement processing on said initial medical image to obtain a standard medical image comprises:
    利用如下计算公式计算所述初始医学图像与二阶高斯函数的卷积,得到所述初始医学图像的尺度空间导数I abcThe following calculation formula is used to calculate the convolution of the initial medical image and the second-order Gaussian function to obtain the scale space derivative I abc of the initial medical image:
    Figure PCTCN2020098947-appb-100009
    Figure PCTCN2020098947-appb-100009
    Figure PCTCN2020098947-appb-100010
    Figure PCTCN2020098947-appb-100010
    其中,I为所述初始医学图像;G(x,y,z)为高斯函数;x,y,z为所述高斯函数的参数;σ为所述高斯函数的标准偏移量;
    Figure PCTCN2020098947-appb-100011
    为求偏倒数运算符号
    Figure PCTCN2020098947-appb-100012
    为求卷积运算符号;
    Where I is the initial medical image; G(x, y, z) is a Gaussian function; x, y, z are the parameters of the Gaussian function; σ is the standard offset of the Gaussian function;
    Figure PCTCN2020098947-appb-100011
    Symbol for reciprocal operation
    Figure PCTCN2020098947-appb-100012
    To find the convolution operation symbol;
    根据所述尺度空间导数I abc对所述初始医学图像进行细胞增强,得到所述标准医学图像。 Perform cell enhancement on the initial medical image according to the scale space derivative I abc to obtain the standard medical image.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述获取所述标准医学图像中各像素信息的分布数据,根据所述分布数据利用图像生成模型生成多张与所述标准医学图相似的第一样本图像,得到第一样本图像集,包括:The computer-readable storage medium according to claim 16, wherein the acquiring distribution data of each pixel information in the standard medical image, and generating a plurality of images similar to the standard medical image using an image generation model according to the distribution data The first sample image of, the first sample image set is obtained, including:
    构建样本生成损失函数F;Construct sample generation loss function F;
    将所述标准医学图像中各像素信息的分布数据输入至所述图像生成模型,生成初始第一样本图像集;Inputting the distribution data of each pixel information in the standard medical image to the image generation model to generate an initial first sample image set;
    将所述初始第一样本图像集和所述标准医学图像输入到所述样本生成损失函数F进行损失计算,得到损失函数值p;Inputting the initial first sample image set and the standard medical image to the sample generating loss function F for loss calculation, to obtain a loss function value p;
    当所述损失函数值p大于或等于预设的损失阈值m时,则调整所述图像生成模型的参数,并重新生成第一样本图像;When the loss function value p is greater than or equal to the preset loss threshold m, adjust the parameters of the image generation model, and regenerate the first sample image;
    当所述损失函数值p小于所述损失阈值m时,则得到所述第一样本图像集。When the loss function value p is less than the loss threshold m, the first sample image set is obtained.
  20. 如权利要求19所述的计算机可读存储介质,其中,所述样本生成损失函数F包括:The computer-readable storage medium of claim 19, wherein the sample generation loss function F comprises:
    F=Lc-LsF=Lc-Ls
    Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
    Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)]
    其中,E[]为求期望值运算;Lc为所述第一样本图像与所述标准医学图像的相似度的期望值;Ls为所述标准医学图像中的有效信息量的期望值;Xreal为所述标准医学图像;Xfake为所述第一样本图像;C为所述第一样本图像中的有效信息量;S为所述标准医学图像中的有效信息量。Wherein, E[] is the expected value operation; Lc is the expected value of the similarity between the first sample image and the standard medical image; Ls is the expected value of the effective information in the standard medical image; Xreal is the expected value Standard medical image; Xfake is the first sample image; C is the effective amount of information in the first sample image; S is the effective amount of information in the standard medical image.
PCT/CN2020/098947 2020-03-17 2020-06-29 Medical image generation method and apparatus, electronic device and medium WO2021184576A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010186679.3A CN111476760B (en) 2020-03-17 2020-03-17 Medical image generation method and device, electronic equipment and medium
CN202010186679.3 2020-03-17

Publications (1)

Publication Number Publication Date
WO2021184576A1 true WO2021184576A1 (en) 2021-09-23

Family

ID=71748220

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098947 WO2021184576A1 (en) 2020-03-17 2020-06-29 Medical image generation method and apparatus, electronic device and medium

Country Status (2)

Country Link
CN (1) CN111476760B (en)
WO (1) WO2021184576A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114463602A (en) * 2022-04-12 2022-05-10 北京云恒科技研究院有限公司 Target identification data processing method based on big data

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112233194B (en) * 2020-10-15 2023-06-02 平安科技(深圳)有限公司 Medical picture optimization method, device, equipment and computer readable storage medium
CN114820357B (en) * 2022-04-11 2023-05-05 深圳明锐理想科技有限公司 X-ray image processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9036044B1 (en) * 2013-07-22 2015-05-19 Google Inc. Adjusting camera parameters associated with a plurality of images
CN106295682A (en) * 2016-08-02 2017-01-04 厦门美图之家科技有限公司 A kind of judge the method for the picture quality factor, device and calculating equipment
CN110070540A (en) * 2019-04-28 2019-07-30 腾讯科技(深圳)有限公司 Image generating method, device, computer equipment and storage medium
CN110147699A (en) * 2018-04-12 2019-08-20 北京大学 A kind of image-recognizing method, device and relevant device
US20190392547A1 (en) * 2018-06-26 2019-12-26 International Business Machines Corporation Determining Appropriate Medical Image Processing Pipeline Based on Machine Learning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948707B (en) * 2019-03-20 2023-04-18 腾讯科技(深圳)有限公司 Model training method, device, terminal and storage medium
CN110853047B (en) * 2019-10-12 2023-09-15 平安科技(深圳)有限公司 Intelligent image segmentation and classification method, device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9036044B1 (en) * 2013-07-22 2015-05-19 Google Inc. Adjusting camera parameters associated with a plurality of images
CN106295682A (en) * 2016-08-02 2017-01-04 厦门美图之家科技有限公司 A kind of judge the method for the picture quality factor, device and calculating equipment
CN110147699A (en) * 2018-04-12 2019-08-20 北京大学 A kind of image-recognizing method, device and relevant device
US20190392547A1 (en) * 2018-06-26 2019-12-26 International Business Machines Corporation Determining Appropriate Medical Image Processing Pipeline Based on Machine Learning
CN110070540A (en) * 2019-04-28 2019-07-30 腾讯科技(深圳)有限公司 Image generating method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114463602A (en) * 2022-04-12 2022-05-10 北京云恒科技研究院有限公司 Target identification data processing method based on big data

Also Published As

Publication number Publication date
CN111476760B (en) 2024-05-10
CN111476760A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
WO2021184576A1 (en) Medical image generation method and apparatus, electronic device and medium
WO2021189912A1 (en) Method and apparatus for detecting target object in image, and electronic device and storage medium
WO2022121156A1 (en) Method and apparatus for detecting target object in image, electronic device and readable storage medium
JP7412334B2 (en) Automatic classification and classification method for 3D tooth data using deep learning methods
WO2021217851A1 (en) Abnormal cell automatic labeling method and apparatus, electronic device, and storage medium
WO2021189913A1 (en) Method and apparatus for target object segmentation in image, and electronic device and storage medium
CN111047609B (en) Pneumonia focus segmentation method and device
WO2021151338A1 (en) Medical imagery analysis method, apparatus, electronic device and readable storage medium
WO2022213465A1 (en) Neural network-based image recognition method and apparatus, electronic device, and medium
WO2021189909A1 (en) Lesion detection and analysis method and apparatus, and electronic device and computer storage medium
WO2021189901A1 (en) Image segmentation method and apparatus, and electronic device and computer-readable storage medium
WO2020253508A1 (en) Abnormal cell detection method and apparatus, and computer readable storage medium
WO2021189910A1 (en) Image recognition method and apparatus, and electronic device and computer-readable storage medium
WO2021189848A1 (en) Model training method and apparatus, cup-to-disc ratio determination method and apparatus, and device and storage medium
WO2021114817A1 (en) Oct image lesion detection method and apparatus based on neural network, and medium
WO2021151275A1 (en) Image segmentation method and apparatus, device, and storage medium
WO2021151278A1 (en) Method and apparatus for vehicle damage assessment based on artificial intelligence, electronic device, and medium
WO2021189911A1 (en) Target object position detection method and apparatus based on video stream, and device and medium
WO2021189856A1 (en) Certificate check method and apparatus, and electronic device and medium
WO2021151307A1 (en) Integrated method, apparatus, device, and medium based on pathological section scanning and analysis
CN112233194B (en) Medical picture optimization method, device, equipment and computer readable storage medium
CN113705686B (en) Image classification method, device, electronic equipment and readable storage medium
CN115761226A (en) Oral cavity image segmentation identification method and device, electronic equipment and storage medium
WO2022227191A1 (en) Inactive living body detection method and apparatus, electronic device, and storage medium
CN117392693B (en) Method and equipment for removing handwriting of pathological image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20926165

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20926165

Country of ref document: EP

Kind code of ref document: A1