Image processing method and deep learning model training method

By combining visual, semantic and spatial features, the super-resolution reconstruction method solves the problem of reduced recognition accuracy of deep learning models in low-quality text image processing, achieves efficient text image enhancement, and improves the clarity and readability of images. sex.

CN118628353APending Publication Date: 2024-09-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410907645.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The recognition accuracy of existing deep learning models decreases when processing low-quality text images, and early text image enhancement methods ignore text sequence features, resulting in unsatisfactory reconstruction results and often leading to over-smoothing or artifacts in the reconstructed images.

Method used

By combining visual prior features, semantic prior features and spatial transformation features, pre-trained visual coding network and semantic coding network are used for super-resolution reconstruction, the backbone network is used for image enhancement, and perceptual loss and semantic alignment loss are combined for deep learning. Model training.

Benefits of technology

It improves the reconstruction effect of low-resolution text images, enhances the accuracy and clarity of text content in images, improves text readability, and avoids the problems of over-smoothing and artifacts in reconstructed images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628353A
    Figure CN118628353A
Patent Text Reader

Abstract

The invention provides an image processing method, and relates to the technical field of artificial intelligence, in particular to the technical field of computer vision, deep learning and large models. According to the specific implementation scheme, the method comprises the steps of processing a first image based on style features of a reference image to obtain visual priori features of the first image; processing the first image based on the text recognition feature of the first image to obtain a semantic prior feature of the first image; and based on the visual priori features, the semantic priori features and the spatial transformation features of the first image, super-resolution reconstruction is carried out on the first image to obtain a second image, and the resolution of the second image is greater than that of the first image. The invention further provides a deep learning model training method and device, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of computer vision, deep learning, and large model technology. More specifically, the present disclosure provides an image processing method, a training method for a deep learning model, an apparatus, an electronic device, a storage medium, and a computer program product. Background Art

[0002] With the development of artificial intelligence technology, text recognition methods based on deep learning models have made continuous breakthroughs at the algorithm level. Especially when processing clear text images, the recognition accuracy has been continuously improved.

[0003] However, when processing low-quality text images, existing recognition models often suffer from inaccurate focusing problems. The errors caused by accumulated errors lead to a significant decrease in recognition accuracy, limiting the actual experience of the model in various scenarios. Summary of the invention

[0004] The present disclosure provides an image processing method, a training method for a deep learning model, an apparatus, an electronic device, a storage medium, and a computer program product.

[0005] According to a first aspect, an image processing method is provided, the method comprising: processing a first image based on style features of a reference image to obtain visual prior features of the first image; processing the first image based on text recognition features of the first image to obtain semantic prior features of the first image; and performing super-resolution reconstruction on the first image based on the visual prior features, the semantic prior features and the spatial transformation features of the first image to obtain a second image, wherein the resolution of the second image is greater than that of the first image.

[0006] According to the second aspect, a training method for a deep learning model is provided, the method comprising: using a semantic coding network to process a sample image based on text recognition features of the sample image to obtain semantic prior features; using a spatial transformation network to spatially transform the sample image to obtain spatial transformation features; using a backbone network to super-resolution reconstruct the sample image based on the semantic prior features, the spatial transformation features, and the visual prior features of the sample image to obtain an output image, wherein the visual prior features are obtained by processing the sample image using a pre-trained visual coding network; based on the output image, determining the loss of the deep learning model; and adjusting the parameters of the deep learning model according to the loss.

[0007] According to a third aspect, an image processing device is provided, which includes: a first visual prior feature determination module, which is used to process the first image based on the style features of a reference image to obtain the visual prior features of the first image; a first semantic prior feature determination module, which is used to process the first image based on the text recognition features of the first image to obtain the semantic prior features of the first image; and a first reconstruction module, which is used to perform super-resolution reconstruction on the first image based on the visual prior features, the semantic prior features and the spatial transformation features of the first image to obtain a second image, wherein the resolution of the second image is greater than that of the first image.

[0008] According to a fourth aspect, a training device for a deep learning model is provided, which includes: a second semantic prior feature determination module, which is used to use a semantic coding network to process a sample image based on a text recognition feature of the sample image to obtain a semantic prior feature; a spatial transformation module, which is used to use a spatial transformation network to spatially transform the sample image to obtain a spatial transformation feature; a second reconstruction module, which is used to use a backbone network to perform super-resolution reconstruction on the sample image based on the semantic prior feature, the spatial transformation feature, and the visual prior feature of the sample image to obtain an output image, wherein the visual prior feature is obtained by processing the sample image using a pre-trained visual coding network; a loss determination module, which is used to determine the loss of the deep learning model based on the output image; and an adjustment module, which is used to adjust the parameters of the deep learning model according to the loss.

[0009] According to a fifth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.

[0010] According to a sixth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0011] According to a seventh aspect, a computer program product is provided, comprising a computer program, wherein the computer program is stored on at least one of a readable storage medium and an electronic device, and wherein the computer program implements the method provided according to the present disclosure when executed by a processor.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0014] Figure 1 is a schematic diagram of an exemplary system architecture to which an image processing method and a training method for a deep learning model can be applied according to an embodiment of the present disclosure;

[0015] Figure 2 is a flowchart of an image processing method according to an embodiment of the present disclosure;

[0016] Figure 3 is a schematic diagram of an image processing method according to an embodiment of the present disclosure;

[0017] Figure 4 is a flowchart of a method for training a deep learning model according to an embodiment of the present disclosure;

[0018] Figure 5 is a schematic diagram of a training method for a deep learning model according to an embodiment of the present disclosure;

[0019] Fig. 6A is a schematic diagram of processing effects on images of different difficulty levels according to an embodiment of the present disclosure;

