Image classification method, image classification model training method, and related device
By combining a reconstruction network and an image quality assessment network, the system uses peak signal-to-noise ratio and subjective opinion scores to determine the local and overall blur levels of images, thus solving the problem of inaccurate image blur level classification and achieving higher accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASHANG CONSUMER FINANCE CO LTD
- Filing Date
- 2021-09-27
- Publication Date
- 2026-05-01
AI Technical Summary
The accuracy of image blur classification in existing technologies is poor, mainly because the network model's global feature analysis of the image leads to inaccurate evaluation.
Image magnification is performed by reconstructing the network. By combining the peak signal-to-noise ratio (PSNR) calculation network and the image quality evaluation network, the local and overall blur levels of the image are comprehensively judged. The degree of blur is determined by using the PNR value and the average subjective opinion score.
It improves the accuracy of image blur level judgment and enhances the accuracy of image blur level classification.
Smart Images

Figure CN115880516B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, specifically relating to an image classification method, an image classification model training method, and related equipment. Background Technology
[0002] As is well known, images are typically classified based on their degree of blur for easier processing. Current technologies usually evaluate image blur using network models. However, since these models analyze and evaluate global features of the image, the accuracy of blur assessment is often poor. Therefore, existing technologies suffer from inaccurate image blur classification. Summary of the Invention
[0003] The purpose of this application is to provide an image classification method, an image classification model training method, and related equipment that can solve the problem of poor accuracy in classifying the blurriness of images.
[0004] In a first aspect, embodiments of this application provide an image classification method, including:
[0005] The first image is input into the reconstruction network to obtain the first feature map;
[0006] The first feature map is input into the peak signal-to-noise ratio (PSNR) calculation network to obtain the PSNR value;
[0007] When the peak signal-to-noise ratio is less than the first threshold, the first feature map is input into the image quality evaluation network to obtain the average subjective opinion score of the first image.
[0008] The degree of blur in the first image is determined based on the peak signal-to-noise ratio and the average subjective opinion score;
[0009] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the first image is determined to be a second type of image, wherein the blurriness of the first type of image is less than that of the second type of image.
[0010] Secondly, embodiments of this application provide an image classification model training method, characterized in that it includes:
[0011] The peak signal-to-noise ratio (PSNR) calculation network is pre-trained using the first sample image to obtain the PSNR calculation network.
[0012] The second sample image is input into the pre-trained reconstruction network, and the output of the reconstruction network is input into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively.
[0013] A first loss value is calculated based on the output of the peak signal-to-noise ratio calculation network, and a second loss value is calculated based on the output of the image quality evaluation network to be trained.
[0014] If the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition, the image classification model is determined based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network.
[0015] In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
[0016] Thirdly, embodiments of this application provide an image classification apparatus, including:
[0017] The first input module is used to input the first image into the reconstruction network to obtain the first feature map;
[0018] The second input module is used to input the first feature map into the peak signal-to-noise ratio calculation network to obtain the peak signal-to-noise ratio value;
[0019] The third input module is used to input the first feature map into the image quality evaluation network when the peak signal-to-noise ratio is less than the first threshold, so as to obtain the average subjective opinion score of the first image.
[0020] The first determining module is used to determine the blur level of the first image based on the peak signal-to-noise ratio and the average subjective opinion score;
[0021] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the first image is determined to be a second type of image, wherein the blurriness of the first type of image is less than that of the second type of image.
[0022] Fourthly, embodiments of this application provide an image classification model training apparatus, characterized in that it includes:
[0023] The first training module is used to pre-train the peak signal-to-noise ratio (PSNR) calculation network to be trained using the first sample image, so as to obtain the PSNR calculation network.
[0024] The second training module is used to input the second sample image into the pre-trained reconstruction network, and input the output of the reconstruction network into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively.
[0025] The calculation module is used to calculate a first loss value based on the output of the peak signal-to-noise ratio calculation network and a second loss value based on the output of the image quality evaluation network to be trained.
[0026] The second determining module is used to determine the image classification model based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network, provided that the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition.
[0027] In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
[0028] Fifthly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.
[0029] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.
[0030] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect, or to implement the steps of the method as described in the second aspect.
[0031] In this embodiment, a reconstruction network is used to magnify the first image to obtain a first feature map. Then, a peak signal-to-noise ratio (PSNR) calculation network is used to determine the local blur level of the first image, and an image quality evaluation network is used to determine the overall blur level of the first image. By comprehensively judging the local and overall blur levels of the first image, the accuracy of image blur level judgment can be improved, thereby improving the accuracy of image blur level classification. Attached Figure Description
[0032] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a flowchart of the image classification method provided in the embodiments of this application;
[0034] Figure 2 This is a flowchart of the image classification method provided in the embodiments of this application;
[0035] Figure 3 This is a structural diagram of the reconstructed network in the image classification method provided in the embodiments of this application;
[0036] Figure 4 This is a structural diagram of the downsampling network layer in the image classification method provided in this application embodiment;
[0037] Figure 5 This is a structural diagram of the image quality assessment network in the image classification method provided in the embodiments of this application;
[0038] Figure 6 This is a structural diagram of the peak signal-to-noise ratio calculation network in the image classification method provided in this application embodiment;
[0039] Figure 7 This is a flowchart of the image classification model training method provided in the embodiments of this application;
[0040] Figure 8 This is a structural diagram of the image classification device provided in the embodiments of this application;
[0041] Figure 9 This is a structural diagram of the image classification model training device provided in the embodiments of this application;
[0042] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of this application;
[0043] Figure 11 This is a structural diagram of another electronic device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0046] With the widespread use of various digital instruments and products, images and videos have become the most commonly used information carriers in human activities. They contain a wealth of information about objects and are the primary means for people to obtain raw information about the outside world. However, during the acquisition, transmission, and storage of images, they are often subject to interference and influence from various noises, leading to image quality degradation. Furthermore, the quality of image preprocessing algorithms directly affects the effectiveness of subsequent image processing, such as image segmentation, target recognition, and edge extraction. Therefore, it is essential to ensure the clarity (i.e., quality) of the received image as much as possible before subsequent image processing. Thus, in order to obtain high-quality digital images, it is necessary to determine the degree of blur in the image to maintain the integrity of the received information. Therefore, image blur judgment and processing has always been a hot topic in image processing and computer vision research.
[0047] With the development of deep learning, in-depth research and innovation have been carried out in image quality assessment algorithms. In 2017, Deep Learning Image Quality (DeepBIQ) was proposed, which uses transfer learning of convolutional neural networks (CNNs) pre-trained for classification tasks to achieve Blind Image Quality Assessment (BIQA). The overall image quality is estimated by accumulating and averaging the predicted scores of sub-regions of the image. Fine-tuning uses randomly initialized values to replace the last fully connected layer of the pre-trained CNN as a new CNN. Transfer learning increases the network depth, but its performance is affected by the original task. In 2018, DIQaM-NF (Deep ImageQuality Measure for NR IQA) was proposed as a deep image quality assessment method for no-reference image quality assessment. The method is named deepIQA in the authors' references, and some citations also use this name. It is based on end-to-end training and contains 10 convolutional layers, 5 pooling layers, and 2 fully connected layers. Perhaps due to insufficient data to support this depth, experimental results did not surpass shallow networks like IQA-CNN.
[0048] Currently, most image blur detection algorithms in industry use classification. However, there isn't a clear, separable line to distinguish the degree of blur in an image. Furthermore, current quality assessment algorithms evaluate images based on overall perception, often failing to distinguish between local blur noise and real-world noise. This leads to low accuracy in image blur detection and consequently, poor accuracy in image blur degree classification. Therefore, this application proposes an image classification method.
[0049] The image classification method, image classification model training method, and related equipment provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0050] See Figure 1 , Figure 1 This is a flowchart of an image classification method provided in an embodiment of this application, such as... Figure 1 As shown, it includes the following steps:
[0051] Step 101: Input the first image into the reconstruction network to obtain the first feature map;
[0052] In this embodiment, all images requiring image classification can be adjusted to a preset size to facilitate recognition and classification by the image classification model. For example, in some embodiments, before inputting the first image into the reconstruction network to obtain the first feature map, the method further includes: adjusting the size of the first image to be processed to a preset size as input to the reconstruction network. The size of the preset size can be set according to actual needs, for example, it can be 512*512.
[0053] It should be understood that if the size of the image to be processed is already a preset size, then no adjustment is needed. The resolution of the first feature map described above is larger than that of the first image.
[0054] Optionally, the above image classification model includes a reconstruction network and an image quality assessment network, a peak signal-to-noise ratio (PSNR) calculation network and an image quality assessment network. The reconstruction network, which can be called an image super-resolution reconstruction network, is used to enlarge the image. Inputting the first image into the reconstruction network to obtain the first feature map can be understood as inputting a feature map representing the first image of a preset size into the reconstruction network, performing image enlargement processing on the feature map, and obtaining the first feature map.
[0055] It should be noted that by reconstructing the network to amplify the image, the degree of blurring can be amplified, which can help the peak signal-to-noise ratio calculation network and the image quality evaluation network to judge the degree of blurring.
[0056] Step 102: Input the first feature map into the peak signal-to-noise ratio calculation network to obtain the peak signal-to-noise ratio value;
[0057] In this embodiment, the peak signal-to-noise ratio (PSNR) calculation network is used to simulate the PSNR calculation formula and calculate the PSNR value on the first feature map. Based on this PSNR value, the blur level of the target object can be initially classified. For example, if the PSNR value is greater than or equal to a first threshold, the first image is determined to be a first-class image; if the PSNR value is less than the first threshold, the blur level of the target object is evaluated based on the image quality evaluation network.
[0058] Step 103: If the peak signal-to-noise ratio is less than the first threshold, the first feature map is input into the image quality evaluation network to obtain the mean opinion score (MOS) of the first image.
[0059] In this embodiment, the MOS value output by the image quality evaluation network can range from 1 to 5, where a higher MOS value indicates higher image sharpness. For example, a MOS value of 5 represents the sharpest image, and a MOS value of 1 represents the blurriest image, or the worst quality image.
[0060] Step 104: Determine the blur level of the first image based on the peak signal-to-noise ratio and the average subjective opinion score;
[0061] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the first image is determined to be a second type of image, wherein the blurriness of the first type of image is less than that of the second type of image.
[0062] Optionally, the definitions of the first and second types of images can be set according to actual needs, specifically related to the values of the first and second thresholds. For example, in some implementations, assuming the first threshold is set to 37.7 and the second threshold is set to 3.5, the first type of image can be understood as a clear image, and the second type of image can be understood as a blurred image. Figure 2As shown, the input image is first preprocessed to obtain a first image. Then, this first image is input into a reconstruction network for image magnification to obtain a first feature map. Next, a peak signal-to-noise ratio (PSNR) calculation network is used to calculate the PSNR value. If the PSNR value is greater than or equal to 37.7, the first image is determined to be a sharp image; if the PSNR value is less than 37.7, the first feature map is input into an image quality assessment network to obtain an average subjective opinion score of 1 to 5. If the average subjective opinion score is greater than or equal to 3.5, the first image is determined to be a sharp image; if the average subjective opinion score is less than 3.5, the first image is determined to be a blurry image.
[0063] Of course, in other embodiments, the first type of image described above can also be defined as a high-definition image, and the second type of image can be defined as a normal image. The specific classification is not further limited here.
[0064] In this embodiment, a reconstruction network is used to magnify the first image to obtain a first feature map. Then, a peak signal-to-noise ratio (PSNR) calculation network is used to determine the local blur level of the first image, and an image quality evaluation network is used to determine the overall blur level of the first image. By comprehensively judging the local and overall blur levels of the first image, the accuracy of image blur level judgment can be improved, thereby improving the accuracy of image blur level classification.
[0065] Optionally, such as Figure 3 As shown, in some embodiments, the reconstruction network includes a first shallow feature extraction network layer, N downsampling network layers, N first upsampling network layers, a first convolutional layer, and a second upsampling network layer connected in sequence, where N is an integer greater than 1. The N downsampling network layers are connected in series, and the N first upsampling network layers are connected in series. The input of the nth first upsampling network layer is the feature obtained by fusing the output of its previous network layer and the output of the (N-n+1)th downsampling network layer. The step of inputting the first image into the reconstruction network to obtain the first feature map includes:
[0066] The first image is input into the first shallow feature extraction network layer for shallow feature extraction processing to obtain the first sub-feature map;
[0067] The first sub-feature map is sampled using the N downsampling network layers and the N first upsampling network layers to obtain the second sub-feature map;
[0068] The third sub-feature map is obtained by smoothing the second sub-feature map using the first convolutional layer;
[0069] The third sub-feature map is upsampled using the second upsampling network layer to obtain the first feature map.
[0070] It should be understood that the value of N can be set according to actual needs. For example, in this embodiment, the value of N can be 5.
[0071] Optionally, the Nth first upsampling network layer and the second upsampling network layer can adopt a deconvolutional (or transposed convolution) network structure, and the aforementioned N first downsampling network layers and the first N-1 first upsampling network layers can adopt a convolutional network structure. The aforementioned first shallow feature extraction network layer can adopt two 3*3 convolutional layers. The aforementioned first convolutional layer can adopt two 3*3 convolutional layers.
[0072] In this embodiment of the application, the convolution kernel of each convolution in the reconstructed network can be 64. For example... Figure 3 As shown, the network reconstruction process is as follows:
[0073] First, shallow feature extraction is performed using two 3x3 convolutional layers to obtain the first sub-feature map. The two 3x3 convolutional layers can extract the texture information of the image, which includes mid-to-high frequency information.
[0074] The extracted feature maps are then fed into a downsampling network layer for five downsampling iterations, and the final sampling result is output to a first upsampling network layer for four upsampling iterations to keep the input and output feature maps of the reconstructed network unchanged. Residual learning is performed on each downsampling and upsampling iteration to supplement high-frequency information lost during feature extraction. Downsampling increases robustness to small perturbations in the input image, such as image translation and rotation, reduces the risk of overfitting, lowers computational cost, and increases the receptive field. Upsampling restores abstract features to the original image size, and this encoding and decoding process of upsampling and downsampling allows for the extraction of abstract features representing the image, such as blurred texture features.
[0075] Secondly, the second sub-feature map, which was last upsampled, is smoothed using two 3*3 convolutional layers to obtain the third sub-feature map.
[0076] Finally, the third sub-feature map is fed into a transposed convolution (Deconv) for final upsampling to obtain the first feature map.
[0077] It should be noted that the structure of the downsampling network layer described above can be configured according to actual needs, such as... Figure 4As shown, in some embodiments, the downsampling network layer described above may include two residual layers, one convolutional layer, and one max pooling layer. In a downsampling process, residual learning can be performed first by the two residual layers to supplement the information lost during downsampling. Then, a 3*3 convolutional layer is used for further feature extraction, and finally, a max pooling layer is used for downsampling.
[0078] Optionally, in some embodiments, the image quality assessment network includes a series of convolutional network layers and a first fully connected network layer connected in sequence; wherein, the step of inputting the first feature map into the image quality assessment network to obtain the average subjective opinion score of the first image includes:
[0079] The first feature map is input into the multi-layer convolutional network for feature extraction and fusion processing to obtain a second feature map with high-frequency abstract features.
[0080] The second feature map is reduced in dimensionality using the first fully connected network layer to obtain the average subjective opinion score.
[0081] In this embodiment of the application, the number of the first fully connected network layers can be 2, wherein the last first fully connected network layer is used to output a MOS value of 0 to 5.
[0082] like Figure 5 As shown, the multi-layer convolutional network is formed by the following layers connected in series: two 3*3 third convolutional layers, a first mixed depth convolutional kernel layer, a first connection layer, a 1*1 fourth convolutional layer, a 2*2 first max pooling layer, a second mixed depth convolutional kernel layer, a second connection layer, a 1*1 fifth convolutional layer, a 2*2 second max pooling layer, a third mixed depth convolutional kernel layer, a third connection layer, a 1*1 sixth convolutional layer, a 2*2 third max pooling layer, two 3*3 seventh convolutional layers, a 1*1 eighth convolutional layer, and a second global pooling layer. The first mixed depth convolutional kernel layer is a mixed depth convolutional kernel layer of 3*3, 5*5, 7*7, and 9*9; the second mixed depth convolutional kernel layer is a mixed depth convolutional kernel layer of 3*3, 5*5, and 7*7; and the third mixed depth convolutional kernel layer is a mixed depth convolutional kernel layer of 3*3 and 5*5. The first, second, and third connection layers can all be understood as concat layers.
[0083] In this embodiment of the application, the process by which the multi-layer convolutional network performs feature extraction and fusion processing on the first feature map to obtain a second feature map with high-frequency abstract features is as follows:
[0084] The first stage: First, two 3*3 third convolutional layers are used for shallow feature extraction, then 3*3, 5*5, 7*7, and 9*9 first mixed depth convolutional kernel layers are used for feature extraction. The extracted features are fused through the first connection layer, then a 1*1 fourth convolutional layer is used as the bottleneck layer for dimensionality reduction and feature fusion. Then, a 2*2 first max pooling layer is used for pooling to halve the feature map output by the previous layer.
[0085] The second stage: First, the feature map output by the first max pooling layer is extracted by the second hybrid depth convolutional kernel layer of 3*3, 5*5, and 7*7. The extracted features are fused by the second connection layer. Then, the fifth convolutional layer of 1*1 is used as the bottleneck layer for dimensionality reduction and feature fusion. Next, a second max pooling layer of 2*2 is used for pooling to halve the feature map output by the previous layer.
[0086] The third stage: First, the feature map output by the second max pooling layer is extracted by the third hybrid depth convolutional kernel layer of 3*3, 5*5, and 7*7. The extracted features are fused by the second connection layer. Then, the sixth convolutional layer of 1*1 is used as the bottleneck layer for dimensionality reduction and feature fusion. Then, a third max pooling layer of 2*2 is used for pooling to halve the feature map output by the previous layer.
[0087] The three-stage cascaded network described above effectively extracts abstract features. These features are then smoothed using two 3x3 seventh convolutional layers, followed by dimensionality reduction using a 1x1 eighth convolutional layer. Next, a second global pooling layer pools the feature map of each channel into a single value. Finally, two fully connected first network layers are used for dimensionality reduction to obtain MOS values from 1 to 5.
[0088] Optionally, such as Figure 6 As shown, in some embodiments, the peak signal-to-noise ratio (PSNR) calculation network includes a first residual network layer, a feature extraction network layer, a second residual network layer, a second convolutional layer, a first global pooling layer, and a second fully connected network layer connected in sequence. Specifically, the first residual network layer performs global residual processing on the first feature map to obtain a fourth sub-feature map; the feature extraction network layer performs high-frequency detail information feature extraction processing on the fourth sub-feature map to obtain a fifth sub-feature map; the second residual network layer performs global residual processing on the fifth sub-feature map to obtain a sixth sub-feature map; the second convolutional layer performs smoothing processing on the feature map resulting from the fusion of the sixth and fourth sub-feature maps to obtain a seventh sub-feature map; the first global pooling layer compresses the seventh sub-feature map to obtain an eighth sub-feature map; and the second fully connected network layer performs dimensionality reduction processing on the eighth sub-feature map to obtain the PSNR value.
[0089] In this embodiment, the purpose of using the first residual network layer and the second residual network layer for global residual is to supplement the mid-to-high frequency detail information lost during convolution. Optionally, the first residual network layer, the feature extraction network layer, the second residual network layer, and the second convolutional layer can all adopt a 3*3 convolutional structure. The feature extraction network layer can be two 3*3 convolutional layers.
[0090] It should be noted that the PSNR value calculated using the formula is only a pixel-level parameter. However, the quality of an image cannot be judged solely by PSNR. In this embodiment, the reconstruction network can reconstruct a high-resolution image using a dictionary. However, the dictionary contains various mappings, which can increase the feasibility of the PSNR index within a certain range, thereby improving the accuracy of image blur judgment.
[0091] It should be noted that the image classification method provided in this application embodiment can be applied to any scenario where image blur degree judgment is required. For example, in some embodiments, the above image classification method can be applied to image receiving scenarios to ensure the integrity of image receiving.
[0092] Suppose that when the first electronic device receives multiple images transmitted by the second electronic device, after each image is received, the currently received image can be input into the image classification model to determine the degree of fuzziness, and the image information that is determined to be a second type of image can be saved.
[0093] After reception is complete, a retransmission request carrying the image information can be sent to the second electronic device. During the retransmission process, the image is continued to be input into the image classification model for fuzzy recognition until all received images are classified as first-class images. In this embodiment, the image classification method described above can ensure the quality of image reception.
[0094] Furthermore, referring to Figure 7 This application also provides an image classification model training method, such as... Figure 7 As shown, the training method for this image classification model includes:
[0095] Step 701: Pre-train the peak signal-to-noise ratio (PSNR) calculation network using the first sample image to obtain the PSNR calculation network.
[0096] Step 702: Input the second sample image into the pre-trained reconstruction network, and input the output of the reconstruction network into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively.
[0097] Step 703: Calculate a first loss value based on the output of the peak signal-to-noise ratio calculation network, and calculate a second loss value based on the output of the image quality evaluation network to be trained;
[0098] Step 704: If the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition, determine the image classification model based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network.
[0099] In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
[0100] In this embodiment, the above-mentioned loss convergence condition can be set according to actual needs. For example, in some embodiments, when the change of the weighted sum is less than a preset value, the network structure including the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network can be used as the image classification model. Here, the first loss value is loss1, the second loss value is loss2, and the weighted sum value is loss, which can satisfy: loss = loss1 / 30 + loss2.
[0101] It should be understood that after pre-training the peak signal-to-noise ratio (PSNR) calculation network using the first sample image, the network parameters of the trained PSNR calculation network can be fixed, and at the same time, the network parameters of the pre-trained reconstruction network are also kept fixed.
[0102] Optionally, when pre-training the peak signal-to-noise ratio (PSNR) calculation network using the first sample image, the high-resolution image can be degraded to different degrees. The degradation model first uses bitriplex downsampling, then uses different super-resolution algorithms to super-resolution the downsampled image, and then calculates the PSNR. This PSNR value is used as the training label. We used free data to create 3000 data points (i.e., 3000 first sample images), and the labels are all calculated PSNR values.
[0103] In this embodiment, the peak signal-to-noise ratio (PSNR) calculation network is first pre-trained using the first sample image. Then, the pre-trained reconstruction network, the pre-trained PSNR calculation network, and the image quality evaluation network to be trained are jointly trained to obtain an image classification model. In this way, the trained image classification model can make a comprehensive judgment on the local and overall aspects of the first image, thereby improving the accuracy of image blur degree judgment and thus improving the accuracy of image blur degree classification.
[0104] It should be noted that during training, the processing of the training sample images by the reconstruction network, peak signal-to-noise ratio calculation network, and image quality assessment network is similar to the processing of the first image by the reconstruction network, peak signal-to-noise ratio calculation network, and image quality assessment network in the above embodiments. For details, please refer to the description in the above embodiments. For example, the processing flow of the second sample image by each network structure in the training process based on the second sample image includes:
[0105] First, the second sample image can be input into the reconstruction network to obtain the third feature map;
[0106] Then, the third feature map is input into the peak signal-to-noise ratio (PSNR) calculation network to obtain the PSNR value;
[0107] Next, if the peak signal-to-noise ratio is less than the first threshold, the third feature map is input into the image quality assessment network to obtain the average subjective opinion score of the second sample image.
[0108] Finally, the blur level of the second sample image is determined based on the peak signal-to-noise ratio and the average subjective opinion score;
[0109] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the second sample image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the second sample image is determined to be a second type of image, and the blurriness of the first type of image is less than that of the second type of image.
[0110] Optionally, the reconstruction network includes a first shallow feature extraction network layer, N downsampling network layers, N first upsampling network layers, a first convolutional layer, and a second upsampling network layer connected in sequence, where N is an integer greater than 1. The N downsampling network layers are concatenated in series, and the N first upsampling network layers are concatenated in series. The input of the nth first upsampling network layer is the feature obtained by fusing the output of its previous network layer and the output of the (N-n+1)th downsampling network layer. The second sample image is input into the reconstruction network to obtain the third feature map, which includes:
[0111] The second sample image is input into the first shallow feature extraction network layer for shallow feature extraction processing to obtain the ninth sub-feature map;
[0112] The ninth sub-feature map is sampled using the N downsampling network layers and the N first upsampling network layers to obtain the tenth sub-feature map;
[0113] The eleventh sub-feature map is obtained by smoothing the tenth sub-feature map using the first convolutional layer.
[0114] The eleventh sub-feature map is upsampled using the second upsampling network layer to obtain the fourth feature map.
[0115] Optionally, the image quality assessment network includes a series of convolutional network layers and a first fully connected network layer connected in sequence; wherein, the step of inputting the third feature map into the image quality assessment network to obtain the average subjective opinion score of the second sample image includes:
[0116] The third feature map is input into the multi-layer convolutional network for feature extraction and fusion processing to obtain a fourth feature map with high-frequency abstract features;
[0117] The fourth feature map is reduced in dimensionality using the first fully connected network layer to obtain the average subjective opinion score.
[0118] Optionally, the peak signal-to-noise ratio (PSNR) calculation network includes a first residual network layer, a feature extraction network layer, a second residual network layer, a second convolutional layer, a first global pooling layer, and a second fully connected network layer connected in sequence; wherein, the first residual network layer is used to perform global residual processing on the fourth feature map to obtain a twelfth sub-feature map, the feature extraction network layer is used to perform high-frequency detail information feature extraction processing on the twelfth sub-feature map to obtain a thirteenth sub-feature map, the second residual network layer is used to perform global residual processing on the thirteenth sub-feature map to obtain a fourteenth sub-feature map, the second convolutional layer is used to perform smoothing processing on the feature map after fusing the fourteenth and twelfth sub-feature maps to obtain a fifteenth sub-feature map, the first global pooling layer is used to compress the fifteenth sub-feature map to obtain a sixteenth sub-feature map, and the second fully connected network layer is used to perform dimensionality reduction processing on the sixteenth sub-feature map to obtain the PSNR value.
[0119] It should be noted that when obtaining the reconstructed network through pre-training, assuming the final magnification factor of the reconstructed network is 4 times, it can be trained directly to achieve 4 times magnification in one go, or it can be trained through three pre-training stages to gradually achieve 4 times magnification. For example, each stage magnifies the reconstructed network by 4 times using sample data. 1 / 3 This training method not only reduces the burden of network training, but also allows the network to more easily obtain realistic results step by step through gradual scaling.
[0120] It should be noted that the image classification method provided in this application embodiment can be executed by an image classification device, or a control module within that image classification device for executing the loading image classification method. This application embodiment uses the execution of the loading image classification method by an image classification device as an example to illustrate the image classification method provided in this application embodiment.
[0121] See Figure 8 , Figure 8 This is a structural diagram of the image classification device provided in the embodiments of this application, such as... Figure 8 As shown, the image classification device 800 includes:
[0122] The first input module 801 is used to input the first image into the reconstruction network to obtain the first feature map;
[0123] The second input module 802 is used to input the first feature map into the peak signal-to-noise ratio calculation network to obtain the peak signal-to-noise ratio value;
[0124] The third input module 803 is used to input the first feature map into the image quality evaluation network when the peak signal-to-noise ratio is less than the first threshold, so as to obtain the average subjective opinion score of the first image.
[0125] The first determining module 804 is used to determine the blur level of the first image based on the peak signal-to-noise ratio and the average subjective opinion score;
[0126] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the first image is determined to be a second type of image, wherein the blurriness of the first type of image is less than that of the second type of image.
[0127] Optionally, the reconstructed network includes a first shallow feature extraction network layer, N downsampling network layers, N first upsampling network layers, a first convolutional layer, and a second upsampling network layer connected in sequence, where N is an integer greater than 1. The N downsampling network layers are connected in series, and the N first upsampling network layers are connected in series. The input of the nth first upsampling network layer is the feature obtained by fusing the output of its previous network layer and the output of the (N-n+1)th downsampling network layer. Specifically, the first input module 801 is used to perform the following operations:
[0128] The first image is input into the first shallow feature extraction network layer for shallow feature extraction processing to obtain the first sub-feature map;
[0129] The first sub-feature map is sampled using the N downsampling network layers and the N first upsampling network layers to obtain the second sub-feature map;
[0130] The third sub-feature map is obtained by smoothing the second sub-feature map using the first convolutional layer;
[0131] The third sub-feature map is upsampled using the second upsampling network layer to obtain the first feature map.
[0132] Optionally, the image quality evaluation network includes a series of convolutional network layers and a first fully connected network layer connected in sequence; wherein, the second input module is specifically used to perform the following operations:
[0133] The first feature map is input into the image quality assessment network for feature extraction and fusion processing to obtain a second feature map with high-frequency abstract features;
[0134] The second feature map is reduced in dimensionality using the first fully connected network layer to obtain the average subjective opinion score.
[0135] Optionally, the peak signal-to-noise ratio (PSNR) calculation network includes a first residual network layer, a feature extraction network layer, a second residual network layer, a second convolutional layer, a first global pooling layer, and a second fully connected network layer connected in sequence; wherein, the first residual network layer is used to perform global residual processing on the first feature map to obtain a fourth sub-feature map, the feature extraction network layer is used to perform high-frequency detail information feature extraction processing on the fourth sub-feature map to obtain a fifth sub-feature map, the second residual network layer is used to perform global residual processing on the fifth sub-feature map to obtain a sixth sub-feature map, the second convolutional layer is used to perform smoothing processing on the feature map after fusing the sixth sub-feature map and the fourth sub-feature map to obtain a seventh sub-feature map, the first global pooling layer is used to compress the seventh sub-feature map to obtain an eighth sub-feature map, and the second fully connected network layer is used to perform dimensionality reduction processing on the eighth sub-feature map to obtain the PSNR value.
[0136] Optionally, the image classification device 800 further includes:
[0137] An adjustment module is used to adjust the size of the first image to be processed to the preset size.
[0138] It should be noted that the image classification model training method provided in this application embodiment can be executed by an image classification model training device, or a control module within that device for executing the image classification model training method. This application embodiment uses the execution of the image classification model training method by an image classification model training device as an example to illustrate the image classification model training method provided in this application embodiment.
[0139] See Figure 9 , Figure 9 This is a structural diagram of the image classification model training device provided in the embodiments of this application, such as... Figure 9 As shown, the image classification model training device 900 includes:
[0140] The first training module 901 is used to pre-train the peak signal-to-noise ratio (PSNR) calculation network to be trained using the first sample image, so as to obtain the PSNR calculation network.
[0141] The second training module 902 is used to input the second sample image into the pre-trained reconstruction network, and input the output of the reconstruction network into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively.
[0142] The calculation module 903 is used to calculate a first loss value based on the output of the peak signal-to-noise ratio calculation network and to calculate a second loss value based on the output of the image quality evaluation network to be trained.
[0143] The second determining module 904 is used to determine an image classification model based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network, provided that the weighted sum of the first loss value and the second loss value meets the loss convergence condition.
[0144] In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
[0145] Optionally, the second training module 902 includes:
[0146] The first input unit is used to input a second sample image of a preset size into the reconstruction network to obtain a third feature map with magnified resolution.
[0147] The second input power supply is used to input the third feature map into the peak signal-to-noise ratio calculation network to obtain the peak signal-to-noise ratio value.
[0148] The third input unit is used to input the third feature map into the image quality evaluation network when the peak signal-to-noise ratio is less than the first threshold, so as to obtain the average subjective opinion score of the second sample image.
[0149] A determining unit is used to determine the blur level classification of the second sample image;
[0150] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the second sample image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the second sample image is determined to be a second type of image, and the blurriness of the first type of image is less than that of the second type of image.
[0151] Optionally, the reconstructed network includes a first shallow feature extraction network layer, N downsampling network layers, N first upsampling network layers, a first convolutional layer, and a second upsampling network layer connected in sequence, where N is an integer greater than 1. The N downsampling network layers are concatenated in series, and the N first upsampling network layers are concatenated in series. The input of the nth first upsampling network layer is the feature obtained by fusing the output of its previous network layer and the output of the (N-n+1)th downsampling network layer. Specifically, the first input unit is used to perform the following operations:
[0152] The second sample image of the preset size is input into the first shallow feature extraction network layer for shallow feature extraction processing to obtain the ninth sub-feature map;
[0153] The ninth sub-feature map is sampled using the N downsampling network layers and the N first upsampling network layers to obtain the tenth sub-feature map;
[0154] The eleventh sub-feature map is obtained by smoothing the tenth sub-feature map using the first convolutional layer.
[0155] The eleventh sub-feature map is upsampled using the second upsampling network layer to obtain the fourth feature map.
[0156] Optionally, the image quality evaluation network includes a series of convolutional network layers and a first fully connected network layer connected in sequence; wherein, the second input unit is specifically used to perform the following operations:
[0157] The third feature map is input into the multi-layer convolutional network for feature extraction and fusion processing to obtain a fourth feature map with high-frequency abstract features;
[0158] The fourth feature map is reduced in dimensionality using the first fully connected network layer to obtain the average subjective opinion score.
[0159] Optionally, the peak signal-to-noise ratio (PSNR) calculation network includes a first residual network layer, a feature extraction network layer, a second residual network layer, a second convolutional layer, a first global pooling layer, and a second fully connected network layer connected in sequence; wherein, the first residual network layer is used to perform global residual processing on the fourth feature map to obtain a twelfth sub-feature map, the feature extraction network layer is used to perform high-frequency detail information feature extraction processing on the twelfth sub-feature map to obtain a thirteenth sub-feature map, the second residual network layer is used to perform global residual processing on the thirteenth sub-feature map to obtain a fourteenth sub-feature map, the second convolutional layer is used to perform smoothing processing on the feature map after fusing the fourteenth and twelfth sub-feature maps to obtain a fifteenth sub-feature map, the first global pooling layer is used to compress the fifteenth sub-feature map to obtain a sixteenth sub-feature map, and the second fully connected network layer is used to perform dimensionality reduction processing on the sixteenth sub-feature map to obtain the PSNR value.
[0160] The image classification device and image classification model training device in the embodiments of this application can be devices, or components, integrated circuits, or chips in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. The embodiments of this application do not impose specific limitations.
[0161] The image classification device and image classification model training device in the embodiments of this application can be devices with an operating system. The operating system can be Android, iOS, or other possible operating systems, and this application does not specifically limit them.
[0162] The image classification device and image classification model training device provided in this application embodiment can achieve Figures 1 to 7 To avoid repetition, the various processes in the method embodiments will not be described again here.
[0163] Optionally, this application embodiment also provides an electronic device, including a processor 1010, a memory 1009, and a program or instructions stored in the memory 1009 and executable on the processor 1010. When the program or instructions are executed by the processor 1010, they implement the various processes of the above-described image classification method or image classification model training method embodiments and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0164] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0165] Figure 11 A schematic diagram of the hardware structure of an electronic device for implementing the various embodiments of this application.
[0166] The electronic device 1100 includes, but is not limited to, components such as: radio frequency unit 1101, network module 1102, audio output unit 1103, input unit 1104, sensor 1105, display unit 1106, user input unit 1107, interface unit 1108, memory 1109, and processor 1110.
[0167] Those skilled in the art will understand that the electronic device 1100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0168] The processor 1110 is used to perform the following operations:
[0169] The first image is input into the reconstruction network to obtain the first feature map;
[0170] The first feature map is input into the peak signal-to-noise ratio (PSNR) calculation network to obtain the PSNR value;
[0171] When the peak signal-to-noise ratio is less than the first threshold, the first feature map is input into the image quality evaluation network to obtain the average subjective opinion score of the first image.
[0172] The degree of blur in the first image is determined based on the peak signal-to-noise ratio and the average subjective opinion score;
[0173] Specifically, if the peak signal-to-noise ratio is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first type of image; if the average subjective opinion score is less than the second threshold, the first image is determined to be a second type of image, wherein the blurriness of the first type of image is less than that of the second type of image.
[0174] Alternatively, processor 1110 is used to perform the following operations:
[0175] The peak signal-to-noise ratio (PSNR) calculation network is pre-trained using the first sample image to obtain the PSNR calculation network.
[0176] The second sample image is input into the pre-trained reconstruction network, and the output of the reconstruction network is input into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively.
[0177] A first loss value is calculated based on the output of the peak signal-to-noise ratio calculation network, and a second loss value is calculated based on the output of the image quality evaluation network to be trained.
[0178] If the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition, the image classification model is determined based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network.
[0179] In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
[0180] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image classification method or image classification model training method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0181] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0182] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image classification method or image classification model training method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0183] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0184] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0186] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image classification method, characterized in that, include: The first image is input into the reconstruction network to obtain the first feature map; The first feature map is input into the peak signal-to-noise ratio (PSNR) calculation network to obtain the PSNR value of the first image; When the peak signal-to-noise ratio is less than the first threshold, the first feature map is input into the image quality evaluation network to obtain the average subjective opinion score of the first image. The degree of blur in the first image is determined based on the peak signal-to-noise ratio and the average subjective opinion score; The peak signal-to-noise ratio (PSNR) calculation network and the image quality evaluation network are both neural network models trained on sample images. When the PSNR value is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first-class image. When the average subjective opinion score is less than the second threshold, the first image is determined to be a second-class image. The blurriness of the first-class image is less than that of the second-class image.
2. The method according to claim 1, characterized in that, The reconstructed network comprises a first shallow feature extraction network layer, N downsampling network layers, N first upsampling network layers, a first convolutional layer, and a second upsampling network layer, connected sequentially, where N is an integer greater than 1. The N downsampling network layers are concatenated, and the N first upsampling network layers are concatenated. The input of the nth first upsampling network layer is the feature obtained by fusing the output of its previous network layer and the output of the (N-n+1)th downsampling network layer. The step of inputting the first image into the reconstructed network to obtain the first feature map includes: The first image is input into the first shallow feature extraction network layer for shallow feature extraction processing to obtain the first sub-feature map; The first sub-feature map is sampled using the N downsampling network layers and the N first upsampling network layers to obtain the second sub-feature map; The third sub-feature map is obtained by smoothing the second sub-feature map using the first convolutional layer; The third sub-feature map is upsampled using the second upsampling network layer to obtain the first feature map.
3. The method according to claim 1, characterized in that, The image quality assessment network includes a series of convolutional network layers and a first fully connected network layer connected in sequence; wherein, the step of inputting the first feature map into the image quality assessment network to obtain the average subjective opinion score of the first image includes: The first feature map is input into the multi-layer convolutional network for feature extraction and fusion processing to obtain a second feature map with high-frequency abstract features. The second feature map is reduced in dimensionality using the first fully connected network layer to obtain the average subjective opinion score.
4. The method according to claim 1, characterized in that, The peak signal-to-noise ratio (PSNR) calculation network comprises a first residual network layer, a feature extraction network layer, a second residual network layer, a second convolutional layer, a first global pooling layer, and a second fully connected network layer connected in sequence. Specifically, the first residual network layer performs global residual processing on the first feature map to obtain a fourth sub-feature map; the feature extraction network layer performs high-frequency detail feature extraction on the fourth sub-feature map to obtain a fifth sub-feature map; the second residual network layer performs global residual processing on the fifth sub-feature map to obtain a sixth sub-feature map; the second convolutional layer performs smoothing processing on the feature map resulting from the fusion of the sixth and fourth sub-feature maps to obtain a seventh sub-feature map; the first global pooling layer compresses the seventh sub-feature map to obtain an eighth sub-feature map; and the second fully connected network layer performs dimensionality reduction processing on the eighth sub-feature map to obtain the PSNR value.
5. The method according to claim 1, characterized in that, Before inputting the first image into the reconstruction network to obtain the first feature map, the method further includes: Adjust the size of the first image to be processed to the preset size.
6. A method for training an image classification model, characterized in that, include: The peak signal-to-noise ratio (PSNR) calculation network is pre-trained using the first sample image to obtain the PSNR calculation network. The second sample image is input into the pre-trained reconstruction network, and the output of the reconstruction network is input into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively. A first loss value is calculated based on the output of the peak signal-to-noise ratio calculation network, and a second loss value is calculated based on the output of the image quality evaluation network to be trained. If the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition, the image classification model is determined based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network. In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
7. An image classification device, characterized in that, include: The first input module is used to input the first image into the reconstruction network to obtain the first feature map; The second input module is used to input the first feature map into the peak signal-to-noise ratio calculation network to obtain the peak signal-to-noise ratio value of the first image; The third input module is used to input the first feature map into the image quality evaluation network when the peak signal-to-noise ratio is less than the first threshold, so as to obtain the average subjective opinion score of the first image. The first determining module is used to determine the blur level of the first image based on the peak signal-to-noise ratio and the average subjective opinion score; The peak signal-to-noise ratio (PSNR) calculation network and the image quality evaluation network are both neural network models trained on sample images. When the PSNR value is greater than or equal to the first threshold or the average subjective opinion score is greater than or equal to the second threshold, the first image is determined to be a first-class image. When the average subjective opinion score is less than the second threshold, the first image is determined to be a second-class image. The blurriness of the first-class image is less than that of the second-class image.
8. An image classification model training device, characterized in that, include: The first training module is used to pre-train the peak signal-to-noise ratio (PSNR) calculation network to be trained using the first sample image, so as to obtain the PSNR calculation network. The second training module is used to input the second sample image into the pre-trained reconstruction network, and input the output of the reconstruction network into the peak signal-to-noise ratio calculation network and the image quality evaluation network to be trained, respectively. The calculation module is used to calculate a first loss value based on the output of the peak signal-to-noise ratio calculation network and a second loss value based on the output of the image quality evaluation network to be trained. The second determining module is used to determine an image classification model based on the peak signal-to-noise ratio calculation network, the reconstruction network, and the currently trained image quality evaluation network, provided that the weighted sum of the first loss value and the second loss value satisfies the loss convergence condition. In the image classification model, the peak signal-to-noise ratio (PSNR) calculation network is used to input the output of the reconstruction network into the image quality evaluation network to classify the degree of image blur when the output PSNR value is less than a first threshold.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the steps of the image classification method as described in any one of claims 1 to 5, or the steps of the image classification model training method as described in claim 6.
10. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the image classification method according to any one of claims 1 to 5, or the steps of the image classification model training method according to claim 6.
Citation Information
Patent Citations
Method and device for measuring quality of experience of mobile video service
CN104956673A
Classification detection network model construction method
CN111126441A