Image enhancement model training method, image enhancement method, device and medium

By constructing an operation operator pool to process image features different operations, and generating loss functions based on attention operations, the image enhancement model is trained, which solves the problem that image enhancement technology may amplify low-quality signals when improving high-quality signals, and enhances the robustness and adaptability of the model.

CN119850451APending Publication Date: 2025-04-18BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510031946.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

While improving high-quality signals, image enhancement technology may amplify the original low-quality signals, resulting in new visual problems and is difficult to ensure robustness and adaptability.

Method used

By building an operation operator pool, including multiple operation operators, different operation processing is performed on the output image features and high-quality image features, and an output operation result set and a high-quality operation result set are generated. Then, attention operations are performed based on these results sets, output label values ​​and high-quality label values ​​are determined, loss functions are generated, and image enhancement models are trained.

Benefits of technology

The robustness and adaptability of the image enhancement model is enhanced, so that it can output high-quality signals stably in complex and changeable image processing tasks, avoiding the introduction of new flaws.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850451A_ABST
    Figure CN119850451A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image enhancement model training method and device, an image enhancement method and device, electronic equipment and a storage medium. The method comprises the following steps: processing an input image through a to-be-trained image enhancement model to obtain an output image; and performing operation processing of different operation algorithms on the output image features and the high-quality image features through an operator pool comprising a plurality of operators to obtain an output operation result set and a high-quality operation result set. And training the image enhancement model based on a loss function generated by comparing the output operation result set with the high-quality operation result set. Due to the fact that different operation operators are introduced in the training process, the image enhancement model is trained based on comparison of the operated output image and the high-quality image, the robustness and adaptability of the model are enhanced, and the robustness and the adaptability of the model are improved. And the output image can still ensure that the high-quality signal has good stability in a complex and changeable image processing task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an image enhancement model training method, an image enhancement method, a device, an electronic device, a computer program product, and a storage medium. Background Art

[0002] With the rapid advancement of video image technology, viewers can enjoy more vivid and high-quality content, which has greatly promoted the prosperity of the short video industry. In the process from video creation to distribution, the quality of the video directly affects the content quality and user experience. Through image enhancement technology, the quality of image content can be effectively improved and the user's viewing experience can be enhanced.

[0003] However, while image enhancement technology enhances high-quality signals, it may also amplify the original low-quality signals, causing new visual problems. Therefore, in practical applications, image enhancement technology must have high robustness to ensure that while improving image quality, it effectively suppresses adverse effects and avoids introducing new defects, thereby providing a stable and high-quality visual experience. Summary of the invention

[0004] The embodiments of the present disclosure provide an image enhancement model training method, an image enhancement method, an apparatus, an electronic device, a computer program product, and a storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image enhancement model training method, comprising: obtaining a training data set comprising a plurality of image training samples; the image training samples comprising a corresponding input image and a high-quality image; performing image enhancement processing on the input image through the image enhancement model to be trained to obtain an output image; performing feature extraction on the output image and the high-quality image to obtain output image features and high-quality image features; performing operation processing on the output image features and the high-quality image features respectively through operation operators in an operation operator pool to obtain an output operation result set and a high-quality operation result set; performing attention operations on the output operation result set and the high-quality operation result set respectively to determine an output label value and a high-quality label value; generating a loss function according to the output label value and the high-quality label value; and training the image enhancement model to be trained according to the loss function to obtain a target image enhancement model.

[0006] In some exemplary embodiments of the present disclosure, the operation operator pool includes a plurality of the operation operators; the output operation result set includes a plurality of output operation results; the output operation results respectively correspond to the operation operators; the high-quality operation result set includes a plurality of high-quality operation results; the high-quality operation results respectively correspond to the operation operators.

[0007] In some exemplary embodiments of the present disclosure, the operation operator pool includes at least: a blur operation operator group and a sharpening operation operator group; the blur operation operator group includes: at least one blur operation operator; the sharpening operation operator group includes: at least one sharpening operation operator.

[0008] In some exemplary embodiments of the present disclosure, the method further includes: acquiring image content information based on the high-quality image; performing feature extraction on the image content information to obtain image content features; and performing attention operations on the output operation result set and the high-quality operation result set, respectively, to determine the output label value and the high-quality label value, including: performing attention operations on the output operation result set and the high-quality operation result set, respectively, based on the image content features, to determine the output label value and the high-quality label value.

[0009] In some exemplary embodiments of the present disclosure, obtaining image content information based on the high-quality image includes: extracting content features of the high-quality image through a contrastive language-image pre-training model (Contrastive Language-Image Pre-Training, CLIP) to obtain the image content information.

[0010] In some exemplary embodiments of the present disclosure, the performing of attention operations on the output operation result set and the high-quality operation result set respectively according to the image content features to determine the output label value and the high-quality label value includes: performing a self-attention operation on the image content features to determine a content query feature; performing feature conversion on the output operation result set to determine an output key feature set and an output value feature set; performing feature conversion on the high-quality operation result set to determine a high-quality key feature set and a high-quality value feature set; performing an attention operation on the output key feature set and the output value feature set through the content query feature to determine the output label value; performing an attention operation on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value.

[0011] In some exemplary embodiments of the present disclosure, the method of performing an attention operation on the output key feature set and the output value feature set through the content query feature to determine the output label value includes: performing an attention operation on corresponding feature items in the output key feature set and the output value feature set through the content query feature to obtain an output attention feature set; determining the output label value according to each feature item in the output attention feature set; the method of performing an attention operation on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value includes: performing an attention operation on corresponding feature items in the high-quality key feature set and the high-quality value feature set through the content query feature to obtain a high-quality attention feature set; and determining the high-quality label value according to each feature item in the high-quality attention feature set.