[0020] Figure 6B is a comparison chart of the processing effects of the image processing method provided by the embodiment of the present disclosure and the image processing method of the related art on the same image;

[0021] Figure 7 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure;

[0022] Figure 8 is a block diagram of a training apparatus for a deep learning model according to an embodiment of the present disclosure;

[0023] Fig. 9 It is a block diagram of an electronic device according to at least one of an image processing method and a deep learning model training method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] In real-life scenarios, a large number of low-resolution text images are inevitably generated due to limitations in shooting equipment, changes in ambient light, and distortion during image transmission. By enhancing low-resolution text images and improving their resolution, images can be made clearer and text readability can be improved, which can bring significant value to many fields.

[0026] For example, processing casual paper documents and improving the resolution of scanned or photographed document images can make the text clearer and more accurate. For low-quality document images such as ancient books, text image enhancement technology can improve the quality of text line images and enhance the readability of text. In the field of public security, text image enhancement technology can be used to improve the clarity of text in the picture, such as license plate numbers, house numbers, etc., which helps to improve recognition accuracy. In general, image enhancement technology that improves the resolution of text images plays an important role in many fields that need to process text images.

[0027] Early text image enhancement methods borrowed ideas from the research of general image super-resolution and directly applied the classic general image super-resolution method to process low-resolution text images. For example, given a low-resolution image, the target output resolution size is obtained by interpolation, and then a convolutional neural network is used to learn the high-resolution image mapping of the target output. However, this type of method ignores the text sequence features, and the reconstruction effect is often not ideal.

[0028] In recent years, the research on text image enhancement technology has begun to try to use text features as clues to guide the super-resolution reconstruction of text images. For example, a pre-trained text recognition model is introduced to supervise whether the text content is correctly reconstructed and provide feedback for the learning of the backbone network. Although such methods have achieved better performance in reconstruction quality and improving downstream recognition accuracy, most of them only use the feedback of the recognizer as a clue to guide super-resolution, while ignoring other useful prior information. In addition, since the recognition model often has incorrect feedback, such methods will lead to incorrect reconstruction results. In addition, such methods usually only use pixel-level loss functions to learn missing details, which often leads to over-smoothing or artifacts in the reconstructed image, and it is difficult to reconstruct the correct text content.

[0029] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0030] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0031] Figure 1is a schematic diagram of an exemplary system architecture to which an image processing method and apparatus can be applied according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0032] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0033] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices, including but not limited to smart phones, tablet computers, laptops, etc.

[0034] The image processing method provided in the embodiment of the present disclosure can generally be executed by the terminal devices 101, 102, and 103. Accordingly, the image processing apparatus provided in the embodiment of the present disclosure can generally be set in the terminal devices 101, 102, and 103.

[0035] The training method of the deep learning model provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the training device of the deep learning model provided in the embodiment of the present disclosure can generally be set in the server 105.

[0036] Figure 2 is a flowchart of an image processing method according to an embodiment of the present disclosure.

[0037] like Figure 2 As shown, the image processing method 200 includes operations S210 to S230.

[0038] In operation S210, the first image is processed based on the style feature of the reference image to obtain a visual priori feature of the first image.

[0039] The reference image may be a pre-acquired image, and the reference image may include a text image or a common texture image. The style feature of the reference image may be a texture feature rich in edge information. For example, the style feature map of the reference image may be obtained by extracting features from the reference image.

[0040] The first image may be a low-resolution text image, and the low resolution may mean that the text in the first image is unclear or fuzzy.

[0041] The style features of the reference image can form a priori style feature library. For a low-resolution first image, the priori style feature library can provide rich texture information for the first image. By processing the first image using the priori style feature library, visual prior features of the first image can be obtained.

[0042] In operation S220, the first image is processed based on the text recognition feature of the first image to obtain a semantic priori feature of the first image.

[0043] The first image contains text content, and text recognition can be performed on the first image to obtain text recognition features. For example, a text recognition model is used to perform text recognition on the first image to obtain a text probability sequence of a character sequence in the first image. A text recognition model based on an attention mechanism can also be used to perform text recognition on the first image to obtain a text probability sequence and a weight sequence of a character sequence in the first image. The text recognition features may include the above-mentioned text probability sequence and weight sequence.

[0044] The weight sequence corresponds to the character sequence, and each weight in the weight sequence represents the degree of attention paid to the character at the corresponding position in the image. The weight sequence can be weighted with the original image, and the obtained weighted feature contains the prior information of the recognized text, which can be used as the semantic prior feature of the first image.

[0045] In operation S230, super-resolution reconstruction is performed on the first image based on the visual prior features, the semantic prior features, and the spatial transformation features of the first image to obtain a second image.

[0046] The spatial transformation feature may be obtained by performing spatial transformation on the first image. For example, the text in the first image may be tilted or distorted. By performing spatial transformation processing such as translation, scaling, and rotation on the first image, the text in the first image may be corrected, for example, the tilted or distorted text may be corrected to a horizontal direction.

[0047] The first image can be super-resolved and reconstructed with the above-mentioned visual prior features, semantic prior features, and spatial transformation features as guidance to obtain a second image. The resolution of the second image is greater than that of the first image. For example, compared with the text in the first image, the text in the second image is clearer and easier to read.

[0048] The embodiments of the present disclosure obtain visual prior features of a first image by utilizing style features of a reference image, obtain semantic prior features of the first image based on text recognition features in the first image, and perform super-resolution reconstruction on the first image based on the visual prior features, semantic prior features, and spatial transformation features to obtain a high-resolution second image, which can improve the accuracy of reconstructing the text content of the image, improve the clarity of the text in the image, and enhance the readability of the text.

