Image detection method and device and electronic equipment

By using multi-layer convolutional and pooling layers in the target neural network model, combined with residual connection layers, the accuracy problem of image blur detection is solved, enabling more accurate blur degree judgment and intelligent processing strategies, thereby improving image processing efficiency.

CN121746277APending Publication Date: 2026-03-27CHENGDU OPPO TELECOMM TECH CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2026-03-27

Smart Images

  • Figure CN121746277A_ABST
    Figure CN121746277A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image detection method and device and electronic equipment. The method comprises the following steps: processing a to-be-detected image through a first convolutional layer of a target neural network model to obtain a first image feature; processing the first image feature through a pooling layer of the target neural network model to obtain a second image feature, and processing the first image feature through a second convolutional layer to obtain a third image feature; inputting the second image feature and the third image feature into a residual connection layer of the target neural network model for processing to obtain a fourth image feature output by the residual connection layer; and determining a fuzzy detection result of the to-be-detected image through an activation function and the fourth image feature. In this way, the fuzzy detection structure determined through the fourth image features can be more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to an image detection method, apparatus, and electronic device. Background Technology

[0002] As the number of images in electronic devices increases, the demand for image processing also grows. One common practice is to detect the degree of blur in an image before processing it, and then determine whether further processing is needed based on the detection results. However, the accuracy of current image blur detection methods still needs improvement. Summary of the Invention

[0003] In view of the above problems, this application proposes an image detection method, apparatus, and electronic device to improve the above problems.

[0004] In a first aspect, this application provides an image detection method, the method comprising: processing an image to be detected through a first convolutional layer of a target neural network model to obtain a first image feature; processing the first image feature through a pooling layer of the target neural network model to obtain a second image feature, and processing the first image feature through a second convolutional layer to obtain a third image feature; inputting the second image feature and the third image feature into a residual connection layer of the target neural network model for processing to obtain a fourth image feature output by the residual connection layer; and determining a blur detection result of the image to be detected through an activation function and the fourth image feature.

[0005] Secondly, this application provides a model training method, the method comprising: acquiring a training image set, the training image set including multiple images with different degrees of blur, wherein each image corresponds to a data label, the data label being used to characterize the blur degree of the corresponding image; training a neural network model to be trained using the training image set to obtain a target neural network model, the neural network model to be trained including a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer; wherein the target neural network model is used to detect the blur degree of the input image.

[0006] Thirdly, this application provides an image detection apparatus, the apparatus comprising: a first convolution processing unit, configured to process an image to be detected through a first convolutional layer of a target neural network model to obtain a first image feature; a pooling processing unit, configured to process the first image feature through a pooling layer of the target neural network model to obtain a second image feature; a second convolution processing unit, configured to process the first image feature through a second convolutional layer to obtain a third image feature; a residual processing unit, configured to input the second image feature and the third image feature into a residual connection layer of the target neural network model for processing to obtain a fourth image feature output by the residual connection layer; and a blur detection unit, configured to determine a blur detection result of the image to be detected through an activation function and the fourth image feature.

[0007] Fourthly, this application provides a model training apparatus, comprising: a training data acquisition unit for acquiring a training image set, the training image set including multiple images with different degrees of blur, wherein each image corresponds to a data label, the data label being used to characterize the blur degree of the corresponding image; and a model training unit for training a neural network model to be trained using the training image set to obtain a target neural network model, the neural network model to be trained including a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer; wherein the target neural network model is used to detect the blur degree of the input image.

[0008] Fifthly, this application provides an electronic device, which includes at least a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above-described method.

[0009] Sixthly, this application provides a computer-readable storage medium storing program code, wherein the above-described method is executed when the program code is run by a processor.

[0010] This application proposes an image detection method, apparatus, and electronic device. In this method, the first convolutional layer of a target neural network model processes the image to be detected to obtain a first image feature. Then, the pooling layer of the target neural network model processes the first image feature to obtain a second image feature, and the second convolutional layer processes the first image feature to obtain a third image feature. Furthermore, the second and third image features are input into a residual connection layer for processing to obtain a fourth image feature output by the residual connection layer. Finally, the activation function and the fourth image feature are used to determine the blur detection result of the image to be detected. Thus, by the above method, the first image feature obtained after convolutional processing (first convolutional layer processing) is further processed by pooling and second convolutional layers respectively, and the image features output by the pooling and second convolutional layers are then input into the residual connection layer for processing to obtain the final output fourth image feature, thereby making the blur detection result determined by the fourth image feature more accurate. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0012] Figure 1 A schematic diagram illustrating an application scenario of the image detection method proposed in this application is shown.

[0013] Figure 2 A schematic diagram illustrating another application scenario of the image detection method proposed in this application embodiment is shown;

[0014] Figure 3 A flowchart of an image detection method proposed in an embodiment of this application is shown;

[0015] Figure 4 A schematic diagram of a target neural network according to an embodiment of this application is shown;

[0016] Figure 5 A flowchart of an image detection method according to another embodiment of this application is shown;

[0017] Figure 6 A schematic diagram of a bottleneck layer in an embodiment of this application is shown;

[0018] Figure 7 A schematic diagram of another target neural network in an embodiment of this application is shown;

[0019] Figure 8 A flowchart of an image detection method according to another embodiment of this application is shown;

[0020] Figure 9 A flowchart of a model training method proposed in an embodiment of this application is shown;

[0021] Figure 10 This illustration shows a process for obtaining a training graph set according to an embodiment of the present application;

[0022] Figure 11 A structural block diagram of an object prediction device according to an embodiment of this application is shown;

[0023] Figure 12 This invention illustrates a structural block diagram of an electronic device for performing an image detection method according to an embodiment of the present invention;

[0024] Figure 13 This is a storage unit in this application embodiment for storing or carrying program code that implements the image detection method according to this application embodiment. Detailed Implementation