[0012] In some exemplary embodiments of the present disclosure, generating a loss function according to the output label value and the high-quality label value includes: performing label discrimination on the output label value and the high-quality label value by a discriminator to determine the loss function.

[0013] In some exemplary embodiments of the present disclosure, the high-quality label value corresponds to a first label category, and the output label value corresponds to a second label category; and the loss function is determined based on calculating the cross entropy loss.

[0014] According to a second aspect of an embodiment of the present disclosure, there is provided an image enhancement method, comprising: acquiring an image to be processed; inputting the image to be processed into an image enhancement model; the image enhancement model is obtained by training through any one of the image enhancement model training methods described; and the image enhancement model performs image enhancement processing on the image to be processed to obtain a target image.

[0015] According to a third aspect of an embodiment of the present disclosure, there is provided an image enhancement model training device, comprising: a sample acquisition module, configured to acquire a training data set comprising a plurality of image training samples; the image training samples comprise a corresponding input image and a high-quality image; an image enhancement module, configured to perform image enhancement processing on the input image through the image enhancement model to be trained to obtain an output image; a feature extraction module, configured to perform feature extraction on the output image and the high-quality image to obtain output image features and high-quality image features; an image operation module, configured to perform operation processing on the output image features and the high-quality image features respectively through an operation operator in an operation operator pool to obtain an output operation result set and a high-quality operation result set; an attention operation module, configured to perform attention operations on the output operation result set and the high-quality operation result set respectively to determine an output label value and a high-quality label value; a loss function module, configured to generate a loss function according to the output label value and the high-quality label value; and a model training module, configured to train the image enhancement model to be trained according to the loss function to obtain a target image enhancement model.

[0016] According to a fourth aspect of an embodiment of the present disclosure, there is provided an image enhancement device, comprising: an image acquisition module, configured to acquire an image to be processed; an image input module, configured to input the image to be processed into an image enhancement model; the image enhancement model is obtained by training through any one of the image enhancement model training methods described above; and an image processing module, configured to perform image enhancement processing on the image to be processed by the image enhancement model to obtain a target image.

[0017] According to the fifth aspect of an embodiment of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement any one of the image enhancement model training methods or any one of the image enhancement methods.

[0018] According to the sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the image enhancement model training methods or any one of the image enhancement methods.

[0019] According to a seventh aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, wherein a processor executes any one of the image enhancement model training methods or any one of the image enhancement methods.

[0020] The image enhancement model training method provided by the embodiment of the present disclosure introduces an operation operator pool including multiple operation operators during the training process, and performs operation processing of different operation algorithms on the output image features and the high-quality image features, thereby obtaining an output operation result set and a high-quality operation result set including different operation results. The image enhancement model is trained to obtain a target image enhancement model by using a loss function generated by comparing the output operation result set with the high-quality operation result set. By introducing different operation operators to compare the output image and the high-quality image after the operation to train the image enhancement model, the robustness and adaptability of the model are enhanced, so that the image output by the model can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0021] 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 present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 A schematic diagram showing an exemplary system architecture to which the method according to an embodiment of the present disclosure can be applied is shown.

[0024] Figure 2 The figure is a flowchart of an image enhancement model training method according to an exemplary embodiment.

[0025] Figure 3 is a flowchart of another image enhancement model training method shown according to an example.

[0026] Figure 4 is a flowchart illustrating a tag value calculation method according to an example.

[0027] Figure 5 is a schematic diagram of an image enhancement model training process according to an example.

[0028] Figure 6 The figure is a flow chart of an image enhancement method according to an exemplary embodiment.

[0029] Figure 7 It is a block diagram of an image enhancement model training device according to an exemplary embodiment.

[0030] Figure 8The figure is a block diagram of an image enhancement device according to an exemplary embodiment.

[0031] Fig. 9 It is a schematic diagram showing the structure of an electronic device suitable for implementing the exemplary embodiments of the present disclosure according to an exemplary embodiment. DETAILED DESCRIPTION

[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0033] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0034] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in at least one hardware module or integrated circuit, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0036] In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of at least one element / component / etc.; the terms "comprising", "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0037] Figure 1 A schematic diagram showing an exemplary system architecture to which the method according to an embodiment of the present disclosure can be applied is shown.

[0038] like Figure 1 As shown, the system architecture may include a server 101, a network 102, a terminal device 103, a terminal device 104, and a terminal device 105. The network 102 is used to provide a medium for a communication link between the terminal device 103, the terminal device 104, or the terminal device 105 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0039] The server 101 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal device 103, the terminal device 104, or the terminal device 105. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device 103, the terminal device 104, or the terminal device 105.

[0040] Terminal device 103, terminal device 104 and terminal device 105 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a wearable smart device, a virtual reality device, an augmented reality device, etc., but are not limited thereto.

[0041] It should be understood that Figure 1 The number of terminal devices 103, terminal devices 104, terminal devices 105, networks 102 and servers 101 are merely illustrative. Server 101 may be a physical server, a server cluster consisting of multiple servers, or a cloud server. Depending on actual needs, any number of terminal devices, networks and servers may be provided.

[0042] Below, each step of the method in the exemplary embodiment of the present disclosure will be described in more detail with reference to the accompanying drawings and embodiments.