[0049] It should be noted that the embodiments of the present disclosure can be used as a pre-module in document parsing to pre-process the detected text line frame to obtain an enhanced text line image. It can also be used as a separate module product to input a low-quality and blurred text image and return a clear enhanced text image for use by users in need.

[0050] Figure 3 is a schematic diagram of an image processing method according to an embodiment of the present disclosure.

[0051] like Figure 3 As shown, this embodiment includes a visual encoding network 310, a spatial transformation network 320, a semantic encoding network 330 and a backbone network 340.

[0052] The first image 301 may be a low-resolution text image, and the characters in the first image 301 are unclear, fuzzy, and difficult to distinguish.

[0053] The first image 301 is respectively input into the visual coding network 310, the spatial transformation network 320, and the semantic coding network 330 to obtain visual prior features, spatial transformation features, and semantic prior features. The visual prior features, spatial transformation features, and semantic prior features are input into the backbone network 340, and the backbone network 340 performs super-resolution reconstruction on the first image 301 based on the guidance of the visual prior features, spatial transformation features, and semantic prior features to obtain the second image 302.

[0054] The following is a detailed description of each network.

[0055] According to an embodiment of the present disclosure, a pre-trained visual coding network 310 is used to process the first image 301 to obtain visual prior features, wherein the pre-trained visual coding network 310 is trained by reconstructing style features of a reference image.

[0056] For example, the first image 301 is input into the visual coding network 310, and the visual coding network 310 outputs the visual prior features. The visual coding network 310 may be pre-trained using a reference image. Specifically, the training may be performed by reconstructing the style features of the reference image.

[0057] In one example, a large-scale pre-training method can be used to adopt a self-supervised pre-training method of mask image modeling. After masking an area on a reference image, the model reconstructs and outputs the pixel content of the part. The pre-trained visual encoding network 310 can learn a large number of style feature maps rich in edge information, so as to have the ability to reconstruct style features. In terms of function, the pre-trained visual encoding network 310 can be regarded as a priori style feature library.

[0058] The first image 301 is input to the pre-trained visual coding network 310 , and the visual coding network 310 reconstructs the style features of the first image 301 to obtain a style feature map of the first image 301 , which can be used as visual prior information of the first image 301 .

[0059] Although the resolution of the first image 301 is low, the pre-trained visual coding network 310 can provide more information. Therefore, by processing the first image 301 through the visual coding network 310, a visual prior feature rich in edge information can be obtained.

[0060] The "prior" of this embodiment is relative to the situation where a randomly initialized network learns style features while training. Compared with the situation where a randomly initialized network learns while training, the pre-trained visual encoding network 310 of this embodiment can directly obtain rich and accurate prior information of the first image 301 without the need for labeled data.

[0061] According to an embodiment of the present disclosure, text recognition is performed on a first image to obtain a weight sequence corresponding to a character sequence in the first image; and the weight sequence and the first image are cross-attentived to obtain semantic prior features. Obtaining the weight sequence includes performing text recognition on the first image, outputting the text probability and attention weight of each character in the character sequence in sequence at multiple moments; and determining the weight sequence based on the attention weights of each character output at multiple moments.

[0062] The semantic coding network 330 may include a text recognition subnetwork and a semantic coding subnetwork. The first image 301 is input into the semantic coding network 330 , and the text recognition subnetwork in the semantic coding network 330 performs text recognition on the first image 301 to obtain a text probability sequence of the character sequence in the first image 301 .

[0063] In one example, the text recognition subnetwork can be a text recognition model based on an attention mechanism, which locates a character at each time step and outputs a text probability of a character and an attention weight of the character at each time step. The attention weights output by the text recognition model at each time step constitute a weight sequence corresponding to the character sequence. Each weight in the weight sequence represents the degree of attention to the character at the corresponding position in the image at the current time step.

[0064] The weight sequence and the first image 301 may be cross-attention processed to obtain weighted features of each time step. The weighted features contain prior information for text recognition and may be used as semantic prior features.

[0065] According to an embodiment of the present disclosure, the first image 301 is input into the spatial transformation network 320, and the spatial transformation network 320 performs spatial transformation processing such as translation, scaling, and rotation on the first image 301, and can correct the image direction in the first image 301. For example, the tilted and distorted text can be corrected to the horizontal direction.

[0066] According to an embodiment of the present disclosure, a splicing feature is obtained based on visual prior features, semantic prior features and spatial transformation features; attention processing is performed on the splicing feature to obtain an attention weighted feature; and the attention weighted feature is upsampled to obtain a second image.

[0067] The backbone network 340 may include a dimension transformation subnetwork, a feature fusion subnetwork, a channel attention subnetwork, and an upsampling processing layer. The dimension transformation subnetwork may be a convolutional network, which is used to convert visual prior features, semantic prior features, and spatial transformation features into a unified dimension (for example, all converted to 128 dimensions). The feature fusion subnetwork splices the visual prior features, semantic prior features, and spatial transformation features of the unified dimension to obtain a spliced ​​feature. For example, the spliced ​​feature is 384 dimensions. For the spliced ​​feature, the channel attention subnetwork may be used to determine the attention weights of the features of each dimension (i.e., channel), and the features of each dimension may be weighted according to the attention weights of each dimension of the spliced ​​feature to obtain a weighted feature. The weighted feature is subjected to an upsampling processing layer to obtain a second image 302. The resolution of the second image 302 is greater than that of the first image 301, and the size of the second image 302 is generally greater than that of the first image 301.

[0068] The above-mentioned upsampling processing layer can reconstruct the first image 301 and improve the resolution of the first image 301. The resolution of the first image 301 is relatively low, and the image content of the second image 302 obtained after the resolution is improved is clearer, and the image size is generally increased. For example, the size of the second image 302 can be two times, three times, etc., of the first image 301. Thus, the user can view the text content in the image more clearly.