[0025] 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, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] With the rapid development of technology, electronic devices have become increasingly ubiquitous in our lives. From smartphones and tablets to high-definition televisions, digital cameras, and even virtual reality devices and self-driving cars, they are all filled with a wealth of images. These images not only record the details of life but also serve as important carriers for information transmission, entertainment, and scientific research. Therefore, with the explosive growth in the number of images, how to process them efficiently and accurately has become an urgent problem to be solved.

[0027] In image processing, the sharpness or blurriness of an image is a crucial indicator of its quality. High-quality images offer richer details and a more realistic visual experience, while blurry images can hinder subsequent analysis, recognition, or enhancement operations due to missing information. Therefore, detecting the blurriness of an image before further processing is essential. This step not only helps identify images requiring special attention but also allows for intelligent adjustments to processing strategies based on the detection results. For example, it determines whether to use deblurring algorithms to enhance image quality or skip unnecessary processing steps, thereby improving processing efficiency and effectiveness.

[0028] However, despite the significant progress made in image blur detection technology in recent years, it still faces some challenges, the most prominent of which is the issue of accuracy.

[0029] Therefore, the inventors have proposed the image detection method, apparatus, and electronic device of this application. In this method, the image to be detected is processed by a first convolutional layer of a target neural network model to obtain a first image feature; then, the first image feature is processed by a pooling layer of the target neural network model to obtain a second image feature, and the first image feature is processed by a second convolutional layer to obtain a third image feature; furthermore, the second and third image features are input into a residual connection layer for processing to obtain a fourth image feature output by the residual connection layer; finally, the blur detection result of the image to be detected is determined by an activation function and the fourth image feature. Thus, by the above method, the first image feature obtained after convolution processing (first convolutional layer processing) is further processed by pooling and second convolutional layers respectively, and the image features output by each of the pooling and second convolutional layers are then input into the residual connection layer for processing to obtain the final output fourth image feature, thereby making the blur detection result determined by the fourth image feature more accurate.

[0030] Before providing a more detailed description of the embodiments of this application, an application environment related to the embodiments of this application will be introduced.

[0031] The application scenarios involved in the embodiments of this application will be introduced below.

[0032] In this embodiment of the application, the provided image detection method can be executed by an electronic device. In this manner, all steps of the image detection method provided in this embodiment can be performed by the electronic device. For example, as... Figure 1 As shown, in the image detection method provided in this application embodiment, all steps can be executed by an electronic device, and all steps can be executed by the processor of the electronic device 100.

[0033] Furthermore, the image detection method provided in this application embodiment can also be executed by a server. Correspondingly, in this server-executed manner, the server can begin executing the steps of the image detection method provided in this application embodiment in response to a triggering instruction. This triggering instruction can be sent by an electronic device used by a user, or it can be triggered locally by the server in response to some automated event.

[0034] In addition, such as Figure 2As shown, the image detection method provided in this application embodiment can also be executed collaboratively by an electronic device and a server. In this collaborative execution method, some steps of the image detection method provided in this application embodiment are performed by the electronic device, while other steps are performed by the server. For example, the electronic device 100 can perform the image detection method including: acquiring an image to be detected, then transmitting the image to be detected to a server 200, then the server 200 performing subsequent steps to obtain a blur detection result of the image to be detected, and returning the blur detection result to the electronic device 100 so that the electronic device 100 can perform subsequent operations based on the blur detection result.

[0035] It should be noted that in this method where electronic devices and servers work together, the steps performed by the electronic devices and servers are not limited to those described in the examples above. In practical applications, the steps performed by the electronic devices and servers can be dynamically adjusted according to the actual situation.

[0036] Furthermore, the execution method of the model training method provided in this application embodiment can also refer to the aforementioned image detection method. That is, the model training method can be executed by the server alone, or it can be executed jointly by the electronic device and the server. In the method of joint execution by the electronic device and the server, the electronic device can be responsible for acquiring the training image set, then uploading the training image set to the server, and then the server can execute the subsequent training steps.

[0037] It should be noted that the electronic equipment 100, in addition to being for Figure 1 and Figure 2 In addition to smartphones, the device can also be a tablet, smartwatch, smart voice assistant, or other similar device. Server 200 can be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed system. Specifically, in the case where the image detection method provided in this embodiment is executed by a server cluster or distributed system consisting of multiple physical servers, different steps in the image detection method can be executed by different physical servers, or they can be executed in a distributed manner by servers built on a distributed system.

[0038] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0039] Please see Figure 3 This application provides an image detection method, the method comprising:

[0040] S110: The image to be detected is processed through the first convolutional layer of the target neural network model to obtain the first image features.

[0041] In this embodiment, the image to be detected can be understood as the image to be subjected to blur detection. The specific category or content of the image to be detected is not specifically limited. For example, the image to be detected can be a face image or an image including other content. The blurriness of an image refers to the degree of loss of detail information or the indistinctness of image edges. Ideally, an image should clearly display all details, including the outlines, textures, and color variations of objects. However, due to various reasons, the actually acquired image may become blurry. In this embodiment, the image to be detected can be acquired in various ways. Optionally, the image to be detected can be an image captured by the camera of an electronic device (e.g., an image from a photo album). Optionally, the image to be detected can be an image obtained from the network (e.g., an image downloaded from a webpage or cloud storage). Optionally, the image to be detected can be an image transmitted from other electronic devices (e.g., an image transmitted from a chat partner).

[0042] In this embodiment of the application, the target neural network model is a model used to detect the blur level of an image. Wherein, such as Figure 4 As shown, the target neural network model includes a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer.

[0043] The first convolutional layer is used to perform preliminary feature extraction on the image (e.g., the image to be detected) input to the target neural network model to obtain the first image features.

[0044] In the embodiments of this application, the first convolutional layer can be constructed in various ways.

[0045] In one approach, the first convolutional layer may include one second convolutional block. In another approach, the first convolutional layer may include two second convolutional blocks. In this approach, processing the image to be detected through the first convolutional layer of the target neural network model to obtain first image features may include: inputting the image to be detected into the first-ordered second convolutional block for processing to obtain the image features output by the first-ordered second convolutional block; and inputting the image features output by the first-ordered second convolutional block into the second-ordered second convolutional block for processing to obtain the first image features output by the second-ordered second convolutional block.