[0043] Figure 2 The figure is a flowchart of an image enhancement model training method according to an exemplary embodiment. Figure 2 The method provided in the embodiment can be executed by any electronic device, such as the above Figure 1 The terminal device in Figure 1 Servers in, or Figure 1 The terminal device and the server in the embodiment are jointly executed, but the present disclosure is not limited to this.

[0044] In step S210, a training data set including a plurality of image training samples is obtained; the image training samples include input images and high-quality images in a corresponding relationship.

[0045] In the disclosed embodiment, a large number of image training samples are obtained in advance to train the image enhancement model and construct a training data set. Each image training sample includes at least one set of corresponding input images and high-quality images. The input image is used as the image to be enhanced in the image training sample. The high-quality image is used as the target image in the image training sample.

[0046] In step S220, the input image is enhanced by the image enhancement model to be trained to obtain an output image.

[0047] In the disclosed embodiment, an image enhancement model to be trained is pre-built to perform image enhancement processing on the input image in each image training sample to obtain a corresponding output image. Based on the comparison between the output image and the corresponding high-quality image, the image enhancement model to be trained is trained.

[0048] In step S230, feature extraction is performed on the output image and the high-quality image to obtain output image features and high-quality image features.

[0049] In the disclosed embodiment, in order to compare and evaluate the difference between the output image and the high-quality image, it is necessary to extract features from the output image and the high-quality image to obtain output image features and high-quality image features for comparison. The output image features and high-quality image features can be represented in the form of feature vectors, which are used to characterize various feature information such as texture, color, and edge in the image.

[0050] In an exemplary embodiment, an input image I is subjected to image enhancement processing by an image enhancement model to be trained to obtain an output image O. The image training sample includes a high-quality image H corresponding to the input image I. By performing attention calculation operations on the output image O and the high-quality image H, and extracting features by using corresponding convolution operations, output image features F(O) and high-quality image features F(H) are obtained. Wherein, F(O)=conv(O), F(H)=conv(H).

[0051] In step S240, the output image features and the high-quality image features are respectively processed by the operation operators in the operation operator pool to obtain an output operation result set and a high-quality operation result set.

[0052] In the disclosed embodiment, an operation operator pool is pre-constructed. The operation operator pool includes a plurality of operation operators. Each operation operator is used to perform corresponding operation processing on image features. For example, blur operation, sharpening operation, etc. It should be noted that various types of operation processing can have a variety of different implementation algorithms. The operation operator pool can select any one or more implementation algorithms to construct the operation operator pool. By constructing the operation operator pool, operation processing of different types and different algorithms can be performed on the output image and the high-quality image, so as to compare the output image and the high-quality image and evaluate their robustness later, and provide a variety of different evaluation objects.

[0053] In the disclosed embodiment, based on the above-constructed operation operator pool, each operation operator performs corresponding operation processing on the output image feature and the high-quality image feature, thereby obtaining an output operation result set and a high-quality operation result set. The output operation result set includes multiple output operation results. Each output operation result corresponds to each operation operator in the aforementioned operation operator pool. The high-quality operation result set includes multiple high-quality operation results. Each high-quality operation result corresponds to each operation operator in the aforementioned operation operator pool.

[0054] In an exemplary embodiment, the output operation result set and the high-quality operation result set include not only the output operation results and high-quality operation results corresponding to each operation operator, but also the original output image features and high-quality image features that have not been processed by the operation operator.

[0055] In an exemplary embodiment, the operation operator pool Pool may include, according to different operation types, a blur operation operator group Pool_blur and a sharpening operation operator group Pool_sharp. The blur operation operator group Pool_blur is an operator group for performing blur operations on image features. The sharpening operation operator group Pool_sharp is an operator group for performing sharpening operations on image features. The blur operation operator group Pool_blur may include multiple blur operation operators. For example, Pool_blur = {blur1, blur2, blur3}. Each blur operation operator {blur1, blur2, blur3} is an operator that uses different algorithms to perform blur operations, including but not limited to mean filtering, Gaussian filtering, etc. The sharpening operation operator group Pool_sharp may include multiple sharpening operation operators. For example, Pool_sharp = {sharp1, sharp2, sharp3}. Each sharpening operator {sharp1, sharp2, sharp3} is an operator that uses different algorithms to perform sharpening operations, including but not limited to sharpening after mean filtering, sharpening after Gaussian filtering, etc. Based on this, the operation operator pool Pool = {blur1, blur2, blur3, sharp1, sharp2, sharp3}.

[0056] In an exemplary embodiment, the output image feature F(O) and the high-quality image feature F(H) are respectively processed by the respective operators in the above-mentioned operator pool Pool to obtain an output operation result set Pool(F(O)) and a high-quality operation result set Pool(F(H)). The output operation result set Pool(F(O))={F(O), blur1(F(O)), blur2(F(O)), blur3(F(O)), sharp1(F(O)), sharp2(F(O)), sharp3(F(O))}. The high-quality operation result set Pool(F(H))={F(H), blurl(F(H)), blur2(F(H)), blur3(F(H)), sharp1(F(H)), sharp2(F(H)), sharp3(F(H))}.

[0057] In step S250, attention operations are performed on the output operation result set and the high-quality operation result set respectively to determine output label values ​​and high-quality label values.