[0069] The embodiments of the present disclosure utilize visual prior information and semantic prior information as guidance to perform super-resolution reconstruction, which can improve the reconstruction effect of low-resolution images, improve the reconstruction accuracy of text content in the image, obtain clearer images, and facilitate more accurate text recognition.

[0070] According to an embodiment of the present disclosure, the present disclosure also provides a training method for a deep learning model.

[0071] Figure 4 It is a flowchart of a method for training a deep learning model according to an embodiment of the present disclosure.

[0072] like Figure 4 As shown, the training method 400 of the deep learning model includes operations S410~S450.

[0073] In operation S410, a semantic encoding network is used to process the sample image based on the text recognition feature of the sample image to obtain a semantic prior feature.

[0074] The sample image may be a low-resolution text image. The semantic encoding network may perform text recognition on the sample image to obtain text recognition features. The text recognition features may include a text probability sequence and a weight sequence of a character sequence in the sample image. The sample image is processed according to the text recognition features, for example, the weight sequence and the sample image are cross-attended, and the obtained attention weighted features contain prior information for text recognition and can be used as semantic prior features.

[0075] In operation S420, a spatial transformation network is used to perform spatial transformation on the sample image to obtain spatial transformation features.

[0076] The sample image is translated, scaled, and rotated using a spatial transformation network to obtain a spatial transformation feature. The purpose of spatial transformation of the sample image is to align the text in the sample image with the text in the label image. The label image can be a high-resolution image of the sample image.

[0077] For example, the text direction in the label image is horizontal. During the training process, the spatial transformation network continuously learns the spatial transformation network until a set of optimal spatial transformation parameters are obtained at the end of the training. The text in the sample image can also be converted to a horizontal direction and aligned with the text in the label image.

[0078] In operation S430, a backbone network is used to perform super-resolution reconstruction on the sample image based on semantic prior features, spatial transformation features, and visual prior features to obtain an output image.

[0079] The visual prior features may be obtained by processing the sample image using a pre-trained visual coding network. The pre-trained visual coding network may be trained by reconstructing the style features of the reference image. This training method may enable the pre-trained visual coding network to learn a large number of style features rich in edge information, thereby having the ability to reconstruct style features.

[0080] By inputting the sample image into the pre-trained visual encoding network, the style features of the sample image can be obtained as visual prior features.

[0081] The backbone network can perform super-resolution reconstruction on the sample image to obtain the output image under the guidance of visual prior features, semantic prior features and spatial transformation features.

[0082] In operation S440, based on the output image, a loss of the deep learning model is determined.

[0083] In operation S450, parameters of the deep learning model are adjusted according to the loss.

[0084] For example, the label image of the sample image can be used as supervision, and the loss of the deep learning model can be determined based on the difference between the output image and the label image. According to the loss, the parameters of the deep learning model can be adjusted.

[0085] In one example, the deep learning model of this embodiment may include a semantic encoding network, a spatial transformation network, and a backbone network. According to the above-mentioned loss, the respective parameters of the semantic encoding network, the spatial transformation network, and the backbone network may be adjusted.

[0086] In another example, the deep learning model of this embodiment may include a pre-trained visual coding network, a semantic coding network, a spatial transformation network, and a backbone network. According to the above loss, only the parameters of the semantic coding network, the spatial transformation network, and the backbone network can be adjusted, and the pre-trained visual coding network does not participate in the training.

[0087] The deep learning model of the embodiment of the present disclosure performs super-resolution reconstruction on sample images under the guidance of visual prior features and semantic prior features. The trained deep learning model can improve the accuracy of reconstructing text content in images.

[0088] Figure 5 It is a schematic diagram of a training method for a deep learning model according to an embodiment of the present disclosure.

[0089] like Figure 5 As shown, a sample image 501 is input into a deep learning model 502 to obtain an output image 503. The sample image 501 has a label image 504, which is a high-resolution image of the sample image 501. The loss of the deep learning model 502 training includes three parts, namely, a basic loss 505, a perceptual loss 506, and a semantic alignment loss 507.

[0090] According to an embodiment of the present disclosure, determining the loss of a deep learning model includes: determining a basic loss based on a pixel difference between an output image and a label image of a sample image; determining a perceptual loss based on an image feature difference between the output image and the label image; determining a semantic alignment loss based on a text feature difference between the output image and the label image; and determining an overall loss based on the basic loss, the perceptual loss, and the semantic alignment loss.

[0091] For example, the mean square error loss between pixels may be calculated for the output image 503 and the label image 504 as the basic loss 505 .

[0092] Since the deep learning model 502 performs super-resolution reconstruction guided by visual prior features and semantic prior features, the visual feature differences and text feature differences between the output image 503 and the label image 504 can also be determined as perceptual loss and semantic alignment loss, respectively, to supervise the training of the deep learning model 502.

[0093] According to an embodiment of the present disclosure, the output image 503 and the label image 504 are respectively input into a pre-trained image feature extraction network to obtain the image features of the output image 503 and the label image 504 respectively; and the perceptual loss is determined based on the difference between the image features of the output image 503 and the image features of the label image 504.

[0094] For example, the pre-trained image feature extraction network may be a general image feature extraction network, which performs feature extraction on the output image 503 and the label image 504, respectively, to obtain image features of the output image 503 and image features of the label image 504. The image features of the output image 503 and the image features of the label image 504 may be used as inputs of the loss function, and the Euclidean distance or Manhattan distance between them may be calculated as the perceptual loss. The goal of the perceptual loss may be to minimize the distance between the output image and the label image in the feature space.