[0046] It's important to note that each second convolutional block can extract certain features from the input. When two second convolutional blocks are stacked, the preliminary features extracted by the first block are fed into the second block for further feature extraction and abstraction. This hierarchical feature representation can capture more complex image information, allowing the first image features output by the first convolutional layer to carry richer feature content. In other words, stacking two second convolutional blocks offers advantages over a single block in several aspects, including stronger feature extraction capabilities, larger model capacity, better nonlinear transformation, accelerated training, and improved generalization ability.

[0047] Optionally, the second convolutional block can be a regular convolutional block, which only includes convolutional layers. Alternatively, the second convolutional block can include convolutional layers, a batch normalization layer, and an activation function layer arranged sequentially. For example, the second convolutional block can be a ConvBlock convolutional block. A ConvBlock convolutional block consists of convolutional layers, a batch normalization layer, and a ReLU activation function layer. The convolutional layers perform convolution operations on the input data using their included kernels to extract local features. The kernels in this convolutional layer can all be 3. Extracting local features from the input data through convolutional operations is crucial for subsequent tasks such as image processing, speech recognition, and natural language processing. The batch normalization layer normalizes the output of the convolutional layers, helping to accelerate the training process and improve model stability. The activation function layer introduces non-linear characteristics, enabling the network to learn more complex feature representations. Available activation functions include ReLU, Sigmoid, and Tanh.

[0048] S120: The first image features are processed by the pooling layer of the target neural network model to obtain the second image features, and the first image features are processed by the second convolutional layer to obtain the third image features.

[0049] In this embodiment, the main function of the pooling layer is to reduce the dimensionality of features while retaining important feature information. It should be noted that the first convolutional layer may include multiple second convolutional blocks. While multiple second convolutional blocks allow the extracted image features (e.g., the first image features) to carry richer feature information, they also further increase the number of model parameters. In this case, pooling the first image features can both retain the relatively rich extracted feature information and reduce the number of parameters to some extent.

[0050] Pooling layers reduce the spatial dimensions (width and height) of the data by downsampling the feature maps, thereby reducing the computational cost of subsequent layers. This dimensionality reduction not only speeds up the forward propagation of the network but also reduces the computational cost of gradients during backpropagation, contributing to improved training efficiency of the entire network.

[0051] Pooling is a feature aggregation method that preserves key features while ignoring less important details. This feature abstraction process makes the model less sensitive to minor changes in the input data (such as translation and rotation), enhancing its robustness. Furthermore, pooling layers extract more abstract, high-level feature representations by aggregating features within local regions, which helps improve model performance. Because pooling layers reduce the dimensionality of feature maps, they reduce the number of parameters in subsequent layers, which helps mitigate the risk of overfitting. Overfitting occurs when a model performs well on training data but poorly on unseen test data. By reducing the number of parameters, pooling layers allow the model to focus more on learning features that contribute to generalization during training, rather than overfitting to noise or details in the training data.

[0052] In this embodiment, the pooling layer can perform pooling operations in several ways. One approach is to use max pooling. Max pooling preserves the most salient features within a local region, making the model somewhat invariant to changes in the target's location. Another approach is to use average pooling. Average pooling calculates the average of all values ​​within the pooling window as the output, resulting in a smoother process.

[0053] In this embodiment, the number of second convolutional blocks included in the second convolutional layer can be more than the number of second convolutional blocks included in the first convolutional layer, thereby making the feature extraction capability of the second convolutional layer stronger than that of the first convolutional layer.

[0054] S130: Input the second and third image features into the residual connection layer of the target neural network model for processing to obtain the fourth image feature output by the residual connection layer.

[0055] In deep learning, especially in the architecture design of convolutional neural networks, residual connection layers can be used to alleviate the gradient vanishing or gradient exploding problems of deep neural networks, while accelerating the training process and improving model performance.

[0056] In models with a large number of layers, the backpropagation algorithm may experience gradient vanishing (gradient vanishing) or exploding (gradient exploding) as the number of layers increases, making the network difficult to train. Residual connections, by directly adding shallow features (or features with minimal processing) to deep features, provide a "short-circuit" path for the gradient, facilitating smoother gradient propagation during backpropagation and reducing the risk of vanishing or exploding gradients. Residual connections allow the network to learn the residual between the input and output—that is, to learn how to adjust the input to approximate the desired output—rather than directly learning the complete output. This mechanism encourages the network to reuse shallow features, helping the model learn more refined and complex feature representations.

[0057] In this embodiment, before the second and third image features are input into the residual connection layer, these features may have already undergone processing through previous convolutional layers, activation layers (such as ReLU), etc. Since the second and third image features may come from layers of different depths, or their dimensions (such as the number of channels, width, and height) may not be exactly the same, it may be necessary to adjust the dimensions of one or more feature maps before adding them together (e.g., adjusting the number of channels through a 1x1 convolutional layer, or adjusting the width and height through upsampling / downsampling) to obtain adjusted second and third image features. After adjustment, in the residual connection layer, the adjusted second and third image features are added element-wise (or sometimes element-wise multiplication followed by addition, but more commonly direct addition) to obtain a residual feature map. This residual connection map is the fourth image feature. It should be noted that if the obtained second and third feature maps do not require adjustment, then the second and third feature maps can be directly added element-wise to obtain the fourth image feature.

[0058] S140: Determine the blur detection result of the image to be detected by using the activation function and the fourth image feature.

[0059] This embodiment proposes an image detection method, in which the first image features obtained after convolution processing (first convolutional layer processing) are further processed by pooling layer and second convolutional layer respectively. Then, the image features output by pooling layer and second convolutional layer are input into residual connection layer for processing to obtain the final output fourth image features, thereby making the blur detection result determined by the fourth image features more accurate.

[0060] Please see Figure 5 This application provides an image detection method, which includes:

[0061] S210: The image to be detected is processed by the first convolutional layer of the target neural network model to obtain the image features output by the first convolutional layer.

[0062] S220: The image features output by the first convolutional layer are processed through the bottleneck layer to obtain the first image features.