[0058] In the embodiments of the present disclosure, on the one hand, an attention operation is performed on each output operation result in the output operation result set to obtain an output attention feature item corresponding to each output operation result. Based on the output attention feature items, the output label value corresponding to the output image is determined. On the other hand, an attention operation is performed on each high-quality operation result in the high-quality operation result set to obtain a high-quality attention feature item corresponding to each high-quality operation result. Based on the high-quality attention feature items, the high-quality label value corresponding to the high-quality image is determined. Among them, the attention operation refers to the process of extracting useful information from the feature vector, weighting it and generating an output. The attention operation can focus on the most relevant or important part of the relevant input data, thereby improving the ability to understand key information. In this way, the key information in each output operation result and each high-quality operation result can be extracted, and then converted into corresponding output label values ​​and high-quality label values. The output label value and high-quality label value can characterize whether the key information of the output image and the high-quality image still has a good correlation after being operated by different operators, thereby enhancing the robustness and adaptability of the model, so that the output image can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0059] In an exemplary embodiment, an attention operation is performed on each output operation result in the output operation result set Pool(F(O)) to obtain an output attention feature item corresponding to each output operation result. Based on statistical calculations of each output attention feature item, the output label value Label(O) corresponding to the output image is determined. An attention operation is performed on each high-quality operation result in the high-quality operation result set Pool(F(H)) to obtain an output attention feature item corresponding to each high-quality operation result. Based on statistical calculations of each high-quality attention feature item, the high-quality label value Label(H) corresponding to the high-quality image is determined.

[0060] In step S260, a loss function is generated according to the output label value and the high-quality label value.

[0061] In the disclosed embodiment, the output label value and the high-quality label value obtained by the aforementioned step S250 respectively characterize the key information in each output operation result and each high-quality operation result after being processed by each operation operator in the operation operator pool. By comparing the difference between the output label value and the high-quality label value, it can be characterized whether the key information of the output image and the high-quality image still has a good correlation after being operated by different operation operators. Based on this, according to the output label value and the high-quality label value, a corresponding loss function is generated for training the image enhancement model to enhance the robustness and adaptability of the model.

[0062] In an exemplary embodiment, the output label value and the high-quality label value are subjected to label discrimination by a discriminator to determine the loss function. The high-quality label value is taken as a true label, and the output label value is taken as a false label. The true and false labels are used to improve the discriminative ability of the discriminator, and based on this, a corresponding loss function is determined for model training.

[0063] In an exemplary embodiment, the high-quality label value corresponds to the first label category, and the output label value corresponds to the second label category; the loss function is determined based on the calculated cross entropy loss. Among them, the first label category is the true value category, that is, the positive sample; the second label category is the false value category, that is, the negative sample. Based on this, it can be understood as a binary classification loss function. In this way, the cross entropy loss function is used to measure the difference between the model prediction and the true label. The cross entropy loss can effectively evaluate the gap between the predicted probability distribution and the actual distribution in the classification task. The loss function quantifies the degree of mismatch between the prediction and the target, and guides the model to optimize the parameters to minimize this gap, thereby improving the quality and accuracy of image enhancement.

[0064] In step S270, the image enhancement model to be trained is trained according to the loss function to obtain a target image enhancement model.

[0065] In the disclosed embodiment, the image enhancement model to be trained is trained according to the loss function. During the training process, the model parameters are continuously optimized using the back propagation algorithm based on the loss function, so that the image enhancement model to be trained can learn the gap between the model prediction results and the high-quality images, thereby enhancing the robustness and adaptability of the model, so that the image output by it can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0066] The image enhancement model training method provided by the embodiment of the present disclosure introduces an operation operator pool including multiple operation operators during the training process, and performs operation processing of output image features and high-quality image features using different operation algorithms, thereby obtaining an output operation result set and a high-quality operation result set including different operation results. The image enhancement model is trained to obtain a target image enhancement model by using a loss function generated based on the comparison of the output operation result set and the high-quality operation result set. By introducing different operation operators to compare the output image and the high-quality image after the operation to train the image enhancement model, the robustness and adaptability of the model are enhanced, so that the image output by the model can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0067] Figure 3 is a flowchart of another image enhancement model training method shown according to an example. Figure 5 is a schematic diagram of an image enhancement model training process according to an example.

[0068] In the disclosed embodiment, Figure 3 Steps S310, S320, S340, S360 and S370 in the image enhancement model training method are respectively Figure 2 Steps S210, S220, S240, S260 and S270 in the image enhancement model training method are corresponding and will not be repeated here.

[0069] In the embodiment of the present disclosure, Figure 2 Based on the image enhancement model training method shown, Figure 3 The image enhancement model training method shown may also include the following steps.

[0070] In step S380, image content information is obtained based on the high-quality image.

[0071] In the embodiment of the present disclosure, based on the high-quality image, image content information of the image is further obtained. The image content information is used to characterize different content areas in the image. Through the image content information, different contents in the image can be better identified and divided, so as to further analyze and compare related image features. It should be pointed out that there are many technologies for identifying and marking content areas in images through image analysis technology, and the present disclosure does not limit the specific image analysis technology used.

[0072] In an exemplary embodiment, the content features of the high-quality image can be extracted through the Contrastive Language-Image Pre-Training (CLIP) model to obtain image content information. The CLIP model is a multimodal pre-training model that performs joint training on a large number of images and corresponding text description pairs through contrastive learning to learn the association between images and texts. The CLIP model can be used to extract content features in high-quality images and generate corresponding semantic information, which is denoted as S=CLIP(H). By using the semantic information as image content information, different content areas in the high-quality image are marked.

[0073] In step S330, feature extraction is performed on the image content information to obtain image content features.

[0074] In the embodiment of the present disclosure, the image content information is subjected to feature extraction in the same feature extraction manner as in the aforementioned step S230 to obtain corresponding image content features. Like the output image features and the high-quality image features, the image content features can be represented in the form of feature vectors. Through the feature extraction operation, the output image, the high-quality image, and the image content information are converted into the same feature space for subsequent operation and comparison of related features.

