Detection system and detection method
A detection system and a detection method are provided. The detection method includes: receiving an image containing a face by an angle acquisition module and obtaining a first angle and a second angle of the face based on the image; obtaining a first projection value and a second projection value based on the first angle and the second angle by a projection calculation module; and performing by a confidence calculation module: performing an exponentiation calculation on the first projection value based on a first correction value to obtain a third value; performing an exponentiation calculation on the second projection value based on a second correction value to obtain a fourth value; and obtaining a confidence value based on the third value and the fourth value.
1 . A detection system, comprising a processor and a memory storing instructions that, when executed by the processor, cause the processor to:
receive an image containing a face;
obtain a first angle and a second angle of the face based on the image;
obtain a first projection value and a second projection value based on the first angle and the second angle; and
perform an exponentiation calculation by raising the first projection value to a power of the first correction value to obtain a third value;
perform an exponentiation calculation by raising the second projection value to a power of the second correction value to obtain a fourth value;
wherein the first correction value is obtained by multiplying a first preset parameter by 2, and the second correction value is obtained by multiplying a second preset parameter by 2; and
obtain a confidence value which indicates whether the face in the image directly faces a camera based on the third value and the fourth value;
wherein the step of obtaining a confidence value based on the third value and the fourth value comprises calculating a difference value between 1 and a square root of a sum of the third value and the fourth value to obtain the confidence value.
2 . The detection system according to claim 1 , wherein the first angle is a yaw angle of the face and the second angle is a pitch angle of the face.
3 . The detection system according to claim 2 , wherein the first projection value is set as a sine function value of the first angle, and the second projection value is set as a negative number obtained by multiplying a cosine function value of the first angle by the sine function value of the second angle.
4 . The detection system according to claim 1 , wherein the instructions, when executed by the processor, cause the processor to implement a neural network module to receive the image containing the face and output the first angle and the second angle of the face.
5 . The detection system according to claim 4 , wherein the neural network module comprises an output feature tensor generation module and a plurality of prediction modules; the output feature tensor generation module is configured to generate a plurality of output feature tensors of different sizes based on the image containing the face; each of the prediction modules is configured to receive one of the output feature tensors to correspondingly generate an information tensor; the information tensor is configured to indicate position information, confidence score information, category information and angle information of the face; and the first angle and the second angle of the face is obtained based on all the information tensors generated by each of the prediction modules.
6 . The detection system according to claim 5 , wherein each of the prediction modules comprises a plurality of convolution layers; and each of the prediction modules is configured to perform convolution operation on one of the received output feature tensors based on respective convolution layers so as to generate the information tensor.
7 . The detection system according to claim 5 , wherein the output feature tensor generation module comprises:
a backbone module comprising a plurality of backbone layers with different sizes and configured to generate a plurality of feature tensors with different sizes and a first sequence based on the image containing the face through the backbone layers, the first sequence being an arrangement sequence of the feature tensors from large to small according to the sizes; and
a feature pyramid module configured to carry out feature fusion on the feature tensors to obtain the output feature tensors.
8 . A detection method, applicable to a detection system comprising an angle acquisition module, a projection calculation module and a confidence calculation module, comprising the following steps:
(a) receiving an image containing a face by the angle acquisition module and obtaining a first angle and a second angle of the face based on the image;
(b) obtaining a first projection value and a second projection value by the projection calculation module based on the first angle and the second angle; and
(c) performing by the confidence calculation module:
performing an exponentiation calculation on the first projection value raising the first projection value to a power of the first correction value to obtain a third value, performing an exponentiation calculation on the second projection value by raising the second projection value to a power of the second correction value to obtain a fourth value;
wherein the first correction value is obtained by multiplying a first preset parameter by 2, and the second correction value is obtained by multiplying a second preset parameter by 2; and
obtaining a confidence value which indicates whether the face in the image directly faces a camera based on the third value and the fourth value;
wherein the step of obtaining a confidence value based on the third value and the fourth value comprises calculating a difference value between 1 and a square root of a sum of the third value and the fourth value to obtain the confidence value.
9 . The detection method according to claim 8 , wherein the first angle is a yaw angle of the face and the second angle is a pitch angle of the face of the face.
10 . The detection method according to claim 9 , wherein the step (b) comprises: setting the first projection value as a sine function value of the first angle, and setting the second projection value as a negative number obtained by multiplying the cosine function value of the first angle by the sine function value of the second angle.
11 . The detection method according to claim 8 , wherein the angle acquisition module comprises a neural network module; and the step (a) comprises:
(a1) receiving the image containing the face and output the first angle and the second angle.
12 . The detection method according to claim 11 , wherein the neural network module comprises an output feature tensor generation module and a plurality of prediction modules; and the step (a1) comprises:
(a11) generating a plurality of output feature tensors of different sizes by the output feature tensor generation module based on the image containing the face;
(a12) receiving one of the output feature tensors to correspondingly generate an information tensor by each of the prediction modules, the information tensor indicating position information, confidence score information, category information and angle information of the face; and
(a13) outputting the first angle and the second angle of the face by the angle acquisition module based on all the information tensors generated by each of the prediction modules.
13 . The detection method according to claim 12 , wherein each of the prediction modules comprises a plurality of convolution layers; and the step (a12) comprises:
performing convolution operation on one of the received output feature tensors by each of the prediction modules based on respective convolution layers so as to generate an information tensor.
14 . The detection method according to claim 12 , wherein the output feature tensor generation module comprises a backbone module and a feature pyramid module; the backbone module comprises a plurality of backbone layers with different sizes; and the step (a11) comprises:
(a111) generating a plurality of feature tensors with different sizes and a first sequence based on the image containing the face by the backbone module through the backbone layers, the first sequence being an arrangement sequence of the feature tensors from large to small according to the sizes; and
(a112) carrying out feature fusion on the feature tensors by the feature pyramid module to obtain the output feature tensor.