Image beautification method, device, electronic device and storage medium

Through the combination of encoder network and feature extraction network, combined with multi-scale lighting map and loss function training, the problem of poor image beautification effect in the existing technology is solved, and the all-round beautification and efficiency improvement of images is achieved. It is suitable for the OTA industry image beautification needs.

CN112435197BActive Publication Date: 2025-01-10CTRIP COMP TECH SHANGHAI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011394095.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-02
Publication Date
2025-01-10
Estimated Expiration
2040-12-02

AI Technical Summary

Technical Problem

The existing image beautification technology only focuses on improving the brightness of the picture, resulting in overexposure of the visual effect, color distortion, and contrast reduction, which cannot achieve all-round beautification of the picture, and rely on manual photo editing to be inefficient and costly.

Method used

Feature extraction is performed using an encoder network, combining the global feature extraction network and the local feature extraction network to form a multi-scale lighting map, and the beautified target image is generated through upsampling and fusion processing, and the color loss function, smoothing loss function and reconstruction loss function are used. Carry out training to achieve a comprehensive improvement in image brightness, color and contrast.

Benefits of technology

It realizes all-round beautification of images, improves image beautification efficiency, reduces labor costs, improves image production speed, avoids yellow and green overexposure, and meets the image beautification needs of the OTA industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112435197B_ABST
    Figure CN112435197B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and provides an image beautification method, device, electronic device and storage medium. The image beautification method comprises: extracting features of an initial image to be beautified through an encoder network to obtain a feature map; extracting features of the feature map through a global feature extraction network and a local feature extraction network respectively to obtain a global feature map and a local feature map; fusing the global feature map and the local feature map to form a first illumination map of a first resolution, wherein the first resolution is lower than the resolution of the initial image; upsampling the first illumination map and the initial image to form a second illumination map of a second resolution, wherein the second resolution is equal to the resolution of the initial image; and obtaining a beautified target image according to the second illumination map and the initial image. The present invention can achieve comprehensive improvement in image brightness, color, contrast and other aspects, improve image beautification efficiency, reduce labor costs, and increase image production speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image beautification method, device, electronic equipment and storage medium. Background Art

[0002] In the OTA (Online Travel Agent) industry, most information is displayed through pictures. High-quality pictures can well show the characteristics of the product, increase user click-through rate, and enhance user experience.

[0003] Pictures for display need to be beautified. However, existing image beautification technologies only focus on improving the brightness of pictures, which leads to problems such as overexposure, color distortion, and reduced contrast, which seriously affect the beauty of the pictures. To achieve multi-faceted beautification of picture brightness, color, contrast, etc., currently only manual image editing can be used, which is inefficient and has high labor costs.

[0004] Therefore, how to efficiently and comprehensively improve the aesthetics of pictures has become a huge challenge facing the OTA industry.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] In view of this, the present invention provides an image beautification method, device, electronic device and storage medium, which can achieve comprehensive improvement in image brightness, color, contrast, etc., improve image beautification efficiency, reduce labor costs, and increase image production speed.

[0007] One aspect of the present invention provides an image beautification method, comprising: performing feature extraction on an initial image to be beautified through an encoder network to obtain a feature map; performing feature extraction on the feature map through a global feature extraction network and a local feature extraction network respectively to obtain a global feature map and a local feature map; fusing the global feature map and the local feature map to form a first illumination map of a first resolution, the first resolution being lower than the resolution of the initial image; upsampling the first illumination map and the initial image to form a second illumination map of a second resolution, the second resolution being equal to the resolution of the initial image; and obtaining a beautified target image based on the second illumination map and the initial image.

[0008] In some embodiments, the encoder network includes connected two-dimensional convolutional layers and activation function layers; the activation function layers include sequentially connected two-dimensional convolutional layers, linear rectification function layers, multi-layer parallel Depth-Wise convolutional layers, Concat connection layers, two-dimensional convolutional layers, batch normalization layers, Gaussian function layers, and Multiplies multiplication layers.

[0009] In some embodiments, the global feature extraction network includes multiple layers of global feature extraction layers, each of which includes a connected two-dimensional convolution layer and the activation function layer; the local feature extraction network includes multiple layers of local feature extraction layers, each of which includes a connected two-dimensional convolution layer and a linear rectification function layer.