[0063] A bottleneck layer, as the name suggests, is a "bottleneck" structure introduced in a neural network (e.g., a target neural network model). It reduces computational cost and the number of parameters by restricting the flow of information. In target neural network models, as the number of layers increases, the number of parameters and computational cost also increase dramatically, which can lead to problems such as vanishing gradients, exploding gradients, and overfitting. Bottleneck layers can reduce parameters and computational cost while maintaining the model's effective feature extraction.

[0064] As a way, such as Figure 6 As shown, the bottleneck layer includes a first convolutional block and a depthwise separable convolutional block. The depthwise separable convolutional block consists of a depthwise convolutional block and a pointwise convolutional block. The first convolutional block can be understood as a regular convolutional block. The depthwise convolutional block performs convolution on each channel of the input. The pointwise convolutional block uses a convolutional layer with a (1,1) kernel to linearly combine each channel.

[0065] In one approach, the number of bottleneck layers is multiple. In this approach, the image features output by the first convolutional layer are processed by multiple bottleneck layers to obtain the first image features. Among the multiple bottleneck layers, the input of the first bottleneck layer is the image features output by the first convolutional layer, the input of the next bottleneck layer is the output of the adjacent first bottleneck layer, and the output of the last bottleneck layer is the first image features.

[0066] For example, multiple bottleneck layers may include bottleneck layer P1, bottleneck layer P2, bottleneck layer P3, bottleneck layer P4, bottleneck layer P5, and bottleneck layer P6. The image features output from the first convolutional layer are first input into bottleneck layer P1 for processing. Then, the output of bottleneck layer P1 can be input into bottleneck layer P2 for processing. Then, the output of bottleneck layer P2 can be input into bottleneck layer P3 for processing. Then, the output of bottleneck layer P3 can be input into bottleneck layer P4 for processing. Then, the output of bottleneck layer P4 can be input into bottleneck layer P5 for processing. Finally, the output of bottleneck layer P5 can be input into bottleneck layer P6 for processing, and the output of bottleneck layer P6 is used as the first image feature.

[0067] It's important to note that having more bottleneck layers in the same neural network model is not necessarily better. As the number of bottleneck layers increases, the model's complexity also increases, which can lead to overfitting of the training data, especially when the amount of data is limited. Overfitting can cause the model to perform well on the training set but degrade on the test set. More bottleneck layers mean more computation and memory requirements, which can prolong training time and may be unsustainable for devices with limited computing resources (such as mobile devices).

[0068] In this embodiment, the number of bottleneck layers can be determined based on the specific detection task being performed. For example, if the target neural network model is performing blur detection on an image, the number of bottleneck layers can be determined based on this blur detection task. Optionally, the number of bottleneck layers can be determined based on the task characteristics of blur detection. These task characteristics may include the processing resources required by the task, the amount of computation required, etc.

[0069] S230: The first image features are processed by the pooling layer of the target neural network model to obtain the second image features, and the first image features are processed by the second convolutional layer to obtain the third image features.

[0070] In cases where the target neural network model includes a bottleneck layer, the pooling layer can be set within that bottleneck layer.

[0071] S240: Input the second and third image features into the residual connection layer of the target neural network model for processing to obtain the fourth image feature output by the residual connection layer.

[0072] S250: Determine the blur detection result of the image to be detected by using the activation function and the fourth image feature.

[0073] Next, we will proceed through... Figure 7 The following describes the flow of an image detection method involved in this embodiment. Figure 7 As shown, compared to the structure of the aforementioned target neural network model, in Figure 7 A bottleneck layer has been added to the structure shown. Figure 7 In the target neural network model shown, the first convolutional layer may include 2 ConvBlock convolutional blocks, the number of bottleneck layers may be 6, and the second convolutional layer may include 3 ConvBlock convolutional blocks.

[0074] It's important to note that when the second convolutional layer contains more convolutional blocks than the first, it means that the second convolutional layer can extract more diverse and complex features, which may include higher-level shapes, textures, patterns, etc. Therefore, the feature extraction capability of the second convolutional layer is stronger than that of the first convolutional layer. However, it's worth noting that while increasing the number of convolutional blocks can increase the number of convolutional kernels and enhance feature extraction capabilities, it also increases model complexity and computational cost. Therefore, to balance model complexity and feature extraction capability, the number of convolutional blocks in both the first and second convolutional layers can be determined based on the complexity of the image to be detected.

[0075] The higher the complexity of the image to be detected, the more second convolutional blocks each the first and second convolutional layers contain. Alternatively, the higher the complexity of the image to be detected, the more second convolutional blocks each the first and second convolutional layers contain, and the number of second convolutional blocks in the second convolutional layer is greater than the number of second convolutional blocks in the first convolutional layer.

[0076] In the embodiments of this application, there are multiple ways to determine the complexity of the image to be detected.

[0077] One approach is to determine the complexity of an image by calculating its information entropy. Specifically, the information entropy value of the image's grayscale is obtained by calculating the probability of occurrence of each grayscale level, thus reflecting the inherent complexity of the image's grayscale domain.

[0078] One approach is to transform the image to be detected into the frequency domain and use mathematical methods to extract its frequency distribution characteristics and the contrast of each frequency component, which can then be used as the basis for measuring the complexity of the image and thus determining the complexity of the image to be detected.

[0079] One approach is to determine the complexity of an image by analyzing its color distribution. Images with a greater variety of colors and uneven color distribution are generally considered more complex. In this case, the more colors an image contains, the higher its complexity; conversely, the more uneven the color distribution, the higher the complexity. Optionally, the color complexity can be assessed by calculating the color histogram of the image and analyzing its distribution and entropy value.

[0080] One approach is to use image segmentation algorithms to identify different regions or objects in an image to be detected, and to evaluate the structural complexity by analyzing the number, size, shape, and interrelationships of these regions or objects, thereby using the structural complexity as the degree of complexity of the image to be detected.

