Facial detection method, apparatus, device, medium and product

By collecting initial facial images of users in banks, enriching the image states of the training set, generating target facial images, and training the model, the problem of low detection accuracy in existing technologies is solved, and high-precision facial detection is achieved in banking application scenarios.

CN116645715BActive Publication Date: 2026-06-05INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-05-30
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

The training set of existing technologies uses relatively limited facial images, resulting in low detection accuracy of facial detection models in banking applications.

Method used

A training set is constructed by collecting initial facial images of users from banks. The facial images in the training set are enriched by including multiple dimensions such as blur, occlusion, illumination and expression. Target facial images are generated and these images are used to train a preset facial detection model.

Benefits of technology

This improves the detection accuracy of the face detection model in banking applications, making it applicable to face detection in various image states and enhancing the detection effect in practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116645715B_ABST
    Figure CN116645715B_ABST
Patent Text Reader

Abstract

The present application provides a face detection method, device, equipment, medium and product, and relates to the field of artificial intelligence. The method comprises the following steps: collecting initial face images of multiple users through a preset collection approach; in response to the image state of at least one dimension of the initial face image of the same user being part of the multiple preset image states of the corresponding dimension, pre-processing the initial face image of the same user according to the remaining part of the multiple preset image states of the corresponding dimension, so as to obtain a target face image of the same user with the image state being the remaining part; generating a training set according to the initial face images of the multiple users and the target face images of the corresponding users; training a preset face detection model by using the training set, so as to obtain the preset face detection model for face detection of bank input images. The method of the present application improves the detection accuracy of the preset face detection model in the bank application scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and in particular to a face detection method, apparatus, device, medium, and product. Background Technology

[0002] Facial detection is a crucial step in facial recognition and an important component of facial analysis, playing a vital role in areas such as bank surveillance, image detection technology, identity authentication, and self-service.

[0003] In existing technologies, a face detection model to be trained is pre-built, and a training set consisting of a large number of face images with labeled ground truth bounding boxes is used to train the face detection model to be trained until a preset training convergence condition is reached. The face detection model to be trained when the preset training convergence condition is reached is determined as the target face detection model, so that the target face detection model can be used to detect faces in the image.

[0004] However, the facial images in the training set of existing technologies are relatively homogeneous, resulting in low detection accuracy of the target face detection model trained using this training set in banking application scenarios. Summary of the Invention

[0005] This application provides a face detection method, apparatus, device, medium, and product to solve the problem that the target face detection model trained using the training set of the prior art has low detection accuracy in banking application scenarios due to the relatively simple nature of the facial images in the training set.

[0006] Firstly, this application provides a face detection method, the face detection method comprising:

[0007] Initial facial images of multiple users are collected through a preset collection method; the preset collection method includes any one or more of bank counters, bank self-service terminals, and online banking; the users are those who have been authorized to collect the images.

[0008] Determine the image state of at least one dimension of the initial facial images of the plurality of users; the dimension includes one or more of blur, occlusion, illumination, and expression.

[0009] In response to the initial facial image of the same user having an image state of at least one dimension that is a partial state among a plurality of preset image states of the corresponding dimension, the initial facial image of the same user is preprocessed according to the remaining state among the plurality of preset image states of the corresponding dimension to obtain the target facial image of the same user, wherein the image state of the target facial image is the remaining state among the plurality of preset image states of the corresponding dimension.

[0010] A training set is generated based on the initial facial images of the multiple users and the target facial images of the corresponding users;

[0011] The training set is used to train the preset face detection model to obtain the trained preset face detection model, which is used to perform face detection on bank input images.

[0012] Secondly, this application provides a face detection device, the face detection device comprising:

[0013] The acquisition module is used to acquire initial facial images of multiple users through preset acquisition methods; the preset acquisition methods include any one or more of bank counters, bank self-service terminals, and online banking; the users are users who have been authorized to acquire images.

[0014] A determining module is used to determine the image state of at least one dimension of the initial facial images of the plurality of users; the dimension includes one or more of blur, occlusion, illumination, and expression.

[0015] A preprocessing module is configured to, in response to an initial facial image of the same user having an image state in at least one dimension that is a partial state among multiple preset image states in the corresponding dimension, preprocess the initial facial image of the same user according to the remaining state among the multiple preset image states in the corresponding dimension to obtain a target facial image of the same user, wherein the image state of the target facial image is the remaining state among the multiple preset image states in the corresponding dimension.

[0016] The generation module is used to generate a training set based on the initial facial images of the multiple users and the target facial images of the corresponding users;

[0017] The training module is used to train the preset face detection model using the training set to obtain the trained preset face detection model, which is used to perform face detection on bank input images.

[0018] Thirdly, this application provides an electronic device, the electronic device comprising: a processor, and a memory communicatively connected to the processor;

[0019] The memory stores computer-executed instructions;

[0020] The processor executes computer execution instructions stored in the memory to implement the face detection method described in the first aspect.

[0021] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the face detection method described in the first aspect.

[0022] Fifthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the face detection method described in the first aspect.

[0023] The face detection method, apparatus, device, medium, and product provided in this application acquire initial facial images of multiple users through a preset acquisition path. The preset acquisition path includes any one or more of bank counters, bank self-service terminals, and online banking. The users are authorized users who have passed the acquisition process. The method determines the image state of at least one dimension of the initial facial images of the multiple users. The dimension includes one or more of blurriness, occlusion, illumination, and expression. Responding to the image state of at least one dimension of the initial facial image of the same user being a partial state among multiple preset image states of the corresponding dimension, the initial facial images of the same user are preprocessed based on the remaining partial states among the multiple preset image states of the corresponding dimension to obtain a target facial image of the same user. The image state of the target facial image is the remaining partial state among the multiple preset image states of the corresponding dimension. A training set is generated based on the initial facial images of multiple users and the target facial images of the corresponding users. The training set is used to train a preset face detection model to obtain a trained preset face detection model, which is then used to perform face detection on bank input images. The above approach achieves two objectives. First, by training a pre-defined facial detection model based on the initial facial images of users collected by the bank, the trained model is well-suited for facial detection in banking applications, thereby improving the accuracy of facial detection in these scenarios. Second, by preprocessing the initial facial images collected by the bank based on their image states, target facial images are obtained. A training set with rich image states is then generated based on the initial and target facial images, ensuring that the pre-defined facial image detection model trained on this set is applicable to facial detection in various image states, thus improving the accuracy of facial detection in actual banking applications. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0025] Figure 1 A schematic diagram of a scenario for the face detection method provided in an embodiment of this application;