[0010] In some embodiments, before performing feature extraction on the initial image through the encoder network, the initial image is first downsampled; when performing feature extraction on the initial image through the encoder network, the downsampled initial image is input into the encoder network.

[0011] In some embodiments, the fusion to form a first illumination map of a first resolution includes: fusing the global feature map and the local feature map through an array reconstruction function layer, a two-dimensional convolution layer, and a linear rectification function layer to form the first illumination map.

[0012] In some embodiments, the upsampling to form a second illumination map of a second resolution includes: upsampling the first illumination map and the initial image through a bilateral guidance function layer to form the second illumination map.

[0013] In some embodiments, obtaining the beautified target image includes: multiplying the second illumination map by the initial image to form the target image.

[0014] In some embodiments, the image beautification method is performed by an image beautification model, wherein the image beautification model uses a color loss function L color For training, the color loss function L color The formula is:

[0015]

[0016] in, is the average intensity value of the p channel in the target image output by the image beautification model, where (p, q) is a pair of channels.

[0017] In some embodiments, the image beautification method is performed by an image beautification model, and the image beautification model uses a smooth loss function L smoothness For training, the smooth loss function Lsmoothness The formula is:

[0018]

[0019] Where c is the channel corresponding to the target image output by the image beautification model, and are the partial derivatives in the horizontal and vertical directions in the image space, L res is the second light map, w x,c and w y,c are the smoothing weights of each channel respectively;

[0020]

[0021]

[0022] Among them, β is a parameter used to control the sensitivity to image gradient, and ε is a constant used to prevent division by zero.

[0023] In some embodiments, the image beautification method is performed by an image beautification model, and the image beautification model uses a reconstruction loss function L reconstruction For training, the reconstruction loss function L reconstruction The formula is:

[0024]

[0025] Among them, I label is a manually annotated beautified image, I out is the target image output by the image beautification model, ||·|| F is the F-norm.

[0026] Another aspect of the present invention provides an image beautification device for implementing the image beautification method described in any of the above embodiments, the image beautification device comprising: a first feature extraction module, configured to perform feature extraction on an initial image to be beautified through an encoder network to obtain a feature map; a second feature extraction module, configured to perform feature extraction on the feature map through a global feature extraction network and a local feature extraction network respectively to obtain a global feature map and a local feature map; a fusion processing module, configured to fuse the global feature map and the local feature map to form a first illumination map of a first resolution, wherein the first resolution is lower than the resolution of the initial image; an upsampling processing module, configured to upsample the first illumination map and the initial image to form a second illumination map of a second resolution, wherein the second resolution is equal to the resolution of the initial image; and a target image generation module, configured to obtain a beautified target image based on the second illumination map and the initial image.

[0027] Another aspect of the present invention provides an electronic device, comprising: a processor; a memory, wherein the memory stores executable instructions; wherein when the executable instructions are executed by the processor, the image beautification method described in any of the above embodiments is implemented.

[0028] Another aspect of the present invention provides a computer-readable storage medium for storing a program, wherein the program, when executed, implements the image beautification method described in any of the above embodiments.

[0029] The beneficial effects of the present invention compared with the prior art include at least:

[0030] Initial features are obtained through encoder network extraction, and global features and local features are further extracted through global feature extraction network and local feature extraction network. The global feature extraction network and the local feature extraction network use different feature extraction methods, which is more conducive to the extraction of all-round features of the image, and compresses the size of the image beautification model, accelerating the image beautification process.

[0031] A low-resolution first illumination map is formed by fusing global features and local features, and a full-resolution second illumination map is formed by upsampling the first illumination map and the initial image. The second illumination map and the initial image are then combined to obtain a target image with improved image aesthetics, thereby achieving comprehensive improvements in image brightness, color, contrast, etc., improving image beautification efficiency, reducing labor costs, and increasing image production speed.

[0032] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0034] Figure 1 A diagram showing the main steps of the image beautification method in an embodiment of the present invention;

[0035] Figure 2 A specific flow chart of the image beautification method in an embodiment of the present invention is shown;

[0036] Figure 3 A network structure diagram of an activation function layer in an embodiment of the present invention is shown;

[0037] Figure 4 A schematic diagram of a module of an image beautification device according to an embodiment of the present invention is shown;

[0038] Figure 5 A schematic diagram showing the structure of an electronic device in an embodiment of the present invention; and