[0075] In an exemplary embodiment, an attention calculation operation is performed on the image content information S, and a feature extraction is performed using a corresponding convolution operation to obtain an image content feature F(S), where F(S)=conv(S).

[0076] In step S350, attention operations are performed on the output operation result set and the high-quality operation result set respectively according to the image content features to determine the output label value and the high-quality label value.

[0077] In the disclosed embodiment, the image content feature is introduced in the process of performing attention operation on the output operation result set and the high-quality operation result set, so that the attention operation process can refer to the relevant features of the image content recognition in the image content feature, thereby obtaining more accurate output attention feature items and high-quality attention feature items. Based on this, the output label value and high-quality label value calculated according to the output attention feature item and the high-quality attention feature item are also more accurate, and can better reflect the attention feature values ​​of different contents in the image.

[0078] It should be noted that the numbers of the above steps are only used to distinguish different execution steps, and are not used as a limitation on the execution order between related steps.

[0079] The image enhancement model training method provided by the embodiment of the present disclosure introduces image content information used to characterize different content areas in the image during the training process, so that the attention operation process can refer to the relevant features of the image content features for image content recognition, thereby obtaining more accurate output attention feature items and high-quality attention feature items. Based on this, the output label value and high-quality label value calculated based on the output attention feature items and high-quality attention feature items are also more accurate, and can better reflect the attention feature values ​​of different contents in the image.

[0080] Figure 4 is a flowchart illustrating a tag value calculation method according to an example. Figure 5 FIG. 1 is a schematic diagram of an image enhancement model training process according to an example. Figure 4 , 5 As shown, in the embodiment of the present disclosure, the label value calculation process of the aforementioned step S350 may include the following steps.

[0081] In step S410, a self-attention operation is performed on the image content features to determine content query features.

[0082] In the disclosed embodiment, a self-attention operation is performed on the image content feature to determine the content query feature. In the self-attention mechanism, the model calculates the correlation (or weight) between each element in the sequence and all other elements, and these weights reflect the relationship between the elements. This mechanism can help the model better understand the contextual information in the sequence, so as to process the sequence data more accurately. The self-attention mechanism determines the weight of each value vector by representing each element in the input sequence as three vectors: query, key, and value, and then calculating the similarity of each query vector with all key vectors. Ultimately, the output is the sum of weighted values, and each weight reflects the dependency between different positions in the input sequence.

[0083] In an exemplary embodiment, the image content feature F(S) is injected into the self-attention layer, and a new feature representation G(S) is generated by calculating the relationship weight between each feature point and all other feature points. Then, the feature G(S) after the self-attention operation is converted into a content query feature Q(S). This conversion process can be achieved by linear mapping or convolution operation.

[0084] In step S420, the output operation result set is subjected to feature conversion to determine an output key feature set and an output value feature set.

[0085] In the disclosed embodiment, each output operation result in the output operation result set is subjected to feature conversion, and converted into an output key feature (Key) and an output value feature (Value) corresponding to the attention operation. The output key features and output value features corresponding to each output operation result are collected to form an output key feature set and an output value feature set. The conversion process can be achieved by linear mapping or convolution operation. It should be noted that converting feature vectors into key features and value features corresponding to the attention operation is a conventional technical means in the art and will not be further introduced here.