[0026] Figure 2 A schematic flowchart of the face detection method provided in the embodiments of this application;

[0027] Figure 3 This is another schematic flowchart of the face detection method provided in the embodiments of this application;

[0028] Figure 4 This is a schematic diagram of the structure of the face detection device provided in the embodiments of this application;

[0029] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0033] It should be noted that the facial detection method, device, equipment, medium and product of this application can be used in the field of artificial intelligence, or in any field other than artificial intelligence. The application field of the facial detection method, device, equipment, medium and product of this application is not limited.

[0034] First, let me explain the terms used in this application:

[0035] Face detection refers to the process of determining the location and size of all faces in an input image. Face detection can be considered as object detection of a single category and is a key technology in facial information processing.

[0036] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.

[0037] In existing technologies, a face detection model to be trained is pre-built, and a training set consisting of a large number of face images with labeled ground truth bounding boxes is used to train the face detection model to be trained until a preset training convergence condition is reached. The face detection model to be trained when the preset training convergence condition is reached is determined as the target face detection model, so that the target face detection model can be used to detect faces in the image.

[0038] However, the facial images in the training set of existing technologies are relatively homogeneous, meaning that the facial images in the training set of existing technologies are all facial images under ideal conditions. In banking application scenarios, the facial images actually obtained are usually different from those under ideal conditions. Therefore, when the target face detection model trained using the training set of existing technologies performs face detection on facial images obtained in banking application scenarios, there are cases of false detection and false detection, that is, the detection accuracy is low.

[0039] To address the issue of low detection accuracy in banking applications due to the limited variety of facial images in the training sets of existing technologies, the inventors discovered a solution: a training set can be constructed using initial facial images of users collected by banks. This makes the initial facial images in the training set more closely resemble actual banking applications. Furthermore, the training set can be enriched with facial images from multiple dimensions, including blurriness, lighting variations, occlusion levels, and facial expressions. This richer training set allows for the training of a pre-defined facial detection model, ensuring that the trained model is effectively applicable to banking applications and achieves high detection accuracy.

[0040] The following describes the application scenarios of the face detection method provided in the embodiments of this application.

[0041] like Figure 1As shown, the scenario includes a user terminal 100 and a server 200. The server 200 pre-stores initial facial images of multiple users collected through one or more of the following methods: bank counters, bank self-service terminals, and online banking. The user terminal 100 sends a model training request to the server 200. Upon receiving the request, the server 200 first determines the image state of at least one dimension of the initial facial images of the multiple users. This dimension includes one or more of blurriness, occlusion, illumination, and expression. If the server 200 determines that the image state of a certain dimension of a user's initial facial image is a partial state among multiple preset image states for that dimension—meaning that the server 200 does not pre-store the image state of the user's initial facial image corresponding to the remaining partial states among the multiple preset image states for that dimension—then the server 200 will perform a training based on the multiple preset image states for that dimension. The remaining states in the image state are used to preprocess the initial facial image of the same user to obtain the target facial image of the user. The image state of the target facial image is the remaining state among multiple preset image states in this dimension. Then, the server 200 traverses the image states of each dimension of the initial facial image of each user and generates the target facial image of the corresponding user through preprocessing. Next, the server 200 generates a training set based on the initial facial image of each user and the target facial image of the corresponding user, and uses the training set to train the preset facial detection model, thereby obtaining a preset facial detection model that is suitable for banking application scenarios and has high detection accuracy.

[0042] The technical solutions shown in this application will now be described in detail through specific embodiments. Optionally, the following embodiments may exist alone or in combination with each other. For the same or similar content, the description will not be repeated in different embodiments.

[0043] Figure 2 A flowchart of the face detection method provided in the embodiments of this application is shown below. Figure 2 As shown, the face detection method provided in this application includes:

[0044] S10: Collect initial facial images of multiple users through preset collection methods; preset collection methods include any one or more of bank counters, bank self-service terminals, and online banking; users are authorized users who have passed the collection process.

[0045] It is understandable that when users go to the bank to conduct related business, it is usually necessary to collect the user's initial facial image for corresponding business verification. In some implementations, before collecting the user's initial facial image, the user is informed of the purpose and use of the collected initial facial image, and the user's initial facial image is collected only after receiving the user's authorization.

[0046] The initial number of facial images for the same user must be at least one.

[0047] S20: Determine the image state of at least one dimension of the initial facial images of multiple users; the dimension includes one or more of blur, occlusion, illumination, and expression.

[0048] The initial facial image state can be automatically identified and determined using relevant algorithms, or it can be determined by relevant personnel after pre-calibration based on relevant calibration data; no limitation is made here.

[0049] For example, the dimensions include all of the following: blur, occlusion, illumination, and expression.

[0050] S30: In response to the fact that the image state of at least one dimension of the initial facial image of the same user is a partial state among a plurality of preset image states of the corresponding dimension, the initial facial image of the same user is preprocessed according to the remaining state among the plurality of preset image states of the corresponding dimension to obtain the target facial image of the same user, wherein the image state of the target facial image is the remaining state among the plurality of preset image states of the corresponding dimension.

[0051] For example, for each user whose initial facial images are collected in step S10, the number of initial facial images can be multiple. When the image state of all initial facial images of a certain user Y1 in any dimension is not all of the multiple preset image states of the corresponding dimension, it is determined that the image state of at least one dimension of the initial facial images of user Y1 is a partial state among the multiple preset image states of the corresponding dimension. Then, it is progressively determined whether each preset image state of each dimension has a corresponding initial facial image of user Y1. If a certain preset image state A in a certain dimension does not have a corresponding initial facial image of user Y1, then the initial facial images of user Y1 are preprocessed according to the preset image state A to obtain the image state of user Y1 as the target facial image of the preset image state A. When the image state of all initial facial images of a certain user Y2 in each dimension is all of the multiple preset image states of the corresponding dimension, that is, each preset image state in each dimension has a corresponding initial facial image of user Y2, then it is not necessary to additionally determine the target facial image of user Y2.

[0052] For example, the multiple preset image states of ambiguity include a clear state and a blurred state. If some of the multiple preset image states of ambiguity are clear states, then the remaining states of the multiple preset image states of ambiguity are blurred states; if some of the multiple preset image states of ambiguity are blurred states, then the remaining states of the multiple preset image states of ambiguity are clear states.