[0039] Figure 6 A schematic diagram showing the structure of a computer-readable storage medium in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0040] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to make the present invention comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art.

[0041] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0042] The step numbers in the following embodiments are only used to indicate different execution contents and do not strictly limit the execution order between the steps. The words "first", "second" and similar words used in the specific description do not indicate any order, quantity or importance, but are only used to distinguish different components. It should be noted that the features in the embodiments of the present invention and different embodiments can be combined with each other without conflict.

[0043] Figure 1 The main steps of the image beautification method in the embodiment are shown, referring to Figure 1 As shown, the image beautification method in this embodiment includes: in step S110, feature extraction is performed on the initial image to be beautified through an encoder network to obtain a feature map; in step S120, feature extraction is performed on the feature map through a global feature extraction network and a local feature extraction network respectively to obtain a global feature map and a local feature map; in step S130, a first illumination map of a first resolution is fused according to the global feature map and the local feature map, and the first resolution is lower than the resolution of the initial image; in step S140, a second illumination map of a second resolution is up-sampled according to the first illumination map and the initial image, and the second resolution is equal to the resolution of the initial image; and in step S150, a beautified target image is obtained according to the second illumination map and the initial image.

[0044] The image beautification method of the above embodiment obtains initial features through encoder network extraction, and further obtains global features and local features through global feature extraction network and local feature extraction network extraction; the global feature extraction network and the local feature extraction network adopt different feature extraction methods, which is more conducive to the extraction of all-round features of the image, and compresses the size of the image beautification model, thereby accelerating the image beautification process; a low-resolution first illumination map is formed by fusing global features and local features, and a full-resolution second illumination map is formed by upsampling the first illumination map and the initial image, and then the target image with improved image beauty is obtained by combining the second illumination map and the initial image, thereby achieving comprehensive improvement in image brightness, color, contrast, etc., improving image beautification efficiency, reducing labor costs, and increasing image production speed.

[0045] Combine the following Figure 2 The image beautification example shown in the figure describes in detail each step of the image beautification method. The image beautification method can be specifically executed by an image beautification model. After training, the image beautification model can automatically beautify the input initial image in all directions and output a target image with significantly improved image beauty.

[0046] In step S110, through S110-2, the initial image to be beautified is input into the image beautification model; S110-4, before using the encoder network to extract features from the initial image, the initial image is downsampled; and S110-6, the downsampled initial image is input into the encoder network to extract features from the initial image through the encoder network to obtain a feature map.

[0047] The initial image to be beautified is, for example, an RGB color image, marked as I r , the size is H×W. For the initial image I r Downsample to obtain an image I of size h×w d ; Then image I d Send it to the encoder network to obtain the feature map f e Where f e =S(C(I d )).

[0048] The encoder network consists of a two-dimensional convolutional layer C(·) and an activation function layer S(·) with multi-scale weights that can be learned. The network structure of the activation function layer S(·) is shown in Figure 3As shown, it specifically includes: a two-dimensional convolution (Conv2d) layer 310; a linear rectification function (ReLU) layer 320; multiple layers of parallel Depth-Wise convolution layers, such as a 7×7 Depth-Wise convolution layer 330a and a 9×9 Depth-Wise convolution layer 330b; a Concat connection layer 340; a two-dimensional convolution (Conv2d) layer 350; a batch normalization (Batch-Norm) layer 360; a Gaussian function (Gaussian) layer 370; and a Multiplies multiplication layer 380. The activation function layer S(·) can be used to input the feature vector x i Perform feature extraction and activation to obtain the feature vector x for further vectorization i+1 .

[0049] In step S120, through S120-2, the global features of the image are extracted using a global feature extraction network; and S120-4, the local features of the image are extracted using a local feature extraction network; wherein S120-2 and S120-4 are performed in parallel.

[0050] Specifically, the feature map f e Send it to the global feature extraction network to extract global features and obtain the global feature map f g The global feature extraction network consists of multiple layers, such as i g The global feature extraction layers are composed of a two-dimensional convolutional layer C(·) and an activation function layer S(·) with learnable multi-scale weights.

[0051] And, the feature map f e Send it to the local feature extraction network to extract local features and obtain the local feature map f l The local feature extraction network consists of multiple layers, such as i l There are multiple local feature extraction layers, each of which is composed of a two-dimensional convolutional layer C(·) and a linear rectification function layer ReLU(·).