[0081] This embodiment proposes an image detection method. The first image features obtained after convolutional processing (first convolutional layer processing) are further processed by pooling and second convolutional layers. The image features output from the pooling and second convolutional layers are then input into a residual connection layer for further processing to obtain the final output fourth image features. This results in more accurate blur detection determined by the fourth image features. Furthermore, in this embodiment, the image features output from the first convolutional layer are further processed by a bottleneck layer to obtain the first image features, thereby reducing the number of parameters in the target neural network model.

[0082] Please see Figure 8 This application provides an image detection method, which includes:

[0083] S310: In response to a request to perform a preset processing operation on an image, the image to be processed is taken as the image to be detected.

[0084] In the embodiments of this application, the preset processing operation can be various. For example, it can be an operation to update image parameters, or an operation to optimize a target object in the image. Updating image parameters includes updating image parameters such as saturation and hue. Optimizing a target object in the image can include replacing the eyes of a person with closed eyes in the image with open eyes, or replacing a face that is not smiling in the image with a smiling face.

[0085] S320: The first convolutional layer of the target neural network model is used to process the image to be detected in order to obtain the first image features.

[0086] S330: The first image features are processed by the pooling layer of the target neural network model to obtain the second image features, and the first image features are processed by the second convolutional layer to obtain the third image features.

[0087] S340: Input the second and third image features into the residual connection layer of the target neural network model for processing to obtain the fourth image feature output by the residual connection layer.

[0088] S350: Determine the blur detection result of the image to be detected by using the activation function and the fourth image feature.

[0089] S360: If the blur detection result meets the preset conditions, then perform the preset processing operation on the image to be detected.

[0090] One approach is to determine the blur level of the image to be detected. In this case, the blur level can be compared with a preset threshold. If the blur level exceeds the preset threshold, the image is considered blurry and unsuitable for further processing. Conversely, if the blur level is within the preset threshold, the image is considered sharp and the preset processing can be performed.

[0091] In one approach, the blur detection result can be either a blurry image or a sharp image. If the blur detection result indicates the image is sharp, then the preset conditions are met, and preset processing operations can be performed on the image. If the blur detection result indicates the image is blurry, then there is no need to perform further preset processing operations on the image.

[0092] This embodiment proposes an image detection method. The first image features obtained after convolution processing (first convolutional layer processing) are further processed by combining them with pooling and second convolutional layers. The image features output from the pooling and second convolutional layers are then input into a residual connection layer for further processing to obtain the final output fourth image features. This makes the blur detection result determined by the fourth image features more accurate. Furthermore, in this embodiment, the image to be processed can be used as the image to be detected in response to a request for preset processing operations. This allows the image detection method to be used as a pre-detection process before performing the preset processing operations, thereby improving the effectiveness of executing the preset processing operations.

[0093] It should be noted that, in this embodiment, there is no specific limitation on the timing of triggering image blur detection. For example, besides detecting image blur before performing a preset processing operation, the blur level can also be detected when the electronic device acquires the image, and the detection result can be stored correspondingly with the image. In this way, after executing a request to perform a preset processing operation on the image and using the image to be processed as the image to be detected, the pre-stored blur detection result of the image to be detected can be directly read, without having to perform blur detection in real time, thereby improving the overall processing efficiency.

[0094] In cases where electronic devices can trigger image blur detection at multiple times, the specific timing of the detection can be determined in various ways.

[0095] One approach is to pre-configure this feature by developers or users of the electronic device. In this method, the specific timing for detecting image blur can be determined manually.

[0096] Alternatively, the load status of the electronic device can be determined based on its real-time load. This load status can be determined based on the number of tasks currently running or the remaining available processing resources. For example, if the electronic device is running a large number of tasks, it is in a high-load state; if the number of tasks is low, it is in a low-load state. It should be noted that the image blur detection method provided in this application consumes processing resources from the electronic device. Therefore, when executing the image detection method provided in this application, the electronic device should be designed to avoid excessive load during the execution of the image detection method.

[0097] In one approach, when an electronic device acquires an image, it can first determine the current image acquisition method. If the current image acquisition method involves directly storing the image captured by the camera, the electronic device can begin executing the image detection method provided in this embodiment immediately after acquiring the image. If the current image acquisition method involves optimizing the image captured by the camera before storing it, the image detection method can be executed later during a low-power period, or when a preset processing operation is about to be performed. This method avoids excessive load caused by the additional execution of the image detection method during image acquisition (i.e., if image optimization already increases the load, image blur detection further increases the load), thus preventing a negative impact on user experience.

[0098] Based on this method, the steps of the image processing method provided in this application embodiment may include:

[0099] The system enters image acquisition mode (which can be determined by detecting the start of an image acquisition program); in response to the electronic device performing an image acquisition operation (e.g., determining that the electronic device has performed an image acquisition operation by detecting that the user has clicked the capture button), it determines the current image acquisition method; if the current image acquisition method is to directly store the image captured by the camera, it processes the image to be detected through the first convolutional layer of the target neural network model to obtain the first image feature, wherein the image to be detected is the image captured by the electronic device performing the image acquisition operation. Afterwards, the electronic device can continue to execute subsequent steps of this method to obtain the corresponding blur detection result. If the current image acquisition method is to optimize the image captured by the camera before storing it, the process ends.

[0100] Optionally, for images that were not detected during acquisition, the electronic device can choose to perform the image detection method during a low-power period to avoid placing a high load on the electronic device for a certain period. In this embodiment, the low-power period and high-power period can be divided according to the historical operating data of the electronic device.

[0101] One approach is to divide low-power and high-power periods based on the number of programs running on the electronic device.

[0102] Optionally, multiple time periods can be pre-defined, and the number of programs running in each time period can be counted. Based on the number of programs running in each time period, each time period can be classified as a low-power period or a high-power period. For example, a time period where the number of running programs is less than a first threshold can be defined as a low-power period, and a time period where the number of running programs is not less than the first threshold can be defined as a high-power period. As another example, a time period where the processor utilization is less than a first utilization threshold can be defined as a low-power period, and a time period where the processor utilization is not less than the first utilization threshold can be defined as a high-power period.

