Face image processing method, device, computer equipment and storage medium
By inputting features such as face positioning, expression recognition, appearance categories and image background categories into the classification model, the user credit rating is determined, the problem of waste of resources in facial image storage is solved, and the utilization rate and accuracy of facial images are improved.
Patent Information
- Application Number
- CN202110196801.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-02-22
AI Technical Summary
In the existing facial recognition technology, the collected face images are usually stored in the form of large number of small images files, with low reuse rate, resulting in waste of resources.
Through face positioning, expression recognition, physical appearance category determination, image background category determination and color feature extraction, input it to the trained classification model to determine the user's credit rating and improve the utilization rate of face images.
It realizes efficient use of facial images, avoids waste of resources, and has high accuracy in user credit ratings, and can identify high-risk users.
Smart Images

Figure CN112818899B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a facial image processing method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of image processing technology, face recognition technology has emerged. Face recognition technology is a technology that uses computer technology for analysis and comparison to identify faces, and to confirm or search for identities through faces.
[0003] During face recognition, the input face image or video stream is processed in the following order based on the facial features of the person: first, it is determined whether a face exists; if a face exists, the position, size and location information of each face and each major facial organ are further given; then, based on this information, the identity features contained in each face are further extracted and compared with known faces to identify the identity of each face.
[0004] However, the facial images currently collected are usually stored in the form of massive small image files, passively waiting for face matching for identity verification, with a very low reuse rate, resulting in a waste of data. Summary of the invention
[0005] Based on this, it is necessary to provide a face image processing method, device, computer equipment and storage medium that can improve the reuse rate of face images in response to the above technical problems.
[0006] A method for processing a face image, the method comprising:
[0007] Get user image;
[0008] Performing face positioning on the user image and identifying the user's facial expression;
[0009] Performing visual detection on the user image to determine the user's body type;
[0010] Performing image recognition on the user image to determine the image background category;
[0011] Acquire image color features from the user image;
[0012] The user's facial expression, the user's body appearance category, the image background category and the image color feature are input into a trained classification model to determine the user's credit rating.
[0013] In one embodiment, the step of locating the face of the user image and identifying the user's facial expression includes:
[0014] Positioning key feature points on the user image to determine the positions of the facial feature points on the user's face;
[0015] Determining the user's facial geometric features based on the positions of the facial feature points on the user's face;
[0016] According to the correspondence between the facial geometric features and the facial expressions, the facial expressions of the user corresponding to the facial geometric features of the user are determined.
[0017] In one embodiment, the locating key feature points on the user image to determine the positions of the facial feature points on the user's face includes:
[0018] Performing face detection on the user image to determine key feature points in the user image;
[0019] Using the key feature points, obtaining a processed image aligned with a standard face image from the user image;
[0020] The distribution positions of the key feature points in the processed image are used as the positions of the facial feature points on the user's face.
[0021] In one embodiment, the visual detection of the user image to determine the user's body type includes:
[0022] extracting pixel data from the user image;
[0023] Inputting the pixel data into various convolution kernels respectively to obtain corresponding body features;
[0024] The physical features are input into the corresponding classification model to obtain the user's physical appearance category.
[0025] In one embodiment, performing image recognition on the user image to determine the image background category includes:
[0026] Clustering pixels in the user image to divide the user image into a foreground image and a background image;
[0027] Removing the foreground image from the user image, and filling the removed portion of the user image according to the background image to obtain a filled image;
[0028] The category to which the filling image belongs is determined as the image background category.
[0029] In one embodiment, inputting the user's facial expression, the user's body type, the image background type, and the image color feature into a trained classification model to determine the user's credit rating includes:
[0030] Obtain a trained GBDT model; the GBDT model includes at least one binary tree, each of the binary trees includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to judging a corresponding category among the user's facial expression, the user's physical appearance category, the image background category, and the image color feature, and two child nodes connected to the same parent node correspond to a corresponding category among the user's facial expression, the user's physical appearance category, the image background category, and the image color feature; each child node has a different credit score;
[0031] Visit each of the binary trees, and when visiting each of the parent nodes, select one of the two child nodes connected to the parent node for visiting according to one of the user's facial expression, the user's body type, the image background type, and the image color feature;
[0032] Add up the credit points of all the visited child nodes to get the user credit point;
[0033] The user credit score is input into a logistic regression model to obtain the user credit level.
[0034] In one embodiment, the method further comprises:
[0035] If the image background categories of the multiple user images are the same, obtaining the upload time of the multiple user images;
[0036] If the time difference between the upload times of the plurality of user images is less than the set time, it is determined that the users corresponding to the plurality of user images belong to a high-risk group.
[0037] A facial image processing device, the device comprising:
[0038] An image acquisition module, used to acquire user images;
[0039] An expression recognition module, used to locate the face of the user image and recognize the user's facial expression;
[0040] A body appearance determination module, used to perform visual detection on the user image to determine the user's body appearance category;
[0041] A background determination module, used to perform image recognition on the user image and determine the image background category;
[0042] A feature acquisition module, used to acquire image color features from the user image;
[0043] The credit determination module is used to input the user's facial expression, the user's body appearance category, the image background category and the image color feature into a trained classification model to determine the user's credit level.
[0044] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0045] Get user image;
[0046] Performing face positioning on the user image and identifying the user's facial expression;
[0047] Performing visual detection on the user image to determine the user's body type;
[0048] Performing image recognition on the user image to determine the image background category;
[0049] Acquire image color features from the user image;
[0050] The user's facial expression, the user's body appearance category, the image background category and the image color feature are input into a trained classification model to determine the user's credit rating.
[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0052] Get user image;
[0053] Performing face positioning on the user image and identifying the user's facial expression;
[0054] Performing visual detection on the user image to determine the user's body type;
[0055] Performing image recognition on the user image to determine the image background category;
[0056] Acquire image color features from the user image;
[0057] The user's facial expression, the user's body appearance category, the image background category and the image color feature are input into a trained classification model to determine the user's credit rating.
[0058] The above-mentioned facial image processing method, device, computer equipment and storage medium, after acquiring the user image, respectively obtain the user's facial expression, user's body category, image background category and image color features based on the user image, and input the user's facial expression, user's body category, image background category and image color features obtained from the user image into the trained classification model, which can make full use of the facial image to determine the user's credit rating, improve the utilization rate of the facial image, and avoid resource waste. Moreover, the user's credit rating is obtained by combining the features of the user's facial expression, user's body category, image background category and image color features, and has a high accuracy rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A diagram of an application environment of a face image processing method in an embodiment;
[0060] Figure 2 FIG. 1 is another application environment diagram of a face image processing method in one embodiment;
[0061] Figure 3 1 is a flow chart of a method for processing a face image in one embodiment;
[0062] Figure 4 is a structural block diagram of a face image processing device in one embodiment;
[0063] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] The face image processing method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 takes a user image and sends it to the server 104. After acquiring the user image, the server 104 processes the user image from four aspects: first, performing face detection on the user image to identify the user's facial expression; second, performing visual detection on the user image to determine the user's body category; third, performing image recognition on the user image to determine the image background category; fourth, obtaining the image color features from the user image. Then the user's facial expression, user's body category, image background category and image color features are input into the trained classification model together to determine the user's credit rating. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster consisting of multiple servers.
[0066] The face image processing method provided in this application can be applied to Figure 2 In the application environment shown. Among them, the storage device 202 communicates with the server 204 through the network. The storage device 202 stores the user image, and the server 204 obtains the user image from the storage device 202. After obtaining the user image, the server 104 processes the user image from four aspects: first, performing face detection on the user image to identify the user's facial expression; second, performing visual detection on the user image to determine the user's body type; third, performing image recognition on the user image to determine the image background type; fourth, obtaining the image color feature from the user image. Then the user's facial expression, user's body type, image background type and image color feature are input into the trained classification model together to determine the user's credit rating. Among them, the storage device 202 can be implemented by an independent storage device or a cluster storage system composed of multiple storage devices, and the server 204 can be implemented by an independent server or a server cluster composed of multiple servers.
[0067] In one embodiment, Figure 3 As shown, a face image processing method is provided, and the method is applied to Figure 1 or Figure 2 The server in the example is used to illustrate the following steps:
[0068] Step S302, obtaining a user image.
[0069] The user image is an image containing the user's face, such as an image taken during identity authentication.
[0070] For example, the user image may be an image of the user's body above the shoulders, an image of the upper half of the user's body, or a full-body image of the user.
[0071] Specifically, the user is usually the service requester and can make a service request to the server through the terminal, such as loan, mortgage, etc. At this time, the terminal needs to take the user's image and upload it to the server. The server obtains the user's image and can authenticate the user based on the user image, or evaluate the user's credit rating based on the user image.
[0072] In actual applications, the terminal can first capture the user image and then send the user image and the server request to the server; or the terminal can first send a service request to the server, and the server requests the user image from the terminal based on the service request. At this time, the terminal then captures the user image and sends it to the server.
[0073] In addition, the user may also directly make a service request to the server, in which case the server will capture the user's image and obtain the user's image.
[0074] Specifically, when the server or terminal captures the user's image, on the one hand, the image is captured by the camera, and on the other hand, the image currently captured by the camera can be displayed to the user through the display screen to instruct the user to adjust his or her position and posture relative to the camera in time to ensure that the camera can capture a complete facial image.
[0075] Furthermore, the server or terminal can also synchronously display the facial outline to the user through the display screen, such as synchronously displaying the facial outline in the middle area between the left and right sides of the displayed image. The user can adjust his or her position and posture relative to the camera according to the relative position relationship between the synchronously displayed self-image and the facial outline, so that the facial image taken by the camera is located in the specified area, which is conducive to accurate positioning on the user image.
[0076] In this embodiment, the server obtains the user image and can obtain the user's facial expression, user's body appearance category, image background category and image color features based on the user image, and inputs the user's facial expression, user's body appearance category, image background category and image color features obtained from the user image into a trained classification model, and uses the facial image to determine the user's credit level, thereby improving the utilization rate of the facial image and avoiding waste of resources.
[0077] Step S304: locate the face of the user image and recognize the user's facial expression.
[0078] Among them, face location is to determine the position of the face. On the basis of face detection, the position of facial feature points (such as eyes, eyebrows, nose, mouth, facial contour, etc.) can be further determined. Face detection refers to the use of a certain strategy to search for any given image to determine whether it contains a face, and if so, the position and size of each face are returned.
[0079] Facial expression refers to the expression of various emotional states through changes in eye muscles, facial muscles and mouth muscles, such as excitement, love, surprise, pain, fear, shyness, disgust, anger, etc. By locating the face of the user image, the position of the facial feature points can be obtained, and then based on the position of the facial feature points, the user's facial expression can be recognized.
[0080] Specifically, the user image is face positioned to obtain the position of facial feature points; the user's facial features are determined based on the position of facial feature points; based on the change of the user's facial features relative to the standard facial features, the corresponding emotional state is determined and used as the user's facial expression. The standard facial features are the facial features when there is no facial expression.
[0081] In this embodiment, the server locates the face of the user image and recognizes the user's facial expression, and can determine the user's credit rating based on the user's facial expression. The user's facial expression can reflect the user's emotional state and mental state, especially micro-expressions. Micro-expressions are spontaneous expressions produced when a person tries to cover up his inner emotions. They can neither be forged nor suppressed, and the user's true intention can be identified through micro-expressions. Therefore, determining the user's credit rating based on the user's facial expression can effectively identify high-risk users and improve the accuracy of user credit rating assessment.
[0082] Step S306: perform visual detection on the user image to determine the user's body type.
[0083] Among them, visual inspection is to use machines instead of human eyes to make measurements and judgments. During visual inspection, the captured target is first converted into an image signal; then the pixel distribution and brightness, color and other information are converted into digital signals; various operations are performed on these digital signals to extract the characteristics of the target for discrimination and obtain the discrimination results, such as the user's body type.
[0084] Physical appearance category refers to the category of physical appearance, such as whether the hair is dyed, whether there is a tattoo, whether the person is shirtless, etc.
[0085] Specifically, visual detection is performed on the user image to obtain the user's physical features, and the user's physical features are compared with standard physical features to determine the user's physical category. The standard physical features are physical features of a certain category, such as physical features of dyed hair, physical features of tattoos, and physical features of bare chests.
[0086] In this embodiment, the server performs visual detection on the user image to determine the user's physical appearance category, and can determine the user's credit rating based on the user's physical appearance category. The user's physical appearance category can reflect the user's living environment and personality characteristics, understand the user's credit maintenance ability, and provide reference information for the user's credit rating assessment. Therefore, determining the user's credit rating based on the user's physical appearance category can improve the accuracy of the user's credit rating assessment.
[0087] Step S308: perform image recognition on the user image to determine the image background category.
[0088] Image recognition refers to the technology of using computers to process images to identify targets and objects of various different modes. The image background category refers to the category to which the background part of the image belongs, such as an indoor space with a certain layout, a certain style of car, etc. By performing image recognition on user images, the background image can be extracted from the user images, and then the image background category can be determined.
[0089] Specifically, the user image is preprocessed first to obtain the image to be processed; then feature extraction is performed on the image to be processed to obtain image background features; finally, the image background category is determined according to the image background features.
[0090] In this embodiment, image recognition is performed on the user image to determine the image background category, and the user credit rating can be determined based on the image background category. Usually, each member of a fraud gang will use the same or similar background, that is, the image background category is the same, and the image background category can be used to identify such high-risk users. Therefore, determining the user credit rating based on the image background category is conducive to identifying high-risk users and improving the accuracy of user credit rating assessment.
[0091] Step S310, obtaining image color features from the user image.
[0092] Among them, the image color features may include whether the background color is single, whether the character image is bright, etc.
[0093] Specifically, the color value of each pixel in the user image is first obtained, and then the color values of each pixel in the user image are compared to determine the image color feature.
[0094] In this embodiment, by acquiring image color features from the user image, the overall characteristics of the user image can be understood, providing reference information for determining the user's credit level.
[0095] Step S312, inputting the user's facial expression, user's body type, image background type and image color features into the trained classification model to determine the user's credit rating.
[0096] The classification model is a model for classifying user credit ratings. The user's facial expression, user's body type, image background type, and image color features are input into the trained classification model, and the classification model can comprehensively consider the user's facial expression, user's body type, image background type, and image color features to classify and output the user's credit rating.
[0097] In this embodiment, the trained classification model is used to determine the corresponding user credit level according to the user's facial expression, user's body type, image background type and image color features, which is simple and convenient to implement.
[0098] The above-mentioned facial image processing method, after acquiring the user image, obtains the user's facial expression, user's body category, image background category and image color features based on the user image, and inputs the user's facial expression, user's body category, image background category and image color features obtained from the user image into the trained classification model, which can make full use of the facial image to determine the user's credit rating, improve the utilization rate of the facial image, and avoid resource waste. Moreover, the user's credit rating is obtained by combining the features of the user's facial expression, user's body category, image background category and image color features, and has a high accuracy rate.
[0099] In one embodiment, after acquiring the user image, the method further includes: processing the user image.
[0100] Exemplarily, the preprocessing includes but is not limited to at least one of image size unification, image enhancement, face straightening and normalization processing.
[0101] In this embodiment, the user image is adjusted to a uniform size, which is conducive to the subsequent processing using the same model and reducing the implementation cost. Image enhancement of the user image can enhance the useful information in the image, improve the visual effect of the image, purposefully emphasize the overall or local characteristics of the image, make the originally unclear image clear or emphasize certain interesting features, expand the difference between the features of different objects in the image, suppress uninteresting features, and facilitate the subsequent feature extraction. Straightening the face in the user image is conducive to the location of feature points in the user image. Normalization processing can facilitate data processing and increase the speed of data processing.
[0102] In one embodiment, face detection is performed on a user image to identify the user's facial expression, including: locating key feature points on the user image to determine the positions of the facial feature points on the user's face; determining the user's facial geometric features based on the positions of the facial feature points on the user's face; and determining the user's facial expression corresponding to the user's facial geometric features based on the correspondence between the facial geometric features and facial expressions.
[0103] Among them, feature points refer to points where the grayscale value of the image changes dramatically or points with large curvature on the edge of the image. Key feature points are feature points for locating facial images. Based on key feature points, the distribution area of the face can be located. Key feature points are mainly facial feature points. Facial feature points are feature points that form the contours of facial features in facial images. Based on facial feature points, the shapes of facial features and their relative positions can be determined.
[0104] Facial geometric features mainly refer to the shape and distribution area of facial features. For example, facial geometric features include but are not limited to the distance between two organs, the proportion of a single organ, the length of a single organ on a certain contour line, the angle between two contour lines of a single organ, the curvature of a contour line of a single organ, and whether the same organ is symmetrical. For example, whether the two eyes are symmetrical, the distance between the two eyes, the curvature of the eye corners, the arc of the mouth corners, the distance between the upper and lower lips, etc.
[0105] Specifically, a face positioning algorithm can be used to process the user image to find each key feature point on the user image. Based on the organs to which each key feature point belongs and the position where it is located, the position of the facial feature points on the user's face is obtained. According to the position of the facial feature points on the user's face, the distribution characteristics of each facial feature point are determined to obtain the user's facial geometric features. According to the correspondence between facial geometric features and facial expressions, the user's facial expressions corresponding to the user's facial geometric features can be obtained.
[0106] In this embodiment, by locating key feature points on the user image, the positions of the facial feature points on the user's face can be determined. Then, based on the positions of the facial feature points on the user's face, the user's facial geometric features can be determined. Finally, based on the correspondence between the facial geometric features and facial expressions, the user's facial expressions corresponding to the user's facial geometric features can be determined.
[0107] In one embodiment, key feature points are located on a user image to determine the positions of facial feature points on the user's face, including: performing face detection on the user image to determine key feature points in the user image; using the key feature points to obtain a processed image from the user image that is aligned with a standard face image; and using the distribution positions of the key feature points in the processed image as the positions of the facial feature points on the user's face.
[0108] The standard face image is a pre-stored face image marked with key feature points.
[0109] Specifically, the user image is processed using a face detection algorithm to obtain key feature points in the user image. The positional relationship of some key feature points in the user image is compared with the positional relationship of corresponding key feature points in the standard face image, and the user image is scaled, flipped, or intercepted to obtain a processed image, so that the positional relationship of these key feature points in the processed image is consistent with the positional relationship of the corresponding key feature points in the standard face image. The distribution position of each key feature point in the processed image is determined as the position of the facial feature points on the user's face.
[0110] For example, face detection is performed on the user image to determine the eye feature points, nose feature points, mouth feature points, ear feature points and facial contour feature points in the user image. The distance between the left and right eye feature points in the user image is compared with the distance between the left and right eye feature points in the standard facial image, and the user image is scaled so that the distance between the left and right eye feature points in the processed image is the same as the distance between the left and right eye feature points in the standard facial image. Depending on whether the line connecting the left and right eye feature points in the user image is parallel or perpendicular to the edge of the image, the user image is flipped and intercepted so that the line connecting the left and right eye feature points in the processed image is parallel or perpendicular to the edge of the image. Finally, the eye feature points, nose feature points, mouth feature points, ear feature points and facial contour feature points in the processed image are used as the positions of the facial feature points on the user's face.
[0111] Exemplarily, face detection can use a trained CNN (Convolutional Neural Networks) model to accurately extract key feature points in user images with different conditions such as lighting, posture, and facial expression.
[0112] In this embodiment, face detection is performed on the user image to obtain key feature points in the user image. Then, based on the distribution difference of key feature points in the user image and the standard face image, the user image and the standard face image can be aligned to obtain a processed image. Finally, the distribution position of the key feature points in the processed image can be used as the position of the facial feature points on the user's face.
[0113] In one embodiment, based on the positions of facial feature points on the user's face, determining the user's facial geometric features includes: sequentially connecting the facial feature points of the same organ; obtaining the distribution area of each organ on the user's face based on the positions of the facial feature points of the same organ on the user's face; obtaining the outline of each organ based on the distribution area of each organ on the user's face; based on the outline of each organ, determining the shape, length, angle, curvature, symmetry of each organ, as well as the spacing, proportion, and relative position of each organ to obtain the user's facial geometric features.
[0114] Exemplarily, facial geometric features include but are not limited to at least one of the following: the aspect ratio of each area of the face, the distance between facial features, the proportion of facial features, the symmetry of facial features, the arc length of the chin contour, the tangent angle of the chin contour, the curvature of the chin contour, the pupil distance, the pupil offset angle, the arc length of the upper and lower eye contours, the arc length of the upper and lower eye contours, the curvature of the upper and lower eye contours, the symmetry of the left and right eyes, the distance between the inner and outer eyebrow corners, the angle of the inner and outer eyebrow corners, the arc length of the upper and lower eyebrow contours, the curvature of the upper and lower eyebrow contours, the symmetry of the left and right eyebrows, the angle of the corners of the mouth, the thickness of the lips, the arc length of the upper and lower lip contours, the tangent angle of the upper and lower lip contours, the curvature of the upper and lower lip contours, the upper and lower symmetry of the lips, the size of the nose, the arc length of the left and right nose wing contours, the tangent angle of the left and right nose wing contours, the left and right symmetry of the nose wing, the arc length of the nose base contour, the tangent angle of the nose base contour, and the curvature of the nose base contour.
[0115] In one embodiment, based on the correspondence between facial geometric features and facial expressions, determining the user facial expressions corresponding to the user facial geometric features includes: obtaining the correspondence between the facial geometric features and facial expressions; searching for the user facial geometric features in the obtained correspondence to obtain the user facial expressions corresponding to the user facial geometric features.
[0116] For example, if the curvature of the outer corners of both eyes is greater than the curvature threshold, it means that both eyes are wide open, and the user should be in an excited state, that is, the user's facial expression is excited. For another example, if the curvature of the mouth corners is greater than the curvature threshold, or the distance between the upper and lower lips is greater than the distance threshold, it means that the mouth is wide open, and the user should be in a happy state, that is, the user's facial expression is happy. For another example, if the angle of the pupil in the eye socket is greater than the angle threshold, it means that the user is not looking straight ahead, and the user should be in a nervous state, that is, the user's facial expression is nervous.
[0117] In one embodiment, visual detection is performed on the user image to determine the user's body appearance category, including: extracting pixel data from the user image; inputting the pixel data into various convolution kernels to obtain corresponding body appearance features; inputting the body appearance features into a corresponding classification model to obtain the user's body appearance category.
[0118] In image processing, given an input image, the pixels in a small area of the input image are weighted averaged to become each corresponding pixel in the output image, where the weight is defined by a function called a convolution kernel. The convolution kernel is equivalent to a filter, which can extract features from images in dimensions such as edges, shapes, and colors to help machines recognize image characteristics.
[0119] Exemplarily, physical features may include but are not limited to at least one of the following: shooting angle, clothing, makeup, overall facial features, eyes, glasses, and mouth and mask. Shooting angles include head-up angle, head-shaking angle, plane rotation angle, etc. Clothing, makeup, and hair include bare chest, hat, headphones, work badge, necklace, tie, tattoo, bald head, dyed hair, etc. Overall facial features include age, gender, appearance, facial emotions, biometric information comparison, etc. Eyes and glasses include open and closed eyes, glasses, sunglasses, whether covered, etc. Mouth and mask include open and closed mouth, mask, mask, whether covered, etc.
[0120] Specifically, the values of each pixel in the user image can be formed into pixel data. The pixel data are respectively input into different convolution kernels to obtain different body features. Then the category of the body features is determined to obtain the user's body category.
[0121] For example, by inputting pixel data into a convolution kernel that obtains the open and closed eye feature, a feature value of the user's open and closed eyes can be obtained. Based on this feature value, it can be determined whether the user has open or closed eyes. For another example, by inputting pixel data into a convolution kernel that obtains the open and closed mouth feature, a feature value of the user's open and closed mouth can be obtained. Based on this feature value, it can be determined whether the user has opened or closed his mouth. For another example, by inputting pixel data into a convolution kernel that obtains the age feature, a feature value of the user's age can be obtained. Based on this feature value, the user's age range can be determined.
[0122] Exemplarily, the classification model can integrate CNN and Sigmoid algorithms.
[0123] In this embodiment, pixel data is extracted from the user image to facilitate feature extraction by the convolution kernel. Different body features can be obtained by inputting the pixel data into different convolution kernels respectively. The body features are input into the corresponding classification model to obtain the user's body class.
[0124] In addition, visual detection can also determine image features, which can also be input into a trained classification model to determine the user's credit rating.
[0125] The image features include image parameters and / or image background. Image parameters include clarity, contrast, color saturation, color gamut mean, color gamut standard deviation, etc. Image background includes the interior space of the vehicle, the position of the upper and lower berths, the number of faces, etc.
[0126] In one embodiment, image recognition is performed on a user image to determine the image background category, including: clustering pixels in the user image to divide the user image into a foreground image and a background image; removing the foreground image from the user image and filling the removed portion of the user image according to the background image to obtain a filled image; and determining the category to which the filled image belongs as the image background category.
[0127] Clustering is the process of dividing a collection of physical or abstract objects into multiple classes consisting of similar objects. The clusters generated by clustering are a set of data objects that are similar to objects in the same cluster and different from objects in other clusters.
[0128] Specifically, a clustering algorithm is used to cluster each pixel in the user image, and each pixel in the foreground image is clustered into one set, and each pixel in the background image is clustered into another set. According to the boundary line of the two sets, the user image can be divided into a foreground image and a background image. Then the foreground image is removed from the user image, and the area where the foreground image is located in the user image becomes a blank area. At this time, the image of the blank area is predicted based on the background image to fill in, restore the background blocked by the user, and realize the background restoration of the user image shooting area.
[0129] For example, a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm may be used to cluster pixels in the user image.
[0130] DBSCAN assumes that the category can be determined by the density of sample distribution. Samples of the same category are closely connected, that is, there must be samples of the same category not far away from any sample of the category. By classifying closely connected samples into one category, a cluster category is obtained. By classifying all groups of closely connected samples into different categories, the final cluster category result can be obtained. It can be applied to both convex sample sets and non-convex sample sets, and has a fast implementation speed. It can dynamically divide user images into foreground images and background images in real time, and can find clusters of arbitrary shapes in noisy spatial pixel data sets, which is convenient for effectively dividing foreground images and background images.
[0131] Exemplarily, a system consisting of a cascade of a Deeplabv3 model, a Resnet50 model, and an Inpainting model may be used to convert a user image into a filled image.
[0132] The Deeplabv3 model can perform semantic segmentation, simply classify each pixel in the image, and divide the image into different blocks according to the content, so as to remove the foreground image from the user's image. The Resnet50 model directly skips multiple layers and introduces the data output of a layer in the first several layers into the input part of the later data layer, so that part of the content of the later feature layer will be linearly contributed by a layer in front of it, which can overcome the problem of lower learning efficiency and ineffective improvement of accuracy caused by the deepening of the network depth. The Inpainting model can repair and reconstruct damaged images or remove redundant objects in the image, and can fill the removed part of the user's image according to the background image.
[0133] In this embodiment, the pixels in the user image are clustered, and the pixels in the foreground image can be clustered into one category, and the pixels in the background image can be clustered into another category, so that the user image is divided into a foreground image and a background image. After the user image is divided into the foreground image and the background image, the foreground image can be removed from the user image, and the area where the foreground image is located in the user image is blank. At this time, the removed part of the user image is filled according to the background image, and the obtained filled image is a complete background image. Based on the filled image, the image background category can be determined.
[0134] In one embodiment, obtaining image color features from a user image includes: obtaining color values of each pixel from the user image; determining the fluctuation amplitude and brightness of the color values in the user image according to the color values of each pixel, and obtaining image color features.
[0135] The fluctuation amplitude is the maximum difference between the color values of each pixel in the user image, and the brightness is the distribution range of the color values of each pixel in the user image.
[0136] In this embodiment, the fluctuation range of the color value in the user image can indicate whether the background image is monotonous, and the brightness of the color value in the user image can indicate whether the user image is brightly colored. These information can provide references for determining the user's credit rating.
[0137] In one embodiment, user facial expressions, user body appearance categories, image background categories, and image color features are input into a trained classification model to determine the user credit rating, including: obtaining a trained GBDT (GradientBoosting Decision Tree) model; visiting each binary tree, and when visiting each parent node, selecting one of the two child nodes connected to the parent node for visiting according to one of the user facial expressions, user body appearance categories, image background categories, and image color features; adding the credit scores of all visited child nodes to obtain the user credit score; and inputting the user credit score into a logistic regression model to obtain the user credit rating.
[0138] Among them, the GBDT model includes at least one binary tree, each binary tree includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to judging a corresponding category among user facial expressions, user body appearance categories, image background categories and image color features, and the two child nodes connected to the same parent node correspond to a corresponding category among user facial expressions, user body appearance categories, image background categories and image color features; each child node has a different credit score.
[0139] Among them, the GBDT model is an iterative decision tree algorithm, which consists of multiple decision trees, and the prediction results of all decision trees are accumulated as the final answer.
[0140] Logistic regression is a machine learning model used to solve binary classification problems, which is used to estimate the probability of something. For example, whether a user's credit risk level is risky or risk-free, or high risk or low risk.
[0141] Specifically, the user's facial expression, user's body type, image background type and image color features are sequentially input into the GBDT model, and each decision tree in the GBDT model is traversed. Each time a branch node in the decision tree is accessed, the child node corresponding to the branch node is selected based on the input for access. Finally, the values of all the nodes visited are added up to obtain the final result and output it. The output result is then input into the logistic regression model to obtain the user's credit risk level.
[0142] In this embodiment, the trained GBDT model is obtained, and each binary tree can be visited. When visiting each parent node, one of the two child nodes connected to the parent node is selected for visit according to one of the user's facial expression, the user's physical appearance category, the image background category, and the image color feature. Then, the credit scores of all the visited child nodes are added together to obtain the user's credit score. Finally, the user's credit score is input into the logistic regression model to obtain the user's credit rating.
[0143] In one embodiment, the method further includes: if the image background categories of multiple user images are the same, obtaining the upload time of the multiple user images; if the difference in the upload time of the multiple user images is less than the set time, determining that the users corresponding to the multiple user images belong to a high-risk group.
[0144] In this embodiment, if the image background categories of multiple user images are the same, the upload time of these user images is obtained, and it is determined whether the upload time of these user images is close. If the upload time of these user images is close, it means that the users corresponding to these user images may belong to the same fraud gang, which is a high-risk gang. Therefore, if the difference in the upload time of multiple user images is less than the set time, it is determined that the users corresponding to the multiple user images belong to a high-risk gang. By identifying the fraud gang, the accuracy of determining the user's credit rating can be further improved.
[0145] It should be understood that although Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0146] In one embodiment, Figure 4 As shown, a facial image processing device is provided, comprising: an image acquisition module 401, an expression recognition module 402, a body appearance determination module 403, a background determination module 404, a feature acquisition module 405 and a credit determination module 406, wherein:
[0147] The image acquisition module 401 is used to acquire a user image.
[0148] The expression recognition module 402 is used to locate the face of the user image and recognize the user's facial expression.
[0149] The body appearance determination module 403 is used to perform visual detection on the user image to determine the user's body appearance category.
[0150] The background determination module 404 is used to perform image recognition on the user image and determine the image background category.
[0151] The feature acquisition module 405 is used to acquire image color features from the user image.
[0152] The credit determination module 406 is used to input the user's facial expression, the user's body type, the image background type and the image color features into the trained classification model to determine the user's credit level.
[0153] In one embodiment, the expression recognition module 402 includes: a position determination unit, a geometric feature determination unit, and an expression determination unit. The position determination unit is used to locate key feature points on the user image and determine the positions of the facial feature points on the user's face. The geometric feature determination unit is used to determine the user's facial geometric features based on the positions of the facial feature points on the user's face. The expression determination unit is used to determine the user's facial expression corresponding to the user's facial geometric features based on the correspondence between the facial geometric features and the facial expressions.
[0154] In one embodiment, the position determination unit is used to perform face detection on a user image and determine key feature points in the user image; using the key feature points, obtain a processed image aligned with a standard face image from the user image; and use the distribution positions of the key feature points in the processed image as the positions of the facial feature points on the user's face.
[0155] In one embodiment, the body shape determination module includes: a data extraction unit, a body shape feature determination unit and a body shape category determination unit. The data extraction unit is used to extract pixel data from the user image. The body shape feature determination unit is used to input the pixel data into various convolution kernels to obtain corresponding body shape features. The body shape category determination unit is used to input the body shape features into the corresponding classification model to obtain the user's body shape category.
[0156] In one embodiment, the background determination module includes: an image division unit, an image determination unit, and a background category determination unit. The image division unit is used to cluster pixels in the user image and divide the user image into a foreground image and a background image. The image determination unit is used to remove the foreground image from the user image and fill the removed part of the user image according to the background image to obtain a filled image. The background category determination unit is used to determine the category to which the filled image belongs as the image background category.
[0157] In one embodiment, the credit determination module is used to obtain a trained GBDT model; the GBDT model includes at least one binary tree; each binary tree is visited, and when visiting each parent node, one of the two child nodes connected to the parent node is selected for visit based on one of the user's facial expression, the user's body shape category, the image background category, and the image color feature; the credit scores of all the visited child nodes are added together to obtain the user's credit score; the user's credit score is input into a logistic regression model to obtain the user's credit level.
[0158] Each binary tree includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to judging a corresponding category among user facial expressions, user body appearance categories, image background categories and image color features, and the two child nodes connected to the same parent node correspond to a corresponding category among user facial expressions, user body appearance categories, image background categories and image color features respectively; each child node has a different credit score.
[0159] In one embodiment, the device further includes a time acquisition module and a gang determination module. The time acquisition module is used to acquire the upload time of the multiple user images when the image background categories of the multiple user images are the same. The gang determination module is used to determine that the users corresponding to the multiple user images belong to a high-risk gang when the difference in the upload time of the multiple user images is less than a set time.
[0160] After acquiring the user image, the above-mentioned face image processing device obtains the user's facial expression, user's body type, image background type and image color features based on the user image, and inputs the user's facial expression, user's body type, image background type and image color features obtained from the user image into the trained classification model, which can make full use of the face image to determine the user's credit rating, improve the utilization rate of the face image, and avoid resource waste. Moreover, the user's credit rating is obtained by combining the features of the user's facial expression, user's body type, image background type and image color features, and has a high accuracy rate.
[0161] For the specific definition of the face image processing device, please refer to the definition of the face image processing method above, which will not be repeated here. Each module in the above-mentioned face image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0162] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store user images. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing facial images is implemented.
[0163] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: acquiring a user image; performing face location on the user image and identifying the user's facial expression; performing visual detection on the user image and determining the user's body appearance category; performing image recognition on the user image and determining the image background category; acquiring image color features from the user image; and inputting the user's facial expression, the user's body appearance category, the image background category, and the image color features into a trained classification model to determine the user's credit rating.
[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented: locating key feature points on the user image to determine the positions of the facial feature points on the user's face; determining the user's facial geometric features based on the positions of the facial feature points on the user's face; and determining the user's facial expressions corresponding to the user's facial geometric features based on the correspondence between the facial geometric features and facial expressions.
[0166] In one embodiment, when the processor executes the computer program, the following steps are also implemented: performing face detection on the user image to determine the key feature points in the user image; using the key feature points to obtain a processed image aligned with the standard face image from the user image; and using the distribution positions of the key feature points in the processed image as the positions of the facial feature points on the user's face.
[0167] In one embodiment, when the processor executes the computer program, it also implements the following steps: extracting pixel data from the user image; inputting the pixel data into various convolution kernels respectively to obtain corresponding physical features; inputting the physical features into the corresponding classification model to obtain the user's physical features category.
[0168] In one embodiment, when the processor executes the computer program, the following steps are also implemented: clustering pixels in the user image to divide the user image into a foreground image and a background image; removing the foreground image from the user image, and filling the removed portion of the user image according to the background image to obtain a filled image; determining the category to which the filled image belongs as the image background category.
[0169] In one embodiment, the processor further implements the following steps when executing the computer program: obtaining a trained GBDT model; the GBDT model includes at least one binary tree, each binary tree includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to a category corresponding to the user's facial expression, user's body appearance category, image background category, and image color feature, and two child nodes connected to the same parent node correspond to a category corresponding to the user's facial expression, user's body appearance category, image background category, and image color feature; each child node has a different credit score; each binary tree is visited, and when visiting each parent node, one of the two child nodes connected to the parent node is selected for visit according to one of the user's facial expression, user's body appearance category, image background category, and image color feature; the credit scores of all visited child nodes are added to obtain the user's credit score; the user's credit score is input into the logistic regression model to obtain the user's credit level.
[0170] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the image background categories of multiple user images are the same, the upload time of the multiple user images is obtained; if the difference in the upload time of the multiple user images is less than the set time, it is determined that the users corresponding to the multiple user images belong to a high-risk group.
[0171] After acquiring the user image, the computer device obtains the user's facial expression, user's body type, image background type and image color features based on the user image, and inputs the user's facial expression, user's body type, image background type and image color features obtained from the user image into the trained classification model, which can fully utilize the face image to determine the user's credit rating, improve the utilization rate of the face image, and avoid resource waste. Moreover, the user's credit rating is obtained by combining the features of the user's facial expression, user's body type, image background type and image color features, and has a high accuracy rate.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a user image; performing face location on the user image and identifying the user's facial expression; performing visual detection on the user image and determining the user's body appearance category; performing image recognition on the user image and determining the image background category; obtaining image color features from the user image; and inputting the user's facial expression, the user's body appearance category, the image background category, and the image color features into a trained classification model to determine the user's credit rating.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: locating key feature points on the user image to determine the positions of the facial feature points on the user's face; determining the user's facial geometric features based on the positions of the facial feature points on the user's face; and determining the user's facial expressions corresponding to the user's facial geometric features based on the correspondence between the facial geometric features and facial expressions.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: performing face detection on the user image to determine the key feature points in the user image; using the key feature points to obtain a processed image aligned with a standard face image from the user image; and using the distribution positions of the key feature points in the processed image as the positions of the facial feature points on the user's face.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: extracting pixel data from the user image; inputting the pixel data into various convolution kernels respectively to obtain corresponding physical features; inputting the physical features into the corresponding classification model to obtain the user's physical features category.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: clustering pixels in the user image to divide the user image into a foreground image and a background image; removing the foreground image from the user image, and filling the removed portion of the user image according to the background image to obtain a filled image; determining the category to which the filled image belongs as the image background category.
[0177] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a trained GBDT model; the GBDT model includes at least one binary tree, each binary tree includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to a category corresponding to the user's facial expression, user's body appearance category, image background category and image color feature, and two child nodes connected to the same parent node correspond to a category corresponding to the user's facial expression, user's body appearance category, image background category and image color feature; each child node has a different credit score; each binary tree is visited, and when visiting each parent node, one of the two child nodes connected to the parent node is selected for visit according to one of the user's facial expression, user's body appearance category, image background category and image color feature; the credit scores of all the visited child nodes are added to obtain the user's credit score; the user's credit score is input into the logistic regression model to obtain the user's credit level.
[0178] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the image background categories of multiple user images are the same, the upload time of the multiple user images is obtained; if the difference in the upload time of the multiple user images is less than the set time, it is determined that the users corresponding to the multiple user images belong to a high-risk group.
[0179] After acquiring the user image, the storage medium obtains the user's facial expression, user's body category, image background category and image color features based on the user image, and inputs the user's facial expression, user's body category, image background category and image color features obtained from the user image into the trained classification model, which can fully utilize the face image to determine the user's credit rating, improve the utilization rate of the face image, and avoid resource waste. Moreover, the user's credit rating is obtained by combining the features of the user's facial expression, user's body category, image background category and image color features, and has a high accuracy rate.
[0180] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0181] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0182] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A facial image processing method, characterized in that: The method comprises: Get user image; Performing face positioning on the user image and identifying the user's facial expression; Converting the user image into an image signal, converting the pixel distribution, brightness and color in the image signal into a digital signal, extracting features from the digital signal and performing discrimination to obtain the user's body type; Performing image recognition on the user image to determine the image background category; Acquire the color value of each pixel from the user image; determine the fluctuation amplitude and brightness of the color value in the user image according to the color value of each pixel, and obtain the image color feature; The user's facial expression, the user's body appearance category, the image background category and the image color feature are input into a trained classification model to determine the user's credit rating.
2. The method according to claim 1, characterized in that The performing face positioning on the user image and identifying the user's facial expression includes: Positioning key feature points on the user image to determine the positions of the facial feature points on the user's face; Determining the user's facial geometric features based on the positions of the facial feature points on the user's face; According to the correspondence between the facial geometric features and the facial expressions, the facial expressions of the user corresponding to the facial geometric features of the user are determined.
3. The method according to claim 2, characterized in that The positioning of key feature points on the user image to determine the positions of the facial feature points on the user's face includes: Performing face detection on the user image to determine key feature points in the user image; Using the key feature points, obtaining a processed image aligned with a standard face image from the user image; The distribution positions of the key feature points in the processed image are used as the positions of the facial feature points on the user's face.
4. The method according to claim 2, characterized in that: The determining of the user's facial geometric features based on the positions of the facial feature points on the user's face includes: Connect the facial feature points of the same organ in sequence; obtain the distribution area of each organ on the user's face based on the positions of the facial feature points of the same organ on the user's face; obtain the outline of each organ based on the distribution area of each organ on the user's face; determine the shape, length, angle, curvature, symmetry of each organ, as well as the spacing, proportion, and relative position of each organ based on the outline of each organ to obtain the user's facial geometric features.
5. The method according to any one of claims 1 to 3, characterized in that: The performing image recognition on the user image to determine the image background category includes: Clustering pixels in the user image to divide the user image into a foreground image and a background image; Removing the foreground image from the user image, and filling the removed portion of the user image according to the background image to obtain a filled image; The category to which the filling image belongs is determined as the image background category.
6. The method according to claim 5, characterized in that The step of inputting the user's facial expression, the user's body type, the image background type and the image color feature into a trained classification model to determine the user's credit rating includes: Obtain a trained GBDT model; the GBDT model includes at least one binary tree, each of the binary trees includes at least one parent node and two child nodes connected to each parent node; each parent node corresponds to judging a corresponding category among the user's facial expression, the user's physical appearance category, the image background category, and the image color feature, and two child nodes connected to the same parent node correspond to a corresponding category among the user's facial expression, the user's physical appearance category, the image background category, and the image color feature; each child node has a different credit score; Visit each of the binary trees, and when visiting each of the parent nodes, select one of the two child nodes connected to the parent node for visiting according to one of the user's facial expression, the user's body type, the image background type, and the image color feature; Add up the credit points of all the visited child nodes to get the user credit point; The user credit score is input into a logistic regression model to obtain the user credit level.
7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the image background categories of the multiple user images are the same, obtaining the upload time of the multiple user images; If the time difference between the upload times of the plurality of user images is less than the set time, it is determined that the users corresponding to the plurality of user images belong to a high-risk group.
8. A facial image processing device, characterized in that: The device comprises: An image acquisition module, used to acquire user images; An expression recognition module, used to locate the face of the user image and recognize the user's facial expression; A body shape determination module, used to convert the user image into an image signal, convert the pixel distribution, brightness and color in the image signal into a digital signal, extract features from the digital signal and perform discrimination to obtain the user's body shape category; A background determination module, used to perform image recognition on the user image and determine the image background category; A feature acquisition module, used to acquire the color value of each pixel from the user image; determine the fluctuation amplitude and brightness of the color value in the user image according to the color value of each pixel, and obtain the image color feature; The credit determination module is used to input the user's facial expression, the user's body appearance category, the image background category and the image color feature into a trained classification model to determine the user's credit level.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