[0052] Different feature activation methods are used in the global feature extraction network and the local feature extraction network, which is more conducive to feature extraction and compresses the model size.

[0053] In step S130, the global feature map f is reshaped by an array reconstruction function layer Reshape(·), a two-dimensional convolution layer C(·) and a linear rectification function layer ReLU(·). g And the local feature map f l Perform fusion processing to form a low-resolution first illumination map L low . Where L low =ReLU(C(Reshape(f g )+fl )).

[0054] In step S140 , the first illumination map and the initial image are upsampled based on bilateral guidance through S140 - 2 ; and S140 - 4 , a second illumination map with full resolution is obtained.

[0055] Specifically, according to the first illumination map L low , combined with the input initial image I r , through the bilateral guidance function layer Bgrid(·) to reconstruct the initial image I r The second light map L with the same resolution res . Where L res =Bgrid(L low ,I r ).

[0056] In step S150, according to the obtained second illumination map L res , combined with the input initial image I r , reconstruct the output beautified target image I out . Where L out =L res ×I r .

[0057] Furthermore, in order to improve the color saturation and contrast of the target image output by the image beautification model, a new loss function is designed during the model training process to improve the model's ability to reconstruct the color saturation and contrast of the image. The loss function specifically includes a color loss function, a smoothing loss function, and a reconstruction loss function, which can enable the trained image beautification model to comprehensively improve the beauty of the image in terms of brightness, color, contrast, etc., and achieve a large-scale improvement in the beauty of images.

[0058] Color loss function L color The formula is:

[0059]

[0060] in, It is the average intensity value of the p channel in the target image output by the image beautification model, where (p,q) is a pair of channels.

[0061] Smooth loss function L smoothness The formula is:

[0062]

[0063] Among them, c is the channel corresponding to the target image output by the image beautification model, and are the partial derivatives in the horizontal and vertical directions in the image space, Lres is the second light map, w x,c and w y,c are the smoothing weights of each channel respectively;

[0064]

[0065]

[0066] Among them, β is a parameter used to control the sensitivity to image gradient, and ε is a constant used to prevent division by zero.

[0067] Reconstruction loss function L reconstruction The formula is:

[0068]

[0069] Among them, I label is a manually annotated beautified image, I out is the target image output by the image beautification model, ||·|| F is the F-norm.

[0070] In the above embodiments, some algorithm principles that are not specifically described are existing technologies and are therefore not described in detail.

[0071] The image beautification method for comprehensively improving image brightness, color, contrast, etc. based on deep learning in the above-mentioned embodiment extracts global features and local features, and realizes adaptive learning and activation through a multi-scale weight learnable activation function combined with a new loss function, so that the image beautification model can improve the image beauty in a targeted manner according to the characteristics of different regions of the initial image, effectively solve the problem of poor image beautification effect, and suppress the yellow-green overexposure phenomenon that is easy to occur after algorithm beautification, meet the image beautification needs of the OTA industry, improve image beautification efficiency, reduce labor costs, increase picture production speed, and improve the business operation efficiency of the OTA industry.

[0072] An embodiment of the present invention further provides an image beautification device, which is used to implement the image beautification method described in any of the above embodiments. Figure 4 The main modules of the image beautification device in the embodiment are shown. Figure 4As shown, the image beautification device 400 in this embodiment includes: a first feature extraction module 410, configured to perform feature extraction on the initial image to be beautified through an encoder network to obtain a feature map; a second feature extraction module 420, configured to perform feature extraction on the feature map through a global feature extraction network and a local feature extraction network respectively, to obtain a global feature map and a local feature map; a fusion processing module 430, configured to fuse the global feature map and the local feature map to form a first illumination map of a first resolution, wherein the first resolution is lower than the resolution of the initial image; an upsampling processing module 440, configured to upsample the first illumination map and the initial image to form a second illumination map of a second resolution, wherein the second resolution is equal to the resolution of the initial image; and a target image generation module 450, configured to obtain a beautified target image according to the second illumination map and the initial image.

[0073] Furthermore, the image beautification device 400 may also include modules for implementing other process steps of the above-mentioned image beautification method embodiments. The specific principles of each module can refer to the description of the above-mentioned image beautification method embodiments, and will not be repeated here.