[0103] The length of each pre-defined time segment can vary. For example, each time segment can be 1 hour, 2 hours, or 3 hours.

[0104] Alternatively, time periods can be divided by statistically analyzing the running status of programs in the electronic device, and simultaneously determining whether the divided time periods are low-power or high-power periods. In this method, the moment when the number of running programs changes compared to a first threshold can be used as the boundary between low-power and high-power periods. Specifically, after the electronic device starts, it can begin detecting the number of currently running programs, and the start time is taken as the start time of the low-power period. If the detected number of running programs exceeds the first threshold, the moment when the detected number of running programs exceeds the first threshold is taken as the start time of the high-power period, and this start time is also the end time of the preceding low-power period. If, after detecting that the number of running programs exceeds the first threshold, the detected number of running programs does not exceed the first threshold, the moment when the detected number of running programs does not exceed the first threshold is taken as the end time of the current high-power period, and this end time is also the start time of a new low-power period. In this way, the electronic device does not need to pre-divide multiple time periods, thus providing greater flexibility.

[0105] Optionally, time periods can be divided by statistically analyzing processor usage in electronic devices, simultaneously determining whether each period is a low-power or high-power period. In this approach, the moment when processor usage changes compared to a first usage threshold can be considered the boundary between low-power and high-power periods. Specifically, after the electronic device starts up, it can begin detecting current processor usage, using the startup time as the start time of the low-power period. If the detected processor usage exceeds the first usage threshold, this moment is designated as the start time of the high-power period, which also marks the end of the preceding low-power period. Conversely, if, after detecting usage exceeding the first threshold, usage does not exceed it, this moment is designated as the end time of the current high-power period, which also marks the start time of a new low-power period.

[0106] Given the availability of multiple ways to divide low-power and high-power time periods, electronic devices can flexibly determine which division method to use.

[0107] One approach is for the user of the electronic device to determine how to divide the low-power and high-power periods. Another approach is for the electronic device itself to determine the specific method for dividing the low-power and high-power periods based on actual circumstances.

[0108] Optionally, the method for dividing the low-power and high-power periods can be determined based on the total operating time of the electronic device after its first startup. Furthermore, different division methods will result in different low-power and high-power periods.

[0109] It's important to note that in the initial stages of using electronic devices, users' program usage habits are not yet fixed. Therefore, directly dividing time periods based on the running status of programs on the electronic device and simultaneously determining whether these periods are low-power or high-power periods may result in inaccurate classifications. Conversely, after users have used the electronic device for a period of time, the running patterns of programs become relatively fixed. In this case, dividing low-power or high-power periods in real time based on running status will be more accurate.

[0110] Therefore, if the total running time of the electronic device after its first startup is less than a first specified time, multiple time periods can be pre-divided, and the number of programs running in each time period can be counted. Based on the number of programs running in each time period, each time period can be classified as a low-power period or a high-power period. Conversely, if the total running time of the electronic device after its first startup is not less than the first specified time, the time periods can be divided by counting the running programs in the electronic device, and simultaneously determining whether the divided time periods are low-power or high-power periods.

[0111] Additionally, it should be noted that in this embodiment, before inputting the image to be detected into the target neural network model, noise reduction processing can be performed first to obtain a noise-reduced image, and then the noise-reduced image is input into the target neural network model for blur detection. The noise reduction processing includes noise reduction methods such as Gaussian filtering or mean filtering.

[0112] Please see Figure 9 This application provides a model training method, which includes:

[0113] S410: Obtain the training image set, which includes multiple images with different degrees of blur. Each image has a corresponding data label, which is used to characterize the degree of blur of the corresponding image.

[0114] One approach is to acquire multiple original images, and then apply Gaussian blur and average blur to each original image to obtain a training image set. All acquired original images can be sharp images. Sharp images are defined as those that visually allow for clear distinction of details, sharp edges, and no blurring or distortion.

[0115] The core idea of ​​Gaussian blur is to sample the color values ​​of each pixel and its neighboring pixels, then assign a weight to each neighboring pixel according to the Gaussian equation, and finally average these weighted color values ​​to obtain a new pixel color value. This blurring method ensures that the farther away a pixel is from the target pixel, the less influence its color value has on the target pixel, thus achieving smooth image processing. Gaussian blur can be achieved using a convolution kernel. In image processing, the convolution kernel slides across the image, performing a weighted average on each pixel and its neighboring pixels to obtain the blurred image. Average blur (also known as mean blur or mean filtering) blurs the image by calculating the average value of the pixel's neighborhood.

[0116] For example, such as Figure 10 As shown, the multiple original images may include original image T1, original image T2, original image T3, original image T4, and original image T5. In this case, Gaussian blurring can be performed on original image T1 to obtain blurred image T11, and average blurring can be performed on original image T1 to obtain blurred image T12. Similarly, Gaussian blurring can be performed on original image T2 to obtain blurred image T21, and average blurring can be performed on original image T2 to obtain blurred image T22. Gaussian blurring can be performed on original image T3 to obtain blurred image T31, and average blurring can be performed on original image T3 to obtain blurred image T32. Gaussian blurring can be performed on original image T4 to obtain blurred image T41, and average blurring can be performed on original image T4 to obtain blurred image T42. Gaussian blurring can be performed on original image T5 to obtain blurred image T51, and average blurring can be performed on original image T5 to obtain blurred image T52.

[0117] based on Figure 10 For example, the resulting training image set may include images T11, T12, T21, T22, T31, T32, T41, T42, T51, and T52.

[0118] S420: The target neural network model is obtained by training the neural network model to be trained using the training graph set. The neural network model to be trained includes a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer.

[0119] In the process of training a neural network model using a training graph set, each time an image from the training graph set is input into the neural network model, the current neural network model is trained. The current neural network model can be a completely untrained model, or it can be a model that has been trained multiple times (but has not yet reached the training objective).

[0120] Based on the foregoing Figure 10 The example shown allows images T11, T12, T21, T22, T31, T32, T41, T42, T51, and T52 to be sequentially input into the neural network model to be trained. For instance, when image T11 is used as the input image, the current neural network model is completely untrained. When image T12 is used as the input image, the current neural network model is one that has already been trained using image T11.