[0053] For example, the multiple preset image states of occlusion degree include eyebrow and eye occlusion state, mouth and nose occlusion state, top of head occlusion state, ear occlusion state, and unoccluded state. Some of the multiple preset image states of occlusion degree can be any one, two, three, or four of the eyebrow and eye occlusion state, mouth and nose occlusion state, top of head occlusion state, ear occlusion state, and unoccluded state. Correspondingly, the remaining states of the multiple preset image states of occlusion degree are the other states besides the partial states of the multiple preset image states of occlusion degree. For example, if some of the preset image states of occlusion degree are eyebrow and eye occlusion states, then the remaining states of the preset image states of occlusion degree are mouth and nose occlusion states, top of head occlusion states, ear occlusion states, and unoccluded states; if some of the preset image states of occlusion degree are eyebrow and eye occlusion states and mouth and nose occlusion states, then the remaining states of the preset image states of occlusion degree are top of head occlusion states, ear occlusion states, and unoccluded states; if some of the preset image states of occlusion degree are unoccluded states, then the remaining states of the preset image states of occlusion degree are eyebrow and eye occlusion states, mouth and nose occlusion states, top of head occlusion states, and ear occlusion states, and so on. This will not be elaborated further.

[0054] For example, the various preset image states of illuminance include strong light state, weak light state, and normal light state. If some of the preset image states of illuminance are strong light state, then the remaining states of the various preset image states of illuminance are weak light state and normal light state; if some of the preset image states of illuminance are strong light state and weak light state, then the remaining states of the various preset image states of illuminance are normal light state; if some of the preset image states of illuminance are normal light state, then the remaining states of the various preset image states of illuminance are strong light state and weak light state, and so on. This will not be elaborated further.

[0055] For example, the multiple preset image states of expression include an expression state and an expressionless state. If some of the multiple preset image states of expression are expression states, then the remaining states of the multiple preset image states of expression are expressionless states; if some of the multiple preset image states of expression are expressionless states, then the remaining states of the multiple preset image states of expression are expression states.

[0056] S40: Generate a training set based on the initial facial images of multiple users and the target facial images of the corresponding users.

[0057] For example, initial facial images of multiple users and target facial images of the corresponding users are both used as facial images in the training set. For each user whose initial facial image is collected in step S10, if it is necessary to determine the target facial image of the user in step S30, then the training set includes both the initial facial image and the target facial image of the user; if it is not necessary to determine the target facial image of the user in step S30, then the training set only includes the initial facial image of the user and does not include the target facial image of the user.

[0058] S50: The preset face detection model is trained using the training set to obtain the trained preset face detection model. The trained preset face detection model is used to perform face detection on bank input images.

[0059] For example, existing object detection models can detect multiple categories of objects at the same time. In terms of structural and motion information, the user's face has a strong recognizability compared with other non-facial objects. Although face detection models are usually different from object detection models, existing object detection models can also be used to detect single-category objects. Therefore, the preset face detection model in this application can be an existing object detection model, such as the YOLO V3 model or the YOLO V5 model, etc., without limitation.

[0060] The bank's input image can be understood as the current facial image of the bank user collected through a preset acquisition method.

[0061] In some implementations, after generating all target facial images in one dimension, step S30 further includes: when preprocessing the initial facial images of the same user based on the remaining states of the next dimension, also preprocessing the target facial images of the previous dimension based on the remaining states of the next dimension.

[0062] The face detection method provided in this application collects initial facial images of multiple users through a preset acquisition method. The preset acquisition method includes any one or more of bank counters, bank self-service terminals, and online banking. The users are authorized users who have passed the acquisition. The method determines the image state of at least one dimension of the initial facial images of multiple users. The dimension includes one or more of blur, occlusion, illumination, and expression. In response to the image state of at least one dimension of the initial facial image of the same user being a partial state among multiple preset image states of the corresponding dimension, the initial facial images of the same user are preprocessed according to the remaining partial states among the multiple preset image states of the corresponding dimension to obtain the target facial image of the same user. The image state of the target facial image is the remaining partial state among the multiple preset image states of the corresponding dimension. A training set is generated based on the initial facial images of multiple users and the target facial images of the corresponding users. The training set is used to train a preset face detection model to obtain a trained preset face detection model. The trained preset face detection model is used to perform face detection on bank input images. The above approach achieves two objectives. First, by training a pre-defined facial detection model based on the initial facial images of users collected by the bank, the trained model is well-suited for facial detection in banking applications, thereby improving the accuracy of facial detection in these scenarios. Second, by preprocessing the initial facial images collected by the bank based on their image states, target facial images are obtained. A training set with rich image states is then generated based on the initial and target facial images, ensuring that the pre-defined facial image detection model trained on this set is applicable to facial detection in various image states, thus improving the accuracy of facial detection in actual banking applications.

[0063] Please combine Figure 3 Optionally, step S20 includes:

[0064] S21: Obtain image state calibration data, wherein the image state calibration data includes image state of at least one dimension of the initial facial images of multiple users.

[0065] S22: Determine the image state of at least one dimension of the initial facial images of multiple users from the image state calibration data.

[0066] In some implementations, relevant personnel calibrate the image states of each dimension of the initial facial images collected at a preset frequency, and generate image state calibration data based on the image states of each dimension of the initial facial images collected, and store it in a preset location. Thus, when it is necessary to determine the image state of at least one dimension of the initial facial images of multiple users, the image state calibration data can be directly obtained from the preset location, and the image state of at least one dimension of the initial facial images of multiple users can be determined from the image state calibration data.

[0067] The preset frequency may include a preset time interval per interval and / or a preset number of images to be acquired per interval.

[0068] The face detection method of the above embodiment acquires image state calibration data, wherein the image state calibration data includes at least one dimension of the image state of initial facial images of multiple users; and determines at least one dimension of the image state of the initial facial images of multiple users from the image state calibration data. Thus, at least one dimension of the image state of the initial facial images of multiple users can be quickly and accurately determined based on the image state calibration data.

[0069] Optionally, the multiple preset image states of blur include a sharp state and a blurred state; step S30 includes:

[0070] S31: In response to the remaining state among multiple preset image states of ambiguity being a clear state, the initial facial image of the same user is sharpened to obtain a target facial image of the same user in a clear state. The sharpening process includes one or more of sharpening, denoising, super-resolution reconstruction, and image enhancement.