[0074] As described above, the image beautification device of the present invention can achieve comprehensive improvement in image brightness, color, contrast, etc. by extracting global features and local features, and through a multi-scale weight learnable activation function combined with a new loss function, adaptive learning and activation are achieved, so that the image beautification model can improve the image beauty in a targeted manner according to the characteristics of different regions of the initial image, effectively solve the problem of poor image beautification effect, and suppress the yellow-green overexposure phenomenon that is easy to occur after algorithm beautification, meet the image beautification needs of the OTA industry, improve image beautification efficiency, reduce labor costs, increase picture production speed, and improve the business operation efficiency of the OTA industry.

[0075] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein executable instructions are stored in the memory, and when the executable instructions are executed by the processor, the image beautification method described in any of the above embodiments is implemented.

[0076] As described above, the electronic device of the present invention can achieve comprehensive improvement in image brightness, color, contrast, etc. by extracting global features and local features, and through a multi-scale weighted learnable activation function combined with a new loss function, adaptive learning and activation are achieved, so that the image beautification model can improve the image beauty in a targeted manner according to the characteristics of different regions of the initial image, effectively solve the problem of poor image beautification effect, and suppress the yellow-green overexposure phenomenon that is easy to occur after algorithm beautification, meet the image beautification needs of the OTA industry, improve image beautification efficiency, reduce labor costs, increase picture production speed, and improve the business operation efficiency of the OTA industry.

[0077] Figure 5 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. It should be understood that: Figure 5 The modules are only schematically shown, and these modules may be virtual software modules or actual hardware modules. The combination and splitting of these modules and the addition of other modules are all within the protection scope of the present invention.

[0078] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 include but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different platform components (including the storage unit 520 and the processing unit 510), a display unit 540, etc.

[0079] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 executes the steps of the image beautification method described in any of the above embodiments. For example, the processing unit 510 can execute the following steps: Figure 1 and Figure 2 Steps shown.

[0080] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202 , and may further include a read-only storage unit (ROM) 5203 .

[0081] The storage unit 520 may also include a program / utility 5204 having one or more program modules 5205, such program modules 5205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0082] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0083] The electronic device 500 can also communicate with one or more external devices 600, which can be one or more of a keyboard, a pointing device, a Bluetooth device, etc. These external devices 600 enable the user to communicate interactively with the electronic device 500. The electronic device 500 can also communicate with one or more other computing devices, and the computer device shown includes a router and a modem. This communication can be performed through an input / output (I / O) interface 550. In addition, the electronic device 500 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 560. The network adapter 560 can communicate with other modules of the electronic device 500 through a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0084] The embodiment of the present invention further provides a computer-readable storage medium for storing a program, which implements the image beautification method described in any of the above embodiments when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the image beautification method described in any of the above embodiments.

[0085] As described above, the computer-readable storage medium of the present invention can achieve comprehensive improvement in image brightness, color, contrast, etc. by extracting global features and local features, and through a multi-scale weight learnable activation function combined with a new loss function, adaptive learning and activation are achieved, so that the image beautification model can improve the image beauty in a targeted manner according to the characteristics of different regions of the initial image, effectively solve the problem of poor image beautification effect, and suppress the yellow-green overexposure phenomenon that is easy to occur after algorithm beautification, meet the image beautification needs of the OTA industry, improve image beautification efficiency, reduce labor costs, increase picture production speed, and improve the business operation efficiency of the OTA industry.

[0086] Figure 6 Schematic diagram of the structure of the computer-readable storage medium of the present invention. Figure 6As shown, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0087] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media include, but are not limited to: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0088] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0089] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device, such as through the Internet using an Internet service provider.