[0095] According to an embodiment of the present disclosure, the output image and the label image are respectively input into a pre-trained text recognition network to obtain the text recognition probabilities of the output image and the label image respectively; and the semantic alignment loss is determined based on the difference between the text recognition probabilities of the output image and the label image.

[0096] For example, a pre-trained text recognition network can perform text recognition on an image to obtain a text probability sequence of a character sequence in the image. The output image 503 and the label image 504 are respectively input into the pre-trained text recognition network to obtain the text recognition probability of the character sequence in the output image 503 and the text recognition probability of the character sequence in the label image 504. The error between the two text probability sequences can be calculated as the semantic alignment loss. By minimizing the two text probability sequences, the alignment of the text content of the output image and the text content of the label image is achieved.

[0097] Compared to the related art that only uses pixel-level loss functions to supervise training, which results in over-smoothing of the reconstructed image or the appearance of artifacts, the embodiment of the present disclosure also uses perceptual loss and semantic alignment loss as supervision to train the deep learning model 502, which can improve the accuracy of the text content in the image reconstructed by the deep learning model.

[0098] According to an embodiment of the present disclosure, the parameters of the semantic encoding network, the spatial transformation network and the backbone network are adjusted according to the overall loss.

[0099] The overall loss includes the above basic loss 505, perceptual loss 506 and semantic alignment loss 507.

[0100] In one example, the deep learning model 502 of this embodiment may include a semantic encoding network, a spatial transformation network, and a backbone network. According to the above-mentioned overall loss, the parameters of the semantic encoding network, the spatial transformation network, and the backbone network may be adjusted.

[0101] In another example, the deep learning model 502 of this embodiment may include a pre-trained visual coding network, a semantic coding network, a spatial transformation network, and a backbone network. According to the above overall loss, only the parameters of the semantic coding network, the spatial transformation network, and the backbone network may be adjusted, and the pre-trained visual coding network does not participate in the training.

[0102] According to an embodiment of the present disclosure, a sample image is input into a pre-trained visual coding network to obtain visual prior features, wherein the visual coding network is trained by reconstructing style features of a reference image.

[0103] The pre-trained visual coding network can be pre-trained by using a self-supervised pre-training method of mask image modeling. This has been explained in detail above and will not be repeated here. The pre-trained visual coding network does not participate in the training process of the deep learning model.

[0104] According to an embodiment of the present disclosure, the semantic coding network includes a text recognition subnetwork and a semantic coding subnetwork; obtaining semantic prior features includes: using the text recognition subnetwork to perform text recognition on a sample image to obtain a weight sequence corresponding to a character sequence in the sample image; and using the semantic coding subnetwork to perform cross-attention processing on the weight sequence and the sample image to obtain semantic prior features. Obtaining the weight sequence includes performing text recognition on the sample image, outputting the text probability and attention weight of each character in the character sequence in sequence at multiple moments; and determining the weight sequence based on the attention weights of each character output at multiple moments.

[0105] The specific implementation method of using the semantic coding network to obtain the semantic prior features of the sample image is similar to the implementation method of using the semantic coding network to obtain the semantic prior features of the first image in the above text, and will not be repeated here.

[0106] According to an embodiment of the present disclosure, a splicing feature is obtained based on visual prior features, semantic prior features and spatial transformation features; attention processing is performed on the splicing feature to obtain an attention weighted feature; and the attention weighted feature is upsampled to obtain an output image.

[0107] The specific implementation method of using the backbone network to obtain the output image is similar to the implementation method of using the backbone network to obtain the second image in the above text, and will not be repeated here.

[0108] In order to more clearly illustrate the technical effects achieved by the image processing method provided by the embodiments of the present disclosure, the embodiments of the present disclosure provide effect display diagrams in multiple dimensions.

[0109] Fig. 6A It is a schematic diagram of processing effects on images of different difficulty levels according to an embodiment of the present disclosure.

[0110] like Fig. 6A As shown, the image processing method provided by the embodiment of the present disclosure performs super-resolution processing on simple images, medium-difficulty images, and difficult images respectively. The recognition difficulty of text content in simple images, medium-difficulty images, and difficult images increases in sequence.

[0111] Example 610 is a processing effect for a simple image, Example 620 is a processing effect for a medium-difficulty image, and Example 630 is a processing effect for a difficult image. In each example, the images in the upper row are low-resolution images, and the images in the lower row are high-resolution images obtained by super-resolution reconstruction using the image processing method provided by the embodiment of the present disclosure.

[0112] like Fig. 6A As shown, no matter it is a simple image, an image of medium difficulty or a difficult image, the image processing method provided by the embodiments of the present disclosure can reconstruct a clear high-resolution image, and the text content in the high-resolution image is clearly visible and highly readable.

[0113] Figure 6B It is a comparison chart of the processing effects of the image processing method provided by the embodiment of the present disclosure and the image processing method of the related art on the same image.

[0114] like Figure 6B As shown, example 640 is a low-resolution original image. Example 650 is a rendering of the original image enhanced by an image processing method of related technology, which may be a method in the prior art that only uses feedback from a text recognizer as a guide to perform super-resolution reconstruction on the original image. Example 660 is a rendering of the original image super-resolution reconstruction using the image processing method provided by an embodiment of the present disclosure. Example 670 is a label image of the original image.

[0115] like Figure 6B As shown, the clarity achieved by super-resolution reconstruction of the original image using the image processing method provided by the embodiment of the present disclosure (Example 660) is closer to the clarity of the label image (Example 670), and the text content (Example 660) obtained by the image processing method provided by the embodiment of the present disclosure is clearer and more accurate than the text content (Example 650) obtained by processing the original image using the related technology.

