Blurred image detection method and device, equipment and storage medium
By using an image blur detection model based on the U-Net algorithm, high-frequency information prediction maps are generated and the proportion of high-frequency pixel points is judged, which solves the problem of inaccurate blur image detection in the prior art, and achieves a more accurate blur image detection effect.
Patent Information
- Application Number
- CN202411842738.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-25
AI Technical Summary
The detection results of the existing blurred image detection methods are inaccurate and have poor detection effects, especially the detection effects of mild blurred images and local blurred images.
An image blur detection model constructed based on the U-Net algorithm is used to obtain the image to be detected and input it into the model, a high-frequency information prediction map is generated, and the proportion of high-frequency pixel points is determined. Based on this proportion, whether the image is a blurred image is determined.
The accuracy and effect of blurred image detection are improved, and it is possible to more accurately determine whether the image is a blurred image, including mild and partial blurred images.
Smart Images

Figure CN119887635A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a blurred image detection method, device, equipment and storage medium. Background Art
[0002] Since large language models have high requirements for image resolution, many large language models need to use deblurring algorithms to process images. Before deblurring an image, it is necessary to determine whether the image is blurry. Blurred images are not very friendly to a series of subsequent algorithms. Therefore, in order to avoid blur interference, it is necessary to quickly determine whether the image is blurry. However, the judgment of image blur has always been a difficult problem to solve. Since the judgment process is easily affected by human subjective consciousness, it is difficult to accurately determine whether an image is a blurry image.
[0003] Based on this, in some related technologies, detection algorithms are introduced to detect images, thereby reducing the influence of human subjective consciousness on the judgment results and improving the accuracy and uniformity of the judgment results. At present, the detection algorithms for blurred images are mainly divided into traditional algorithms and deep learning algorithms.
[0004] Most traditional algorithms use the Laplace algorithm, which can highlight image areas containing rapid intensity changes by measuring the second-order derivative of the image. This method is particularly effective for detecting images with blurred edges, but its detection effect is poor for blurred images with small gradient changes. In addition, the Laplace algorithm is sensitive to image noise, has a certain dependence on the illumination level of the image, and has difficulty in perceiving motion blur that is common in images.
[0005] Deep learning algorithms mostly use binary classification algorithms, which divide a large number of sample images into two categories: clear samples and blurred samples. A large number of samples are used to train the model so that the model has the ability to distinguish between clear images and blurred images. However, the model can usually only distinguish between heavily blurred images and clear images. For slightly blurred images or partially blurred images, the model's detection results are poor. In addition, the binary classification model is also very sensitive to image noise, which may lead to poor overall detection results of the model.
[0006] Therefore, the detection results of existing blurred image detection methods are inaccurate and the detection effect is poor. Summary of the invention
[0007] The present invention provides a blurred image detection method, device, equipment and storage medium, which are used to solve the defects of the blurred image detection method in the prior art, such as inaccurate detection results and poor detection effect.
[0008] The present invention provides a blurred image detection method, comprising: obtaining an image to be detected; inputting the image to be detected into an image blur detection model to obtain a high-frequency information prediction map output by the image blur detection model; determining the proportion of high-frequency pixels in the high-frequency information prediction map; the high-frequency information prediction map is a grayscale map, the proportion of high-frequency pixels is the ratio of the number of high-frequency pixels to the total number of pixels, and the high-frequency pixels are white pixels; based on the proportion of high-frequency pixels, judging whether the image to be detected is a blurred image; the blurred image is an image in which boundary information of a target element is missing; wherein the image blur detection model is obtained by pre-training an initial model constructed based on a U-Net algorithm based on a sample image and a sample high-frequency information prediction map corresponding to the sample image.
[0009] According to a blurred image detection method provided by the present invention, the image blur detection model includes a convolution layer, a first feature extraction layer, a second feature extraction layer, a first encoder, a second encoder, a first decoder, a second decoder and a deconvolution layer; the convolution layer is used to extract features of the image to be detected and generate a first feature map; the first feature extraction layer is used to scale the image to be detected to obtain a second image to be detected, and extract features from the second image to be detected to generate a first intermediate feature; the second feature extraction layer is used to scale the image to be detected to obtain a third image to be detected, and extract features from the third image to be detected to generate a second intermediate feature; the first encoder is used to scale the first feature map and the first intermediate feature. The first encoder is used to perform feature fusion processing on the second feature map and the second intermediate feature to generate a second feature map; the second encoder is used to perform feature fusion processing on the second feature map and the second intermediate feature to generate a third feature map; the first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a fusion feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fusion feature to generate a high-frequency feature map; the deconvolution layer is used to upsample the high-frequency feature map to generate a high-frequency information prediction map; wherein the image to be detected, the second image to be detected and the third image to be detected have different image sizes, and the first feature map, the second feature map and the third feature map have different image sizes.
[0010] According to a blurred image detection method provided by the present invention, the first feature extraction layer includes a first spatial feature convolution layer and a first frequency feature convolution layer, and the second feature extraction layer includes a second spatial feature convolution layer and a second frequency feature convolution layer; wherein the first spatial feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first spatial feature; the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, perform Fourier transform on the first image feature to generate a first low-frequency information and a first high-frequency information, perform filtering processing on the first low-frequency information and the first high-frequency information to generate a second low-frequency information and a second high-frequency information, perform inverse Fourier transform on the second low-frequency information and the second high-frequency information to generate a first enhanced feature map; the first feature extraction layer is used to perform addition fusion on the first spatial feature and the first enhanced feature map to generate a first intermediate feature; the second spatial feature convolution layer is used to perform feature extraction on the third ... and the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, and the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, and the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, and the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, The first high-frequency information, the second high-frequency information, the third high-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is greater than a preset threshold; the first low-frequency information, the second low-frequency information, the third low-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is less than or equal to the preset threshold.
[0011] According to a blurred image detection method provided by the present invention, the first encoder includes a first downsampling module, a first feature attention module and a third feature extraction layer, and the second encoder includes a second downsampling module, a second feature attention module and a fourth feature extraction layer; wherein the first downsampling module is used to downsample the first feature map to generate a first high-dimensional feature; the first feature attention module is used to perform feature fusion processing on the first high-dimensional feature and the first intermediate feature to generate a first coding feature; the third feature extraction layer is used to perform feature extraction on the first coding feature to generate a second feature map; the second downsampling module is used to downsample the second feature map to generate a second high-dimensional feature; the second feature attention module is used to perform feature fusion processing on the second high-dimensional feature and the second intermediate feature to generate a second coding feature; the fourth feature extraction layer is used to perform feature extraction on the second coding feature to generate a third feature map.
[0012] According to a blurred image detection method provided by the present invention, the first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a first fused feature, and perform deconvolution calculation and Fourier transform on the first fused feature to generate a fused feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a second fused feature, and perform deconvolution calculation and Fourier transform on the second fused feature to generate a high-frequency feature map.
[0013] According to a blurred image detection method provided by the present invention, an image blur detection model is pre-trained based on a preset loss function, and the preset loss function is determined based on L1 norm loss, frequency focus loss and edge loss.
[0014] According to a blurred image detection method provided by the present invention, based on the proportion of high-frequency pixels, it is determined whether the image to be detected is a blurred image, including: determining whether the proportion of high-frequency pixels is less than a first preset threshold; if the proportion of high-frequency pixels is less than the first preset threshold, determining that the image to be detected is not a blurred image; if the proportion of high-frequency pixels is greater than or equal to the first preset threshold, determining that the image to be detected is a blurred image, and determining whether the proportion of high-frequency pixels is less than a second preset threshold; the second preset threshold is greater than the first preset threshold; if the proportion of high-frequency pixels is less than the second preset threshold, determining that the image to be detected is a slightly blurred image; if the proportion of high-frequency pixels is greater than or equal to the second preset threshold, determining that the image to be detected is a severely blurred image.
[0015] The present invention also provides a blurred image detection device, including: an acquisition module, used to acquire an image to be detected; a high-frequency information reconstruction module, used to input the image to be detected into an image blur detection model, and obtain a high-frequency information prediction map output by the image blur detection model; a determination module, used to determine the proportion of high-frequency pixels in the high-frequency information prediction map; the high-frequency information prediction map is a grayscale map, the proportion of high-frequency pixels is the ratio of the number of high-frequency pixels to the total number of pixels, and the high-frequency pixels are white pixels; a judgment module, used to judge whether the image to be detected is a blurred image based on the proportion of high-frequency pixels; the blurred image is an image in which the boundary information of the target element is missing; wherein the image blur detection model is obtained by pre-training an initial model constructed based on a U-Net algorithm based on a sample image and a sample high-frequency information prediction map corresponding to the sample image.
[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the blurred image detection methods described above is implemented.
[0017] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the blurred image detection methods described above is implemented.
[0018] The blurred image detection method, device, equipment and storage medium provided by the present invention take into account the high-frequency information of the image in the process of image blur judgment. Compared with a clear image, a blurred image has less high-frequency information and more low-frequency information. Therefore, the information characteristics of the blurred image can be used to perform image blur judgment. For each image to be detected, a high-frequency information prediction map of the image to be detected can be reconstructed through an image blur detection model. The high-frequency pixels in the high-frequency information prediction map can represent the high-frequency information of the image to be detected, and the proportion of high-frequency pixels can reflect the proportion of high-frequency information in the image to be detected. According to the proportion of high-frequency pixels, it can be quickly judged whether the image to be detected is a blurred image, and the detection result is more accurate and the detection effect is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flow chart of the blurred image detection method provided by the present invention.
[0021] Figure 2 It is a structural schematic diagram of the image blur detection model provided by the present invention.
[0022] Figure 3 It is a schematic diagram of the structure of the encoder provided by the present invention.
[0023] Figure 4 It is a schematic diagram of the process of multi-size image feature fusion of the first decoder provided by the present invention.
[0024] Figure 5 It is a flowchart of multi-size image feature fusion of the second decoder provided by the present invention.
[0025] Figure 6 It is a structural schematic diagram of the feature extraction layer provided by the present invention.
[0026] Figure 7 It is a schematic diagram of the structure of the first encoder provided by the present invention.
[0027] Figure 8 It is a structural schematic diagram of the decoder provided by the present invention.
[0028] Fig. 9 It is a structural schematic diagram of the blurred image detection device provided by the present invention.
[0029] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] See also Figure 1 , Figure 1 : is a flow chart of the blurred image detection method provided by the present invention. In this embodiment, the blurred image detection method includes steps S110 to S140, and each step is specifically as follows: S110: Acquire an image to be detected.
[0032] S120: Input the image to be detected into the image blur detection model to obtain a high-frequency information prediction map output by the image blur detection model.
[0033] A blurred image refers to an image in which the boundary information of the target element is missing. The target element is information elements such as text, objects or graphics in the image. The reduction or absence of the boundary information of the target element will cause the loss of image details and reduced clarity, thus causing the image to be blurred.
[0034] Image blur generally includes motion blur and out-of-focus blur. Compared with a clear image, a blurred image has less high-frequency information and more low-frequency information. Therefore, the above characteristics of a blurred image can be used to judge image blur.
[0035] To ensure that the reconstructed high-frequency information is more refined, the image blur detection model of this embodiment is constructed based on the U-Net algorithm. The U-Net network structure can be used to reconstruct high-frequency information of images to be detected of different sizes, so as to use the reconstructed high-frequency information to judge the blur degree of the image to be detected, and quantify the blur degree to output to meet actual market applications.
[0036] Specifically, the image to be detected is input into the image blur detection model, and the image blur detection model can reconstruct the lost high-frequency information of the image to be detected and generate a high-frequency information prediction map of the image to be detected.
[0037] To facilitate understanding of the image processing process of the image blur detection model, here we take three sizes of images to be detected as examples: (1) After the image to be detected is input into the image blur detection model, the image blur detection model can convert the image to be detected into a grayscale image and scale the image to be detected to a fixed size w*h, that is, the image to be detected is scaled to an image with a width of w and a height (i.e., length) of h (denoted as a w*h image), for example, a size of 256*256. Similarly, in order to obtain three images of different sizes, the image to be detected can be scaled to other fixed sizes respectively to obtain a second image to be detected with a size of w / 2*h / 2 (denoted as a w / 2*h / 2 image) and a third image to be detected with a size of w / 4*h / 4 (denoted as a w / 4*h / 4 image).
[0038] It can be understood that if the size of the image to be detected is 256*256, it is not necessary to perform scaling processing on the image to be detected.
[0039] (2) Perform feature extraction on the w*h image and generate a first feature map of size w*h.
[0040] (3) Perform feature extraction on the w / 2*h / 2 image to generate a first intermediate feature with a size of w / 2*h / 2, and input the first feature map with a size of w*h and the first intermediate feature with a size of w / 2*h / 2 into the first encoder for feature fusion processing to extract more useful frequency features and generate a more refined second feature map with a size of w / 2*h / 2.
[0041] (4) Perform feature extraction on the w / 4*h / 4 image to generate a second intermediate feature map of size w / 4*h / 4, and input the second feature map of size w / 2*h / 2 and the second intermediate feature of size w / 4*h / 4 into the second encoder for feature fusion processing to extract more useful frequency features and generate a more refined third feature map of size w / 4*h / 4.
[0042] (5) Through two decoders, multi-scale feature fusion is performed on the first feature map, the second feature map and the third feature map to reconstruct the lost high-frequency information and generate a high-frequency feature map.
[0043] (6) Set the threshold to upsample the reconstructed high-frequency feature map and obtain the final high-frequency information prediction map.
[0044] The high-frequency information prediction map is a grayscale map. For each pixel in the high-frequency information prediction map, it is determined whether the pixel value of the pixel is greater than or equal to a preset threshold; if the pixel value of the pixel is greater than or equal to the preset threshold, the pixel value of the pixel is set to 255, and the pixel with a pixel value of 255 is a white pixel; if the pixel value of the pixel is less than the preset threshold, the pixel value of the pixel is set to 0, and the pixel with a pixel value of 0 is a black pixel; after the above-mentioned binarization processing is completed for each pixel in the high-frequency information prediction map, the output is performed, and the pixel value of the pixel in the high-frequency information prediction map is either 0 or 255, that is, the high-frequency information prediction map only contains white pixels and black pixels, which realizes the binarization processing of the image and can effectively reduce the data dimension.
[0045] Among them, white pixels contain high-frequency information and are high-frequency pixels; black pixels contain low-frequency information and are low-frequency pixels.
[0046] S130: Determine the proportion of high-frequency pixels in the high-frequency information prediction map.
[0047] The high-frequency information prediction map is a grayscale map. The high-frequency pixel ratio is the ratio of the number of high-frequency pixels to the total number of pixels, and the high-frequency pixels are white pixels.
[0048] Specifically, the proportion of high-frequency pixels in the high-frequency information prediction map is calculated, that is, the ratio of white pixels to the total number of pixels in the high-frequency information prediction map is calculated.
[0049] S140: Based on the proportion of high-frequency pixels, determine whether the image to be detected is a blurred image.
[0050] A blurred image is an image where the boundary information of the target element is missing.
[0051] Among them, the image blur detection model is obtained by pre-training the initial model built based on the U-Net algorithm based on the sample image and the sample high-frequency information prediction map corresponding to the sample image.
[0052] The higher the proportion of high-frequency pixels, the more blurred the image to be detected is; the lower the proportion of high-frequency pixels, the clearer the image to be detected is.
[0053] The blurred image detection method provided in the present embodiment takes the high-frequency information of the image into consideration during the image blur judgment process. Compared with a clear image, a blurred image has less high-frequency information and more low-frequency information. Therefore, the information characteristics of the blurred image can be used to perform image blur judgment. For each image to be detected, a high-frequency information prediction map of the image to be detected can be reconstructed through an image blur detection model. The high-frequency pixels in the high-frequency information prediction map can represent the high-frequency information of the image to be detected, and the proportion of high-frequency pixels can reflect the proportion of high-frequency information in the image to be detected. According to the proportion of high-frequency pixels, it can be quickly determined whether the image to be detected is a blurred image, and the detection result is more accurate and the detection effect is better.
[0054] In some embodiments, the image blur detection model includes a convolution layer, a first feature extraction layer, a second feature extraction layer, a first encoder, a second encoder, a first decoder, a second decoder and a deconvolution layer; the convolution layer is used to extract features of the image to be detected and generate a first feature map; the first feature extraction layer is used to scale the image to be detected to obtain a second image to be detected, and extract features from the second image to be detected to generate a first intermediate feature; the second feature extraction layer is used to scale the image to be detected to obtain a third image to be detected, and extract features from the third image to be detected to generate a second intermediate feature; the first encoder is used to perform feature extraction on the first feature map and the first intermediate feature. The first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a fused feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a high-frequency feature map; the deconvolution layer is used to upsample the high-frequency feature map to generate a high-frequency information prediction map; wherein the image to be detected, the second image to be detected and the third image to be detected have different image sizes, and the first feature map, the second feature map and the third feature map have different image sizes.
[0055] See also Figures 2 to 5 , Figure 2 is a structural schematic diagram of the image blur detection model provided by the present invention, Figure 3 is a schematic diagram of the structure of the encoder provided by the present invention, Figure 4 is a schematic diagram of the process of multi-size image feature fusion of the first decoder provided by the present invention, Figure 5 It is a flowchart of multi-size image feature fusion of the second decoder provided by the present invention.
[0056] For ease of understanding, Figure 2 and Figure 3 We still take the images to be detected of three sizes as an example. Figure 2 and Figure 3 In the example, the size of the image to be detected is w*h (in Figure 2 The image to be detected with a size of w*h is scaled to other fixed sizes to obtain a second image to be detected with a size of w / 2*h / 2 (in Figure 2 The third image to be detected is a 1 / 2 image (in Figure 2 (abbreviated as 1 / 4 image).
[0057] like Figure 2 As shown, the image blur detection model of this embodiment includes a convolutional layer ( Figure 2 CNNBlock in), the first feature extraction layer ( Figure 2 DCT-CNN connected to "1 / 2 image" in the second feature extraction layer ( Figure 2 DCT-CNN connected to "1 / 4 image"), the first encoder ( Figure 2 The middle CNN-DCT-CNN, that is, the CNN-DCT-CNN directly connected to CNNBlock), the second encoder ( Figure 2 The bottom CNN-DCT-CNN, which is the CNN-DCT-CNN directly connected to the first encoder), the first decoder ( Figure 2 The bottom DCT-TCNN, which is the DCT-TCNN to the right of the second encoder), the second decoder ( Figure 2 The DCT-TCNN in the middle, that is, the DCT-TCNN to the right of the first encoder) and the deconvolution layer ( Figure 2 The first encoder is between the convolutional layer and the second encoder, and the second decoder is between the first decoder and the deconvolutional layer.
[0058] Specifically, the convolution layer can perform feature extraction on the image to be detected with a size of w*h, and generate a first feature map with a size of w*h.
[0059] Furthermore, if Figure 3 As shown, the first feature extraction layer ( Figure 3 The DCT-CNN connected with the "1 / 2 image" in the figure can scale the image to be detected with a size of w*h to obtain a second image to be detected with a size of w / 2*h / 2 (in Figure 3 The second image to be detected is simply referred to as 1 / 2 image), and feature extraction is performed on the second image to be detected to generate a first intermediate feature with a size of w / 2*h / 2.
[0060] Furthermore, the first feature map with a size of w*h and the first intermediate feature with a size of w / 2*h / 2 are input into the first encoder, and the first encoder can perform feature fusion processing on the first feature map with a size of w*h and the first intermediate feature with a size of w / 2*h / 2, extract more useful frequency features, and generate a more refined second feature map with a size of w / 2*h / 2.
[0061] Similarly, if Figure 3 As shown, the second feature extraction layer ( Figure 3 The DCT-CNN connected to the "1 / 4 image" in the figure can scale the image to be detected with a size of w*h to obtain a third image to be detected with a size of w / 4*h / 4 (in Figure 3 The third image to be detected is simply referred to as 1 / 4 image), and feature extraction is performed on the third image to be detected to generate a second intermediate feature with a size of w / 4*h / 4.
[0062] Furthermore, a finer second feature map of size w / 2*h / 2 and a second intermediate feature of size w / 4*h / 4 are input into the second encoder, and the second encoder can perform feature fusion processing on the second feature map of size w / 2*h / 2 and the second intermediate feature of size w / 4*h / 4, extract more useful frequency features, and generate a finer third feature map of size w / 4*h / 4.
[0063] Furthermore, if Figure 2 As shown, the first decoder can perform feature fusion processing on the first feature map with a size of w*h, the second feature map with a size of w / 2*h / 2, and the third feature map with a size of w / 4*h / 4 to generate fused features.
[0064] Specifically, Figure 4 As shown, the first decoder can scale the first feature map with a size of w*h by 4 times, and scale the second feature map with a size of w / 2*h / 2 by 2 times, that is, scale the first feature map with a size of w*h to a first feature map with a size of w / 4*h / 4, and scale the second feature map with a size of w / 2*h / 2 to a second feature map with a size of w / 4*h / 4, thereby adjusting the first feature map, the second feature map, and the third feature map to the same size; perform feature splicing processing, convolution processing, and feature fusion processing on the resized first feature map, the second feature map, and the third feature map in turn to obtain fused features.
[0065] Similarly, if Figure 2 As shown, the second decoder can perform feature fusion processing on the first feature map with a size of w*h, the second feature map with a size of w / 2*h / 2, the third feature map with a size of w / 4*h / 4 and the fused features to generate a high-frequency grayscale image.
[0066] Specifically, Figure 4 As shown, the second decoder can scale the first feature map of size w*h by 2 times, and enlarge the third feature map of size w / 4*h / 4 by 2 times, that is, scale the first feature map of size w*h to a first feature map of size w / 2*h / 2, and enlarge the third feature map of size w / 4*h / 4 to a third feature map of size w / 2*h / 2, thereby adjusting the first feature map, the second feature map and the third feature map to the same size; perform feature splicing processing, convolution processing and feature fusion processing on the resized first feature map, second feature map, third feature map and fusion features in sequence to obtain a high-frequency feature map.
[0067] Furthermore, if Figure 2 As shown in Figure 1, the deconvolution layer can upsample the high-frequency feature map to generate a high-frequency information prediction map.
[0068] In some embodiments, the first feature extraction layer includes a first spatial feature convolution layer and a first frequency feature convolution layer, and the second feature extraction layer includes a second spatial feature convolution layer and a second frequency feature convolution layer; wherein the first spatial feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first spatial feature; the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, perform Fourier transform on the first image feature to generate a first low-frequency information and a first high-frequency information, perform filtering on the first low-frequency information and the first high-frequency information to generate a second low-frequency information and a second high-frequency information, perform inverse Fourier transform on the second low-frequency information and the second high-frequency information to generate a first enhanced feature map; the first feature extraction layer is used to perform addition and fusion on the first spatial feature and the first enhanced feature map to generate a first intermediate feature; the second spatial feature convolution layer is used to perform feature extraction on the third image to be detected The first high-frequency information, the second high-frequency information, the third high-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is greater than a preset threshold; the first low-frequency information, the second low-frequency information, the third low-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is less than or equal to the preset threshold.
[0069] It is understandable that the scaling and expansion of the image has a greater impact on the image frequency domain, so the frequency domain features between the images to be detected of different sizes can be compensated by extracting the image features of the images to be detected of different sizes. In this embodiment, the image to be detected can be converted into a grayscale image, and a second image to be detected of size w*h, a second image to be detected of size w / 2*h / 2, and a third image to be detected of size w / 4*h / 4 can be obtained through scaling.
[0070] For example, assuming that the size of the image to be detected is 256*256, the size of the second image to be detected is 128*128, and the size of the third image to be detected is 64*64.
[0071] like Figure 2 As shown in the figure, for the three images to be detected of different sizes, it is necessary to design the feature extraction networks of the corresponding channels for feature extraction: the image to be detected with a size of w*h can be feature extracted through the convolution layer (with a channel of 32 and a step size of 1) to generate a first feature map with a size of w*h; for the second image to be detected with a size of w / 2*h / 2, the feature extraction network can be designed as a 2-layer convolution (n=2, n is the number of convolution layers in the first feature extraction layer DCT-CNN), with channels of 32 and 64 respectively; similarly, for the third image to be detected with a size of w / 4*h / 4, the feature extraction network can be designed as a 3-layer convolution (n=3, n is the number of convolution layers in the second feature extraction layer DCT-CNN), with channels of 32, 64 and 128 respectively.
[0072] See also Figure 6 , Figure 6 It is a structural schematic diagram of the feature extraction layer provided by the present invention.
[0073] like Figure 6 As shown, the feature extraction layer includes a spatial feature convolution layer and a frequency feature convolution layer.
[0074] The spatial feature convolution layer is mainly composed of n 3*3 convolution blocks, where n is the number of convolution layers in the feature extraction layer DCT-CNN. The number of convolution layers designed for images of different sizes is different, which is used to extract features of the image to be detected and generate spatial features.
[0075] The frequency feature convolution layer is mainly composed of a discrete cosine transform layer, a convolution layer and an inverse discrete cosine transform layer. The frequency feature convolution layer can perform Fourier transform (FFT) on the image features to obtain low-frequency information and high-frequency information; channel splicing is performed on the low-frequency information and the high-frequency information, and an adaptive filter is formed using two 3*3 convolution layers and a Relu activation function layer. The adaptive filter can filter the low-frequency information and the high-frequency information, learn and filter the features of the low-frequency information, and enhance the features of the high-frequency information; the low-frequency information and the high-frequency information filtered by the adaptive filter are split, and the inverse Fourier transform (IFFT) is used to generate the enhanced feature map after enhancement.
[0076] Furthermore, the feature extraction layer can add and fuse the spatial features generated by the spatial feature convolution layer and the enhanced feature map generated by the frequency feature convolution layer to generate intermediate features.
[0077] It should be noted that the structures of the first feature extraction layer and the second feature extraction layer in this embodiment are similar, that is, the first feature extraction layer includes a first spatial feature convolution layer and a first frequency feature convolution layer, and the second feature extraction layer includes a second spatial feature convolution layer and a second frequency feature convolution layer; the difference between the first feature extraction layer and the second feature extraction layer is that: the first spatial feature convolution layer in the first feature extraction layer is composed of two 3*3 convolution blocks, and the channels of the two convolution blocks are 32 and 64 respectively; the second spatial feature convolution layer in the second feature extraction layer is composed of three 3*3 convolution blocks, and the channels of the three convolution blocks are 32, 64 and 128 respectively.
[0078] Specifically, the first spatial feature convolution layer can perform feature extraction on the second image to be detected with a size of w / 2*h / 2 to generate the first spatial feature.
[0079] Furthermore, the first frequency feature convolution layer can perform feature extraction on the second image to be detected with a size of w / 2*h / 2 to generate a first image feature; perform Fourier transform on the first image feature to generate first low-frequency information and first high-frequency information; perform filtering on the first low-frequency information and the first high-frequency information to generate second low-frequency information and second high-frequency information; perform inverse Fourier transform on the second low-frequency information and the second high-frequency information to generate a first enhanced feature map.
[0080] Furthermore, the first feature extraction layer may perform additive fusion on the first spatial feature and the first enhanced feature map to generate a first intermediate feature having a size of w / 2*h / 2.
[0081] Similarly, the second spatial feature convolution layer can perform feature extraction on the third image to be detected with a size of w / 4*h / 4 to generate a second spatial feature.
[0082] Furthermore, the second frequency feature convolution layer can perform feature extraction on the third image to be detected of size w / 4*h / 4 to generate a second image feature; perform Fourier transform on the second image feature to generate third low-frequency information and third high-frequency information; perform filtering on the third low-frequency information and the third high-frequency information to generate fourth low-frequency information and fourth high-frequency information; perform inverse Fourier transform on the fourth low-frequency information and the fourth high-frequency information to generate a second enhanced feature map.
[0083] Furthermore, the second feature extraction layer can add and fuse the second spatial feature and the second enhanced feature map to generate a second intermediate feature with a size of w / 4*h / 4.
[0084] It should be noted that the first high-frequency information, the second high-frequency information, the third high-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose change rate is greater than a preset threshold. High-frequency information can characterize the fast-changing parts in the image, that is, the details and edges of the image. Although high-frequency components usually contain only a small amount of energy in the image, they are very important for the clarity and detail performance of the image.
[0085] Similarly, the first low-frequency information, the second low-frequency information, the third low-frequency information and the fourth low-frequency information are all information used to characterize the target element whose change rate in the image to be detected is less than or equal to the preset threshold. The low-frequency information can characterize the slowly changing part in the image, that is, the overall structure and contour of the image.
[0086] In some embodiments, the first encoder includes a first downsampling module, a first feature attention module and a third feature extraction layer, and the second encoder includes a second downsampling module, a second feature attention module and a fourth feature extraction layer; wherein the first downsampling module is used to downsample the first feature map to generate a first high-dimensional feature; the first feature attention module is used to perform feature fusion processing on the first high-dimensional feature and the first intermediate feature to generate a first encoding feature; the third feature extraction layer is used to extract features from the first encoding feature to generate a second feature map; the second downsampling module is used to downsample the second feature map to generate a second high-dimensional feature; the second feature attention module is used to perform feature fusion processing on the second high-dimensional feature and the second intermediate feature to generate a second encoding feature; the fourth feature extraction layer is used to extract features from the second encoding feature to generate a third feature map.
[0087] and Figure 6Compared with the feature extraction layer in the embodiment, the encoder of this embodiment adds an additional convolution block on the basis of the feature extraction layer as a downsampling module, which is used to downsample the feature map to extract higher-dimensional features; the higher-dimensional features and the intermediate features extracted by the feature extraction layer are input into the feature attention module, which is composed of a convolution block. The higher-dimensional features and the intermediate features can be multiplied and fused to enhance important features and suppress unimportant features to generate encoding features. The encoding feature is a feature matrix; the feature matrix after multiplication and fusion is input into the feature extraction layer, which can further fuse the feature information and extract useful features to generate a feature map.
[0088] See also Figure 7 , Figure 7 It is a schematic structural diagram of the first encoder provided by the present invention.
[0089] like Figure 7 As shown, the first encoder includes a first downsampling module, a first feature attention module and a third feature extraction layer.
[0090] Among them, the first downsampling module can downsample the first feature map to generate a first high-dimensional feature; the first feature attention module can perform feature fusion processing on the first high-dimensional feature and the first intermediate feature to generate a first encoding feature; the third feature extraction layer can perform feature extraction on the first encoding feature to generate a second feature map.
[0091] Similarly, the structure of the second encoder is the same as the first encoder, including a second downsampling module, a second feature attention module and a fourth feature extraction layer.
[0092] Among them, the second downsampling module can downsample the second feature map to generate a second high-dimensional feature; the second feature attention module can perform feature fusion processing on the second high-dimensional feature and the second intermediate feature to generate a second encoding feature; the fourth feature extraction layer can perform feature extraction on the second encoding feature to generate a third feature map.
[0093] In some embodiments, the first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a first fused feature, perform deconvolution calculation and Fourier transform on the first fused feature to generate a fused feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a second fused feature, perform deconvolution calculation and Fourier transform on the second fused feature to generate a high-frequency feature map.
[0094] See also Figure 8 , Figure 8 It is a structural schematic diagram of the decoder provided by the present invention.
[0095] like Figure 8As shown in the figure, the decoder can learn to reconstruct the high-frequency features lost due to blur in the image, and use the frequency domain features of feature maps of different sizes for feature fusion. The decoder can scale the feature maps of different sizes to the corresponding size (for example, w / 4*h / 4) through Fourier transform and deconvolution calculation, and perform feature fusion by splicing. Specifically, the fused fusion features can be deconvolved to obtain a feature map of w / 2*h / 2, and the Fourier transform (FFT) and adaptive filter can be used to further reconstruct the lost high-frequency features. The feature map and high-frequency features are added and fused to output a reconstructed high-frequency image.
[0096] Specifically, Figure 2 As shown, the first decoder can perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a first fusion feature; perform deconvolution calculation and Fourier transform on the first fusion feature to generate a fusion feature.
[0097] Furthermore, the second decoder may perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a second fused feature; perform deconvolution calculation and Fourier transform on the second fused feature to generate a high-frequency feature map.
[0098] In some embodiments, the image blur detection model is pre-trained based on a preset loss function, which is determined based on L1 norm loss, frequency focus loss and edge loss.
[0099] Specifically, in the training stage of the image blur detection model, clear sample clear images can be collected first, and then python code can be used to generate some sample blurred images such as Gaussian blur, median blur, motion blur, etc. with noise. At the same time, Photoshop software is used to generate sample blurred images such as lens blur, linear motion blur, and focus blur. The sample high-frequency information prediction map corresponding to each sample image (including sample clear images and sample blurred images) is collected as a training sample set, and the sample blurred images are input into the image blur detection model for training. The image blur detection model is trained based on a preset loss function. During the training process, the image blur detection model learns to reconstruct the high-frequency information prediction map, adds the high-frequency prediction map to the blurred map, obtains the predicted clear image, and calculates the loss of the predicted clear image and the real clear image. The preset loss function is mainly composed of L1 norm loss, frequency focus loss FFTLoss and edge loss. The actual loss can be obtained by summing the three losses, and back-propagation training is performed according to the calculated loss.
[0100] Among them, the preset loss function mainly consists of L1 norm loss, frequency focus loss FFTLoss and edge loss.
[0101] The frequency focus loss FFTLoss is used to dynamically adjust the weight of each frequency to focus on the frequency with large loss during training. The introduction of the frequency focus loss FFTLoss helps the model pay more attention to those frequency components that are difficult to process. Specifically, the frequency focus loss FFTLoss can be determined by calculating the frequency graphs of the clear image predicted by the model and the real clear image, and the distance between the two frequency graphs. The calculation formula of the frequency focus loss FFTLoss is as follows: FFTLoss=mean(abs(F(x)-F(y))); Among them, F represents Fourier transform; x represents the predicted value; y represents the true value; mean represents the average error; and abs represents the absolute value function.
[0102] The calculation principle of edge loss is to use Gaussian convolution and downsampling to calculate the Laplacian edge of the image, and calculate the Charbonnier Loss of the edge as the edge loss. The calculation formula of Charbonnier Loss is as follows: ; Among them, x represents the predicted value and y represents the true value.
[0103] After the training is completed, the image to be detected can be scaled to a fixed size and divided by 255 to complete the normalization process; the normalized image to be detected is input into the trained image blur detection model, and the image blur detection model can reconstruct a high-frequency grayscale image and binarize the high-frequency grayscale image to generate a high-frequency information prediction image.
[0104] Furthermore, the proportion of pixels with a pixel value of 255 (ie, high-frequency pixels) in the high-frequency information prediction map is calculated, and combined with a preset threshold to determine whether the image to be detected is a blurred image.
[0105] In some embodiments, based on the proportion of high-frequency pixels, determining whether the image to be detected is a blurred image includes: determining whether the proportion of high-frequency pixels is less than a first preset threshold; if the proportion of high-frequency pixels is less than the first preset threshold, determining that the image to be detected is not a blurred image; if the proportion of high-frequency pixels is greater than or equal to the first preset threshold, determining that the image to be detected is a blurred image, and determining whether the proportion of high-frequency pixels is less than a second preset threshold; the second preset threshold is greater than the first preset threshold; if the proportion of high-frequency pixels is less than the second preset threshold, determining that the image to be detected is a slightly blurred image; if the proportion of high-frequency pixels is greater than or equal to the second preset threshold, determining that the image to be detected is a severely blurred image.
[0106] In this embodiment, the first preset threshold and the second preset threshold can be adjusted according to actual needs, but the second preset threshold needs to be greater than the first preset threshold.
[0107] For ease of understanding, the first preset threshold is 0.3 and the second preset threshold is 0.4 for explanation: Specifically, after determining the proportion of high-frequency pixels, it is determined whether the proportion of high-frequency pixels is less than a first preset threshold of 0.3.
[0108] If the proportion of high-frequency pixels is less than the first preset threshold value of 0.3, it is determined that the image to be detected is not a blurred image, that is, the image to be detected is a clear image.
[0109] If the proportion of high-frequency pixels is greater than or equal to the first preset threshold of 0.3, it is determined that the image to be detected is a blurred image. At this time, the blurriness of the blurred image can be further determined according to the second preset threshold of 0.4.
[0110] Specifically, it is determined whether the proportion of high-frequency pixels is less than a second preset threshold of 0.4.
[0111] If the proportion of high-frequency pixels is less than the second preset threshold value of 0.4, it is determined that the image to be detected is a slightly blurred image or a partially blurred image.
[0112] If the proportion of high-frequency pixels is greater than or equal to the second preset threshold value 0.4, it is determined that the image to be detected is a severely blurred image.
[0113] It can be understood that this blurred image determination method can be directly applied to a complete image, or can be used to detect a partial area of a complete image, and this embodiment does not impose any limitation on this.
[0114] The blurred image detection method provided in this embodiment has a small model size and a fast computing speed. Since a multi-size image method is used, blur judgment can be performed on large-resolution images in a friendly manner. To verify the effectiveness of this solution, it has been tested on real document images. The model has a detection accuracy of 98% for severely blurred document images, a detection accuracy of 99.7% for clear document images, and a detection accuracy of 97.9% for slightly blurred document images or partially blurred document images.
[0115] The present invention also provides a blurred image detection device. Fig. 9 , Fig. 9 9 is a schematic diagram of the structure of the blurred image detection device provided by the present invention. In this embodiment, the blurred image detection device includes an acquisition module 910 , a high frequency information reconstruction module 920 , a determination module 930 and a judgment module 940 .
[0116] The acquisition module 910 is used to acquire the image to be detected.
[0117] The high-frequency information reconstruction module 920 is used to input the image to be detected into the image blur detection model to obtain the high-frequency information prediction map output by the image blur detection model.
[0118] The determination module 930 is used to determine the proportion of high-frequency pixels in the high-frequency information prediction map.
[0119] The high-frequency information prediction map is a grayscale map. The high-frequency pixel ratio is the ratio of the number of high-frequency pixels to the total number of image pixels, and the high-frequency pixels are white pixels.
[0120] The judgment module 940 is used to judge whether the image to be detected is a blurred image based on the proportion of high-frequency pixels.
[0121] A blurred image is an image where the boundary information of the target element is missing.
[0122] Among them, the image blur detection model is obtained by pre-training the initial model built based on the U-Net algorithm based on the sample image and the sample high-frequency information prediction map corresponding to the sample image.
[0123] In some embodiments, the image blur detection model includes a convolution layer, a first feature extraction layer, a second feature extraction layer, a first encoder, a second encoder, a first decoder, a second decoder and a deconvolution layer; the convolution layer is used to extract features of the image to be detected and generate a first feature map; the first feature extraction layer is used to scale the image to be detected to obtain a second image to be detected, and extract features from the second image to be detected to generate a first intermediate feature; the second feature extraction layer is used to scale the image to be detected to obtain a third image to be detected, and extract features from the third image to be detected to generate a second intermediate feature; the first encoder is used to perform feature extraction on the first feature map and the first intermediate feature. The first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a fused feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a high-frequency feature map; the deconvolution layer is used to upsample the high-frequency feature map to generate a high-frequency information prediction map; wherein the image to be detected, the second image to be detected and the third image to be detected have different image sizes, and the first feature map, the second feature map and the third feature map have different image sizes.
[0124] In some embodiments, the first feature extraction layer includes a first spatial feature convolution layer and a first frequency feature convolution layer, and the second feature extraction layer includes a second spatial feature convolution layer and a second frequency feature convolution layer; wherein the first spatial feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first spatial feature; the first frequency feature convolution layer is used to perform feature extraction on the second image to be detected to generate a first image feature, perform Fourier transform on the first image feature to generate a first low-frequency information and a first high-frequency information, perform filtering on the first low-frequency information and the first high-frequency information to generate a second low-frequency information and a second high-frequency information, perform inverse Fourier transform on the second low-frequency information and the second high-frequency information to generate a first enhanced feature map; the first feature extraction layer is used to perform addition and fusion on the first spatial feature and the first enhanced feature map to generate a first intermediate feature; the second spatial feature convolution layer is used to perform feature extraction on the third image to be detected The first high-frequency information, the second high-frequency information, the third high-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is greater than a preset threshold; the first low-frequency information, the second low-frequency information, the third low-frequency information and the fourth high-frequency information are all information used to characterize the target elements in the image to be detected whose changing rate is less than or equal to the preset threshold.
[0125] In some embodiments, the first encoder includes a first downsampling module, a first feature attention module and a third feature extraction layer, and the second encoder includes a second downsampling module, a second feature attention module and a fourth feature extraction layer; wherein the first downsampling module is used to downsample the first feature map to generate a first high-dimensional feature; the first feature attention module is used to perform feature fusion processing on the first high-dimensional feature and the first intermediate feature to generate a first encoding feature; the third feature extraction layer is used to extract features from the first encoding feature to generate a second feature map; the second downsampling module is used to downsample the second feature map to generate a second high-dimensional feature; the second feature attention module is used to perform feature fusion processing on the second high-dimensional feature and the second intermediate feature to generate a second encoding feature; the fourth feature extraction layer is used to extract features from the second encoding feature to generate a third feature map.
[0126] In some embodiments, the first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a first fused feature, perform deconvolution calculation and Fourier transform on the first fused feature to generate a fused feature; the second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a second fused feature, perform deconvolution calculation and Fourier transform on the second fused feature to generate a high-frequency feature map.
[0127] In some embodiments, the image blur detection model is pre-trained based on a preset loss function, which is determined based on L1 norm loss, frequency focus loss and edge loss.
[0128] In some embodiments, the judgment module 940 is used to determine whether the proportion of high-frequency pixels is less than a first preset threshold; if the proportion of high-frequency pixels is less than the first preset threshold, it is determined that the image to be detected is not a blurred image; if the proportion of high-frequency pixels is greater than or equal to the first preset threshold, it is determined that the image to be detected is a blurred image, and it is determined whether the proportion of high-frequency pixels is less than a second preset threshold; the second preset threshold is greater than the first preset threshold; if the proportion of high-frequency pixels is less than the second preset threshold, it is determined that the image to be detected is a slightly blurred image; if the proportion of high-frequency pixels is greater than or equal to the second preset threshold, it is determined that the image to be detected is a severely blurred image.
[0129] The invention also provides an electronic device. Fig.10 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the blurred image detection method.
[0130] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0131] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the blurred image detection method provided by the above methods is implemented.
[0132] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A blurred image detection method, characterized in that: include: Acquire the image to be detected; Inputting the image to be detected into an image blur detection model to obtain a high-frequency information prediction map output by the image blur detection model; Determine the proportion of high-frequency pixels in the high-frequency information prediction map; the high-frequency information prediction map is a grayscale map, the proportion of high-frequency pixels is the ratio of the number of high-frequency pixels to the total number of pixels, and the high-frequency pixels are white pixels; Based on the proportion of high-frequency pixels, determining whether the image to be detected is a blurred image; The blurred image is an image in which boundary information of the target element is missing; The image blur detection model is obtained by pre-training an initial model constructed based on a U-Net algorithm based on a sample image and a sample high-frequency information prediction map corresponding to the sample image.
2. The blurred image detection method according to claim 1, characterized in that: The image blur detection model includes a convolution layer, a first feature extraction layer, a second feature extraction layer, a first encoder, a second encoder, a first decoder, a second decoder and a deconvolution layer; The convolution layer is used to extract features from the image to be detected and generate a first feature map; The first feature extraction layer is used to perform scaling processing on the image to be detected to obtain a second image to be detected, and perform feature extraction on the second image to be detected to generate a first intermediate feature; The second feature extraction layer is used to perform scaling processing on the image to be detected to obtain a third image to be detected, and perform feature extraction on the third image to be detected to generate a second intermediate feature; The first encoder is used to perform feature fusion processing on the first feature map and the first intermediate feature to generate a second feature map; The second encoder is used to perform feature fusion processing on the second feature map and the second intermediate feature to generate a third feature map; The first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a fusion feature; The second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fusion feature to generate a high-frequency feature map; The deconvolution layer is used to perform upsampling processing on the high-frequency feature map to generate the high-frequency information prediction map; Among them, the image to be detected, the second image to be detected and the third image to be detected have different image sizes, and the first feature map, the second feature map and the third feature map have different image sizes.
3. The blurred image detection method according to claim 2, characterized in that: The first feature extraction layer includes a first spatial feature convolution layer and a first frequency feature convolution layer, and the second feature extraction layer includes a second spatial feature convolution layer and a second frequency feature convolution layer; The first spatial feature convolution layer is used to extract features from the second image to be detected to generate a first spatial feature; The first frequency feature convolution layer is used to extract features from the second image to be detected to generate a first image feature, perform Fourier transform on the first image feature to generate first low-frequency information and first high-frequency information, perform filtering on the first low-frequency information and the first high-frequency information to generate second low-frequency information and second high-frequency information, and perform inverse Fourier transform on the second low-frequency information and the second high-frequency information to generate a first enhanced feature map; The first feature extraction layer is used to add and fuse the first spatial feature and the first enhanced feature map to generate the first intermediate feature; The second spatial feature convolution layer is used to extract features from the third image to be detected to generate a second spatial feature; The second frequency feature convolution layer is used to extract features from the third image to be detected to generate second image features, perform Fourier transform on the second image features to generate third low-frequency information and third high-frequency information, perform filtering on the third low-frequency information and the third high-frequency information to generate fourth low-frequency information and fourth high-frequency information, perform inverse Fourier transform on the fourth low-frequency information and the fourth high-frequency information to generate a second enhanced feature map; The second feature extraction layer is used to add and fuse the second spatial feature and the second enhanced feature map to generate the second intermediate feature; The first high-frequency information, the second high-frequency information, the third high-frequency information, and the fourth high-frequency information are all information used to characterize the target element in the image to be detected whose change rate is greater than a preset threshold; The first low-frequency information, the second low-frequency information, the third low-frequency information, and the fourth low-frequency information are all information used to characterize the target element in the image to be detected whose change rate is less than or equal to the preset threshold.
4. The blurred image detection method according to claim 2, characterized in that: The first encoder includes a first downsampling module, a first feature attention module and a third feature extraction layer, and the second encoder includes a second downsampling module, a second feature attention module and a fourth feature extraction layer; The first downsampling module is used to downsample the first feature map to generate a first high-dimensional feature; The first feature attention module is used to perform feature fusion processing on the first high-dimensional feature and the first intermediate feature to generate a first encoding feature; The third feature extraction layer is used to extract features from the first coding features to generate the second feature map; The second down-sampling module is used to down-sample the second feature map to generate a second high-dimensional feature; The second feature attention module is used to perform feature fusion processing on the second high-dimensional feature and the second intermediate feature to generate a second encoding feature; The fourth feature extraction layer is used to extract features from the second coding features to generate the third feature map.
5. The blurred image detection method according to claim 2, characterized in that: The first decoder is used to perform feature fusion processing on the first feature map, the second feature map and the third feature map to generate a first fused feature, and perform deconvolution calculation and Fourier transform on the first fused feature to generate the fused feature; The second decoder is used to perform feature fusion processing on the first feature map, the second feature map, the third feature map and the fused feature to generate a second fused feature, and perform deconvolution calculation and Fourier transform on the second fused feature to generate the high-frequency feature map.
6. The blurred image detection method according to claim 1, characterized in that: The image blur detection model is pre-trained based on a preset loss function, and the preset loss function is determined based on L1 norm loss, frequency focus loss and edge loss.
7. The blurred image detection method according to claim 1, characterized in that: The determining whether the image to be detected is a blurred image based on the proportion of high-frequency pixels includes: Determine whether the proportion of high-frequency pixels is less than a first preset threshold; If the proportion of the high-frequency pixels is less than a first preset threshold, it is determined that the image to be detected is not a blurred image; If the proportion of high-frequency pixels is greater than or equal to a first preset threshold, it is determined that the image to be detected is a blurred image, and it is determined whether the proportion of high-frequency pixels is less than a second preset threshold; the second preset threshold is greater than the first preset threshold; If the proportion of the high-frequency pixels is less than a second preset threshold, it is determined that the image to be detected is a slightly blurred image; If the proportion of the high-frequency pixels is greater than or equal to a second preset threshold, it is determined that the image to be detected is a severely blurred image.
8. A blurred image detection device, characterized in that: include: An acquisition module, used for acquiring an image to be detected; A high-frequency information reconstruction module, used to input the image to be detected into an image blur detection model to obtain a high-frequency information prediction map output by the image blur detection model; A determination module, used to determine the proportion of high-frequency pixels in the high-frequency information prediction map; the high-frequency information prediction map is a grayscale map, the proportion of high-frequency pixels is the ratio of the number of high-frequency pixels to the total number of pixels, and the high-frequency pixels are white pixels; A judgment module, used for judging whether the image to be detected is a blurred image based on the proportion of high-frequency pixels; The blurred image is an image in which boundary information of the target element is missing; The image blur detection model is obtained by pre-training an initial model constructed based on a U-Net algorithm based on a sample image and a sample high-frequency information prediction map corresponding to the sample image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the blurred image detection method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blurred image detection method according to any one of claims 1 to 7 is implemented.