Acne exacerbation image generation method and system, electronic equipment and medium
By generating acne aggravation images using variational autoencoders and Fourier transforms, the problems of low efficiency and insufficient accuracy in acne prediction are solved, improving the generation efficiency and accuracy of acne aggravation images and promoting timely treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUNNAN YUNKE CHARACTERISTIC PLANT EXTRACTION LABORATORY CO LTD
- Filing Date
- 2023-10-24
- Publication Date
- 2026-04-28
AI Technical Summary
Current acne prediction techniques are inefficient and inaccurate, requiring patients to visit hospitals for examinations, which can lead to missed opportunities for optimal treatment. Furthermore, acne treatment can easily leave behind difficult-to-repair acne pits and keloids.
A variational autoencoder is used to encode features in facial images, and Fourier transform and inverse transform are combined to generate acne-intensified images. A diffusion model is then used for denoising to automatically generate acne-intensified images, thereby improving generation efficiency and accuracy.
It achieves high efficiency and high accuracy in automatically generating images of worsening acne, helping patients to intuitively perceive the extent of acne deterioration and prompting timely treatment.
Smart Images

Figure CN121937548A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and in particular to a method, system, electronic device, and medium for generating images of aggravated acne. Background Technology
[0002] Acne is a chronic inflammatory disease of the pilosebaceous unit that primarily occurs during adolescence. While it can affect people of all ages, its incidence is highest during adolescence, hence the common name "pimples." Almost everyone will experience acne at least once in their lifetime, but most people don't consider it a disease, thus neglecting intervention and treatment, missing the optimal treatment window, and potentially developing into more severe forms like acne conglobata. Even after healing, it can leave behind difficult-to-repair acne scars, keloids, and other pitted scars. Currently, acne treatment typically involves a doctor examining the acne on-site and manually predicting its development. This prediction is inaccurate and requires patients to visit the hospital for examination, making it extremely inefficient. Summary of the Invention
[0003] The purpose of this invention is to provide a method, system, electronic device, and medium for generating images of aggravated acne, which can improve the efficiency and accuracy of generating such images.
[0004] To achieve the above objectives, the present invention provides the following solution:
[0005] A method for generating images that aggravate acne includes:
[0006] Obtain the facial image to be predicted;
[0007] The facial image to be predicted is encoded using a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted.
[0008] Perform a Fourier transform on the spatial domain feature map to be predicted to obtain the frequency domain feature map to be predicted.
[0009] Obtain the frequency domain distribution characteristics of different acne severity levels;
[0010] Based on the frequency domain distribution characteristics of different acne severity levels, the frequency domain distribution of the frequency domain feature map to be predicted is adjusted to obtain a target frequency domain distribution map; the acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted.
[0011] An inverse Fourier transform is performed on the target frequency domain distribution map to obtain an image of acne aggravation.
[0012] Optionally, the method for generating acne aggravation images further includes: using a pre-trained diffusion model to denoise the acne aggravation images.
[0013] To achieve the above objectives, the present invention also provides the following solution:
[0014] An acne aggravation image generation system, comprising:
[0015] The image acquisition module is used to acquire the facial image to be predicted;
[0016] The encoding module is connected to the image acquisition module and is used to encode the features of the face image to be predicted based on a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted.
[0017] The Fourier transform module, connected to the encoding module, is used to perform a Fourier transform on the spatial domain feature map to be predicted, to obtain the frequency domain feature map to be predicted.
[0018] The frequency domain feature acquisition module is used to acquire the frequency domain distribution features of different acne severity levels;
[0019] The frequency domain adjustment module is connected to both the Fourier transform module and the frequency domain feature acquisition module. It is used to adjust the frequency domain distribution of the frequency domain feature map to be predicted based on the frequency domain distribution characteristics of different acne severity levels, thereby obtaining a target frequency domain distribution map. The acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted.
[0020] The inverse Fourier transform module, connected to the frequency domain adjustment module, is used to perform an inverse Fourier transform on the target frequency domain distribution map to obtain an image of aggravated acne.
[0021] Optionally, the acne aggravation image generation system further includes a denoising module connected to the inverse Fourier transform module, used to denoise the acne aggravation image using a pre-trained diffusion model.
[0022] To achieve the above objectives, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to cause the electronic device to perform the above-described method for generating images to aggravate acne.
[0023] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for generating images to aggravate acne.
[0024] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The present invention encodes features of the facial image to be predicted based on a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted. Then, a Fourier transform is performed on the spatial domain feature map to be predicted to obtain a frequency domain feature map to be predicted. Based on the frequency domain distribution characteristics of different acne severity levels, the frequency domain distribution of the frequency domain feature map to be predicted is adjusted to obtain a target frequency domain distribution map. An inverse Fourier transform is performed on the target frequency domain distribution map to obtain an acne aggravation image. Acne aggravation images can be automatically generated simply by acquiring facial images, improving the generation efficiency of acne aggravation images. The use of variational autoencoders, Fourier transforms, and inverse Fourier transforms improves the accuracy of acne aggravation images. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart of the acne aggravation image generation method provided by the present invention;
[0027] Figure 2 This is a schematic diagram of the acne aggravation image generation system provided by the present invention.
[0028] Symbol explanation: 1-Image acquisition module, 2-Encoding module, 3-Fourier transform module, 4-Frequency domain feature acquisition module, 5-Frequency domain adjustment module, 6-Inverse Fourier transform module, 7-Denoising module. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] The purpose of this invention is to provide a method, system, electronic device, and medium for generating images of worsened acne. Based on the patient's current facial condition, the invention automatically generates images of the patient's face after the acne has worsened, using a variational autoencoder (VAE), Fourier transform, and diffusion model.
[0031] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Example 1
[0033] like Figure 1 As shown, this embodiment provides a method for generating images of aggravated acne, including:
[0034] Step 100: Obtain the facial image to be predicted.
[0035] Specifically, first, an initial facial image is acquired. Then, the face position in the initial facial image is detected. Next, based on the face position, the face region in the initial facial image is cropped to obtain the facial image to be predicted.
[0036] The initial facial image contains frontal faces. The face detection interface of Google's open-source MediaPipe is used to detect the location of faces in the initial facial image.
[0037] Step 200: Encode the features of the face image to be predicted based on the pre-trained variational autoencoder to obtain the spatial domain feature map to be predicted. The variational autoencoder is pre-trained using a set of face image samples. The encoder of the VAE can output vector representations of the features of each dimension of the input image.
[0038] Step 300: Perform a Fourier transform on the spatial domain feature map to be predicted to obtain the frequency domain feature map to be predicted.
[0039] Specifically, Fourier transform is used to compress the spatial domain feature map to be predicted into a one-dimensional frequency domain, which better captures the nonlinear features of the patient's facial information.
[0040] Step 400: Obtain the frequency domain distribution characteristics of different acne severity levels.
[0041] Specifically, step 400 includes:
[0042] (1) Obtain multiple acne images. The severity of acne varies in each acne image.
[0043] (2) A pre-trained variational autoencoder is used to encode the features of each acne image to obtain multiple corresponding acne spatial domain feature maps.
[0044] (3) Perform Fourier transform on each acne spatial domain feature map to obtain multiple corresponding acne frequency domain feature maps. The acne frequency domain feature maps include the frequency domain distribution features corresponding to the severity of acne.
[0045] This invention obtains the frequency domain distribution characteristics of different acne severity levels by comparing the differences in frequency domain distribution between images containing acne and images without acne.
[0046] Step 500: Based on the frequency domain distribution characteristics of different acne severity levels, adjust the frequency domain distribution of the frequency domain feature map to be predicted to obtain a target frequency domain distribution map. The acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted.
[0047] Specifically, firstly, the frequency domain distribution of the frequency domain feature map to be predicted is compared with the frequency domain distribution characteristics of different acne severity levels to determine the frequency domain distribution of acne more severe than that in the frequency domain feature map to be predicted. Then, based on the frequency domain distribution of this severity level, the distribution of a specific frequency domain range in the frequency domain feature map to be predicted is adjusted so that the frequency domain distribution of the frequency domain feature map to be predicted is close to the frequency domain distribution of more severe acne.
[0048] Step 600: Perform an inverse Fourier transform on the target frequency domain distribution map to obtain an image showing aggravated acne.
[0049] After converting the target frequency domain distribution map to the spatial domain using inverse Fourier transform, the converted spatial domain image contains some noise and lacks image details. To make the texture details of the acne aggravation image more natural and realistic, the acne aggravation image generation method further includes:
[0050] Step 700: Denoise the acne aggravation image using a pre-trained diffusion model.
[0051] The diffusion model is pre-trained using a set of face image samples. This set includes multiple face images. During training, noise is randomly added to the face images, and local regions of the face images are randomly occluded (setting the pixel values of these local regions to 0) and used as input to the diffusion model. The model is then trained iteratively. The goal of training is to make the image output by the diffusion model closely resemble the face image without added noise, ensuring that the output image retains the content of the input image while exhibiting more natural and realistic texture details.
[0052] As a specific implementation method, an initial facial image can be captured by a mobile phone, and the algorithms of steps 100 to 700 can be packaged into a mobile application to process the initial facial image, generate a denoised acne aggravation image, and display it on the mobile phone.
[0053] Alternatively, an initial facial image can be captured by a camera, and the algorithms from steps 100 to 700 can be embedded into the computer's processor. The initial facial image is then processed by the processor to generate a denoised image of aggravated acne, which is then displayed on the screen.
[0054] This invention automatically generates images of worsened acne simply by acquiring facial images, enabling acne prediction and improving the efficiency of acne worsening image generation. Furthermore, based on the patient's current facial image, this invention uses VAE, Fourier transform, and a diffusion model to generate and display images of worsened facial acne, thus improving the accuracy of these images.
[0055] Example 2
[0056] In order to implement the method corresponding to Embodiment 1 above and achieve the corresponding functions and technical effects, an acne aggravation image generation system is provided below.
[0057] like Figure 2 As shown, the acne aggravation image generation system provided in this embodiment includes: an image acquisition module 1, an encoding module 2, a Fourier transform module 3, a frequency domain feature acquisition module 4, a frequency domain adjustment module 5, and an inverse Fourier transform module 6.
[0058] The image acquisition module 1 is used to acquire the facial image to be predicted.
[0059] The encoding module 2 is connected to the image acquisition module 1. The encoding module 2 is used to encode the features of the face image to be predicted based on a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted.
[0060] The Fourier transform module 3 is connected to the encoding module 2. The Fourier transform module 3 is used to perform Fourier transform on the spatial domain feature map to be predicted to obtain the frequency domain feature map to be predicted.
[0061] The frequency domain feature acquisition module 4 is used to acquire the frequency domain distribution features of different acne severity levels.
[0062] The frequency domain adjustment module 5 is connected to both the Fourier transform module 3 and the frequency domain feature acquisition module 4. The frequency domain adjustment module 5 adjusts the frequency domain distribution of the frequency domain feature map to be predicted based on the frequency domain distribution characteristics of different acne severity levels, thereby obtaining a target frequency domain distribution map. The acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted.
[0063] The inverse Fourier transform module 6 is connected to the frequency domain adjustment module 5. The inverse Fourier transform module 6 is used to perform an inverse Fourier transform on the target frequency domain distribution map to obtain an image of aggravated acne.
[0064] Furthermore, the acne aggravation image generation system also includes a denoising module 7. The denoising module 7 is connected to the inverse Fourier transform module 6, and the denoising module 7 is used to perform denoising processing on the acne aggravation image using a pre-trained diffusion model.
[0065] Example 3
[0066] This embodiment provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the acne aggravation image generation method of Embodiment 1.
[0067] Alternatively, the aforementioned electronic device may be a server.
[0068] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the acne aggravation image generation method of Embodiment 1.
[0069] This invention uses images of worsening acne to allow patients to visually experience how their acne will worsen if left untreated, thus serving as a warning and prompting them to seek treatment promptly.
[0070] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0071] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for generating images that aggravate acne, characterized in that, The method for generating images that aggravate acne includes: Obtain the facial image to be predicted; The facial image to be predicted is encoded using a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted. Perform a Fourier transform on the spatial domain feature map to be predicted to obtain the frequency domain feature map to be predicted. Obtain the frequency domain distribution characteristics of different acne severity levels; Based on the frequency domain distribution characteristics of different acne severity levels, the frequency domain distribution of the frequency domain feature map to be predicted is adjusted to obtain a target frequency domain distribution map; the acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted. An inverse Fourier transform is performed on the target frequency domain distribution map to obtain an image of acne aggravation.
2. The method for generating acne aggravation images according to claim 1, characterized in that, The method for generating images that aggravate acne also includes: The acne aggravation image was denoised using a pre-trained diffusion model.
3. The method for generating acne aggravation images according to claim 1, characterized in that, Obtain the facial image to be predicted, specifically including: Acquire initial facial images; Detect the face position in the initial facial image; The face region in the initial facial image is cropped based on the face location to obtain the facial image to be predicted.
4. The method for generating acne aggravation images according to claim 1, characterized in that, Obtain the frequency domain distribution characteristics of different acne severity levels, specifically including: Acquire multiple acne images; the severity of acne varies in each image; A pre-trained variational autoencoder is used to encode the features of each acne image to obtain multiple corresponding acne spatial domain feature maps. Perform Fourier transform on each acne spatial domain feature map to obtain multiple corresponding acne frequency domain feature maps; the acne frequency domain feature maps include the frequency domain distribution features corresponding to the severity of acne.
5. A system for generating images that aggravate acne, characterized in that, The acne aggravation image generation system includes: The image acquisition module is used to acquire the facial image to be predicted; The encoding module is connected to the image acquisition module and is used to encode the features of the face image to be predicted based on a pre-trained variational autoencoder to obtain a spatial domain feature map to be predicted. The Fourier transform module, connected to the encoding module, is used to perform a Fourier transform on the spatial domain feature map to be predicted, to obtain the frequency domain feature map to be predicted. The frequency domain feature acquisition module is used to acquire the frequency domain distribution features of different acne severity levels; The frequency domain adjustment module is connected to both the Fourier transform module and the frequency domain feature acquisition module. It is used to adjust the frequency domain distribution of the frequency domain feature map to be predicted based on the frequency domain distribution characteristics of different acne severity levels, thereby obtaining a target frequency domain distribution map. The acne severity in the target frequency domain distribution map is greater than the acne severity in the frequency domain feature map to be predicted. The inverse Fourier transform module, connected to the frequency domain adjustment module, is used to perform an inverse Fourier transform on the target frequency domain distribution map to obtain an image of aggravated acne.
6. The acne aggravation image generation system according to claim 5, characterized in that, The acne aggravation image generation system also includes: The denoising module, connected to the inverse Fourier transform module, is used to denoise the acne aggravation image using a pre-trained diffusion model.
7. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the acne aggravation image generation method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the acne aggravation image generation method as described in any one of claims 1 to 5.