[0121] The target neural network model is used to detect the blur level of the input image.

[0122] In this embodiment of the application, the training parameters are set as follows: learning rate: 0.001; batch size: 25; number of epochs: 25; weight decay rate: 0.0001.

[0123] Please see Figure 11 This application provides an image detection device 500, which includes:

[0124] The first convolutional processing unit 510 is used to process the image to be detected through the first convolutional layer of the target neural network model to obtain the first image features.

[0125] Pooling processing unit 520 is used to process the first image features through the pooling layer of the target neural network model to obtain the second image features.

[0126] The second convolution processing unit 530 is used to process the first image features through the second convolution layer to obtain the third image features.

[0127] The residual processing unit 540 is used to input the second image features and the third image features into the residual connection layer of the target neural network model for processing, so as to obtain the fourth image features output by the residual connection layer.

[0128] The blur detection unit 550 is used to determine the blur detection result of the image to be detected by using an activation function and fourth image features.

[0129] As one approach, the target neural network model also includes a bottleneck layer. The first convolutional processing unit 510 is specifically used to process the image to be detected through the first convolutional layer of the target neural network model to obtain the image features output by the first convolutional layer; and to process the image features output by the first convolutional layer through the bottleneck layer to obtain the first image features.

[0130] Optionally, there can be multiple bottleneck layers. The first convolutional processing unit 510 is specifically used to process the image features output by the first convolutional layer through multiple bottleneck layers to obtain the first image features. Among the multiple bottleneck layers, the input of the first bottleneck layer is the image features output by the first convolutional layer, the input of the next bottleneck layer is the output of the adjacent first bottleneck layer, and the output of the last bottleneck layer is the first image features.

[0131] As one approach, the first convolution processing unit 510 is specifically used to process the image to be detected by inputting it into the first convolution block to obtain the image features output by the first convolution block; and to input the image features output by the first convolution block into the second convolution block to obtain the first image features output by the second convolution block.

[0132] As a way, such as Figure 12 As shown, the device 500 also includes:

[0133] The image processing unit 560 is configured to, in response to a request to perform a preset processing operation on an image, use the image to be processed as the image to be detected. The image processing unit 560 is also configured to perform the preset processing operation on the image to be detected if the blur detection result meets preset conditions.

[0134] This embodiment proposes an image detection device, which further processes the first image features obtained after convolution processing (first convolutional layer processing) by combining pooling layers and residual connection layers to obtain the final output fourth image features, thereby making the blur detection result determined by the fourth image features more accurate.

[0135] The following will combine Figure 13 This application describes an electronic device.

[0136] Please see Figure 13Based on the image detection method and apparatus described above, this application also provides an electronic device 1000 capable of executing the aforementioned image detection method. The electronic device 1000 includes one or more (only one shown in the figure) processors 105, a memory 104, an audio playback module 106, and an audio acquisition device 108 coupled together. The memory 104 stores programs capable of executing the contents of the aforementioned embodiments, and the processor 105 can execute the programs stored in the memory 104.

[0137] The processor 105 may include one or more processing cores. The processor 105 connects to various parts within the electronic device 1000 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and by calling data stored in the memory 104. Optionally, the processor 105 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 105 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 105 and may be implemented separately using a communication chip.

[0138] The memory 104 may include random access memory (RAM) or read-only memory (ROM). The memory 104 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below.

[0139] Furthermore, in addition to the aforementioned devices, the electronic device 1000 may also include a network module 110 and a sensor module 112.

[0140] The network module 110 is used to enable information interaction between the electronic device 1000 and other devices. For example, it can establish connections with other audio playback devices or other electronic devices and interact with information based on the established connections. As one approach, the network module 110 of the electronic device 1000 is a radio frequency (RF) module. This RF module is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby enabling communication with communication networks or other devices. The RF module may include various existing circuit elements used to perform these functions, such as antennas, RF transceivers, digital signal processors, encryption / decryption chips, SIM cards, memory, etc. For example, this RF module can interact with external devices through transmitted or received electromagnetic waves.

[0141] Sensor module 112 may include at least one sensor. Specifically, sensor module 112 may include, but is not limited to, pressure sensors, motion sensors, acceleration sensors, and other sensors.

[0142] The pressure sensor is a sensor that detects pressure generated by pressing on the electronic device 1000. That is, the pressure sensor detects pressure generated by contact or pressing between the user and the electronic device 1000, such as pressure generated by contact or pressing between the user's ear and the electronic device 1000. Therefore, the pressure sensor can be used to determine whether contact or pressing has occurred between the user and the electronic device 1000, and the magnitude of the pressure.

[0143] The accelerometer can detect the magnitude of acceleration in various directions (generally three axes), and when stationary, it can detect the magnitude and direction of gravity. It can be used for applications such as identifying the posture of the electronic device 1000 (e.g., screen orientation switching, related games, magnetometer posture calibration), and vibration recognition functions (e.g., pedometer, tapping). Additionally, the electronic device 1000 can also be equipped with other sensors such as a gyroscope, barometer, hygrometer, and thermometer, which will not be elaborated upon here.

[0144] The audio acquisition device 108 is used to acquire audio signals. Optionally, the audio acquisition device 108 includes multiple audio acquisition devices, which may be microphones.

[0145] Please refer to Figure 13 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0146] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.

[0147] Based on the method described in the foregoing embodiments, this application was tested on the official face image dataset CelebA-ID, and also on our own accumulated dataset. Our own accumulated dataset was downsampled to 784 face images, denoted as Data1; the official dataset CelebA-ID was downsampled to 19,000 images, denoted as Data2. The final accuracy is shown in Table 1. A threshold for image blurring can be defined to determine whether the blurring is truly blurred. The specific threshold should be obtained based on the specific distribution of the data.

[0148] Dataset Accuracy with a threshold of 0.45 Accuracy with a threshold of 0.55 Accuracy with a threshold of 0.6 Data1 99.49% 99.87% 99.62% Data2 99.31% 99.89% 100%

