Online car-hailing driver face target detection method and device based on deep learning
Patent Information
- Application Number
- CN202410753072.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-08
AI Technical Summary
[0010]有鉴于此,本发明实施例希望提供一种基于深度学习的网约车司机人脸目标检测方法和装置,以解决或缓解现有技术中存在的技术问题,至少提供一种有益的选择
[0042] 1. The present invention solves the three problems of low accuracy, heavy workload and slow response speed under the traditional machine learning method through this method, and greatly improves the accuracy and recall rate. It is committed to identifying the driver's face position and building The face recognition platform provides powerful image data, greatly improving the accuracy of face recognition and reducing the rate of manslaughter.
Smart Images

Figure CN118747906A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data processing, and in particular to a method and device for detecting face targets of online car-hailing drivers based on deep learning. Background Art
[0002] With the rapid development of online ride-hailing services, a large number of drivers have flocked to the platforms. In order to ensure the quality and safety of drivers, the platforms have adopted some technical means to ensure the safety of the platform, drivers and passengers. This includes facial recognition detection for drivers, which aims to prevent drivers who are not themselves from driving and avoid unsafe hidden dangers.
[0003] For example, driver A is unable to drive on a certain day due to some matters, and driver B wants to use driver A's account to drive and pick up passengers. This situation is not allowed by the platform and there are unforeseen risks. Therefore, driver A's account can only allow driver A to drive. We will conduct full inspections and random inspections before or during the driving process, and other facial recognition methods. Therefore, after we get the photo of the online car-hailing driver, the first step is to identify the face position from the photo, which is convenient for subsequent facial comparison and verification.
[0004] Traditional face target detection mainly extracts features from each area in the image through sliding windows or pyramid image scaling, such as using Haar features, HOG features, or LBP features, etc. Candidate bounding boxes are generated to cover areas that may contain faces, and some boxes that are obviously not faces are removed through screening using thresholds or other methods. For the retained candidate boxes, they are classified or regressed using traditional machine learning classifiers or regressors to determine whether they are faces.
[0005] Traditional face target detection methods are relatively simple and direct;
[0006] However, the above traditional methods have the following three problems:
[0007] 1. The accuracy is relatively low and is greatly affected by factors such as lighting, posture, and expression;
[0008] 2. The workload is large, and the feature extraction algorithm and classifier need to be manually designed, and the designed model has poor scalability;
[0009] 3. The response speed is slow and the calculation amount is large, which is not conducive to real-time application scenarios and is not suitable for online response in seconds. Therefore, a method and device for face target detection of online car-hailing drivers based on deep learning are proposed. Summary of the invention
[0010] In view of this, the embodiments of the present invention hope to provide a method and device for online car-hailing driver face target detection based on deep learning to solve or alleviate the technical problems existing in the prior art and at least provide a beneficial option.
[0011] The technical solution of the embodiment of the present invention is implemented as follows: A method for detecting face targets of online car-hailing drivers based on deep learning, comprising the following steps:
[0012] S1. Randomly select a large amount of real online car-hailing verification photo data from the online database;
[0013] S2. Perform feature engineering on the online car-hailing verification photo data to generate training sets, test sets, and validation sets;
[0014] S3, repeat steps S1 and S2 to generate multiple sets of data;
[0015] S4, design the model based on the data of S2;
[0016] S5, read the validation set data, and input the data into the model in S4 to verify the effect of S4 on the validation set;
[0017] S6, repeat S4 and S5 to generate the optimal neural network model according to the evaluation index of the model;
[0018] S7, performing feature engineering processing on the real-time online car-hailing verification photo data;
[0019] S8. Input the online car-hailing verification photo data after feature processing in S7 into the model, obtain the circled face position in each driver's photo, and give the evaluation result through the model evaluation index in S6.
[0020] In some embodiments, in S2 and S7, the steps of performing feature engineering processing on the online car-hailing verification photo data are specifically as follows:
[0021] S101. Dataset preprocessing:
[0022] All online car-hailing verification photos are normalized to 256*256 jpg format data, and left-right mirror flipping is randomly added with a probability of 0.5. The RGB channels of online car-hailing verification photos are uniformly subtracted from the [104, 117, 123][ImageNet] empirical values;
[0023] S102, image sample annotation:
[0024] Use Python's image annotation tools to annotate the online car-hailing verification photos. After saving, you will get the corresponding annotation information.
[0025] In some embodiments, the annotation information includes the annotation category and the coordinate positions of two diagonal points of the rectangle.
[0026] In some embodiments, in said S4, the model design comprises the following steps:
[0027] S201, loading the training set and the test set, generating a data iterator for gradually calling the iterative model;
[0028] S202, forming an overall network model;
[0029] S203, designing an anchor frame, and pre-defining a rectangular frame uniformly on the image;
[0030] S204, design a loss function, calculate the loss between the marked box and the predetermined anchor box, and use Smooth L1 Loss to implement it;
[0031] S205: Start training until the loss function converges and generate a network inference model.
[0032] In some embodiments, in S202, the specific steps of forming the overall network model are as follows:
[0033] S2021. The backbone network uses MobileNetV1 to perform preliminary feature extraction on the image and obtain the C3, C4 and C5 feature layers;
[0034] S2022, enter the feature pyramid network (FPN), connect from top to bottom and side to side, sum each element, and convolutionally fuse and output the effective feature layers P3, P4, and P5;
[0035] S2023, enter the SSH structure, which includes three parallel structures, using 3*3 convolution stacking to replace the effects of 5*5 and 7*7, to obtain effective output layers SSH1, SSH2 and SSH3.
[0036] In some embodiments, in S6, the evaluation index of the model includes accuracy, which is the ratio of the number of correctly classified samples to the total number of samples, and can measure the accuracy of the overall classification of the model.
[0037] Accuracy = (TP+TN) / (TP+TN+FP+FN)
[0038] Among them, TP (True Positive) represents true positive examples, TN (True Negative) represents true negative examples, FP (False Positive) represents false positive examples, and FN (False Negative) represents false negative examples.
[0039] A device for detecting face targets of online car-hailing drivers based on deep learning, comprising: a memory and a processor;
[0040] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the online car-hailing driver face target detection method based on deep learning as described in any one of the above items are implemented.
[0041] The embodiment of the present invention has the following advantages due to the adoption of the above technical solution:
[0042] 1. The present invention solves the three problems of low accuracy, large workload and slow response speed under the traditional machine learning method through this method, and greatly improves the accuracy and recall rate. It is committed to identifying the driver's face position, building a face recognition platform to provide powerful image data, and greatly improving the accuracy of face recognition and reducing the false positive rate.
[0043] Second, the present invention can learn richer and more abstract feature representations through neural networks, thereby better capturing the details and features of the face. Deep learning can automatically extract high-level features from raw data, avoiding the tediousness and subjectivity of manually designed features.
[0044] 3. The present invention can learn more internal evolution laws through the model during the training process, making it more sensitive to abnormal and sudden situations.
[0045] 4. The present invention has strong generalization ability through the model, which can adapt to changes in different scenarios and data distribution. At the same time, the model can improve performance by expanding the network structure or increasing training data, and has high scalability and extensibility.
[0046] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is a flow chart of the present invention;
[0049] Figure 2 A schematic diagram of annotated image samples of the present invention;
[0050] Figure 3 is a schematic diagram of the iterative model of the present invention;
[0051] Figure 4 It is a schematic diagram of feature extraction of the present invention;
[0052] Figure 5 Schematic diagram of the feature pyramid network of the present invention;
[0053] Figure 6 This is a curve diagram of the training of the present invention. DETAILED DESCRIPTION
[0054] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0055] It should be noted that the terms "first", "second", "symmetrical", "array", etc. are only used to distinguish between description and position description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the definition of "first", "symmetrical", etc. can explicitly or implicitly include one or more of these features; similarly, when the quantity of certain features is not limited in the form of words such as "two" or "three", it should be noted that this feature also explicitly or implicitly includes one or more feature quantities;
[0056] In the present invention, unless otherwise clearly specified and limited, the terms such as "installation", "connection", "fixation" and the like should be understood in a broad sense; for example, it can be a fixed connection, a detachable connection, or an integral molding; it can be a mechanical connection, a direct connection, welding, or an indirect connection through an intermediate medium, or it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood based on the description and drawings combined with specific circumstances.
[0057] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0058] like Figure 1-Figure 6 As shown, an embodiment of the present invention provides a method for detecting face targets of online car-hailing drivers based on deep learning, comprising the following steps:
[0059] S1. Randomly select a large amount of real online car-hailing verification photo data from the online database;
[0060] S2. Perform feature engineering on the online car-hailing verification photo data to generate training sets, test sets, and validation sets;
[0061] S3, repeat steps S1 and S2 to generate multiple sets of data;
[0062] S4, design the model based on the data of S2;
[0063] S5, read the validation set data, and input the data into the model in S4 to verify the effect of S4 on the validation set;
[0064] S6, repeat S4 and S5 to generate the optimal neural network model according to the evaluation index of the model;
[0065] S7, performing feature engineering processing on the real-time online car-hailing verification photo data;
[0066] S8. Input the online car-hailing verification photo data after feature processing in S7 into the model, obtain the circled face position in each driver's photo, and give the evaluation result through the model evaluation index in S6.
[0067] In this embodiment, specifically, in S2 and S7, the steps of performing feature engineering processing on the online car-hailing verification photo data are as follows:
[0068] S101. Dataset preprocessing:
[0069] All online car-hailing verification photos are normalized to 256*256 jpg format data, and left-right mirror flipping is randomly added with a probability of 0.5. The RGB channels of online car-hailing verification photos are uniformly subtracted from the [104, 117, 123][ImageNet] empirical values;
[0070] S102, such as Figure 2 As shown, the image sample is labeled:
[0071] Use Python's image annotation tools to annotate the online car-hailing verification photos. After saving, you will get the corresponding annotation information.
[0072] In this embodiment, specifically, the annotation information includes the annotation category and the coordinate positions of two diagonal points of the rectangle.
[0073] In this embodiment, specifically, in S4, the model design includes the following steps:
[0074] S201, such as Figure 3 As shown, the training set and test set are loaded, and a data iterator is generated for step-by-step calling of the iterative model;
[0075] S202, forming an overall network model;
[0076] S203, designing an anchor frame, and pre-defining a rectangular frame uniformly on the image;
[0077] S204, design a loss function, calculate the loss between the marked box and the predetermined anchor box, and use Smooth L1 Loss to implement it;
[0078] S205, such as Figure 6 As shown, training starts until the loss function converges and a network inference model is generated.
[0079] In this embodiment, specifically, in S202, the specific steps of forming the overall network model are as follows:
[0080] S2021, such as Figure 4 As shown, the backbone network uses MobileNetV1 to perform preliminary feature extraction on the image and obtain C3, C4 and C5 feature layers;
[0081] S2022, such as Figure 5 As shown, it enters the feature pyramid network (FPN), connects from top to bottom and side to side, and sums element by element, and convolutionally fuses the output P3, P4, and P5 effective feature layers;
[0082] S2023, enter the SSH structure, which includes three parallel structures, using 3*3 convolution stacking to replace the effects of 5*5 and 7*7, to obtain effective output layers SSH1, SSH2 and SSH3.
[0083] In this embodiment, specifically, in S6, the evaluation index of the model includes accuracy, which is the ratio of the number of correctly classified samples to the total number of samples, and can measure the accuracy of the overall classification of the model.
[0084] Accuracy = (TP+TN) / (TP+TN+FP+FN)
[0085] Among them, TP (True Positive) represents true positive examples, TN (True Negative) represents true negative examples, FP (False Positive) represents false positive examples, and FN (False Negative) represents false negative examples.
[0086] A device for detecting face targets of online car-hailing drivers based on deep learning, comprising: a memory and a processor;
[0087] The memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of any one of the above-mentioned methods for detecting the face of an online car-hailing driver based on deep learning are implemented.
[0088] In this embodiment, specifically, the feature engineering process may be different, such as predefined image size, data enhancement method, etc.;
[0089] The deep learning algorithms used can be different. For example, the backbone uses the resnet60 network as the backbone network, and the feature pyramid or SSH structure can be flexibly transformed.
[0090] The indicators for model evaluation can be different, and manual subjective verification can be performed, which only requires judging whether the person is in the box.
[0091] In this embodiment, specifically, deep learning: deep learning is a branch of machine learning that achieves data modeling and learning by building deep neural networks. The core idea of deep learning is to discover high-level abstract features of data through multi-level nonlinear transformations, thereby improving the accuracy and generalization ability of learning tasks. Deep learning technology has been widely used in computer vision, natural language processing, speech recognition and other fields.
[0092] Online ride-hailing drivers: Online ride-hailing drivers are professional drivers who register through the Internet platform and accept passengers' requests. They usually have the corresponding driver's license and driving record certificate, and must pass the review of the Internet platform to become a registered driver. Online ride-hailing drivers need to use their own vehicles or rented vehicles to serve passengers, and accept orders and complete passengers' travel needs according to the platform rules.
[0093] Face Detection: refers to the process of automatically detecting and locating faces in images or video streams using computer vision technology. Generally speaking, face detection is a basic problem in the field of computer vision and a prerequisite for many advanced computer vision tasks (such as face recognition, expression recognition, etc.). Face detection technology can be achieved by using various algorithms and models (such as Haar feature detectors, HOG feature detectors, convolutional neural networks (CNN), etc.). It has been widely used in security, biometrics, human-computer interaction and other fields.
[0094] Convolutional Neural Network (CNN): A neural network model in deep learning, mainly used to process tasks with network structures, such as images and audio. The core idea of CNN is to automatically extract and learn the feature representation of input data through convolutional layers, pooling layers and fully connected layers. MobileNetV1 used in this patent: It is a lightweight convolutional neural network model, mainly used for image classification tasks on mobile devices and embedded systems. While maintaining good accuracy, it greatly reduces the number of parameters and computational complexity of the model. Depthwise Separable Convolution is used to replace the traditional standard convolution operation, thereby significantly reducing the amount of calculation.
[0095] Traditional machine learning: refers to a class of methods and techniques in the field of machine learning, which are mainly based on classical theories such as statistics and pattern recognition. Compared with deep learning, traditional machine learning methods focus on manually designing features and using statistical methods to build predictive models.
[0096] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for detecting face targets of online car-hailing drivers based on deep learning, characterized in that: The following steps are involved: S1. Randomly select a large amount of real online car-hailing verification photo data from the online database; S2. Perform feature engineering on the online car-hailing verification photo data to generate training sets, test sets, and validation sets; S3, repeat steps S1 and S2 to generate multiple sets of data; S4, design the model based on the data of S2; S5, read the validation set data, and input the data into the model in S4 to verify the effect of S4 on the validation set; S6, repeat S4 and S5 to generate the optimal neural network model according to the evaluation index of the model; S7, performing feature engineering processing on the real-time online car-hailing verification photo data; S8. Input the online car-hailing verification photo data after feature processing in S7 into the model, obtain the circled face position in each driver's photo, and give the evaluation result through the model evaluation index in S6.
2. The method for detecting face targets of online car-hailing drivers based on deep learning according to claim 1, characterized in that: In S2 and S7, the steps of performing feature engineering processing on the online car-hailing verification photo data are specifically as follows: S101. Dataset preprocessing: All online car-hailing verification photos are normalized to 256*256 jpg format data, and left-right mirror flipping is randomly added with a probability of 0.
5. The RGB channels of online car-hailing verification photos are uniformly subtracted from the [104, 117, 123][ImageNet] empirical values; S102, image sample annotation: Use Python's image annotation tools to annotate the online car-hailing verification photos. After saving, you will get the corresponding annotation information.
3. The method for detecting face targets of online car-hailing drivers based on deep learning according to claim 1, characterized in that: The annotation information includes the annotation category and the coordinate positions of two diagonal points of the rectangle.
4. The method for detecting face targets of online car-hailing drivers based on deep learning according to claim 1, characterized in that: In said S4, the model design includes the following steps, S201, loading the training set and the test set, generating a data iterator for gradually calling the iterative model; S202, forming an overall network model; S203, designing an anchor frame, and pre-defining a rectangular frame uniformly on the image; S204, designing a loss function, calculating the loss between the labeled box and the predetermined anchor box, and implementing it with smooth L1 loss (Smooth L1 Loss); S205: Start training until the loss function converges and generate a network inference model.
5. The method for detecting face targets of online car-hailing drivers based on deep learning according to claim 4 is characterized by: In S202, the specific steps of forming the overall network model are as follows: S2021. The backbone network uses MobileNetV1 to perform preliminary feature extraction on the image and obtain the C3, C4 and C5 feature layers. S2022, enter the feature pyramid network (FPN), connect from top to bottom and side to side, sum each element, and convolutionally fuse and output the effective feature layers P3, P4, and P5; S2023, enter the SSH structure, which includes three parallel structures, using 3*3 convolution stacking to replace the effects of 5*5 and 7*7, to obtain effective output layers SSH1, SSH2 and SSH3.
6. The method for detecting face targets of online car-hailing drivers based on deep learning according to claim 1, characterized in that: In S6, the evaluation index of the model includes accuracy, which is the ratio of the number of correctly classified samples to the total number of samples, and can measure the accuracy of the overall classification of the model. Accuracy = (TP+TN) / (TP+TN+FP+FN) Among them, TP (True Positive) represents true positive examples, TN (True Negative) represents true negative examples, FP (False Positive) represents false positive examples, and FN (False Negative) represents false negative examples.
7. A device for detecting face targets of online car-hailing drivers based on deep learning, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the online car-hailing driver face target detection method based on deep learning as described in any one of claims 1 to claim 6 are implemented.
