Image processing method, device, electronic device and computer readable storage medium
The SVM classifier identifies the image quality level and selects an appropriate resolution network to optimize the image, which solves the problem of resource waste in the existing technology and achieves efficient optimization and resource saving of images of different quality levels.
Patent Information
- Application Number
- CN202110886359.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-08-03
AI Technical Summary
In the existing technology, there is a waste of resources when using the same resolution network to process images of different quality levels. A resolution network with a strong learning ability wastes resources when processing high-quality images, and a resolution network with a low learning ability processes low-quality images. The expected results may not be achieved.
By identifying the characteristic parameters of the image to be processed based on the support vector machine (SVM) classifier, the quality level of the image is obtained, and the target resolution network is determined from multiple candidate resolution networks based on the level, and the image is optimized to obtain Higher resolution target images.
On the premise of ensuring the optimization effect, it avoids the waste of resources caused by using the same resolution network, adapts to targeted optimization of images of different quality levels, and improves resource utilization efficiency.
Smart Images

Figure CN113674152B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] In the field of image processing, super-resolution technology has emerged to enable users to obtain a higher quality visual experience. The purpose of super-resolution technology is to improve the resolution of images. At present, super-resolution algorithms based on machine learning are one of the ways to achieve super-resolution technology. The specific implementation method is to generate a resolution network through a super-resolution algorithm based on machine learning, and use the resolution network to optimize the image, so as to obtain an image with higher resolution. However, there is a problem of resource waste in the prior art of using a resolution network to optimize images. Summary of the invention
[0003] The embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium, which can use different resolution networks to optimize images of different quality levels to avoid wasting resources.
[0004] An image processing method comprises: obtaining the quality level of an image to be processed; the quality level is used to characterize the resolution of the image to be processed.
[0005] Based on the quality level of the image to be processed, determining a target resolution network corresponding to the quality level from a plurality of candidate resolution networks;
[0006] The target resolution network is used to optimize the image to be processed to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0007] An image processing device, further comprising:
[0008] The acquisition module is used to acquire the quality level of the image to be processed; the quality level is used to characterize the resolution of the image to be processed.
[0009] A processing module is used to determine a target resolution network corresponding to the quality level of the image to be processed obtained by the acquisition module from multiple candidate resolution networks; the processing module is also used to optimize the image to be processed using the target resolution network to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0010] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0011] The quality level of the image to be processed is obtained; the quality level is used to characterize the resolution of the image to be processed.
[0012] Based on the quality level of the image to be processed, a target resolution network corresponding to the quality level is determined from a plurality of candidate resolution networks.
[0013] The target resolution network is used to optimize the image to be processed to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0014] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0015] The quality level of the image to be processed is obtained; the quality level is used to characterize the resolution of the image to be processed.
[0016] Based on the quality level of the image to be processed, a target resolution network corresponding to the quality level is determined from a plurality of candidate resolution networks.
[0017] The target resolution network is used to optimize the image to be processed to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0018] The above-mentioned image processing method, device, electronic device and computer-readable storage medium can determine the target resolution network corresponding to the quality level of the image to be processed based on the quality level of the image to be processed. In order to optimize the image to be processed using the target resolution network, a target image with higher resolution can be obtained. Through the technical solution of the present application, images of different quality levels can be optimized based on different resolution networks, and the problem of resource waste caused by using the same resolution network can be avoided while ensuring the optimization effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 A diagram showing an application environment of an image processing method in an embodiment;
[0021] Figure 2 is a flowchart of an image processing method in one embodiment;
[0022] Figure 3is a flow chart of step 202 in one embodiment;
[0023] Figure 4 is a flowchart of a method for obtaining a candidate resolution network in one embodiment;
[0024] Figure 5 A schematic diagram of nodes of an initial super network in one embodiment;
[0025] Figure 6 A schematic diagram of a process of forming a sub-network in one embodiment;
[0026] Figure 7 is a flow chart of step 406 in one embodiment;
[0027] Figure 8 is a flow chart of step 408 in one embodiment;
[0028] Fig. 9 A structural block diagram of an image processing device in one embodiment
[0029] Fig.10 FIG. 4 is a structural block diagram of an electronic device in an embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client. Both the first client and the second client are clients, but they are not the same client.
[0032] Considering that in the prior art, the same resolution network is mostly used to process images of different quality levels. However, images with high quality levels only need a resolution network with low learning ability to process. Images with low quality levels require a resolution network with strong learning ability to process. Since the quality levels of images may differ greatly, the problem of using the same resolution network to process images of different quality levels is that when a resolution network with strong learning ability is used to process images with high quality levels, it will cause a waste of resources; when a resolution network with low learning ability is used to process images with low quality levels, the expected processing effect may not be achieved.
[0033] Based on this, the embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium to solve the above problems. The technical principle of the embodiments of the present application is: based on a support vector machine (SVM) classifier, the characteristic parameters of the image to be processed are identified to obtain the quality level of the image to be processed. After that, the resolution corresponding to the quality level is used to optimize the image to be processed, and a target image with a higher resolution is obtained. Thereby, images of different quality levels are optimized using different resolution networks to avoid waste of resources.
[0034] Figure 1 FIG. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. Figure 1 As shown, the application environment includes a terminal 10 and a server 20, and the terminal 10 and the server 20 communicate through a network. In one implementation, the terminal 10 obtains the quality level of the image to be processed; here, the terminal 10 can obtain the image to be processed from a third-party device or the server 20; or, the terminal 10 has a shooting function and obtains the image to be processed by shooting. After obtaining the quality level of the image to be processed, a target resolution network of the quality level of the image to be processed is determined from multiple candidate resolution networks. Finally, the image to be processed is optimized using the target resolution network to obtain a target image with a higher resolution. It should be noted that multiple candidate resolution networks can be obtained by the terminal based on super-resolution algorithm training. Alternatively, after the server 20 generates multiple candidate resolution networks based on super-resolution algorithm training, the network structure and network parameters of each candidate resolution network are sent to the terminal 10, and the terminal 10 obtains each candidate resolution network according to the network structure and network parameters of each candidate resolution network received. In addition, the terminal 10 can be implemented by another server in implementing the technical solution provided in the embodiment of the present application. The embodiment of the present application does not impose any limitation on the device form used to implement the provided technical solution. The terminal 10 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 20 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0035] The following will be combined Figure 1 , the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0036] Figure 2FIG. 1 is a flowchart of an image processing method in an embodiment. The image processing method in this embodiment is executed on Figure 1 This article describes the terminal or server in the following example. Figure 2 As shown, the image processing method includes steps 202 to 206.
[0037] Step 202: Obtain the quality level of the image to be processed; the quality level is used to characterize the resolution of the image to be processed.
[0038] Specifically, the image to be processed is an image that needs to be processed with a higher resolution. The image to be processed can be obtained by taking it from a camera or a camcorder connected to a communication device, or by obtaining it from a storage device that stores the image to be processed.
[0039] The above-mentioned image to be processed may be an image in various monitoring scenes, and the image to be processed may be taken by a camera or a camera. The image to be processed may contain specific people, objects or events. For example, a specific person may be a target person that the user needs to monitor; a specific object may be an animal, a building or an item carried by a person; a specific event may be a gathering, a fight or other specific activities.
[0040] Optionally, the characteristic parameters of the image to be processed are input into a pre-trained image quality evaluation model to obtain evaluation results of the image to be processed at multiple preset quality levels. The characteristic parameters include at least one or more of image brightness, image blur and image texture.
[0041] The above-mentioned preset multiple quality levels can be multiple quality levels set according to requirements, and the range and number of the quality levels are also set according to requirements. For example, 3 quality levels can be set, and the quality levels are integers between 1 and 13; 10 quality levels can also be set, and the quality levels are integers between 1 and 10. The above-mentioned image quality evaluation model is obtained by machine learning training using a sample set, and each sample in the sample set includes a characteristic parameter of a sample image and a quality level corresponding to the sample image.
[0042] In one implementation, when obtaining a sample set, for the same image, different people may give different judgment results on the image quality and feature parameters. When obtaining the quality level and feature parameters of the image, n (n>10) people can independently label it, and finally the average value of the labeling results of the n people is taken as the final quality level and feature parameter labeling result.
[0043] Step 204: Based on the quality level of the image to be processed, determine a target resolution network corresponding to the quality level from multiple candidate resolution networks.
[0044] Among them, different quality levels correspond to different candidate resolution networks.
[0045] For example, using the same sample and the same machine learning algorithm to train the candidate resolution networks, the network structures of different candidate resolution networks are generally different. Therefore, a corresponding relationship between the network structure and the quality level of each candidate resolution network can be established. For example, the identifier of the network structure and the quality level are stored in correspondence.
[0046] Step 206: Optimize the image to be processed using the target resolution network to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0047] Furthermore, the embodiments of the present application are not limited to optimizing the image to be processed, but can also be specifically applied to the target area of the image to be processed, and the specific implementation method is as follows: first, determine the target area in the image to be processed that needs to be optimized, and obtain the quality level of the target area in the image to be processed. After that, determine the target resolution network corresponding to the quality level from multiple candidate resolution networks. Among them, the target area in the image to be processed that needs to be optimized can be determined by identifying the area circled by the user on the touch screen; or, after determining at least one object contained in the image to be processed, it is determined by identifying the object corresponding to the user's click or touch operation. For example, it is identified that the image to be processed contains two types of faces and plants. When the user clicks or touches the face area, it can be determined that the target area is a face. It should be noted that when it is for the target area of the image to be processed, all embodiments for the image to be processed in the embodiments of the present application can be applied to the target area of the image to be processed.
[0048] The above-mentioned image processing method can determine the target resolution network corresponding to the quality level of the image to be processed based on the quality level of the image to be processed. In order to optimize the image to be processed using the target resolution network, a target image with higher resolution can be obtained. Through the technical solution of the present application, images of different quality levels can be optimized based on different resolution networks, and the problem of resource waste caused by using the same resolution network can be avoided while ensuring the optimization effect.
[0049] In one embodiment, referring to Figure 3 , one implementation of step 202 is steps 302 and 304:
[0050] Step 302: Acquire characteristic parameters of the image to be processed; the characteristic parameters include one or more of image brightness, image blur and image texture.
[0051] It should be noted that the degree of image blur can be expressed as the degree of image clarity in another sense.
[0052] Optionally, the above-mentioned image to be processed may be an image in a natural scene, an image in a surveillance scene, or an image in other scenes. The image to be processed may be an image taken by a camera or a still camera, or a certain video frame in a recorded video. In specific implementation, the image to be processed may be subjected to quality analysis to obtain characteristic parameters corresponding to the image to be processed. For example, the characteristic parameters of the image to be processed may be obtained by subjective quality analysis, that is, by evaluating with the naked eye, or by objective quality analysis, that is, by calculating the quality of the image to be processed by a preset formula to obtain the characteristic parameters; or the characteristic parameters corresponding to the image to be processed may be obtained by a machine learning model such as a deep learning model or a neural network model.
[0053] Exemplarily, this step is explained by taking the three characteristic parameters including image brightness, image blur and image texture as an example. The image brightness, image blur and image texture of the image to be processed are identified by the recognition model. Among them, the recognition model includes: an image brightness recognition model, an image blur recognition model and an image texture recognition model; among them, the image brightness recognition model is used to identify the image brightness of the image to be processed; the image blur recognition model is used to identify the image blur of the image to be processed; the image texture recognition model is used to identify the image texture of the image to be processed.
[0054] Specifically, the image brightness recognition model, the image blur degree recognition model, and the image texture recognition model can all be obtained through training based on machine learning algorithms (such as neural network algorithms) and corresponding sample sets. For example, the image brightness recognition model can be generated based on a sample set containing multiple sample patterns and the image brightness corresponding to each sample pattern, combined with training using a neural network algorithm. The image blur degree recognition model can be generated based on a sample set containing multiple sample patterns and the image blur degree corresponding to each sample pattern, combined with training using a neural network algorithm. The image texture recognition model is similar and will not be described in detail here.
[0055] Step 304: Input the feature parameters into a support vector machine (SVM) model to generate a quality grade of the image to be processed.
[0056] Furthermore, a data set with quality levels corresponding to feature parameters is obtained, and the data set is divided into a training set and a test set; an initial SVM detection model is established according to the feature parameters in the training set; a kernel function is selected according to the quality level in the training set; cross-validation is performed to select the penalty parameter C of the initial SVM detection model and the parameter g of the kernel function; the initial SVM detection model is tested using the test set and the penalty parameter C and the parameter g of the kernel function are adjusted and optimized to establish the SVM detection model.
[0057] In this embodiment, the SVM model is used to identify one or more characteristic parameters including image brightness, image blur and image texture to obtain the quality level of the image to be processed. The SVM model can accurately identify the quality level of the image to be processed, providing an accurate basis for subsequent optimization of the image to be processed.
[0058] In one embodiment, the SVM model includes at least two binary classification models, and one implementation of step 304 is: inputting the feature parameters into each binary classification model to obtain the output result of each binary classification model. Then, according to the output result of each binary classification model, the quality level of the image to be processed is obtained.
[0059] Optionally, the number of binary classification models corresponds to the number of quality levels of the image.
[0060] Exemplarily, feature parameters are extracted from three dimensions including image brightness, image blur and image texture. First, a data set is established; wherein the data set includes each quality level and a feature vector (F1, F2, F3) corresponding to each quality level, and the data set is divided into a training set and a test set; wherein F1 represents image brightness, F2 represents image blur, and F3 represents image texture. In this example, three quality levels are set, namely level 1, level 2 and level 3. The number of corresponding binary classification models is 3, namely binary classification model 1 for identifying level 1, binary classification model 2 for identifying level 2, and binary classification model 3 for identifying level 3. The training set contains quality levels of level 1, level 2 and level 3; using level 1 and the feature parameters corresponding to level 1 as positive examples, and level 2 and level 3 and the feature parameters corresponding to each level as negative examples, combined with the SVM binary classification algorithm, training obtains binary classification model 1; and using the test set to test whether the accuracy of binary classification model 1 is greater than the preset threshold; when the accuracy is greater than the preset threshold, the binary classification model 1 is determined as the model of recognition level 1; when the accuracy is less than or equal to the preset threshold, the number of training samples is increased, and the binary classification model 1 is continued to be trained using the increased training samples until the accuracy tested by the test set is greater than the preset threshold, and the training is completed. For the training process of binary classification model 2 and binary classification model 3, reference can be made to binary classification model 1, which will not be repeated here.
[0061] Combined with the above example, after obtaining the feature parameters of the image to be processed, the feature parameters are respectively input into the three binary classification models to obtain the output results of the quality level of the image to be processed. The output result is in the form of a three-dimensional vector. The first column of the three-dimensional vector is the output result of the binary classification model 1, the second column is the output result of the binary classification model 2, and the third column is the output result of the binary classification model 3. When the output result of the binary classification model 1 is "1", the quality level of the image to be processed is level 1; when the output result of the binary classification model 1 is "0", the quality level of the image to be processed is not level 1; similarly, when the output result of the binary classification model 2 is "1", the quality level of the image to be processed is level 2; when the output result of the binary classification model 2 is "0", the quality level of the image to be processed is not level 2; when the output result of the binary classification model 3 is "1", the quality level of the image to be processed is level 3; when the output result of the binary classification model 3 is "0", the quality level of the image to be processed is not level 3.
[0062] For example, when the quality level of the image to be processed is identified as level 1, the output result is (1, 0, 0); it should be noted that, similarly, when the quality level of the image to be processed is identified as level 2, the output result is (0, 1, 0); when the quality level of the image to be processed is identified as level 3, the output result is (0, 0, 1).
[0063] It should be noted that the data and quality levels included in the characteristic parameters can be adjusted according to actual needs, and the embodiments of the present application do not impose any limitations on them.
[0064] In this embodiment, different binary classification models correspond to identifying images of different quality levels, the multi-classification task is split into several binary classification tasks, and the output results of multiple binary classification models are integrated to obtain the quality level of the image to be processed.
[0065] In one embodiment, referring to Figure 4 In order to avoid the consumption of network resources, the embodiment of the present application provides a method for obtaining a candidate resolution network, which specifically includes:
[0066] Step 402: Obtain a sample set; the sample set includes a plurality of sample images and a quality level of each sample image.
[0067] Step 404: Using the sample set and the super-resolution algorithm, an initial super-network is trained; the initial super-network includes multiple sub-structures.
[0068] It should be noted that the initial super network generated by super-resolution algorithm training is a network that can optimize images of various quality levels, and the resolution of the optimized images can achieve the expected effect. The super-resolution algorithm can be, for example, a deep learning algorithm.
[0069] Specifically, the initial super network includes: N network layers; each network layer includes: M nodes, wherein N is a positive integer not less than 2, and M is a positive integer not less than 2. The mth node of the nth network layer of the initial super network is selected as the node of the nth network layer constituting the substructure, wherein n is a positive integer less than or equal to N, and m is a positive integer less than or equal to M.
[0070] Here, based on the single path activation algorithm, one or more nodes can be selected from each network layer, and the selected nodes can be used as nodes constituting the substructure. In this way, based on the single path activation algorithm, one or more nodes can be selected from each network layer as nodes constituting the substructure, which can simplify the complexity of training the substructure and improve the efficiency of substructure training.
[0071] Step 406: Train each substructure according to the sample set to obtain a subnetwork corresponding to each substructure.
[0072] Exemplarily, each node may be distinguished according to a node identifier of the node, wherein the node identifier may be a node number or a node name.
[0073] Step 408: Determine a candidate resolution network based on the sub-network.
[0074] Optionally, after forming a trained sub-network, its performance can be evaluated on a test set, and the network structure can be gradually optimized until the optimal sub-network is found. For example, a sub-network that minimizes the validation loss or maximizes the reward. Here, the test data in the test data set can be input into the trained sub-network, and the evaluation result is output through the sub-network. The output evaluation result is then compared with a preset standard to obtain a comparison result, and the performance of the sub-network is evaluated based on the comparison result, wherein the test result can be the speed or accuracy of the sub-network processing the test data.
[0075] In this embodiment, a substructure is selected from the trained initial super network and trained to obtain a subnetwork corresponding to the substructure, which can improve the training speed and accuracy of the subnetwork, so as to more quickly determine the candidate resolution network in the subnetwork.
[0076] In one embodiment, the substructure is obtained by selecting one or more nodes in each layer of the initial hypernetwork based on a neural architecture search (NAS) strategy, and determining the substructure based on the one or more nodes selected in each layer.
[0077] Among them, the neural structure search NAS strategy (i.e., NAS search method) is usually an iterative process, which defines what algorithm can be used to quickly and accurately find the optimal network structure parameter configuration. Common NAS search methods include: random search, Bayesian optimization, evolutionary algorithm, reinforcement learning, gradient-based algorithm, etc.
[0078] In the embodiment of the present application, in the process of searching based on the NAS strategy, an initial super network including multiple network nodes (hereinafter referred to as nodes) can be trained to generate an initial super network including a search space of all nodes, that is, a node set, wherein the node is part of the initial super network. The initial super network includes multiple network layers, and each network layer can include multiple nodes. Here, the initial super network is a set of all nodes. Figure 5 is a schematic diagram of nodes of an initial super network according to an exemplary embodiment. Figure 5 As shown, the initial super network 500 includes a first network layer 501, a second network layer 502, and a third network layer 503, wherein the first network layer 501, the second network layer 502, and the third network layer 503 respectively include four parallel nodes, namely, node A, node B, node C, and node D.
[0079] Here, nodes may be selected from the initial hypernetwork, and a substructure may be constructed based on the selected nodes. Figure 6 is a schematic diagram of a process of forming a sub-network according to an exemplary embodiment. Figure 6 As shown, the initial super network 500 includes a first network layer 501, a second network layer 502, and a third network layer 503, wherein the first network layer 501, the second network layer 502, and the third network layer 503 respectively include four parallel nodes, node A, node B, node C, and node D. In the process of forming a substructure, one or more nodes can be selected from each network layer to form a substructure. For example, nodes A, node B, node C, and node D are selected from the first network layer 501 in the initial super network 500 as the first network layer 601 of the substructure 600, nodes A and node B are selected from the second network layer 502 as the second network layer 602 of the substructure 600, and nodes A, node B, node C, and node D are selected from the third network layer 503 as the third network layer 603 of the substructure 600.
[0080] In this embodiment, based on the neural structure search NAS strategy, the optimal substructure can be automatically found from the initial super network quickly and accurately to obtain a better subnetwork.
[0081] In one embodiment, in combination Figure 4 , refer to Figure 7 , step 406, specifically includes:
[0082] Step 702: Obtain network parameters of the initial super network.
[0083] Optionally, the network parameters include weight parameters.
[0084] Step 704: Determine the initialization parameters of each substructure in the network parameters.
[0085] It can be understood that after training the initial super network, the network parameters corresponding to each node can be obtained, and a mapping relationship between the node identifier corresponding to the node and the network parameters can be established. Here, the mapping relationship can be stored in a mapping list in the form of a list. Based on the node identifier of the node contained in the substructure, the corresponding network parameters are obtained from the mapping list, and the network parameters are shared to the corresponding nodes in the subnetwork.
[0086] Step 706: train each substructure using the sample set and the initialization parameters of each substructure to obtain a subnetwork corresponding to each substructure.
[0087] Here, after the substructure is constructed, the network parameters in the initial supernetwork can be assigned to the substructure as the initialization parameters of the substructure, so that the substructure inherits the network parameters from the initial supernetwork, and the substructure is trained based on the initialization parameters of the substructure without training the substructure from scratch. In this way, the network parameters of the substructure include: the network parameters of the substructure obtained after training the substructure.
[0088] In this embodiment, the substructure can inherit network parameters from the initial supernetwork, use the network parameters as the initialization parameters of the substructure, and train the substructure to obtain the network parameters of the substructure, without the need to train the substructure from scratch, which can reduce the amount of computation in the subnetwork training process and thereby improve the training efficiency of the subnetwork.
[0089] In one embodiment, referring to Figure 8 , step 408 specifically includes:
[0090] Step 4081, obtain a test set; the test set includes at least one test image of the same quality level.
[0091] For example, in order to obtain the best candidate resolution networks of different quality levels, the test image with the lowest quality level is prioritized as the test image in the test set. After that, in order of quality level from low to high, the test set containing at least one test image is selected in turn to test each sub-network.
[0092] Step 4082: Utilize each sub-network to optimize each test image to obtain multiple optimized images.
[0093] Specifically, each sub-network is used to optimize each test image to obtain an optimized image with a quality level corresponding to the test image.
[0094] Step 4083: Obtain the resolution of each optimized image.
[0095] Specifically, characteristic parameters of each optimized image are obtained, and the resolution of each optimized image is determined based on the characteristic parameters of each optimized image.
[0096] Step 4084: Determine a candidate resolution network corresponding to the quality level of the test image according to the resolution of each optimized image.
[0097] Example 1: Without considering the hardware conditions of the device, since the image with the lowest quality level requires a network with stronger learning ability during the optimization process. Therefore, the test image with the lowest quality level (represented as the first level) is first used as the test image in the test set. Each sub-network is used to optimize each test image to obtain multiple optimized images, and the sub-network corresponding to the image with the highest resolution is selected from the multiple optimized images (represented as the first sub-network) to determine the candidate resolution network corresponding to the first level. After that, in order from low to high quality levels, at least one test image of the second level that is one level higher than the first level is selected; the test set of the second level is optimized using other sub-networks that do not contain the first sub-network; multiple optimized images are obtained, and the sub-network corresponding to the image with the highest resolution is selected from the multiple optimized images (represented as the second sub-network) to determine the candidate resolution network corresponding to the first level. Similarly, in the above manner, the candidate resolution networks corresponding to each quality level are selected from low to high quality levels.
[0098] Example 2: Considering the hardware conditions of the device, the test image with the lowest quality level (indicated as the first level) is prioritized as the test image in the test set. Each sub-network is used to optimize each test image to obtain multiple optimized images. According to the resolution of the multiple optimized images, each test image is sorted in a preset order (such as from high to low order), and the sub-network with the highest resolution that the device can carry is determined as the candidate resolution network corresponding to the first level. Similarly, in the above manner, the candidate resolution networks corresponding to each quality level are selected in order from low to high.
[0099] It should be noted that the candidate resolution network that has been determined will no longer be used as a sub-network to optimize subsequent test images.
[0100] In addition, when there are multiple test images of the same quality level, after optimizing them using each sub-network, the weighted average of the resolutions of the multiple optimized images is determined, and the sub-network corresponding to the highest weighted average is selected to determine the candidate resolution network corresponding to the quality level of the test image.
[0101] In this embodiment, each sub-network is used to optimize at least one test image of the same quality level to obtain the resolution of each optimized image. According to the resolution of each optimized image, a candidate resolution network corresponding to the quality level of the test image can be obtained more accurately.
[0102] In one embodiment, in order to reduce the amount of computation of the device, the candidate resolution network may be obtained from another server. The specific acquisition method includes:
[0103] Receive candidate resolution network information from a server; the candidate resolution network information includes a network structure of the candidate resolution network, network parameters of the candidate resolution network, and a quality level corresponding to the candidate resolution network. Obtain the candidate resolution network from the network structure of the candidate resolution network and the network parameters of the candidate resolution, and store the corresponding relationship between the candidate resolution network and the quality level.
[0104] It should be noted that the candidate resolution network information determined by the server side can refer to the description of the above steps 402 to 408, which will not be repeated here.
[0105] In this embodiment, the candidate resolution network information is directly received from the server, and based on the candidate resolution network information, the candidate resolution network is obtained, and the correspondence between the candidate resolution network and the quality level is stored, which reduces the training and selection process of the candidate resolution network locally and greatly reduces the local computational complexity.
[0106] It should be understood that although Figure 2-4 The steps in the flowcharts of , 7, and 8 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps in , 7, and 8 may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages does not necessarily have to be sequentially, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0107] Fig. 9900 is a structural block diagram of an image processing device according to an embodiment. The image processing device 900 includes: an acquisition module 901 and a processing module 902. Specifically:
[0108] The acquisition module 901 is used to acquire the quality level of the image to be processed; the quality level is used to represent the resolution of the image to be processed.
[0109] The processing module 902 is used to determine a target resolution network corresponding to the quality level from multiple candidate resolution networks based on the quality level of the image to be processed obtained by the obtaining module 901.
[0110] The processing module 902 is further used to optimize the image to be processed by using the target resolution network to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed.
[0111] In one embodiment, the acquisition module 901 is specifically used to acquire characteristic parameters of the image to be processed; the characteristic parameters include one or more of image brightness, image blur and image texture.
[0112] The processing module 902 is used to input the feature parameters obtained by the obtaining module 901 into a support vector machine (SVM) model to generate a quality level of the image to be processed.
[0113] In one embodiment, the processing module 902 is specifically used to input the feature parameters into each binary classification model respectively to obtain the output result of each binary classification model; and obtain the quality level of the image to be processed according to the output result of each binary classification model.
[0114] In one embodiment, the acquisition module 901 is used to acquire a sample set; the sample set includes a plurality of sample images and a quality level of each sample image.
[0115] The processing module 902 is used to train an initial super network using the sample set obtained by the obtaining module 901 and a super-resolution algorithm; the initial super network includes multiple substructures.
[0116] The processing module 902 is further used to train each substructure according to the sample set to obtain a subnetwork corresponding to each substructure.
[0117] The processing module 902 is further configured to determine a candidate resolution network according to the sub-network.
[0118] In one embodiment, the processing module 902 is specifically configured to select one or more nodes in each layer of the initial super network based on the neural structure search NAS strategy; and determine a substructure based on the one or more nodes selected in each layer.
[0119] In one embodiment, the acquisition module 901 is specifically configured to acquire network parameters of the initial super network.
[0120] The processing module 902 is used to determine the initialization parameters of each substructure in the network parameters obtained by the obtaining module 901.
[0121] The processing module 902 is further used to train each substructure using the sample set and the initialization parameters of each substructure to obtain a subnetwork corresponding to each substructure.
[0122] In one embodiment, the acquisition module 901 is further used to acquire a test set; the test set includes at least one test image of the same quality level.
[0123] The processing module 902 is used to optimize each test image obtained by the obtaining module 901 by using each sub-network to obtain multiple optimized images.
[0124] The processing module 902 is also used to obtain the resolution of each optimized image.
[0125] The processing module 902 is further used to determine a candidate resolution network corresponding to the quality level of the test image according to the resolution of each optimized image.
[0126] In one embodiment, the acquisition module 901 is specifically used to receive candidate resolution network information from a server; the candidate resolution network information includes a network structure of the candidate resolution network, network parameters of the candidate resolution network, and a quality level corresponding to the candidate resolution network;
[0127] The processing module 902 is used to obtain the candidate resolution network by using the network structure of the candidate resolution network and the network parameters of the candidate resolution received by the acquisition module 901, and store the corresponding relationship between the candidate resolution network and the quality level.
[0128] The image processing device provided in the embodiment of the present application can determine the target resolution network corresponding to the quality level of the image to be processed based on the quality level of the image to be processed. In order to optimize the image to be processed using the target resolution network, a target image with a higher resolution can be obtained. Through the image processing device of the present application, images of different quality levels can be optimized based on different resolution networks, and the problem of resource waste caused by using the same resolution network can be avoided while ensuring the optimization effect.
[0129] The division of the modules in the above-mentioned image processing device is only for illustration. In other embodiments, the image processing device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned image processing device.
[0130] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each module in the above image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0131] Fig.10 Schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. Among them, the processor may include one or more processing modules. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each of the following embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium.
[0132] The implementation of each module in the image processing device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program module constituted by the computer program may be stored in a memory of an electronic device. When the computer program is executed by a processor, the steps of the method described in the embodiment of the present application are implemented.
[0133] The embodiment of the present application also provides a computer-readable storage medium, which is one or more non-volatile computer-readable storage media containing computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image processing method.
[0134] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the image processing method.
[0135] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-only Memory) or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (Double Data Rate Synchronous Dynamic Random Access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).
[0136] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a quality level of the image to be processed; the quality level is used to characterize the resolution of the image to be processed; Based on the quality level of the image to be processed, determining a target resolution network corresponding to the quality level from a plurality of candidate resolution networks; Optimizing the image to be processed by using the target resolution network to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed; The method for obtaining the candidate resolution network includes: Acquire a sample set; the sample set includes a plurality of sample images and a quality level of each of the sample images; Using the sample set and the super-resolution algorithm, an initial super-network is trained; Selecting one or more nodes in each layer of the initial super network based on a neural structure search (NAS) strategy, and determining a substructure based on the one or more nodes selected in each layer; According to the sample set, each of the substructures is trained to obtain a subnetwork corresponding to each of the substructures; The candidate resolution network is determined according to the sub-network.
2. The image processing method according to claim 1, characterized in that: The obtaining of the quality level of the image to be processed includes: Acquire characteristic parameters of the image to be processed; the characteristic parameters include one or more of image brightness, image blur and image texture; The characteristic parameters are input into a support vector machine (SVM) model to generate a quality grade of the image to be processed.
3. The image processing method according to claim 2, characterized in that the SVM model includes at least two binary classification models, and the step of inputting the feature parameters into the support vector machine (SVM) model to generate the quality level of the image to be processed comprises: Inputting the characteristic parameters into each of the two-classification models respectively to obtain the output result of each of the two-classification models; According to the output results of each of the binary classification models, the quality level of the image to be processed is obtained.
4. The image processing method according to claim 1, characterized in that: The step of training each of the substructures according to the sample set to obtain a subnetwork corresponding to each of the substructures includes: Acquiring network parameters of the initial supernetwork; In the network parameters, determining initialization parameters of each of the substructures; Each of the substructures is trained using the sample set and the initialization parameters of each of the substructures to obtain a subnetwork corresponding to each of the substructures.
5. The image processing method according to claim 1, characterized in that: The determining the candidate resolution network according to the sub-network includes: Acquire a test set; the test set includes at least one test image of the same quality level; Utilizing each of the sub-networks to optimize each of the test images to obtain a plurality of optimized images; Acquiring the resolution of each of the optimized images; A candidate resolution network corresponding to the quality level of the test image is determined according to the resolution of each of the optimized images.
6. The image processing method according to any one of claims 1 to 3, characterized in that: The method for obtaining the candidate resolution network includes: Receiving candidate resolution network information from a server; the candidate resolution network information includes a network structure of the candidate resolution network, network parameters of the candidate resolution network, and a quality level corresponding to the candidate resolution network; The candidate resolution network is acquired according to the network structure of the candidate resolution network and the network parameters of the candidate resolution network, and the corresponding relationship between the candidate resolution network and the quality level is stored.
7. An image processing device, characterized in that: include: An acquisition module, used for acquiring a quality level of the image to be processed; the quality level is used to characterize the resolution of the image to be processed; A processing module, configured to determine a target resolution network corresponding to the quality level from a plurality of candidate resolution networks based on the quality level of the image to be processed acquired by the acquisition module; The processing module is further used to optimize the image to be processed by using the target resolution network to obtain a target image; the resolution of the target image is higher than the resolution of the image to be processed; The acquisition module is further used to acquire a sample set; the sample set includes a plurality of sample images and a quality level of each of the sample images; The processing module is further used to train an initial super network using the sample set and the super-resolution algorithm; Selecting one or more nodes in each layer of the initial super network based on a neural structure search (NAS) strategy, and determining a substructure based on the one or more nodes selected in each layer; According to the sample set, each of the substructures is trained to obtain a subnetwork corresponding to each of the substructures; and the candidate resolution network is determined according to the subnetwork.
8. The device according to claim 7, characterized in that The acquisition module is specifically used to acquire the characteristic parameters of the image to be processed; the characteristic parameters include one or more of image brightness, image blur and image texture; The acquisition module is also specifically used to input the feature parameters into a support vector machine (SVM) model to generate the quality level of the image to be processed.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