[0086] In an exemplary embodiment, each output operation result in the output operation result set Pool(F(O))={F(O), blurl(F(O)), blur2(F(O)), blur3(F(O)), sharp1(F(O)), sharp2(F(O)), sharp3(F(O))} is subjected to feature conversion to obtain an output key feature set K(O)={K(F(O), K(blur1(F(O)), blur2(F(O)), blur3(F(O)), sharp1(F(O)), sharp2(F(O)), sharp3(F(O))} (O))), K(blur2(F(O))), K(blur3(F(O))), K(sharp1(F(O))), K(sharp2(F(O))), K(sharp3(F(O)))}, and the output value feature set V(O) = {V(F(O),V(blur1(F(O))), V(blur2(F(O))), V(blur3(F(O))), V(sharp 1(F(O))), V(sharp2(F(O))), V(sharp3(F(O)))}.

[0087] In step S430, the high-quality operation result set is subjected to feature conversion to determine a high-quality key feature set and a high-quality value feature set.

[0088] In the disclosed embodiment, each high-quality operation result in the high-quality operation result set is subjected to feature conversion to high-quality key features (Key) and high-quality value features (Value) corresponding to the attention operation. The high-quality key features and high-quality value features corresponding to each high-quality operation result are grouped together to form a high-quality key feature set and a high-quality value feature set. The conversion process can be achieved through linear mapping or convolution operations. It should be noted that converting feature vectors into key features and value features corresponding to the attention operation is a conventional technical means in the art and will not be further introduced here.

[0089] In an exemplary embodiment, each high-quality operation result in the high-quality operation result set Pool(F(H))={F(H), blur1(F(H)), blur2(F(H)), blur3(F(H)), sharp1(F(H)), sharp2(F(H)), sharp3(F(H))} is subjected to feature transformation to obtain a high-quality key feature set K(H)={K(F(H), K(blur1(F (H))), K(blur2(F(H))), K(blur3(F(H))), K(sharp1(F(H))), K(sharp2(F(H))), K(sharp3(F(H)))}, and the high-quality feature set V(H) = {V(F(H), V(blur1(F(H))), V(blur2(F(H))), V(blur3(F(H))), V(sharp 1(F(H))), V(sharp2(F(H))), V(sharp3(F(H)))}.

[0090] In step S440, an attention operation is performed on the output key feature set and the output value feature set through the content query feature to determine the output label value.

[0091] In the disclosed embodiment, the content query feature Q(S) is used to perform an attention operation on the output key feature set K(O) and the output value feature set v(O) to determine the output label value Label(O).

[0092] In an exemplary embodiment, the content query feature Q(S) is used to perform attention operations on the corresponding feature items in the output key feature set K(O) and the output value feature set v(O) to obtain the output attention feature set A(O). The corresponding feature items in the output key feature set K(O) and the output value feature set v(O) refer to the output key features and output value features obtained based on the same operation operator. For example, K(blur1(F(O))) and V(blur1(F(O))), K(sharp2(F(O))) and V(sharp2F(O))). Through the content query feature Q(S), each output key feature and output value feature is calculated according to the following formula to obtain the corresponding output attention feature items.

[0093]

[0094] Among them, Q is the query feature, K is the key feature, V is the value feature, and d k is the dimension of the feature vector.

[0095] Based on the above formula, the output attention feature items corresponding to each operation operator are calculated to form the output attention feature set A(O) = {A(F(O), A(blurl(F(O))), A(blur2(F(O))), A(blur3(F(O))), A(sharp l(F(O))), A(sharp2(F(O))), A(sharp3(F(O)))}.

[0096] According to each output attention feature item in the output attention feature set A(O), the output label value Label(O) is determined.

[0097] In an exemplary embodiment, each output attention feature item in the output attention feature set A(O) may be accumulated and calculated to obtain the output label value Label(O).

[0098] In an exemplary embodiment, each output attention feature item in the output attention feature set A(O) may be weighted averaged to obtain the output label value Label(O).

[0099] In step S450, an attention operation is performed on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value.

[0100] In the disclosed embodiment, the content query feature Q(S) is used to perform an attention operation on the high-quality key feature set K(H) and the high-quality value feature set v(H) to determine the high-quality label value Label(H).

[0101] In an exemplary embodiment, the content query feature Q(S) is used to perform attention operations on the corresponding feature items in the high-quality key feature set K(H) and the high-quality value feature set v(H) to obtain a high-quality attention feature set A(H). The corresponding feature items in the high-quality key feature set K(H) and the high-quality value feature set v(H) refer to high-quality key features and high-quality value features obtained by processing based on the same operation operator. For example, K(blur1(F(H))) and V(blur1(F(H))), K(sharp2(F(H))) and V(sharp2F(H))). Through the content query feature Q(S), each high-quality key feature and high-quality value feature is calculated according to the following formula to obtain the corresponding high-quality attention feature items.

[0102]

[0103] Among them, Q is the query feature, K is the key feature, v is the value feature, and d k is the dimension of the feature vector.

[0104] Based on the above formula, the high-quality attention feature items corresponding to each operation operator are calculated to form the high-quality attention feature set A(H) = {A(F(H), A(blurl(F(H))), A(blur2(F(H))), A(blur3(F(H))), A(sharp l(F(H))), A(sharp2(F(H))), A(sharp3(F(H)))}.

[0105] The high-quality label value Label(H) is determined according to each high-quality attention feature item in the high-quality attention feature set A(H).

[0106] In an exemplary embodiment, each high-quality attention feature item in the high-quality attention feature set A(H) may be accumulated and calculated to obtain the high-quality label value Label(H).

[0107] In an exemplary embodiment, each high-quality attention feature item in the high-quality attention feature set A(H) may be weighted averaged to obtain the high-quality label value Label(H).

[0108] The image enhancement model training method provided by the embodiment of the present disclosure converts the image content feature into a content query feature, and converts the output operation result set and the high-quality operation result set into corresponding output key feature sets and output value feature sets, high-quality key feature sets and high-quality value feature sets. Through the content query feature, the corresponding feature items in the output key feature set and the output value feature set are subjected to attention operation to obtain the output attention feature set. Through the content query feature, the corresponding feature items in the high-quality key feature set and the high-quality value feature set are subjected to attention operation to obtain the high-quality attention feature set. The output label value and the high-quality label value are obtained by performing statistical calculations on each feature item in the output attention feature set and the high-quality attention feature set. Through this method, the output operation result set and the high-quality operation result set can be subjected to attention operation with reference to the content query feature corresponding to the image content feature, so as to obtain more accurate output label values ​​and high-quality label values.

[0109] Figure 6 The figure is a flow chart of an image enhancement method according to an exemplary embodiment. Figure 6 The method provided in the embodiment can be executed by any electronic device, such as the above Figure 1 The terminal device in Figure 1 Servers in, or Figure 1 The terminal device and the server in the embodiment are jointly executed, but the present disclosure is not limited to this.

[0110] In step S610, an image to be processed is obtained.

[0111] In the embodiment of the present disclosure, an image enhancement request of a user is obtained. The image enhancement request at least includes: an image to be processed. The image to be processed is an input image to be subjected to image enhancement processing.

[0112] In step S620, the image to be processed is input into an image enhancement model; the image enhancement model is obtained by training using any of the aforementioned image enhancement model training methods.

[0113] In step S630, the image enhancement model performs image enhancement processing on the image to be processed to obtain a target image.

[0114] In the disclosed embodiment, the image to be processed in the image enhancement request is input into the image enhancement model trained by any of the aforementioned image enhancement model training methods. The image enhancement model can perform image enhancement processing on the image to be processed based on the model parameters adjusted in the aforementioned training process. Since the robustness and adaptability of the model are enhanced during the training process, the image outputted by the image can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0115] The image enhancement model training method provided by the embodiment of the present disclosure introduces an operation operator pool including multiple operation operators during the training process, and performs operation processing of different operation algorithms on the output image features and the high-quality image features, thereby obtaining an output operation result set and a high-quality operation result set including different operation results. The image enhancement model is trained to obtain a target image enhancement model by using a loss function generated by comparing the output operation result set with the high-quality operation result set. By introducing different operation operators to compare the output image and the high-quality image after the operation to train the image enhancement model, the robustness and adaptability of the model are enhanced, so that the image output by the model can still ensure that the high-quality signal has good stability in complex and changeable image processing tasks.

[0116] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0117] Figure 7 is a block diagram of an image enhancement model training device according to an exemplary embodiment. Figure 7 The device 700 may include: a sample acquisition module 710, an image enhancement module 720, a feature extraction module 730, an image operation module 740, an attention operation module 750, a loss function module 760 and a model training module 770.

[0118] The sample acquisition module 710 is configured to acquire a training data set including a plurality of image training samples; the image training samples include input images and high-quality images in a corresponding relationship.

[0119] The image enhancement module 720 is configured to perform image enhancement processing on the input image through the image enhancement model to be trained to obtain an output image.

[0120] The feature extraction module 730 is configured to perform feature extraction on the output image and the high-quality image to obtain output image features and high-quality image features.

[0121] The image operation module 740 is configured to respectively operate the output image features and the high-quality image features through the operation operators in the operation operator pool to obtain an output operation result set and a high-quality operation result set.

[0122] The attention operation module 750 is configured to perform attention operations on the output operation result set and the high-quality operation result set respectively to determine the output label value and the high-quality label value.

[0123] The loss function module 760 is configured to generate a loss function according to the output label value and the high-quality label value.

[0124] The model training module 770 is configured to train the image enhancement model to be trained according to the loss function to obtain a target image enhancement model.

[0125] In some exemplary embodiments of the present disclosure, the operation operator pool includes a plurality of the operation operators; the output operation result set includes a plurality of output operation results; the output operation results respectively correspond to the operation operators; the high-quality operation result set includes a plurality of high-quality operation results; the high-quality operation results respectively correspond to the operation operators.

[0126] In some exemplary embodiments of the present disclosure, the operation operator pool includes at least: a blur operation operator group and a sharpening operation operator group; the blur operation operator group includes: at least one blur operation operator; the sharpening operation operator group includes: at least one sharpening operation operator.

[0127] In some exemplary embodiments of the present disclosure, the image content module is configured to obtain image content information based on the high-quality image; perform feature extraction on the image content information to obtain image content features; the attention operation module 750 is also configured to perform attention operations on the output operation result set and the high-quality operation result set, respectively, based on the image content features, to determine the output label value and the high-quality label value.

[0128] In some exemplary embodiments of the present disclosure, the image content module is further configured to extract content features of the high-quality image through a contrastive language-image pre-training model (Contrastive Language-Image Pre-Training, CLIP) to obtain the image content information.

[0129] In some exemplary embodiments of the present disclosure, the attention operation module 750 is further configured to perform a self-attention operation on the image content features to determine a content query feature; perform a feature conversion on the output operation result set to determine an output key feature set and an output value feature set; perform a feature conversion on the high-quality operation result set to determine a high-quality key feature set and a high-quality value feature set; perform an attention operation on the output key feature set and the output value feature set through the content query feature to determine the output label value; perform an attention operation on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value.

[0130] In some exemplary embodiments of the present disclosure, the attention operation module 750 is further configured to perform an attention operation on the output key feature set and the output value feature set through the content query feature to determine the output label value, including: performing an attention operation on corresponding feature items in the output key feature set and the output value feature set through the content query feature to obtain an output attention feature set; determining the output label value according to each feature item in the output attention feature set; performing an attention operation on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value, including: performing an attention operation on corresponding feature items in the high-quality key feature set and the high-quality value feature set through the content query feature to obtain a high-quality attention feature set; determining the high-quality label value according to each feature item in the high-quality attention feature set.

[0131] In some exemplary embodiments of the present disclosure, the loss function module 760 is further configured to perform label discrimination on the output label value and the high-quality label value through a discriminator to determine the loss function.

[0132] In some exemplary embodiments of the present disclosure, the loss function module 760 is further configured to correspond the high-quality label value to the first label category and the output label value to the second label category; and determine the loss function based on calculating the cross entropy loss.

[0133] Figure 8 is a block diagram of an image enhancement device according to an exemplary embodiment. Figure 8The device 800 may include: an image acquisition module 810, an image input module 820 and an image processing module 830.

[0134] The image acquisition module 810 is configured to acquire an image to be processed.

[0135] The image input module 820 is configured to input the image to be processed into an image enhancement model; the image enhancement model is obtained by training through any one of the image enhancement model training methods described above.

[0136] The image processing module 830 is configured to perform image enhancement processing on the image to be processed using the image enhancement model to obtain a target image.

[0137] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0138] Refer to the following Fig. 9 hereinafter describes an electronic device 900 according to such an embodiment of the present disclosure. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0139] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.