[0149] Table 1

[0150] In summary, this application proposes an image detection method, apparatus, and electronic device. In this method, the first convolutional layer of a target neural network model processes the image to be detected to obtain a first image feature. Then, the pooling layer of the target neural network model processes the first image feature to obtain a second image feature, and the second convolutional layer processes the first image feature to obtain a third image feature. Furthermore, the second and third image features are input into a residual connection layer for processing to obtain a fourth image feature output by the residual connection layer. Finally, the activation function and the fourth image feature are used to determine the blur detection result of the image to be detected. Thus, by using the above method, the first image feature obtained after convolutional processing (first convolutional layer processing) is further processed by pooling and second convolutional layers respectively, and the image features output by the pooling and second convolutional layers are then input into the residual connection layer for processing to obtain the final output fourth image feature. This makes the blur detection result determined by the fourth image feature more accurate.

[0151] In this embodiment, a deep neural network is used to implement the regression model for fuzz detection (i.e., the target neural network model in this embodiment).

[0152] In addition, since there are few blurred face images in real-world scenarios, it is difficult to construct a blurred dataset. We constructed blurred face data (i.e., the training image set obtained by Gaussian blur and average blur in the embodiments of this application), which can be used in other models, etc.

[0153] Furthermore, in the embodiments of this application, specific problems are solved and the model detection accuracy is improved by optimizing the ordinary convolutional network and adding depthwise convolution, residual connections, average pooling, and activation functions.

[0154] Furthermore, the solution provided in this application can be reused on any device based on RGB or grayscale images, and can also be reused in any quality inspection or other tasks that require blur detection, without being limited to the image content itself, and there are no requirements for the input.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An image detection method, characterized in that, The method includes: The first convolutional layer of the target neural network model is used to process the image to be detected in order to obtain the first image features; The first image features are processed by the pooling layer of the target neural network model to obtain the second image features, and the first image features are processed by the second convolutional layer to obtain the third image features. The second image feature and the third image feature are input into the residual connection layer of the target neural network model for processing to obtain the fourth image feature output by the residual connection layer; The blur detection result of the image to be detected is determined by the activation function and the fourth image feature.

2. The method according to claim 1, characterized in that, The target neural network model further includes a bottleneck layer, wherein the bottleneck layer is used to reduce the number of parameters in the target neural network model; the processing of the image to be detected through the first convolutional layer of the target neural network model to obtain the first image features includes: The first convolutional layer of the target neural network model is used to process the image to be detected in order to obtain the image features output by the first convolutional layer. The bottleneck layer processes the image features output by the first convolutional layer to obtain the first image features.

3. The method according to claim 2, characterized in that, The number of bottleneck layers is multiple, and the process of processing the image features output by the first convolutional layer through the bottleneck layers to obtain the first image features includes: The image features output by the first convolutional layer are processed by multiple bottleneck layers to obtain the first image features. Among the multiple bottleneck layers, the input of the first bottleneck layer is the image features output by the first convolutional layer, the input of the next bottleneck layer is the output of the adjacent first bottleneck layer, and the output of the last bottleneck layer is the first image features.

4. The method according to claim 2, characterized in that, The bottleneck layer includes a first convolutional block and a depth-separable convolutional block, the depth-separable convolutional block comprising a depth convolutional block and a pointwise convolutional block.

5. The method according to claim 1, characterized in that, The first convolutional layer includes two second convolutional blocks. The first convolutional layer of the target neural network model processes the image to be detected to obtain first image features, including: The image to be detected is input into the first convolutional block and processed to obtain the image features output by the first convolutional block. The image features output by the first convolutional block are input into the second convolutional block to be processed, so as to obtain the first image features output by the second convolutional block.

6. The method according to claim 5, characterized in that, The second convolutional block includes a convolutional layer, a normalization layer, and an activation function layer arranged in sequence.

7. The method according to claim 1, characterized in that, Before processing the image to be detected through the first convolutional layer of the target neural network model to obtain the first image features, the process further includes: In response to a request to perform a preset processing operation on an image, the image to be processed is taken as the image to be detected; After determining the blur detection result of the image to be detected through the activation function and the fourth image features, the method further includes: If the blur detection result meets the preset conditions, then the preset processing operation is performed on the image to be detected.

8. A model training method, characterized in that, The method includes: Obtain a training image set, which includes multiple images with different degrees of blur. Each image has a corresponding data label, which is used to characterize the degree of blur of the corresponding image. The training graph is used to train the neural network model to obtain the target neural network model. The neural network model to be trained includes a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer. The target neural network model is used to detect the blur level of the input image.

9. The method according to claim 8, characterized in that, The acquisition of the training image set includes: Acquire multiple raw images; Each original image is subjected to Gaussian blur and average blur processing respectively to obtain the training image set.

10. An image detection device, characterized in that, The device includes: The first convolutional processing unit is used to process the image to be detected through the first convolutional layer of the target neural network model to obtain the first image features; A pooling processing unit is used to process the first image features through the pooling layer of the target neural network model to obtain the second image features; The second convolution processing unit is used to process the first image features through the second convolution layer to obtain the third image features; The residual processing unit is used to input the second image feature and the third image feature into the residual connection layer of the target neural network model for processing, so as to obtain the fourth image feature output by the residual connection layer; The blur detection unit is used to determine the blur detection result of the image to be detected by using an activation function and the fourth image feature.

11. A model training device, characterized in that, The device includes: The training data acquisition unit is used to acquire a training image set, which includes multiple images with different degrees of blur. Each image has a corresponding data label, which is used to characterize the degree of blur of the corresponding image. The model training unit is used to train the neural network model to be trained using the training graph set to obtain the target neural network model. The neural network model to be trained includes a first convolutional layer, a pooling layer, a second convolutional layer, and a residual connection layer. The target neural network model is used to detect the blur level of the input image.

12. An electronic device, characterized in that, It includes a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-7.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code, wherein the program code, when executed by a processor, performs the method according to any one of claims 1-7.