[0071] In one example, when the initial facial image of the same user is in a blurred state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a clear state, the initial facial image of the same user is sharpened to obtain a clear target facial image of the same user.

[0072] In another example, when the initial facial image of the same user is in a blurred state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a clear state, the initial facial image of the same user is denoised to obtain a clear target facial image of the same user.

[0073] In another example, when the initial facial image of the same user is in a blurred state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a clear state, super-resolution reconstruction is performed on the initial facial image of the same user to obtain a clear target facial image of the same user.

[0074] In another example, when the initial facial image of the same user is in a blurred state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a clear state, image enhancement is performed on the initial facial image of the same user to obtain a clear target facial image of the same user.

[0075] S32: In response to the remaining state in a variety of preset image states of ambiguity being a blurred state, the initial facial image of the same user is blurred to obtain a target facial image of the same user in a blurred state. The blurring process includes one or more of Gaussian blur, motion blur, mean blur, and downsampling.

[0076] In one example, when the initial facial image of the same user is in a clear state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a blur state, the initial facial image of the same user is subjected to Gaussian blur processing to obtain the target facial image of the same user in a blur state.

[0077] In another example, when the initial facial image of the same user is in a clear state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a blur state, motion blur processing is performed on the initial facial image of the same user to obtain the target facial image of the same user in a blur state.

[0078] In another example, when the initial facial image of the same user is in a clear state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a blur state, the initial facial image of the same user is subjected to mean blur processing to obtain the target facial image of the same user in a blur state.

[0079] In another example, when the initial facial image of the same user is in a clear state among multiple preset image states, that is, when the remaining state among the multiple preset image states of blur is a blur state, the initial facial image of the same user is downsampled to obtain the target facial image of the same user in a blur state.

[0080] The face detection method in the above embodiments, in response to the remaining state being a clear state among multiple preset image states of ambiguity, performs sharpening processing on the initial face image of the same user to obtain a clear target face image of the same user. The sharpening processing includes one or more of sharpening, denoising, super-resolution reconstruction, and image enhancement. In response to the remaining state being a blurred state among multiple preset image states of ambiguity, the initial face image of the same user is blurred to obtain a blurred target face image of the same user. The blurring processing includes one or more of Gaussian blur, motion blur, mean blur, and downsampling. Thus, it is possible to obtain both clear and blurred face images of the same user, enriching the facial images of the same user in the dimension of ambiguity.

[0081] Optionally, the preset image states of occlusion include one or more of the following: eyebrow and eye occlusion state, mouth and nose occlusion state, top of head occlusion state, ear occlusion state, and no occlusion state; step S30 includes:

[0082] S33: In response to the remaining states among the various preset image states of occlusion degree, including the eyebrow and eye occlusion state, determine the eyebrow and eye positions in the initial facial image of the same user, add a first occlusion at the eyebrow and eye positions, and obtain the target facial image of the same user with eyebrow and eye occlusion state.

[0083] Optionally, the first occluder may include one or more of the following: a preset glasses image, a preset bandage image, a preset gauze image, a preset image block, or an image block cropped from the initial facial image. The shape and size of the first occluder are not limited herein.

[0084] In one example, the multiple preset image states of occlusion include eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, ear occlusion, and no occlusion. When the image state of occlusion of the initial facial image of the same user is any one or more of the following states: mouth and nose occlusion, top of head occlusion, ear occlusion, and no occlusion, that is, when the remaining states of the multiple preset image states of occlusion include eyebrow and eye occlusion, the eyebrow and eye positions in each initial facial image of the same user are determined by a preset eyebrow and eye position recognition algorithm. Then, a preset gauze image is added at the left eyebrow and eye position or the right eyebrow and eye position to obtain the target facial image of the same user with eyebrow and eye occlusion.

[0085] S34: In response to the remaining states among the various preset image states of occlusion degree, including the mouth and nose occlusion state, determine the mouth and nose position in the initial facial image of the same user, add a second occlusion at the mouth and nose position, and obtain the target facial image of the same user with the mouth and nose occlusion state.

[0086] Optionally, the second occluder may include one or more of the following: a preset mask image, a preset bandage image, a preset gauze image, a preset image block, or an image block cropped from the initial facial image. The shape and size of the second occluder are not limited herein.

[0087] In one example, the preset image states for occlusion include eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, ear occlusion, and no occlusion. If the image state of the occlusion of the initial facial image of the same user is any one or more of the following states: eyebrow and eye occlusion, top of head occlusion, ear occlusion, and no occlusion, that is, when the remaining states among the preset image states for occlusion include mouth and nose occlusion, the mouth and nose positions in the initial facial image of the same user are determined by a preset mouth and nose position recognition algorithm, and then a preset mask image is added to the mouth and nose positions to obtain the target facial image of the same user with mouth and nose occlusion.

[0088] S35: In response to the remaining states among the various preset image states of occlusion degree, including the top occlusion state, determine the top position of the head in the initial facial image of the same user, add a third occluder at the top position, and obtain the target facial image of the same user with the top occlusion state.

[0089] Optionally, the third occluder may include one or more of the following: a preset hat image, a preset bandage image, a preset gauze image, a preset image block, or an image block cropped from the initial face image. The shape and size of the third occluder are not limited herein.

[0090] In one example, the preset image states of occlusion include eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, ear occlusion, and no occlusion. When the image state of occlusion of the initial facial image of the same user is any one or more of the following states: eyebrow and eye occlusion, mouth and nose occlusion, ear occlusion, and no occlusion, that is, when the remaining states of the preset image states of occlusion include top of head occlusion, the top of the head position in the initial facial image of the same user is determined by a preset top of head position recognition algorithm, and then a preset hat image is added to the top of the head position to obtain the target facial image of the same user with top of head occlusion.

[0091] S36: In response to the remaining states among the various preset image states of occlusion degree, including the ear occlusion state, determine the ear position in the initial facial image of the same user, add a fourth occluder at the ear position, and obtain the target facial image of the same user with the ear occlusion state.

[0092] Optionally, the fourth occluder includes one or more of the following: a preset headphone image, a preset bandage image, a preset gauze image, a preset image block, and an image block cropped from the initial facial image. The shape and size of the fourth occluder are not limited herein. The first, second, third, and fourth occluders may be the same or different, and this is not limited herein.