[0140] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 910 can perform the following steps: Figure 2 The steps shown.

[0141] For example, electronic devices can achieve Figure 2 or Figure 6 The steps shown.

[0142] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 921 and / or a cache memory unit 922 , and may further include a read-only memory unit (ROM) 923 .

[0143] The storage unit 920 may also include a program / utility 924 having a set (at least one) of program modules 925, such program modules 925 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.

[0144] Bus 930 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.

[0145] The electronic device 900 may also communicate with one or more external devices 970 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0146] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0147] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of the device to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0148] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in the above embodiment is implemented.

[0149] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0150] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for training an image enhancement model, characterized in that: include: Obtaining a training data set including a plurality of image training samples; The image training samples include an input image and a high-quality image in a corresponding relationship; Performing image enhancement processing on the input image by using the image enhancement model to be trained to obtain an output image; Extracting features from the output image and the high-quality image to obtain output image features and high-quality image features; By using the operation operators in the operation operator pool, the output image features and the high-quality image features are respectively operated and processed to obtain an output operation result set and a high-quality operation result set; Performing attention operations on the output operation result set and the high-quality operation result set respectively to determine an output label value and a high-quality label value; Generate a loss function according to the output label value and the high-quality label value; According to the loss function, the image enhancement model to be trained is trained to obtain a target image enhancement model.