[0090] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. An image beautification method, characterized in that: include: The encoder network is used to extract features from the initial image to be beautified to obtain a feature map; The encoder network includes connected two-dimensional convolutional layers and activation function layers; the activation function layer includes sequentially connected two-dimensional convolutional layers, linear rectification function layers, multi-layer parallel Depth-Wise convolutional layers, Concat connection layers, two-dimensional convolutional layers, batch normalization layers, Gaussian function layers, and Multiplies multiplication layers; Extracting features from the feature map through a global feature extraction network and a local feature extraction network respectively to obtain a global feature map and a local feature map; Wherein, the global feature extraction network includes multiple layers of global feature extraction layers, each of which includes a connected two-dimensional convolution layer and the activation function layer; the local feature extraction network includes multiple layers of local feature extraction layers, each of which includes a connected two-dimensional convolution layer and a linear rectification function layer; According to the global feature map and the local feature map, a first illumination map with a first resolution is formed by fusing the first resolution, where the first resolution is lower than a resolution of the initial image; Upsampling the first illumination map and the initial image to form a second illumination map with a second resolution, wherein the second resolution is equal to a resolution of the initial image; and A beautified target image is obtained according to the second illumination map and the initial image.

2. The image beautification method according to claim 1, characterized in that: Before extracting features from the initial image through the encoder network, downsampling the initial image; When the encoder network is used to extract features from the initial image, the downsampled initial image is input into the encoder network.

3. The image beautification method according to claim 1, characterized in that: The fusing to form a first illumination map of a first resolution includes: The global feature map and the local feature map are fused through an array reconstruction function layer, a two-dimensional convolution layer and a linear rectification function layer to form the first illumination map.

4. The image beautification method according to claim 1, characterized in that: The upsampling to form a second illumination map of a second resolution includes: The first illumination map and the initial image are upsampled through a bilateral guidance function layer to form the second illumination map.

5. The image beautification method according to claim 1, characterized in that: The step of obtaining the beautified target image comprises: The second illumination map is multiplied by the initial image to form the target image.

6. The image beautification method according to any one of claims 1 to 5, characterized in that: The image beautification method is performed by an image beautification model, wherein the image beautification model uses a color loss function L color For training, the color loss function L color The formula is: γ={(R,G),(R,B),(B,G)}; in, is the average intensity value of the p channel in the target image output by the image beautification model, where (p, q) is a pair of channels.

7. The image beautification method according to any one of claims 1 to 5, characterized in that: The image beautification method is performed by an image beautification model, wherein the image beautification model uses a smooth loss function L smoothness For training, the smooth loss function L smoothness The formula is: Where c is the channel corresponding to the target image output by the image beautification model, and are the partial derivatives in the horizontal and vertical directions in the image space, L res is the second light map, w x,c and w y,c are the smoothing weights of each channel respectively; Among them, β is a parameter used to control the sensitivity to image gradient, and ε is a constant used to prevent division by zero.

8. The image beautification method according to any one of claims 1 to 5, characterized in that: The image beautification method is performed by an image beautification model, wherein the image beautification model uses a reconstruction loss function L reconstruction For training, the reconstruction loss function L reconstruction The formula is: Among them, I label is a manually annotated beautified image, I out is the target image output by the image beautification model, ||·|| F is the F-norm.

9. An image beautification device, characterized in that: Used to implement the image beautification method according to any one of claims 1 to 8, the image beautification device comprises: A first feature extraction module is configured to extract features of the initial image to be beautified through an encoder network to obtain a feature map; The encoder network includes connected two-dimensional convolutional layers and activation function layers; the activation function layer includes sequentially connected two-dimensional convolutional layers, linear rectification function layers, multi-layer parallel Depth-Wise convolutional layers, Concat connection layers, two-dimensional convolutional layers, batch normalization layers, Gaussian function layers, and Multiplies multiplication layers; A second feature extraction module is configured to extract features from the feature map through a global feature extraction network and a local feature extraction network, respectively, to obtain a global feature map and a local feature map; Wherein, the global feature extraction network includes multiple layers of global feature extraction layers, each of which includes a connected two-dimensional convolution layer and the activation function layer; the local feature extraction network includes multiple layers of local feature extraction layers, each of which includes a connected two-dimensional convolution layer and a linear rectification function layer; a fusion processing module, configured to fuse the global feature map and the local feature map to form a first illumination map with a first resolution, wherein the first resolution is lower than a resolution of the initial image; an upsampling processing module configured to upsample the first illumination map and the initial image to form a second illumination map of a second resolution, wherein the second resolution is equal to a resolution of the initial image; and The target image generation module is configured to obtain a beautified target image according to the second illumination map and the initial image.

10. An electronic device, characterized in that: include: A processor; a memory storing executable instructions; When the executable instruction is executed by the processor, the image beautification method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the image beautification method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Image enhancement method and device and storage medium

    CN109919869A