[0116] According to an embodiment of the present disclosure, the present disclosure also provides an image processing device and a training device for a deep learning model.

[0117] Figure 7 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure.

[0118] like Figure 7As shown, the image processing device 700 includes a first visual priori feature determination module 710 , a first semantic priori feature determination module 720 and a first reconstruction module 730 .

[0119] The first visual priori feature determination module 710 is used to process the first image based on the style features of the reference image to obtain the visual priori features of the first image.

[0120] The first semantic priori feature determination module 720 is used to process the first image based on the text recognition feature of the first image to obtain the semantic priori feature of the first image.

[0121] The first reconstruction module 730 is used to perform super-resolution reconstruction on the first image based on visual prior features, semantic prior features and spatial transformation features of the first image to obtain a second image, wherein the resolution of the second image is greater than that of the first image.

[0122] The first visual prior feature determination module 710 is used to process the first image using a pre-trained visual coding network to obtain a visual prior feature, wherein the pre-trained visual coding network is trained by reconstructing the style features of a reference image.

[0123] The first semantic priori feature determination module 720 includes a first text recognition unit and a first semantic encoding unit.

[0124] The first text recognition unit is used to perform text recognition on the first image to obtain a weight sequence corresponding to a character sequence in the first image.

[0125] The first semantic encoding unit is used to perform cross-attention processing on the weight sequence and the first image to obtain semantic prior features.

[0126] The first text recognition unit includes a first text recognition subunit and a first weight sequence determination subunit.

[0127] The first text recognition subunit is used to perform text recognition on the first image, and sequentially output the text probability and attention weight of each character in the character sequence at multiple times.

[0128] The first weight sequence determination subunit is used to determine a weight sequence according to the attention weights of each character output at multiple moments.

[0129] The first reconstruction module 730 includes a first splicing unit, a first weighting unit and a first up-sampling unit.

[0130] The first splicing unit is used to obtain a splicing feature based on the visual prior feature, the semantic prior feature and the spatial transformation feature.

[0131] The first weighting unit is used to perform attention processing on the splicing features to obtain attention weighted features.

[0132] The first upsampling unit is used to upsample the attention weighted features to obtain a second image.

[0133] Figure 8 is a block diagram of a training device for a deep learning model according to an embodiment of the present disclosure.

[0134] like Figure 8 As shown, the training device 800 of the deep learning model includes a second semantic prior feature determination module 810, a spatial transformation module 820, a second reconstruction module 830, a loss determination module 840 and an adjustment module 850.

[0135] The second semantic prior feature determination module 810 is used to process the sample image using a semantic coding network based on the text recognition features of the sample image to obtain semantic prior features.

[0136] The spatial transformation module 820 is used to perform spatial transformation on the sample image using a spatial transformation network to obtain spatial transformation features.

[0137] The second reconstruction module 830 is used to use the backbone network to perform super-resolution reconstruction on the sample image based on semantic prior features, spatial transformation features, and visual prior features of the sample image to obtain an output image, wherein the visual prior features are obtained by processing the sample image using a pre-trained visual encoding network.

[0138] The loss determination module 840 is used to determine the loss of the deep learning model based on the output image.

[0139] The adjustment module 850 is used to adjust the parameters of the deep learning model according to the loss.

[0140] The loss determination module 840 includes a basic loss determination unit, a perceptual loss determination unit, a semantic alignment loss determination unit, and an overall loss determination unit.

[0141] The basic loss determination unit is used to determine the basic loss based on the pixel difference between the output image and the label image of the sample image.

[0142] The perceptual loss determination unit is used to determine the perceptual loss based on the image feature difference between the output image and the label image.

[0143] The semantic alignment loss determination unit is used to determine the semantic alignment loss based on the text feature difference between the output image and the label image.

[0144] The overall loss determination unit is used to determine the overall loss based on the basic loss, perceptual loss and semantic alignment loss.

[0145] The perceptual loss determination unit includes an image feature determination subunit and a perceptual loss determination subunit.

[0146] The image feature determination subunit is used to input the output image and the label image into the pre-trained image feature extraction network respectively to obtain the image features of the output image and the label image respectively.

[0147] The perceptual loss determination subunit is used to determine the perceptual loss according to the difference between the image features of the output image and the image features of the label image.

[0148] The semantic alignment loss determination unit includes a text recognition probability determination subunit and a semantic alignment loss determination subunit.

[0149] The text recognition probability determination subunit is used to input the output image and the label image into the pre-trained text recognition network respectively to obtain the text recognition probabilities of the output image and the label image respectively.

[0150] The semantic alignment loss determination subunit is used to determine the semantic alignment loss according to the difference between the text recognition probability of the output image and the text recognition probability of the label image.

[0151] The adjustment module 850 is used to adjust the parameters of the semantic encoding network, the spatial transformation network and the backbone network according to the overall loss.

[0152] The deep learning model training device 800 also includes a second visual prior feature determination module, which is used to input the sample image into a pre-trained visual coding network to obtain visual prior features, wherein the visual coding network is trained by reconstructing the style features of the reference image.

[0153] The semantic coding network includes a text recognition sub-network and a semantic coding sub-network. The second semantic prior feature determination module 810 includes a second text recognition unit and a second semantic coding unit.

[0154] The second text recognition unit is used to perform text recognition on the sample image using the text recognition subnetwork to obtain a weight sequence corresponding to the character sequence in the sample image.

[0155] The second semantic encoding unit is used to use the semantic encoding sub-network to perform cross-attention processing on the weight sequence and the sample image to obtain semantic prior features.

[0156] The second text recognition unit includes a second text recognition subunit and a second weight sequence determination subunit.