2. The method according to claim 1, characterized in that The operation operator pool includes a plurality of the operation operators; The output operation result set includes a plurality of output operation results; the output operation results correspond to the operation operators respectively; The high-quality operation result set includes multiple high-quality operation results; the high-quality operation results correspond to the operation operators respectively.

3. The method according to claim 2, characterized in that The operation operator pool at least includes: a blur operation operator group and a sharpening operation operator group; The fuzzy operation operator group includes: at least one fuzzy operation operator; The sharpening operation operator group includes: at least one sharpening operation operator.

4. The method according to claim 1, characterized in that The method further comprises: Acquiring image content information according to the high-quality image; Extracting features from the image content information to obtain image content features; The performing attention operations on the output operation result set and the high-quality operation result set respectively to determine the output label value and the high-quality label value includes: According to the image content features, attention operations are performed on the output operation result set and the high-quality operation result set respectively to determine the output label value and the high-quality label value.

5. The method according to claim 4, characterized in that The step of obtaining image content information according to the high-quality image includes: The content features of the high-quality image are extracted by a contrastive language-image pre-training model (CLIP) to obtain the image content information.

6. The method according to claim 4, characterized in that The performing attention operations on the output operation result set and the high-quality operation result set respectively according to the image content feature to determine the output label value and the high-quality label value includes: Performing a self-attention operation on the image content features to determine content query features; Performing feature conversion on the output operation result set to determine an output key feature set and an output value feature set; Performing feature conversion on the high-quality operation result set to determine a high-quality key feature set and a high-quality value feature set; By using the content query feature, performing an attention operation on the output key feature set and the output value feature set to determine the output label value; By using the content query feature, an attention operation is performed on the high-quality key feature set and the high-quality value feature set to determine the high-quality label value.

7. The method according to claim 6, characterized in that The performing an attention operation on the output key feature set and the output value feature set through the content query feature to determine the output label value includes: By using the content query feature, performing an attention operation on corresponding feature items in the output key feature set and the output value feature set to obtain an output attention feature set; Determining the output label value according to each feature item in the output attention feature set; The performing an attention operation on the high-quality key feature set and the high-quality value feature set through the content query feature to determine the high-quality label value includes: By using the content query feature, performing an attention operation on corresponding feature items in the high-quality key feature set and the high-quality value feature set to obtain a high-quality attention feature set; The high-quality label value is determined according to each feature item in the high-quality attention feature set.

8. The method according to claim 1, characterized in that The generating a loss function according to the output label value and the high-quality label value includes: The output label value and the high-quality label value are subjected to label discrimination by a discriminator to determine the loss function.

9. The method according to claim 1, characterized in that: The generating a loss function according to the output label value and the high-quality label value includes: The high-quality label value corresponds to a first label category, and the output label value corresponds to a second label category; The loss function is determined based on calculating the cross entropy loss.

10. An image enhancement method, characterized in that: include: Get the image to be processed; Inputting the image to be processed into an image enhancement model; The image enhancement model is obtained by training through the image enhancement model training method according to any one of claims 1 to 9; The image enhancement model performs image enhancement processing on the image to be processed to obtain a target image.

11. An image enhancement model training device, characterized in that: include: A sample acquisition module is configured to acquire a training data set including a plurality of image training samples; The image training samples include an input image and a high-quality image in a corresponding relationship; An image enhancement module is configured to perform image enhancement processing on the input image through the image enhancement model to be trained to obtain an output image; a feature extraction module, configured to extract features from the output image and the high-quality image to obtain output image features and high-quality image features; An image operation module is configured to respectively operate the output image features and the high-quality image features through the operation operators in the operation operator pool to obtain an output operation result set and a high-quality operation result set; an attention operation module, configured to perform attention operations on the output operation result set and the high-quality operation result set respectively, to determine an output label value and a high-quality label value; A loss function module, configured to generate a loss function according to the output label value and the high-quality label value; The model training module is configured to train the image enhancement model to be trained according to the loss function to obtain a target image enhancement model.

12. An image enhancement device, characterized in that: include: An image acquisition module is configured to acquire an image to be processed; An image input module, configured to input the image to be processed into an image enhancement model; The image enhancement model is obtained by training through the image enhancement model training method according to any one of claims 1 to 9; The image processing module is configured to perform image enhancement processing on the image to be processed by the image enhancement model to obtain a target image.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the executable instructions to implement the image enhancement model training method as described in any one of claims 1 to 9 or the image enhancement method as described in claim 10.

14. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the image enhancement model training method as described in any one of claims 1 to 9 or the image enhancement method as described in claim 10.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the image enhancement model training method as described in any one of claims 1 to 9 or the image enhancement method as described in claim 10.