[0093] In one example, the preset image states of occlusion include eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, ear occlusion, and no occlusion. When the image state of occlusion of the initial facial image of the same user is any one or more of the following states: eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, and no occlusion, that is, when the remaining states of the preset image states of occlusion include ear occlusion, the ear position in the initial facial image of the same user is determined by a preset top of head position recognition algorithm, and then a preset headphone image is added to the ear position to obtain the target facial image of the same user with ear occlusion.

[0094] S37: In response to the remaining state among the various preset image states of occlusion degree, including the unoccluded state, the facial symmetry line, occluded region and symmetrical region in the initial facial image of the same user are determined, and the image content in the symmetrical region is used to cover the image content in the occluded region to obtain the target facial image of the same user in the unoccluded state, wherein the symmetrical region is the unoccluded region in the initial facial image that is symmetrical to the occluded region about the facial symmetry line.

[0095] In one example, the preset image states for occlusion include eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, ear occlusion, and unoccluded state. When the image state of occlusion of the initial facial image of the same user is any one or more of the eyebrow and eye occlusion, mouth and nose occlusion, top of head occlusion, and ear occlusion, that is, when the remaining states among the preset image states for occlusion include the unoccluded state, the facial symmetry line in each initial facial image of the same user is determined by a preset facial symmetry line recognition algorithm, and the occluded region and symmetrical region in each initial facial image of the same user are determined by a preset region recognition algorithm. Then, the image content in the symmetrical region is flipped along the facial symmetry line, and the flipped image content is used to cover the image content in the occluded region, thereby obtaining the target facial image of the same user in the unoccluded state.

[0096] In some implementations, when an initial facial image of the same user does not contain or only contains a portion of an unobstructed area that is symmetrical to the obstructed area about the facial symmetry line, the complete unobstructed area, i.e., the symmetrical area, of the initial image can be pieced together by combining all the user's initial facial images. Then, the image content in the symmetrical area is flipped along the facial symmetry line, and the flipped image content is used to cover the image content of the obstructed area, thereby obtaining the target facial image of the same user in an unobstructed state.

[0097] The facial detection method of the above embodiments, in response to the remaining states among multiple preset image states of occlusion degree, including eyebrow and eye occlusion state, determines the eyebrow and eye positions in the initial facial image of the same user, and adds a first occluder at the eyebrow and eye positions to obtain a target facial image of the same user with eyebrow and eye occlusion state; in response to the remaining states among multiple preset image states of occlusion degree, including mouth and nose occlusion state, determines the mouth and nose positions in the initial facial image of the same user, and adds a second occluder at the mouth and nose positions to obtain a target facial image of the same user with mouth and nose occlusion state; in response to the remaining states among multiple preset image states of occlusion degree, including top-of-the-head occlusion state, determines the top-of-the-head position in the initial facial image of the same user, and adds a third occluder at the top-of-the-head position. To obtain a target facial image of the same user with head occlusion, the remaining states among various preset image states based on occlusion degree, including ear occlusion, are determined. The ear position in the initial facial image of the same user is determined, and a fourth occluder is added at the ear position to obtain a target facial image of the same user with ear occlusion. Responding to the remaining states among various preset image states based on occlusion degree, including unoccluded states, the facial symmetry line, occluded region, and symmetrical region in the initial facial image of the same user are determined. The image content in the symmetrical region is used to cover the image content in the occluded region to obtain a target facial image of the same user with unoccluded state. The symmetrical region is the unoccluded region in the initial facial image that is symmetrical to the occluded region about the facial symmetry line. Thus, it is possible to obtain facial images of the same user with one or more of the following states: eyebrow and eye occlusion, mouth and nose occlusion, head occlusion, and ear occlusion, as well as an unoccluded facial image of the same user, enriching the facial images of the same user in the dimension of occlusion degree.

[0098] Optionally, the preset image states of illumination include one or more of strong illumination state, weak illumination state, and normal illumination state; step S30 includes:

[0099] S38: In response to the remaining state among a variety of preset image states of illumination, which are any one or two of strong illumination state, weak illumination state, and normal illumination state, gamma correction is performed on the initial facial image of the same user to obtain the target facial image of the same user in strong illumination state, weak illumination state, or normal illumination state.

[0100] In one example, the preset image states of illumination include strong illumination, weak illumination, and normal illumination. When the image state of the initial facial image of the same user is normal illumination, that is, when the remaining states among the preset image states of illumination include strong illumination and weak illumination, a preset strong light gamma factor is used to perform gamma correction on the initial facial image of the same user to obtain the target facial image of the same user in strong illumination. Similarly, a preset weak light gamma factor is used to perform gamma correction on the initial facial image of the same user to obtain the target facial image of the same user in weak illumination.

[0101] The face detection method in the above embodiments, in response to the remaining states among various preset image states of illumination being any one or two of strong illumination, weak illumination, and normal illumination, performs gamma correction on the initial facial image of the same user to obtain a target facial image of the same user under strong illumination, weak illumination, or normal illumination. Thus, it can obtain facial images of the same user under one or more of the strong illumination and weak illumination states, as well as facial images of the same user under normal illumination, enriching the facial images of the same user in the dimension of illumination.

[0102] Optionally, the preset image states for expression include an expressive state and an expressionless state; step S30 includes:

[0103] S39: In response to the remaining states in a variety of preset image states of expression degree being either an expressive state or an expressionless state, a pre-stored expression conversion model is used to convert the facial expressions of the person in the initial facial image of the same user to obtain the target facial image of the same user in either an expressive state or an expressionless state.

[0104] In one example, when the initial facial image of the same user has an expressionless state, that is, when the remaining state among the various preset image states of the expression is an expressive state, a pre-stored expression conversion model is used to convert the facial expressions of the same user in the initial facial image, thereby obtaining the target facial image of the same user with an expressive state.

[0105] The facial detection method described in the above embodiments, in response to the remaining states in a variety of preset image states of expression being either an expressive state or an expressionless state, uses a pre-stored expression conversion model to convert the facial expressions of the same user in the initial facial image, thereby obtaining target facial images of the same user in either an expressive or expressionless state. In this way, it is possible to obtain both expressive and expressionless facial images of the same user, enriching the facial images of the same user in the dimension of expression.

[0106] Optionally, step S40 includes:

[0107] S41: Obtain the annotation data of the initial facial images of multiple users and the annotation data of the target facial images of the corresponding users.

[0108] S42: The initial facial images of multiple users, the target facial image of the corresponding user, the labeled data of the initial facial images of multiple users, and the labeled data of the target facial image of the corresponding user are determined as the content of the training set, and the training set is generated.

[0109] For example, relevant personnel pre-select user faces from each initial facial data set of multiple users, generating and storing labeled data for the initial facial images of multiple users; relevant personnel also pre-select user faces from each target facial data set of a corresponding user, generating and storing labeled data for the initial facial images of that corresponding user. Then, when a training set needs to be generated, the labeled data for the initial facial images of multiple users and the labeled data for the target facial images of the corresponding user can be quickly retrieved from the storage location and used together with the initial facial images of multiple users and the target facial images of the corresponding user as the content of the training set to generate the training set.

[0110] The face detection method in the above embodiment acquires labeled data of initial facial images of multiple users and labeled data of target facial images of corresponding users; the initial facial images of multiple users, the target facial images of corresponding users, the labeled data of the initial facial images of multiple users, and the labeled data of the target facial images of corresponding users are determined as the content of the training set to generate a training set. In this way, a training set with rich image states can be obtained, which facilitates improving the detection accuracy of the preset face detection model trained based on this training set.

[0111] Optionally, the training set includes facial images labeled with ground truth bounding boxes; step S50 includes:

[0112] S51: Input the facial image into the preset facial detection model to obtain the facial prediction bounding box of the facial image.

[0113] S52: Calculate the loss value based on the predicted face bounding box and the ground truth face bounding box.

[0114] S53: Adjust the parameters of the preset face detection model according to the loss value to obtain the trained preset face detection model.

[0115] For example, the preset face detection model is the YOLO V3 model. The face images in the training set are input into the YOLO V3 model to obtain the face prediction boxes of the face images. The relevant parameters of the face prediction boxes and the relevant parameters of the face ground truth boxes are input into the Logistic function to calculate the loss value. Then, the parameters of the preset face detection model are adjusted according to the loss value. When the loss value reaches the minimum value, the YOLO V3 model with the minimum loss value is used as the preset face detection model after training.

[0116] The face detection method described in the above embodiment inputs a face image into a preset face detection model to obtain a predicted face bounding box; calculates a loss value based on the predicted face bounding box and the ground truth face bounding box; and adjusts the parameters of the preset face detection model based on the loss value to obtain a trained preset face detection model. In this way, a preset face detection model for face detection can be trained using a training set rich in image states, and the obtained preset face detection model has high detection accuracy in banking application scenarios.

[0117] Optionally, after step S50, the method further includes:

[0118] S60: Obtain the input image of the bank to be detected.

[0119] S70: Input the input image of the bank to be detected into the trained preset face detection model, perform face detection on the input image of the bank to be detected, and output the face detection results.

[0120] For example, after acquiring the current facial image of a bank user through a preset acquisition method, the acquired current facial image of the bank user is used as the input image of the bank to be detected to train the preset facial detection model, perform facial detection on the input image of the bank to be detected, and output the facial detection result, so as to facilitate the subsequent handling of relevant business for the bank user based on the facial detection result.

[0121] The face detection method described in the above embodiment acquires an input image of a bank to be detected; inputs the input image of the bank to be detected into a trained preset face detection model, performs face detection on the input image of the bank to be detected, and outputs the face detection result. Thus, by using a preset face detection model trained on a training set rich in image states to perform face detection on the input image of the bank to be detected, the accuracy of the face detection result can be improved.

[0122] Figure 4 This is a schematic diagram of the structure of the face detection device provided in the embodiments of this application, such as... Figure 4As shown, the face detection device 400 provided in this application embodiment includes an acquisition module 401, a determination module 402, a preprocessing module 403, a generation module 404, and a training module 405.

[0123] The system comprises the following modules: Acquisition module 401, used to acquire initial facial images of multiple users through preset acquisition methods; these methods include any one or more of bank counters, bank self-service terminals, and online banking; and the users are authorized users. Determination module 402, used to determine the image state of at least one dimension of the initial facial images of multiple users; the dimension includes one or more of blur, occlusion, illumination, and expression. Preprocessing module 403, in response to the initial facial image of the same user having at least one dimension of image state as a partial state among multiple preset image states for that dimension, preprocesses the initial facial image of the same user based on the remaining states among the multiple preset image states for that dimension to obtain a target facial image of the same user, wherein the image state of the target facial image is the remaining states among the multiple preset image states for that dimension. Generation module 404, used to generate a training set based on the initial facial images of multiple users and the target facial image of the corresponding user. Training module 405, used to train a preset facial detection model using the training set to obtain a trained preset facial detection model, which is then used to perform facial detection on bank input images.

[0124] Optionally, the determining module 402 is specifically used to: acquire image state calibration data, wherein the image state calibration data includes image state of at least one dimension of the initial facial images of multiple users; and determine image state of at least one dimension of the initial facial images of multiple users from the image state calibration data.

[0125] Optionally, the multiple preset image states of ambiguity include a clear state and a blurred state; the preprocessing module 403 is specifically used for: responding to the remaining state in the multiple preset image states of ambiguity being a clear state, performing sharpening processing on the initial facial image of the same user to obtain a target facial image of the same user in a clear state, wherein the sharpening processing includes one or more of sharpening processing, denoising processing, super-resolution reconstruction, and image enhancement; responding to the remaining state in the multiple preset image states of ambiguity being a blurred state, performing blurring processing on the initial facial image of the same user to obtain a target facial image of the same user in a blurred state, wherein the blurring processing includes one or more of Gaussian blur, motion blur, mean blur, and downsampling.