[0157] The second text recognition subunit is used to perform text recognition on the sample image, and output the text probability and attention weight of each character in the character sequence in sequence at multiple times.

[0158] The second weight sequence determination subunit is used to determine a weight sequence according to the attention weights of each character output at multiple moments.

[0159] The second reconstruction module 830 includes a second splicing unit, a second weighting unit and a second up-sampling unit.

[0160] The second splicing unit is used to obtain splicing features based on visual prior features, semantic prior features and spatial transformation features.

[0161] The second weighting unit is used to perform attention processing on the concatenated features to obtain attention weighted features.

[0162] The second upsampling unit is used to upsample the attention weighted features to obtain an output image.

[0163] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0164] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0165] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0166] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0167] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as at least one of the image processing method and the training method of the deep learning model. For example, in some embodiments, at least one of the image processing method and the training method of the deep learning model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of at least one of the image processing method and the training method of the deep learning model described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute at least one of the image processing method and the deep learning model training method in any other appropriate manner (for example, by means of firmware).

[0168] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0170] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0172] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0173] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0174] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0175] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An image processing method, comprising: Based on the style features of the reference image, the first image is processed to obtain a visual priori feature of the first image; Based on the text recognition feature of the first image, the first image is processed to obtain a semantic priori feature of the first image; as well as Based on the visual prior features, the semantic prior features and the spatial transformation features of the first image, super-resolution reconstruction is performed on the first image to obtain a second image, wherein the resolution of the second image is greater than that of the first image.

2. The method according to claim 1, wherein: The step of processing the first image based on the style feature of the reference image to obtain the visual prior features of the first image includes: The first image is processed using a pre-trained visual coding network to obtain the visual prior features, wherein the pre-trained visual coding network is trained by reconstructing the style features of the reference image.

3. The method according to claim 1, wherein: The processing of the first image based on the text recognition feature of the first image to obtain the semantic prior features of the first image includes: Performing text recognition on the first image to obtain a weight sequence corresponding to a character sequence in the first image; and The weight sequence and the first image are cross-attention processed to obtain the semantic prior feature.

4. The method according to claim 3, wherein: The performing text recognition on the first image to obtain a weight sequence corresponding to a character sequence in the first image comprises: Performing text recognition on the first image, and sequentially outputting the text probability and attention weight of each character in the character sequence at multiple times; and The weight sequence is determined according to the attention weights of each character output at multiple moments.

5. The method according to claim 1, wherein: The performing super-resolution reconstruction on the first image based on the visual prior feature, the semantic prior feature and the spatial transformation feature of the first image to obtain the second image comprises: Obtaining a splicing feature based on the visual prior feature, the semantic prior feature, and the spatial transformation feature; Performing attention processing on the concatenated features to obtain attention weighted features; and The attention weighted features are upsampled to obtain the second image.

6. A method for training a deep learning model, comprising: Using a semantic encoding network to process the sample image based on text recognition features of the sample image to obtain semantic prior features; Performing spatial transformation on the sample image using a spatial transformation network to obtain spatial transformation features; Using a backbone network to perform super-resolution reconstruction on the sample image based on the semantic prior features, the spatial transformation features, and the visual prior features of the sample image to obtain an output image, wherein the visual prior features are obtained by processing the sample image using a pre-trained visual encoding network; Based on the output image, determining a loss of the deep learning model; and Based on the loss, parameters of the deep learning model are adjusted.

7. The method according to claim 6, wherein: Determining the loss of the deep learning model based on the output image includes: Determining a basic loss based on pixel differences between the output image and a label image of the sample image; determining a perceptual loss based on a difference in image features between the output image and the label image; Determining a semantic alignment loss based on a difference in text features between the output image and the label image; and According to the basic loss, perceptual loss and semantic alignment loss, the overall loss is determined.

8. The method according to claim 7, wherein: The determining of the perceptual loss based on the image feature difference between the output image and the label image comprises: Inputting the output image and the label image into a pre-trained image feature extraction network respectively to obtain image features of the output image and the label image respectively; and The perceptual loss is determined based on a difference between image features of the output image and image features of the label image.

9. The method according to claim 7, wherein: The determining of the semantic alignment loss based on the text feature difference between the output image and the label image comprises: Inputting the output image and the label image into a pre-trained text recognition network respectively to obtain text recognition probabilities of the output image and the label image respectively; and The semantic alignment loss is determined according to a difference between the text recognition probability of the output image and the text recognition probability of the label image.

10. The method according to claim 7, wherein: The adjusting the deep learning model according to the loss includes: According to the overall loss, the parameters of the semantic encoding network, the spatial transformation network and the backbone network are adjusted.

11. The method according to claim 6, further comprising: The sample image is input into a pre-trained visual coding network to obtain the visual prior features, wherein the visual coding network is trained by reconstructing the style features of a reference image.

12. The method according to claim 6, wherein: The semantic coding network includes a text recognition subnetwork and a semantic coding subnetwork; the semantic coding network is used to process the sample image based on the text recognition features of the sample image to obtain the semantic prior features including: Performing text recognition on the sample image using the text recognition subnetwork to obtain a weight sequence corresponding to a character sequence in the sample image; and The semantic encoding subnetwork is used to perform cross-attention processing on the weight sequence and the sample image to obtain the semantic prior feature.

13. The method according to claim 12, wherein: The method of performing text recognition on the sample image using the text recognition subnetwork to obtain a weight sequence corresponding to a character sequence in the sample image comprises: Performing text recognition on the sample image, and sequentially outputting the text probability and attention weight of each character in the character sequence at multiple moments; and The weight sequence is determined according to the attention weights of each character output at multiple moments.

