CN-113570510-B - Image processing method, device, equipment and storage medium
Abstract
The application discloses an image processing method, an image processing device, image processing equipment and a storage medium, belongs to the technical field of artificial intelligence, and particularly relates to cloud computing, big data or a database and the like in the technical field of cloud. According to the embodiment of the application, the first sample image with high resolution can be subjected to degradation treatment by randomly selecting a treatment mode, so that the second sample image with low resolution can be obtained without manual treatment, the labor cost can be greatly reduced, and the obtaining efficiency of low resolution can be improved. In the training process, one processing mode can be selected for degradation processing each time, so that the target image processing model obtained through training can perform good image processing on images processed by the plurality of processing modes, and can adapt to more image processing scenes, and therefore, the target image processing model is good in applicability.
Inventors
- Zhu Feida
- WANG CHENGJIE
- TAI YING
- LI JILIN
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20210119
Claims (20)
- 1. An image processing method, the method comprising: Acquiring a first sample image; Randomly selecting one processing mode from at least two processing modes, and processing the first sample image to obtain a second sample image, wherein the resolution of the second sample image is smaller than that of the first sample image; Inputting the second sample image into an image processing model, performing super-resolution image processing on the second sample image by at least two residual error dense modules in the image processing model to obtain at least two residual error images, and acquiring and outputting a third sample image based on the at least two residual error images and the second sample image, wherein the at least two residual error images are obtained by performing super-resolution image processing based on residual error dense modules with different numbers, and the resolution of the third sample image is larger than that of the second sample image; Acquiring a target loss value based on the first sample image and the third sample image; updating model parameters of the image processing model based on the target loss value; And continuing to execute the steps of processing the first sample image by randomly selecting one processing mode, performing super-resolution image processing based on the image processing model and acquiring a target loss value until the target loss value meets the target condition, and stopping to obtain the target image processing model.
- 2. The method of claim 1, wherein the at least two processing modes include at least two of image blurring, adding image noise, image filtering, image compression; Randomly selecting one processing mode from at least two processing modes, and processing the first sample image to obtain a second sample image, wherein the second sample image comprises any one of the following steps: Performing blurring processing on the first sample image to obtain a second sample image; adding image noise into the first sample image to obtain a second sample image; Performing image filtering on the first sample image to obtain a second sample image; And carrying out image compression on the first sample image to obtain a second sample image.
- 3. The method of claim 1, wherein the selecting one of the at least two processing modes at random to process the first sample image comprises: and randomly selecting one degradation model from at least two degradation models, and processing the first sample image based on the degradation model and degradation parameters corresponding to the degradation model.
- 4. A method according to claim 3, wherein said processing said first sample image based on said degradation model and degradation parameters corresponding to said degradation model comprises: Randomly selecting one degradation parameter from at least two degradation parameters corresponding to the degradation model; the first sample image is processed based on the degradation model and the randomly selected degradation parameters.
- 5. The method according to claim 1, wherein the model parameters comprise weights for each of at least two residual images; the acquiring and outputting a third sample image based on the at least two residual images and the second sample image includes: respectively fusing the at least two residual images with the second sample image to obtain at least two candidate third sample images; And weighting the at least two candidate third sample images based on the respective weights of the at least two residual images to obtain the third sample images, and outputting the third sample images.
- 6. The method of claim 1, wherein the residual dense module comprises at least two convolutional layers in series with dense links.
- 7. The method of claim 1, wherein the obtaining a target loss value based on the first sample image and the third sample image comprises: acquiring a first loss value based on the first sample image and the third sample image; Performing image recognition on the first sample image and the third sample image to obtain a first recognition result of the first sample image and a second recognition result of the second sample image, wherein the first recognition result and the second recognition result are used for indicating whether the image is a generated image or not; acquiring a second loss value based on the first identification result and the second identification result; and acquiring a target loss value based on the first loss value and the second loss value.
- 8. The method of claim 1, wherein the first, second, and third sample images are face images; The acquiring a first sample image includes: Obtaining a sampling face image; carrying out face detection and face registration processing on the sample face image; Based on a processing result, cutting a region where a face is located in the sample face image to obtain a first sample image, wherein the first sample image comprises the region where the face is located.
- 9. The method according to claim 1, wherein the method further comprises: Acquiring a first image; and performing super-resolution image processing on the first image based on the image processing model to obtain a second image, wherein the resolution of the second image is larger than that of the first image.
- 10. The method of claim 9, wherein the acquiring the first image comprises: Acquiring a video; Carrying out face detection and face registration processing on a face image in the video, wherein the face image is an image frame in the video; based on a processing result, cutting a region where a face is located in the face image to obtain a first image, wherein the first image comprises the region where the face is located.
- 11. The method according to claim 9 or 10, characterized in that the method further comprises: And fusing the face image and the second image to obtain a third image, wherein the area of the face in the third image is the second image.
- 12. An image processing apparatus, characterized in that the apparatus comprises: The acquisition module is used for acquiring a first sample image; the degradation processing module is used for randomly selecting one processing mode from at least two processing modes and processing the first sample image to obtain a second sample image, wherein the resolution of the second sample image is smaller than that of the first sample image; the super-processing module is used for inputting the second sample image into an image processing model, performing super-resolution image processing on the second sample image by at least two residual error density modules in the image processing model to obtain at least two residual error images, and acquiring and outputting a third sample image based on the at least two residual error images and the second sample image, wherein the at least two residual error images are obtained by performing super-resolution image processing based on residual error density modules with different numbers, and the resolution of the third sample image is larger than that of the second sample image; a loss value acquisition module for acquiring a target loss value based on the first sample image and the third sample image; The updating module is used for updating the model parameters of the image processing model based on the target loss value; The device continues to execute the steps of processing the first sample image by randomly selecting one processing mode, performing super-resolution image processing based on the image processing model and acquiring a target loss value until the target loss value meets the target condition, and stopping to obtain the target image processing model.
- 13. The apparatus of claim 12, wherein the at least two processing means comprise at least two of image blurring, adding image noise, image filtering, image compression; The degradation processing module is used for any one of the following: Performing blurring processing on the first sample image to obtain a second sample image; adding image noise into the first sample image to obtain a second sample image; Performing image filtering on the first sample image to obtain a second sample image; And carrying out image compression on the first sample image to obtain a second sample image.
- 14. The apparatus of claim 12, wherein the degradation processing module is configured to: and randomly selecting one degradation model from at least two degradation models, and processing the first sample image based on the degradation model and degradation parameters corresponding to the degradation model.
- 15. The apparatus of claim 14, wherein the degradation processing module is configured to: Randomly selecting one degradation parameter from at least two degradation parameters corresponding to the degradation model; the first sample image is processed based on the degradation model and the randomly selected degradation parameters.
- 16. The apparatus of claim 12, wherein the model parameters comprise weights for each of at least two residual images; the super processing module is used for: respectively fusing the at least two residual images with the second sample image to obtain at least two candidate third sample images; And weighting the at least two candidate third sample images based on the respective weights of the at least two residual images to obtain the third sample images, and outputting the third sample images.
- 17. The apparatus of claim 12, wherein the residual dense module comprises at least two convolutional layers in series with dense links.
- 18. The apparatus of claim 12, wherein the loss value acquisition module is configured to: acquiring a first loss value based on the first sample image and the third sample image; Performing image recognition on the first sample image and the third sample image to obtain a first recognition result of the first sample image and a second recognition result of the second sample image, wherein the first recognition result and the second recognition result are used for indicating whether the image is a generated image or not; acquiring a second loss value based on the first identification result and the second identification result; and acquiring a target loss value based on the first loss value and the second loss value.
- 19. The apparatus of claim 12, wherein the first, second, and third sample images are face images; the acquisition module is used for: Obtaining a sampling face image; carrying out face detection and face registration processing on the sample face image; Based on a processing result, cutting a region where a face is located in the sample face image to obtain a first sample image, wherein the first sample image comprises the region where the face is located.
- 20. The apparatus of claim 12, wherein the device comprises a plurality of sensors, The acquisition module is also used for acquiring a first image; The super-processing module is further used for performing super-resolution image processing on the first image based on the image processing model to obtain a second image, and the resolution of the second image is larger than that of the first image.
Description
Image processing method, device, equipment and storage medium Technical Field The present application relates to the field of artificial intelligence, and in particular, to an image processing method, apparatus, device, and storage medium. Background With the development of artificial intelligence technology, in many scenes, it is required to obtain a high-resolution image by processing a low-resolution image. Through artificial intelligence technology, can train the image processing model through sample image, obtain the target image processing model. At present, the image processing method generally acquires high-resolution and low-resolution sample images, trains an image processing model, and therefore a large number of sample images are needed, the sample images are needed to be processed by technicians through an image processing application, and the acquisition process of the sample images needs to consume a large amount of manpower, so that the labor cost is high, the acquisition efficiency is low, and therefore, the efficiency of the image processing method is low. Disclosure of Invention The embodiment of the application provides an image processing method, an image processing device, image processing equipment and a storage medium, which can improve the image processing efficiency and the applicability of a target image processing model. The technical scheme is as follows: in one aspect, there is provided an image processing method, the method including: Acquiring a first sample image; Randomly selecting one processing mode from at least two processing modes, and processing the first sample image to obtain a second sample image, wherein the resolution of the second sample image is smaller than that of the first sample image; performing super-resolution image processing on the second sample image based on an image processing model to obtain a third sample image, wherein the resolution of the third sample image is larger than that of the second sample image; Acquiring a target loss value based on the first sample image and the third sample image; updating model parameters of the image processing model based on the target loss value; And continuing to execute the steps of processing the first sample image by randomly selecting one processing mode, performing super-resolution image processing based on the image processing model and acquiring a target loss value until the target loss value meets the target condition, and stopping to obtain the target image processing model. In one aspect, there is provided an image processing apparatus including: The acquisition module is used for acquiring a first sample image; the degradation processing module is used for randomly selecting one processing mode from at least two processing modes and processing the first sample image to obtain a second sample image, wherein the resolution of the second sample image is smaller than that of the first sample image; The super-processing module is used for performing super-resolution image processing on the second sample image based on an image processing model to obtain a third sample image, wherein the resolution of the third sample image is larger than that of the second sample image; a loss value acquisition module for acquiring a target loss value based on the first sample image and the third sample image; The updating module is used for updating the model parameters of the image processing model based on the target loss value; The device continues to execute the steps of processing the first sample image by randomly selecting one processing mode, performing super-resolution image processing based on the image processing model and acquiring a target loss value until the target loss value meets the target condition, and stopping to obtain the target image processing model. In some embodiments, the at least two processing modes include at least two of image blurring, adding image noise, image filtering, image compression; the degradation processing module is used for any one of the following: Performing blurring processing on the first sample image to obtain a second sample image; adding image noise into the first sample image to obtain a second sample image; Performing image filtering on the first sample image to obtain a second sample image; And carrying out image compression on the first sample image to obtain a second sample image. In some embodiments, the degradation processing module is configured to randomly select one degradation model from at least two degradation models, and process the first sample image based on the degradation model and degradation parameters corresponding to the degradation model. In some embodiments, the degradation processing module is to: Randomly selecting one degradation parameter from at least two degradation parameters corresponding to the degradation model; the first sample image is processed based on the degradation model and the randomly selected degradation parameters. In some e