[0126] Optionally, the multiple preset image states of occlusion include one or more of the following: eyebrow and eye occlusion state, mouth and nose occlusion state, top-of-the-head occlusion state, and ear occlusion state, as well as an unoccluded state; the preprocessing module 403 is specifically used for: responding to the remaining states among the multiple preset image states of occlusion including eyebrow and eye occlusion state, determining the eyebrow and eye positions in the initial facial image of the same user, and adding a first occlusion at the eyebrow and eye positions to obtain a target facial image of the same user with eyebrow and eye occlusion; responding to the remaining states among the multiple preset image states of occlusion including mouth and nose occlusion state, determining the mouth and nose positions in the initial facial image of the same user, and adding a second occlusion at the mouth and nose positions to obtain a target facial image of the same user with mouth and nose occlusion; responding to the remaining states among the multiple preset image states of occlusion including top-of-the-head occlusion state, determining the same... The initial facial image of a user is used to determine the top of the head position. A third occlusion is added at the top of the head position to obtain a target facial image of the same user with the top of the head occluded. In response to the remaining states among various preset image states of occlusion degree, including the ear occlusion state, the ear position in the initial facial image of the same user is determined, and a fourth occlusion is added at the ear position to obtain a target facial image of the same user with the ear occlusion state. In response to the remaining states among various preset image states of occlusion degree, including the unoccluded state, the facial symmetry line, occluded area, and symmetrical area in the initial facial image of the same user are determined. The image content in the symmetrical area is used to cover the image content in the occluded area to obtain a target facial image of the same user with the unoccluded state. The symmetrical area is the unoccluded area in the initial facial image that is symmetrical to the occluded area about the facial symmetry line.

[0127] Optionally, the multiple preset image states of illumination include one or more of strong illumination state, weak illumination state, and normal illumination state; the preprocessing module 403 is specifically used to: in response to the remaining states of the multiple preset image states of illumination being any one or two of strong illumination state, weak illumination state, and normal illumination state, perform gamma correction on the initial facial image of the same user to obtain the target facial image of the same user under strong illumination state, weak illumination state, or normal illumination state.

[0128] Optionally, the multiple preset image states of expression include an expressive state and an expressionless state; the preprocessing module 403 is specifically used to: in response to the remaining state among the multiple preset image states of expression being an expressive state or an expressionless state, use a pre-stored expression conversion model to convert the facial expressions of the person in the initial facial image of the same user, so as to obtain the target facial image of the same user in an expressive state or an expressionless state.

[0129] Optionally, the generation module 404 is specifically used to: obtain the annotation data of the initial facial images of multiple users and the annotation data of the target facial images of the corresponding users; determine the initial facial images of multiple users, the target facial images of the corresponding users, the annotation data of the initial facial images of multiple users and the annotation data of the target facial images of the corresponding users as the content of the training set, and generate the training set.

[0130] Optionally, the training set includes facial images labeled with ground truth bounding boxes; the training module 405 is specifically used for: inputting the facial images into a preset facial detection model to obtain the predicted facial bounding boxes of the facial images; calculating the loss value based on the predicted facial bounding boxes and the ground truth bounding boxes; and adjusting the parameters of the preset facial detection model based on the loss value to obtain the trained preset facial detection model.

[0131] Optionally, the face detection device 400 also includes a detection module. The detection module is specifically used for: acquiring the input image of the bank to be detected; inputting the input image of the bank to be detected into a trained preset face detection model; performing face detection on the input image of the bank to be detected; and outputting the face detection result.

[0132] The face detection device 400 provided in this application embodiment can execute the technical solution shown in the above face detection method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0133] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 5 As shown, the electronic device 500 provided in this application embodiment includes: a processor 501 and a memory 502 communicatively connected to the processor 501; the memory 502 stores computer execution instructions; the processor 501 executes the computer execution instructions stored in the memory 502 to implement the face detection method of any of the above embodiments.

[0134] For example, when processor 501 executes computer execution instructions stored in memory 502, the following steps of the face detection method are implemented:

[0135] S10: Collect initial facial images of multiple users through preset collection methods; preset collection methods include any one or more of bank counters, bank self-service terminals, and online banking; users are those who have been authorized to collect images.

[0136] S20: Determine the image state of at least one dimension of the initial facial images of multiple users; the dimension includes one or more of blur, occlusion, illumination, and expression.

[0137] S30: In response to the fact that the image state of at least one dimension of the initial facial image of the same user is a partial state among a plurality of preset image states of the corresponding dimension, the initial facial image of the same user is preprocessed according to the remaining state among the plurality of preset image states of the corresponding dimension to obtain the target facial image of the same user, wherein the image state of the target facial image is the remaining state among the plurality of preset image states of the corresponding dimension.

[0138] S40: Generate a training set based on the initial facial images of multiple users and the target facial images of the corresponding users;

[0139] S50: The preset face detection model is trained using the training set to obtain the trained preset face detection model. The trained preset face detection model is used to perform face detection on bank input images.

[0140] exist Figure 5 In a corresponding embodiment, the program may include program code, which includes computer-executable instructions. Processor 501 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Memory 502 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0141] The memory 502 and processor 501 are connected via a bus. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0142] For example, electronic devices can be mobile phones, computers, digital broadcasting terminals, messaging devices, game consoles, tablets, medical devices, fitness equipment, personal digital assistants, etc.

[0143] The electronic device 500 provided in this application embodiment can execute the technical solution shown in the above-described face detection method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0144] This application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the face detection method of any of the above embodiments.

[0145] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the face detection method of any of the above embodiments.

[0146] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0147] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0148] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0149] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0150] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, an AI processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, storage units can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.

[0151] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0152] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

Claims

1. A facial detection method, characterized in that, include: Initial facial images of multiple users are collected through a preset acquisition method; The preset data collection methods include any one or more of bank counters, bank self-service terminals, and online banking; the user is a user who has been authorized to collect data. Determine the image state of at least one dimension of the initial facial images of the plurality of users; the dimension includes one or more of blur, occlusion, illumination, and expression. In response to an initial facial image of the same user having an image state in at least one dimension that is a partial state among multiple preset image states in the corresponding dimension, the initial facial image of the same user is preprocessed according to the remaining partial states among the multiple preset image states in the corresponding dimension to obtain a target facial image of the same user, wherein the image state of the target facial image is the remaining partial state among the multiple preset image states in the corresponding dimension; the remaining partial state is the other states among the preset image states besides the partial state. A training set is generated based on the initial facial images of the multiple users and the target facial images of the corresponding users; The training set is used to train the preset face detection model to obtain the trained preset face detection model, which is used to perform face detection on bank input images. The preprocessing of the initial facial image of the same user based on the remaining states among multiple preset image states of the corresponding dimension includes: When the dimension is the occlusion degree, in response to the remaining state among the various preset image states of the occlusion degree, including the unoccluded state, the facial symmetry line, occlusion region, and symmetrical region in the initial facial image of the same user are determined. The image content in the symmetrical region is used to cover the image content in the occlusion region to obtain the target facial image of the same user in the unoccluded state, wherein the symmetrical region is the unoccluded region in the initial facial image that is symmetrical to the occlusion region with respect to the facial symmetry line.