14. The method according to claim 6, wherein: The using of the backbone network to perform super-resolution reconstruction on the sample image based on the semantic prior features, the spatial transformation features, and the visual prior features of the sample image to obtain an output image includes: Obtaining a splicing feature based on the visual prior feature, the semantic prior feature, and the spatial transformation feature; Performing attention processing on the concatenated features to obtain attention weighted features; and The attention weighted features are upsampled to obtain the output image.

15. An image processing device, comprising: A first visual prior feature determination module, configured to process the first image based on the style features of the reference image to obtain the visual prior features of the first image; a first semantic priori feature determination module, configured to process the first image based on the text recognition feature of the first image to obtain the semantic priori feature of the first image; and The first reconstruction module is used to perform super-resolution reconstruction on the first image based on the visual prior features, the semantic prior features and the spatial transformation features of the first image to obtain a second image, wherein the resolution of the second image is greater than that of the first image.

16. The device according to claim 15, wherein: The first visual prior feature determination module is used to process the first image using a pre-trained visual coding network to obtain the visual prior feature, wherein the pre-trained visual coding network is trained by reconstructing the style features of the reference image.

17. The device according to claim 15, wherein: The first semantic prior feature determination module includes: a first text recognition unit, configured to perform text recognition on the first image to obtain a weight sequence corresponding to a character sequence in the first image; and The first semantic encoding unit is used to perform cross-attention processing on the weight sequence and the first image to obtain the semantic prior feature.

18. The device according to claim 17, wherein: The first text recognition unit comprises: A first text recognition subunit is used to perform text recognition on the first image, and sequentially output the text probability and attention weight of each character in the character sequence at multiple time points; and The first weight sequence determination subunit is used to determine the weight sequence according to the attention weights of each character output at multiple moments.

19. The device according to claim 15, wherein: The first reconstruction module comprises: A first splicing unit, configured to obtain a splicing feature based on the visual prior feature, the semantic prior feature and the spatial transformation feature; A first weighting unit, configured to perform attention processing on the concatenated features to obtain attention weighted features; and The first upsampling unit is used to upsample the attention weighted features to obtain the second image.

20. A training device for a deep learning model, comprising: A second semantic prior feature determination module is used to process the sample image using a semantic coding network based on the text recognition features of the sample image to obtain a semantic prior feature; A spatial transformation module, used for performing spatial transformation on the sample image using a spatial transformation network to obtain spatial transformation features; A second reconstruction module is used to use a backbone network to perform super-resolution reconstruction on the sample image based on the semantic prior features, the spatial transformation features, and the visual prior features of the sample image to obtain an output image, wherein the visual prior features are obtained by processing the sample image using a pre-trained visual encoding network; a loss determination module, configured to determine a loss of the deep learning model based on the output image; and An adjustment module is used to adjust the parameters of the deep learning model according to the loss.

21. The device according to claim 20, wherein: The loss determination module comprises: a basic loss determining unit, configured to determine a basic loss based on a pixel difference between the output image and a label image of the sample image; a perceptual loss determining unit, configured to determine a perceptual loss based on a difference in image features between the output image and the label image; a semantic alignment loss determining unit, configured to determine a semantic alignment loss based on a text feature difference between the output image and the label image; and The overall loss determining unit is used to determine the overall loss according to the basic loss, the perceptual loss and the semantic alignment loss.

22. The device according to claim 21, wherein The perception loss determination unit comprises: An image feature determination subunit, used to input the output image and the label image into a pre-trained image feature extraction network respectively, to obtain image features of the output image and the label image respectively; The perceptual loss determination subunit is used to determine the perceptual loss according to the difference between the image features of the output image and the image features of the label image.

23. The device according to claim 21, wherein The semantic alignment loss determination unit comprises: a text recognition probability determination subunit, configured to input the output image and the label image into a pre-trained text recognition network respectively, to obtain the text recognition probabilities of the output image and the label image respectively; and The semantic alignment loss determination subunit is used to determine the semantic alignment loss according to the difference between the text recognition probability of the output image and the text recognition probability of the label image.

24. The device according to claim 21, wherein The adjustment module is used to adjust the parameters of the semantic encoding network, the spatial transformation network and the backbone network according to the overall loss.

25. The apparatus of claim 20, further comprising: The second visual prior feature determination module is used to input the sample image into a pre-trained visual coding network to obtain the visual prior feature, wherein the visual coding network is trained by reconstructing the style features of the reference image.

26. The device according to claim 20, wherein: The semantic encoding network includes a text recognition subnetwork and a semantic encoding subnetwork; the second semantic prior feature determination module includes: A second text recognition unit, configured to perform text recognition on the sample image using the text recognition subnetwork to obtain a weight sequence corresponding to a character sequence in the sample image; and The second semantic encoding unit is used to use the semantic encoding sub-network to perform cross-attention processing on the weight sequence and the sample image to obtain the semantic prior feature.

27. The device according to claim 26, wherein: The second text recognition unit comprises: A second text recognition subunit is used to perform text recognition on the sample image, and sequentially output the text probability and attention weight of each character in the character sequence at multiple moments; and The second weight sequence determination subunit is used to determine the weight sequence according to the attention weights of each character output at multiple moments.

28. The device according to claim 20, wherein: The second reconstruction module comprises: A second splicing unit, configured to obtain a splicing feature based on the visual prior feature, the semantic prior feature and the spatial transformation feature; a second weighting unit, configured to perform attention processing on the concatenated features to obtain attention weighted features; and The second upsampling unit is used to upsample the attention weighted features to obtain the output image.

29. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.

30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 14.

31. A computer program product, comprising a computer program, wherein the computer program is stored on at least one of a readable storage medium and an electronic device, and when the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.