Image processing method, device and computer readable storage medium
Through the face detection network and scene classification network of deep learning, the image type and scene label are determined, which solves the problem in the existing technology that the image quality can only be adjusted for the same scene, and achieves rapid and differentiated video frames of different scenes. processing to improve video quality.
Patent Information
- Application Number
- CN202110019522.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-07
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-01-07
AI Technical Summary
The existing technology can only adjust the image quality of video frames belonging to the same scene, and cannot quickly and differentially process video frames of different scenes.
Through the face detection network and scene classification network based on deep learning, the image type and scene label are determined, and the image is processed differently according to the scene label to improve the image quality.
It realizes fast and differentiated image quality adjustment of video frames in different scenes, improves video image quality, and is suitable for embedded systems with limited computing power.
Smart Images

Figure CN112699830B
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image processing method, device, and computer-readable storage medium. Background Art
[0002] The current image quality adjustment scheme is based on key frame detection and analyzes whether adjacent key frames belong to the same scene. The image quality can only be adjusted for video frames belonging to the same scene. Summary of the invention
[0003] The embodiments of the present disclosure provide an image processing method, an apparatus, and a computer-readable storage medium to achieve rapid and differentiated image quality adjustment for different scenes.
[0004] In one aspect, an embodiment of the present disclosure provides an image processing method, comprising:
[0005] Acquire an image, perform face detection on the image using a deep learning-based face detection network, and determine the type of the image, wherein the type includes a face close-up image and a non-face close-up image;
[0006] Determining a scene label corresponding to the type of the image according to the type of the image;
[0007] The image is processed according to the scene label.
[0008] On the other hand, an embodiment of the present disclosure further provides a display device, including a processor and a memory storing a computer program that can be run on the processor, wherein the processor implements the steps of the above-mentioned image processing method when executing the program.
[0009] On the other hand, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program executable on a processor, wherein the computer program is used to implement the above-mentioned image processing method when executed by the processor.
[0010] The method provided by the embodiment of the present disclosure determines the image type and determines that different types correspond to different scene tags. Different images can be processed differently according to the scene tags to achieve the purpose of improving image quality.
[0011] Of course, it is not necessary to achieve all the advantages described above at the same time for any product or method of the present disclosure. Other features and advantages of the present disclosure will be described in the subsequent description embodiments, and partly become apparent from the description embodiments, or be understood by practicing the present disclosure. The purposes and other advantages of the embodiments of the present disclosure can be achieved and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to provide a further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure. The shapes and sizes of the components in the accompanying drawings do not reflect the actual proportions and are only intended to illustrate the contents of the present disclosure.
[0013] Figure 1 This is a flow chart of the image processing method according to an embodiment of the present disclosure;
[0014] Figure 2 This is a schematic diagram of the face detection network structure of the embodiment of the present disclosure;
[0015] Figure 3 This is a diagram showing the effect of using the face detection network of the embodiment of the present disclosure to detect a face;
[0016] Figure 4 This is a schematic diagram of a scenario classification network structure according to an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of the structure of a deep convolution block in an embodiment of the present disclosure;
[0018] Figure 6 This is a flowchart of the image quality enhancement process according to the embodiment of the present disclosure;
[0019] Figure 7 Schematic diagram of the structure of the image processing device according to the embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The present disclosure describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present disclosure. Although many possible feature combinations are shown in the drawings and discussed in the embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0021] The present disclosure includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features, and elements disclosed in the present disclosure may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present disclosure may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other limitations. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0022] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As will be appreciated by those of ordinary skill in the art, other orders of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps performed in the order written, and those skilled in the art can easily understand that these orders can be changed and still remain within the spirit and scope of the disclosed embodiments.
[0023] Unless otherwise defined, the technical terms or scientific terms used in this disclosure are the usual meanings understood by people with ordinary skills in the field to which this disclosure belongs. The "first", "second" and similar words used in this disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. In this disclosure, "plurality" can mean two or more numbers. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0024] In order to keep the following description of the embodiments of the present disclosure clear and concise, the present disclosure omits detailed descriptions of some known functions and known components. The drawings of the embodiments of the present disclosure only relate to the structures related to the embodiments of the present disclosure, and other structures can refer to the general design.
[0025] The present disclosure provides an image processing method, such as Figure 1 As shown, the following steps are included:
[0026] Step 11, acquiring an image, performing face detection on the image using a deep learning-based face detection network, and determining the type of the image, wherein the type includes a face close-up image and a non-face close-up image;
[0027] An image can be obtained from a video frame, and a frame sequence can be generated by decoding the video, and each video frame can be used as an image to be processed. Each frame of the image is detected by a face detection network to determine whether the type of the image is a face close-up image or a non-face close-up image.
[0028] In an exemplary embodiment, the following steps may be used to acquire an image, perform face detection on the image using a face detection network based on deep learning, and determine the type of the image:
[0029] Acquire an image, and perform face detection on the image to obtain a face position;
[0030] Determine the face area according to the face position;
[0031] The type of the image is determined according to the relationship between the area of the face and the area of the image.
[0032] For example, if the percentage of the face area to the image area is greater than a preset threshold, the type of the image is determined to be a face close-up image, and if the percentage of the face area to the image area is less than the preset threshold, the type of the image is determined to be a non-face close-up image. The preset threshold may be 20%, for example.
[0033] Optionally, in an exemplary embodiment, after performing face detection on the image to obtain the face position, the method further includes: performing an optimization process on the detected face, such as performing skin refining on the face.
[0034] Step 12, determining a scene label corresponding to the type of the image according to the type of the image;
[0035] In an exemplary embodiment, determining the scene label corresponding to the type of the image according to the type of the image includes:
[0036] When the type of the image is a non-face close-up image, a scene classification network based on deep learning is used to perform scene classification on the non-face close-up image to determine the scene label of the non-face close-up image; for example, if the scene classification network classifies the image as a food image, the scene label of the image is determined to be a food scene; for example, if the scene classification network classifies the image as a night image, the scene label of the image is determined to be a night scene; for example, if the scene classification network classifies the image as an indoor image, the scene label of the image is determined to be an indoor scene; for example, if the scene classification network classifies the image as a natural scenery image, the scene label of the image is determined to be a natural scenery scene. The scene label depends on the output of the scene classification network, and the output of the scene classification network depends on the training result of the scene classification network based on deep learning. Optionally, the label output by the scene classification network can be used as the scene label.
[0037] When the type of the image is a face close-up image, the scene label of the face close-up image is determined to be a face close-up label.
[0038] Step 13: Process the image according to the scene label.
[0039] In an exemplary embodiment, the image parameter corresponding to the scene tag is determined, for example, according to the scene tag and a table of correspondence between the scene tag and the image parameter;
[0040] The parameters of the image are adjusted according to the image parameters.
[0041] The image parameters include but are not limited to one or more of the following parameters: brightness, contrast, and saturation.
[0042] The table of correspondence between scene labels and image parameters can be pre-set, and each scene and the image parameters corresponding to each scene are stored in the table. For example, corresponding image parameters are set for food scenes, night scenes, indoor scenes, and natural scenery scenes. When processing an image, the image is adjusted according to the determined image parameters.
[0043] By determining the image type and determining that different types correspond to different scene labels, different images can be processed differently according to the scene labels to achieve the purpose of improving image quality.
[0044] The embodiments of the present disclosure may be applicable to display devices such as mobile phones, tablets or monitors that can display videos. Since these display devices are implemented using embedded chips, their computing power is limited. In order to achieve precise image enhancement, a face detection network and a scene classification network with fast computing speed and high accuracy are required.
[0045] In an exemplary embodiment, a simplified SSD (Single Shot MultiBox Detector) neural network can be used as a face detection algorithm. The face detection network structure used in this embodiment is as follows: Figure 2 As shown, it includes an input part, a feature extraction part, a prediction part and an output part, wherein:
[0046] An input unit, used to process the original image into an image suitable for a face detection network, for example, processing the original image into an image to be processed of a small size (for example, 320×240);
[0047] The feature extraction unit is used to extract features from the image to be processed and input the obtained feature map into the prediction unit. In this embodiment, the feature extraction unit includes multiple blocks, wherein:
[0048] The first block includes a first convolution layer, a first activation function layer, a second convolution layer, a second activation function layer and a first pooling layer; wherein: the convolution kernel of the first convolution layer is 3×3, the convolution kernel of the second convolution layer is 1×1, the first activation function layer and the second activation function layer can both be implemented using a linear rectified unit (ReLu), the pooling type of the first pooling layer can be max-pooling, and the filter size of the pooling layer is 2×2. Adding an activation function layer can introduce nonlinear factors. The pooling layer is used to reduce the dimension of the obtained feature map. The original 320×240 feature map is compressed into 160×120 through the pooling layer as the input of the second block. The input image size of the first block is 320×240×3, where 320×240 represents the size of the input image, and 3 represents red, green and blue. In this embodiment, the number of channels (depth) of the first block is 16, and the size of the processed feature map is 320×240.
[0049] The second block includes a third convolution layer, a third activation function layer, a fourth convolution layer, a fourth activation function layer, and a second pooling layer; wherein: the convolution kernel of the third convolution layer is 3×3, the convolution kernel of the fourth convolution layer is 1×1, the third activation function layer and the fourth activation function layer are both implemented using the ReLu function, the pooling type of the second pooling layer is maximum pooling, and the filter size of the pooling layer is 2×2. In this embodiment, the number of channels of the second block is 16, and the size of the feature map processed is 160×120.
[0050] The third block includes the fifth convolution layer, the fifth activation function layer, the sixth convolution layer, the sixth activation function layer, the seventh convolution layer, the seventh activation function layer and the third pooling layer; wherein: the convolution kernels of the fifth convolution layer and the seventh convolution layer are 3×3, the convolution kernel of the sixth convolution layer is 1×1, the fifth activation function layer, the sixth activation function layer and the seventh activation function layer are all implemented using the ReLu function, the pooling type of the third pooling layer is maximum pooling, and the filter size of the pooling layer is 2×2. In this embodiment, the number of channels of the third block is 32, the size of the processed feature map is 80×60, and the output feature map of the third block is used as the input of the fourth block and as the input of the first detection classifier.
[0051] The fourth block includes the eighth convolution layer, the eighth activation function layer, the ninth convolution layer, the ninth activation function layer, the tenth convolution layer, the tenth activation function layer and the fourth pooling layer; wherein: the convolution kernels of the eighth convolution layer and the tenth convolution layer are 3×3, the convolution kernel of the ninth convolution layer is 1×1, the eighth activation function layer, the ninth activation function layer and the tenth activation function layer are all implemented using the ReLu function, the pooling type of the fourth pooling layer is maximum pooling, and the filter size of the pooling layer is 2×2. In this embodiment, the number of channels of the fourth block is 64, the size of the processed feature map is 40×30, and the fourth block outputs the feature map as the input of the fifth block and as the input of the second detection classifier.
[0052] The fifth block includes the eleventh convolution layer, the eleventh activation function layer, the twelfth convolution layer, the twelfth activation function layer, the thirteenth convolution layer, the thirteenth activation function layer and the fifth pooling layer; wherein: the convolution kernels of the eleventh convolution layer and the thirteenth convolution layer are 3×3, the convolution kernel of the twelfth convolution layer is 1×1, the eleventh activation function layer, the twelfth activation function layer and the thirteenth activation function layer are all implemented using the ReLu function, the pooling type of the fifth pooling layer is maximum pooling, and the filter size of the pooling layer is 2×2. In this embodiment, the number of channels of the fifth block is 128, the size of the processed feature map is 20×15, and the fifth block outputs the feature map as the input of the sixth block and as the input of the third detection classifier.
[0053] The sixth block includes a fourteenth convolution layer, a fourteenth activation function layer, a fifteenth convolution layer, a fifteenth activation function layer, a sixteenth convolution layer, and a sixteenth activation function layer; wherein: the convolution kernels of the fourteenth convolution layer and the sixteenth convolution layer are 3×3, the convolution kernel of the fifteenth convolution layer is 1×1, and the fourteenth activation function layer, the fifteenth activation function layer, and the sixteenth activation function layer are all implemented using the ReLu function. In this embodiment, the number of channels of the sixth block is 128, the size of the processed feature map is 10×8, and the sixth block outputs a feature map as the input of the fourth detection classifier.
[0054] The feature map unit in this embodiment is pixel, and the feature map size is only for example, and can be adjusted accordingly according to the image size. The feature map size in the embodiment of the present disclosure is used, and the calculation speed is fast, which is suitable for systems with low computing power.
[0055] The prediction unit is used to detect and filter feature maps of different sizes and output the predicted frame position, including a first detection classifier, a second detection classifier, a third detection classifier and a fourth detection classifier, wherein the first detection classifier is used to detect and filter the feature map output by the third block, the second detection classifier is used to detect and filter the feature map output by the fourth block, the third detection classifier is used to detect and filter the feature map output by the fifth block, and the fourth detection classifier is used to detect and filter the feature map output by the sixth block. Each detection classifier first decodes all the detection frame positions and the confidences corresponding to the detection frames, and then performs a first filtering on the detection frames with low confidence according to a preset confidence threshold to obtain the predicted frame. The predicted frames obtained by different detection classifiers are of different sizes. The large-sized feature map is used to detect small objects, and the small-sized feature map is used to detect large objects.
[0056] The output part is used to perform a second filtering on the prediction box output by the prediction part and output the final target box position, that is, the face position. The output of each detector and classifier is filtered out through non-maximum suppression to remove the prediction boxes with large overlap, and the final target box position (for example, including the upper left corner horizontal corner, the upper left corner vertical coordinate, the target box width and the target box height) is obtained. The non-maximum suppression can adopt the fast non-maximum suppression (Fast NMS) method.
[0057] Since the target of face detection is single and does not involve multi-target detection, this embodiment simplifies the SSD network model. There is no need to use the VGG network, and the number of channels is reduced from 256-1024 to 16-128, which greatly improves the running speed while ensuring the accuracy of face detection. The accuracy of face detection using the face detection network of the disclosed embodiment reaches 97%. Figure 3 This is a diagram showing the effect of performing face detection using the face detection network described in the present disclosure.
[0058] In an exemplary embodiment, face detection datasets such as FDDB and wild face may be used to train the face detection network.
[0059] In an exemplary embodiment, after obtaining the target frame, i.e., the face position, through the face detection network, the face image can be captured from the image, and the face image can be subjected to portrait optimization processing, such as skin resurfacing processing, to make the face skin smoother and softer, and enhance the visual effect of the face. Skin resurfacing can be directly processed using a bilateral filter algorithm. The bilateral filter formula is as follows:
[0060]
[0061] In the formula, σ d and σ r is the smoothing parameter, i,j,k,l are the pixel coordinate parameters, I i , I j , I k , I l is the grayscale value of the corresponding pixel coordinate.
[0062] After the face resurfacing is completed, the face image is pasted back to the corresponding position in the video frame. Then the face frame area can be calculated using the height and width information of the face frame. For example, if the face frame area exceeds 20% of the image area of the video frame, the frame is considered to be a face close-up scene, and the corresponding label of the face close-up scene is output, such as label 0. If the face frame area does not exceed 20% of the image area, it is a non-face close-up image, and the video frame is sent to the scene classification network for scene semantic classification prediction.
[0063] In this embodiment, the non-face close-up images are semantically classified into four scenes, including natural scenery scenes, food scenes, indoor scenes and other scenes, corresponding to label 1, label 2, label 3 and label 4 respectively.
[0064] In this embodiment, the scene classification network is implemented using a simplified MobileNet network, which can ensure the real-time performance of scene classification. The scene classification network structure is as follows: Figure 4 As shown, it includes input layer, deep convolution layer, global pooling layer and output layer, where:
[0065] An input layer is used to process the image to be processed into an image suitable for a scene classification network, for example, processing the original image into an image to be processed of a small size (for example, 128×128);
[0066] The depth convolution layer includes the first depth convolution block (Dwise block), the sixth pooling layer, the second depth convolution block, the seventh pooling layer and the third depth convolution block, where:
[0067] The first depth convolution block receives the output image of the input layer, for example, an image of size 128×128 with 3 channels (R, G, B), and uses the following for each channel: Figure 5The deep convolution block shown in FIG. 1 is processed. A deep convolution block includes three sub-blocks. The first sub-block includes the seventeenth convolution layer and the seventeenth activation function layer. The convolution kernel of the seventeenth convolution layer is 1×1. The seventeenth activation function layer is implemented using the ReLu function. The second sub-block includes the eighteenth convolution layer and the eighteenth activation function layer. The eighteenth convolution layer is implemented using depthwise convolution (i.e., grouped convolution with 1 convolution kernel in each group). The convolution kernel is 3×3. Depthwise convolution means that a convolution kernel is used for each input channel, that is, one convolution kernel corresponds to one input channel. The independent convolution calculation of each channel is small and fast. The eighteenth activation function layer is implemented using the ReLu function. The third sub-block includes the nineteenth convolution layer. The convolution kernel of the nineteenth convolution layer is 1×1. The output of the nineteenth convolution layer is summed with the input of the first deep convolution block as the output of the first deep convolution block. After being processed by the first deep convolution block, the output feature map has a size of 64×64 and a channel number of 32. The output feature map of the first deep convolution block is used as the input of the sixth pooling layer. In the disclosed embodiment, the second sub-block in a deep convolution block adopts a channel-by-channel independent convolution mode, and the convolution layers in the first sub-block and the third sub-block are used to fuse the information of each channel.
[0068] The sixth pooling layer reduces the dimension of the obtained feature map and compresses the image to a size of 32×32;
[0069] The structure of the second depth convolutional block is as follows Figure 5 As shown, no further details are given here. After being processed by the second depth convolution block, the output feature map size is 32×32 and the number of channels is 64. The output feature map of the second depth convolution block is used as the input of the seventh pooling layer.
[0070] The seventh pooling layer reduces the dimension of the obtained feature map and compresses the image to a size of 16×16;
[0071] The structure of the third depth convolutional block is as follows Figure 5 As shown in the figure, no further details are given here. After being processed by the third deep convolution block, the output feature map size is 16×16, the number of channels is 128, and the output of the second deep convolution layer is used as the output of the global pooling layer.
[0072] The global pooling layer is used to perform global average pooling on the feature map output by the third deep convolutional block to minimize the overfitting effect by reducing the number of model parameters;
[0073] The output layer is used to generate the predicted probability of each classification, which can be implemented using the softmax function.
[0074] The scene classification network of this embodiment has less computation and higher speed, and is particularly suitable for embedded systems.
[0075] During training, video frames of different scenes can be captured from multiple movies and TV shows, and labels can be added by category. Each scene image data is about 10,000 frames, and these data are used to train and optimize the model. The trained network can perform semantic classification prediction on the input frame and output the scene label corresponding to the frame.
[0076] In an exemplary embodiment, the image processing of the image frame may be performed as follows: Figure 6 In the process shown, the image quality enhancement module for image processing obtains each frame of image and its corresponding scene label (including label 0, label 1, label 2, label 3 or label 4), and then calls the image parameter set corresponding to the pre-saved scene label according to the scene label, and uses the image parameter set corresponding to the scene label to automatically adjust the image quality, including but not limited to adjusting one or more of the brightness, contrast and saturation of the image. In addition, the image can also be sharpened, denoised, etc. For example, for close-up scenes of faces or food, the saturation of the image frame can be adjusted to make the image more warm; for natural scenery scenes, the contrast of the image frame can be increased; for night scenes or indoor scenes, the brightness of the image frame can be increased, etc. The image frame with enhanced image quality is output in real time to improve the overall video quality and improve the user's viewing experience.
[0077] The algorithm models used in the embodiments of the present disclosure have been greatly simplified so that they can be deployed and operated on embedded system terminals and maintain real-time processing performance for video frames. They can be directly used for display terminal integration without increasing hardware costs. In addition, by using neural networks to classify and predict the semantics of different scenes, scene labels of video frames can be obtained. The corresponding image parameters can be called according to the scene labels to adjust the images, and fast and automatic differentiated image quality adjustments can be achieved for different scenes to meet the different requirements for image quality enhancement in different scenes and achieve more accurate image quality adjustments.
[0078] In an exemplary embodiment, the present disclosure further provides an image processing device, which may include a processor and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the computer program, the steps of the image processing method in any of the above embodiments of the present disclosure are implemented.
[0079] In an exemplary embodiment, Figure 7 FIG. 1 is a schematic diagram of the structure of a display device in an embodiment of the present disclosure. Figure 7As shown, the device 60 includes: at least one processor 601; and at least one memory 602 and a bus 603 connected to the processor 601; wherein the processor 601 and the memory 602 communicate with each other via the bus 603; the processor 601 is used to call the program instructions in the memory 602 to execute the steps of the image processing method in any of the above embodiments.
[0080] The processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a transistor logic device, etc., and the present disclosure does not limit this.
[0081] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0082] In addition to the data bus, the bus may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 In the text file, various buses are marked as buses.
[0083] In the implementation process, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the processor or the instructions in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0084] In an exemplary embodiment, the present disclosure further provides a non-volatile computer-readable storage medium on which is stored a computer program executable on a processor, wherein the computer program implements the steps of the aforementioned image processing method when executed by the processor.
[0085] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the functional modules / units mentioned in the above description are not divided equally; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0086] Although the embodiments disclosed in the present disclosure are as above, the contents described are only embodiments adopted to facilitate understanding of the present disclosure and are not intended to limit the present disclosure. Any technician in the field to which the present disclosure belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in the present disclosure, but the scope of patent protection of the present disclosure shall still be subject to the scope defined in the attached claims.
Claims
1. An image processing method, characterized in that: include: Acquire an image, perform face detection on the image using a deep learning-based face detection network, and determine the type of the image, wherein the type includes a face close-up image and a non-face close-up image; Determining a scene label corresponding to the type of the image according to the type of the image; Processing the image according to the scene label; The face detection network based on deep learning includes: an input unit, a feature extraction unit, a prediction unit and an output unit, wherein: The input unit is used to process the original image into an image suitable for a face detection network; The feature extraction unit is used to extract features from the image to be processed, and input the obtained feature map into the prediction unit. The feature extraction unit includes multiple blocks, wherein: the first block includes the first convolution layer, the first activation function layer, the second convolution layer, the second activation function layer and the first pooling layer; wherein: the convolution kernel of the first convolution layer is 3×3, and the convolution kernel of the second convolution layer is 1×1; the second block includes the third convolution layer, the third activation function layer, the fourth convolution layer, the fourth activation function layer and the second pooling layer; wherein: the convolution kernel of the third convolution layer is 3×3, and the convolution kernel of the fourth convolution layer is 1×1; the third block includes the fifth convolution layer, the fifth activation function layer, the sixth convolution layer, the sixth activation function layer, the seventh convolution layer, the seventh activation function layer and the third pooling layer; wherein: the convolution kernels of the fifth convolution layer and the seventh convolution layer are 3×3, and the convolution kernel of the sixth convolution layer is 1×1; the fourth block includes the eighth convolution layer, the eighth activation function layer, the ninth convolution layer, the ninth activation function layer, and the ninth pooling layer; The fifth block includes the eleventh convolution layer, the eleventh activation function layer, the twelfth convolution layer, the twelfth activation function layer, the thirteenth convolution layer, the thirteenth activation function layer and the fifth pooling layer; wherein: the convolution kernels of the eleventh convolution layer and the thirteenth convolution layer are 3×3, and the convolution kernel of the twelfth convolution layer is 1×1; the sixth block includes the fourteenth convolution layer, the fourteenth activation function layer, the fifteenth convolution layer, the fifteenth activation function layer, the sixteenth convolution layer and the sixteenth activation function layer; wherein: the convolution kernels of the fourteenth convolution layer and the sixteenth convolution layer are 3×3, and the convolution kernel of the fifteenth convolution layer is 1×1; the pooling type of the first pooling layer, the second pooling layer, the third pooling layer, the fourth pooling layer and the fifth pooling layer is maximum pooling, and the filter size of the pooling layer is 2×2; The prediction unit is used to detect and filter feature maps of different sizes and output the predicted box position; the prediction unit includes a first detection classifier, a second detection classifier, a third detection classifier and a fourth detection classifier; the image size processed by the first block is 320×240, the number of channels is 16, the output of the first block is used as the input of the second block, the image size processed by the second block is 160×120, the number of channels is 16, the output of the second block is used as the input of the third block, the image size processed by the third block is 80×60, the number of channels is 32, and the output of the third block is 160×120. The output is used as the input of the fourth block and the input of the first detection classifier. The image size processed by the fourth block is 40×30 and the number of channels is 64. The output of the fourth block is used as the input of the fifth block and the input of the second detection classifier. The image size processed by the fifth block is 20×15 and the number of channels is 128. The output of the fifth block is used as the input of the sixth block and the input of the third detection classifier. The image size processed by the sixth block is 10×8 and the number of channels is 128. The output of the sixth block is used as the input of the fourth detection classifier. The output unit is used to filter the prediction frame output by the prediction unit and output the face position.
2. The method according to claim 1, characterized in that: Determining the scene label corresponding to the type of the image according to the type of the image includes: When the type of the image is a non-face close-up image, a scene classification network based on deep learning is used to perform scene classification on the image to determine a scene label of the non-face close-up image; When the type of the image is a close-up face image, the scene label of the close-up face image is determined to be a close-up face label.
3. The method according to claim 1, characterized in that The processing of the image according to the scene label comprises: Determine the image parameter corresponding to the scene label according to the scene label and the table of correspondence between the scene label and the image parameter; The parameters of the image are adjusted according to the image parameters.
4. The method according to claim 1, characterized in that: The acquiring of the image, performing face detection on the image using a face detection network based on deep learning, and determining the type of the image comprises: Acquire an image, and perform face detection on the image to obtain a face position; Determine the face area according to the face position; The type of the image is determined according to the relationship between the area of the face and the area of the image.
5. The method according to claim 4, characterized in that The determining the type of the image according to the relationship between the area of the face and the area of the image comprises: When the ratio of the face area to the image area exceeds a threshold ratio, determining that the type of the image is a face close-up image; When the ratio of the face area to the image area does not exceed a threshold ratio, it is determined that the type of the image is a non-face close-up image.
6. The method according to claim 4, characterized in that After performing face detection on the image to obtain the face position, the method further includes: Perform skin smoothing on the detected face.
7. The method according to claim 1, characterized in that in: The scene classification network based on deep learning includes an input layer, a deep convolution layer, a global pooling layer and an output layer, wherein: The input layer is used to process the image to be processed into an image suitable for a scene classification network; The depth convolution layer includes a first depth convolution block, a sixth pooling layer, a second depth convolution block, a seventh pooling layer and a third depth convolution block connected in sequence; The global pooling layer is used to perform global average pooling on the feature map output by the third depth convolution block; The output layer is used to generate the predicted probability for each classification.
8. The method according to claim 7, characterized in that in The image size processed by the first depth convolution block is 64×64, and the number of channels is 32; the image size processed by the second depth convolution block is 32×32, and the number of channels is 64; the image size processed by the third depth convolution block is 16×16, and the number of channels is 128.
9. The method according to claim 7 or 8, characterized in that: in Any depth convolution block includes three sub-blocks, wherein the first sub-block includes the seventeenth convolution layer and the seventeenth activation function layer, the convolution kernel of the seventeenth convolution layer is 1×1, the second sub-block includes the eighteenth convolution layer and the eighteenth activation function layer, the eighteenth convolution layer adopts depth convolution, and the convolution kernel is 3×3, the third sub-block includes the nineteenth convolution layer, the convolution kernel of the nineteenth convolution layer is 1×1, and the output of the nineteenth convolution layer is summed with the input of the depth convolution block as the output of the depth convolution block.
10. An image processing device, comprising a processor and a memory storing a computer program executable on the processor, wherein: When the processor executes the program, the steps of the image processing method according to any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium, characterized in that: A computer program that can be run on a processor is stored thereon, and when the computer program is executed by the processor, the steps of the image processing method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Image classification method, device and system
CN109117879A
Semantic segmentation network integrating multi-scale feature space and semantic space
CN109509192A
Image processing method and device and terminal
CN110163810A
Image processing method and device, electronic equipment and computer readable medium
CN111696064A