2. The method according to claim 1, characterized in that, Determining the image state of at least one dimension of the initial facial images of the plurality of users includes: Obtain image state calibration data, wherein the image state calibration data includes image state of at least one dimension of the initial facial images of the plurality of users; The image state of at least one dimension of the initial facial images of the plurality of users is determined from the image state calibration data.

3. The method according to claim 1, characterized in that, The various preset image states of the blur level include a clear state and a blurred state; The preprocessing of the initial facial image of the same user based on the remaining states among multiple preset image states of the corresponding dimension includes: In response to the remaining state among a variety of preset image states of the ambiguity, the clear state is defined. The initial facial image of the same user is then sharpened to obtain a target facial image of the same user in the clear state. The sharpening process includes one or more of the following: sharpening, denoising, super-resolution reconstruction, and image enhancement. The remaining state among a plurality of preset image states in response to the blurring is the blurred state. The initial facial image of the same user is blurred to obtain the target facial image of the same user in the blurred state. The blurring process includes one or more of Gaussian blur, motion blur, mean blur, and downsampling.

4. The method according to claim 1, characterized in that, The preset image states of the occlusion degree include one or more of the following states: eyebrow and eye occlusion state, mouth and nose occlusion state, top of head occlusion state, ear occlusion state, and no occlusion state. The step of preprocessing the initial facial image of the same user based on the remaining states among multiple preset image states of the corresponding dimension further includes: In response to the remaining states among a variety of preset image states of the occlusion degree, including the eyebrow and eye occlusion state, the eyebrow and eye positions in the initial facial image of the same user are determined, and a first occlusion is added at the eyebrow and eye positions to obtain a target facial image of the same user with eyebrow and eye occlusion state. In response to the remaining states among a variety of preset image states of the occlusion degree, including the mouth and nose occlusion state, the mouth and nose positions in the initial facial image of the same user are determined, and a second occlusion is added at the mouth and nose positions to obtain a target facial image of the same user with the mouth and nose occlusion state. In response to the remaining states among a variety of preset image states of the occlusion degree, including the top-of-head occlusion state, the top-of-head position in the initial facial image of the same user is determined, and a third occluder is added at the top-of-head position to obtain a target facial image of the same user with the top-of-head occlusion state. In response to the remaining states among a variety of preset image states of the occlusion degree, including the ear occlusion state, the ear position in the initial facial image of the same user is determined, and a fourth occlusion is added at the ear position to obtain a target facial image of the same user with the ear occlusion state.

5. The method according to claim 1, characterized in that, The preset image states of the illumination include one or more of strong illumination state, weak illumination state, and normal illumination state; The preprocessing of the initial facial image of the same user based on the remaining states among multiple preset image states of the corresponding dimension includes: In response to the remaining state among the various preset image states of the illumination being any one or two of the strong illumination state, weak illumination state, and normal illumination state, gamma correction is performed on the initial facial image of the same user to obtain the target facial image of the same user under the strong illumination state, weak illumination state, or normal illumination state.

6. The method according to claim 1, characterized in that, The preset image states for the expression level include an expressive state and an expressionless state; The preprocessing of the initial facial image of the same user based on the remaining states among multiple preset image states of the corresponding dimension includes: In response to the remaining state among the various preset image states of the expression level being either the expressive state or the expressionless state, a pre-stored expression conversion model is used to convert the facial expressions of the person in the initial facial image of the same user to obtain the target facial image of the same user in either the expressive state or the expressionless state.

7. The method according to claim 1, characterized in that, The step of generating a training set based on the initial facial images of the multiple users and the target facial images of the corresponding users includes: Obtain the annotation data of the initial facial images of the multiple users and the annotation data of the target facial images of the corresponding users; The training set is generated by determining the initial facial images of the multiple users, the target facial image of the corresponding user, the annotation data of the initial facial images of the multiple users, and the annotation data of the target facial image of the corresponding user as the content of the training set.

8. The method according to claim 1, characterized in that, The training set includes facial images with labeled ground truth bounding boxes. The step of training a preset face detection model using the training set to obtain a trained preset face detection model includes: The facial image is input into a preset facial detection model to obtain the facial prediction bounding box of the facial image; Calculate the loss value based on the predicted face bounding box and the ground truth face bounding box; The parameters of the preset face detection model are adjusted based on the loss value to obtain the trained preset face detection model.

9. The method according to any one of claims 1-8, characterized in that, After obtaining the trained preset face detection model, the method further includes: Obtain the input image of the bank to be inspected; The input image of the bank to be detected is input into the trained preset face detection model to perform face detection on the input image of the bank to be detected and output the face detection result.

10. A facial detection device, characterized in that, include: The acquisition module is used to acquire initial facial images of multiple users through a preset acquisition method; The preset data collection methods include any one or more of bank counters, bank self-service terminals, and online banking; the user is a user who has been authorized to collect data. A determining module is used to determine the image state of at least one dimension of the initial facial images of the plurality of users; the dimension includes one or more of blur, occlusion, illumination, and expression. A preprocessing module is configured to, in response to an initial facial image of the same user having an image state in at least one dimension that is a partial state among multiple preset image states in the corresponding dimension, preprocess the initial facial image of the same user based on the remaining partial states among the multiple preset image states in the corresponding dimension to obtain a target facial image of the same user, wherein the image state of the target facial image is the remaining partial state among the multiple preset image states in the corresponding dimension; the remaining partial state is the other states among the preset image states besides the partial state. The generation module is used to generate a training set based on the initial facial images of the multiple users and the target facial images of the corresponding users; The training module is used to train the preset face detection model using the training set to obtain the trained preset face detection model, which is used to perform face detection on bank input images. The preprocessing module is specifically used to determine the facial symmetry line, occlusion region, and symmetrical region in the initial facial image of the same user when the dimension is occlusion degree, in response to the remaining part of the various preset image states of the occlusion degree including the unoccluded state, and to cover the image content of the occlusion region with the image content of the symmetrical region to obtain the target facial image of the same user in the unoccluded state, wherein the symmetrical region is the unoccluded region in the initial facial image that is symmetrical to the occlusion region with respect to the facial symmetry line.

11. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the face detection method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the face detection method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the face detection method according to any one of claims 1-9.