Gate trailing detection method and device, computer equipment and storage medium
By constructing a three-dimensional head and shoulders detection model and using depth information to optimize the YOLOX target detection model, the problem of low accuracy of tailing detection in the existing technology is solved, and high-accuracy tailing behavior detection and real-time alarms are achieved.
Patent Information
- Application Number
- CN202411290724.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-24
AI Technical Summary
When detecting trailing behavior, existing gate machine trailing detection methods are prone to missed detection and missed detection due to the interference of objects on human characteristics, resulting in low detection accuracy.
By obtaining the three -dimensional data of the human head and shoulders, optimize the YOLOX target detection model, build a three -dimensional detection model of the head, shoulder, use deep information for detection, reduce the interference of the human characteristics of the body, and make the end -based on the target trajectory analysis.
It improves the accuracy of tailing detection, reduces the occurrence of false detections and missed detections, and achieves real-time and accurate tailing behavior alarms.
Smart Images

Figure CN119360414A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of gate tailgating detection, and in particular to a gate tailgating detection method, device, computer equipment and storage medium. Background Art
[0002] With the widespread application of smart cities and intelligent security systems, gate systems have gradually become popular in entrance and exit management, especially in places such as subways, airports, and office buildings. The deployment of gates has effectively improved the efficiency and safety of personnel passage. However, in these application scenarios, "tailgating behavior" has become a common security hazard, that is, unauthorized personnel follow authorized personnel closely and try to pass through the gate without authorization. If this type of tailing behavior is not detected and prevented in time, it may lead to security loopholes, causing criminals to enter sensitive areas or affect normal traffic order. Therefore, how to accurately detect tailing behavior has become a technical problem that needs to be solved in the current entrance and exit management system.
[0003] The target detection method used in the prior art is to make a trailing judgment in the channel inside the gate. At this time, the camera is in a bird's-eye view and can better observe pedestrians, but at the same time, the images of backpacks, suitcases, clothes and hats will be confused with human features with a certain probability, making human detection have a certain proportion of false detection, which may lead to misjudgment of trailing judgment. Summary of the invention
[0004] Based on this, it is necessary to provide a gate tailgating detection method, device, computer equipment and storage medium that can reduce the interference of objects on human body features, reduce the occurrence of false detection and missed detection, thereby improving the accuracy of tailgating detection, and facilitate the realization of real-time and accurate tailgating behavior alarm.
[0005] On the one hand, a gate tailgating detection method is provided, the method comprising:
[0006] Acquire human head and shoulder data to obtain a three-dimensional human data set;
[0007] The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset;
[0008] Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model;
[0009] In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis;
[0010] In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
[0011] In one embodiment,
[0012] Obtain human head and shoulder data to obtain a 3D human data set, including:
[0013] Acquire human head and shoulder data through a binocular lens disposed on the top of the gate, wherein the human head and shoulder data includes a binocular image of a human head and shoulder target;
[0014] Based on the human body key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain the two-dimensional pixel coordinates of the head and shoulder, and the disparity values of the same head and shoulder key points are obtained;
[0015] Calibrate the binocular lens to obtain camera intrinsic parameters and camera extrinsic parameters;
[0016] Obtaining a depth value of each of the head and shoulder key points according to the camera intrinsic parameters, the camera extrinsic parameters and the disparity value;
[0017] According to the two-dimensional pixel coordinates of the head and shoulders, combined with the depth value, three-dimensional human head and shoulders information is obtained;
[0018] The three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
[0019] In one embodiment,
[0020] The YOLOX target detection model is optimized and combined with the human body 3D dataset to build a head and shoulder 3D detection model, including:
[0021] Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head.
[0022] Based on the YOLOX loss function, the loss function of depth information is added to obtain the 3D detection loss function;
[0023] Obtaining a YOLOX extended model according to the three-dimensional detection decoupling head and the three-dimensional detection loss function;
[0024] Performing data processing according to the human body three-dimensional data set to obtain a training data set and a test data set;
[0025] The YOLOX extended model is trained and optimized through the training data set, and the detection performance is evaluated through the test data set;
[0026] In response to the detection performance evaluation result being excellent, the YOLOX extended model is deployed to the edge device to obtain a head and shoulder three-dimensional detection model.
[0027] In one embodiment,
[0028] Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head, which further includes:
[0029] The information output by the original decoupling head includes: cls, which indicates the category of the target box, including N dimensions, where N is the number of categories; obj, which is used to determine whether the target box is foreground or background, including 1 dimension; Reg, which indicates the coordinate information of the target box, recorded as (x, y, w, h), where x is the horizontal coordinate of the upper left pixel of the target box in the image, y is the vertical coordinate value of the upper left pixel of the target box in the image, w is the pixel width of the target box, and h is the pixel height of the target box;
[0030] On the basis of the original decoupling head, the target category is set to 1, and a network branch of depth information is added, set to depth, which is used to represent the depth information of the human head and shoulders, denoted as (z l ,z h ,z r ), z l Indicates the longitudinal distance from the left shoulder of the human body to the detection position, z h represents the longitudinal distance from the center of the head to the detection position, z r Indicates the longitudinal distance from the right shoulder of the human body to the detection position;
[0031] Based on the YOLOX loss function, depth information is added to obtain the 3D detection loss function, which further includes:
[0032] The three-dimensional detection loss function is:
[0033] Loss = Loss_reg + Loss_obj + Loss_cls + Loss_depth, where Loss is the 3D detection loss function; Loss_reg represents the loss function of the detection position, which has two forms: iou_loss and giou_loss; Loss_obj represents the confidence of the target box, which is used to distinguish between target information and background information; Loss_cls represents the category score of the target, and Loss_depth represents the loss function of the depth information;
[0034] The calculation formula of the loss function of the depth information is:
[0035]
[0036] , where z represents the true depth value, satisfying z=(z l ,z h ,z r ); Represents the predicted depth value, satisfying in, Indicates the predicted longitudinal distance from the left shoulder of the human body to the detection position, represents the predicted longitudinal distance from the center of the head to the detection position, Represents the predicted longitudinal distance from the right shoulder of the human body to the detection position; δ is a hyperparameter used to control the smoothness of the loss function.
[0037] In one embodiment,
[0038] The YOLOX extended model is trained and optimized by the training data set, and the detection performance is evaluated by the test data set, further comprising:
[0039] The YOLOX extended model is inferred using the test data set to obtain target detection results and depth prediction results;
[0040] Based on the target detection result, target detection index calculation is performed to obtain a target detection evaluation result;
[0041] Based on the depth prediction result, a depth prediction index is calculated to obtain a depth prediction evaluation result;
[0042] Combining the target detection evaluation result and the depth prediction evaluation result to perform a consistency check;
[0043] In response to the consistency check result being consistent, the detection performance evaluation result is excellent.
[0044] In one embodiment,
[0045] Acquire a real-time image and make a head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model, including:
[0046] Acquire a real-time image, wherein the real-time image includes a left view of a human body and a right view of a human body;
[0047] Based on the head and shoulder three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulder target, wherein the real-time data of the head and shoulder target includes at least one of the following: the depth difference between the left and right shoulders of the human body and the depth difference between the head and shoulder;
[0048] Based on the real-time data of the head and shoulders target, make a head and shoulders rationality judgment and a head and shoulders continuity judgment;
[0049] The rationality judgment of the head and shoulders includes:
[0050] Set the depth difference thresholds of the left and right shoulders and the head and shoulders of the human body;
[0051] Perform a left-right shoulder check and comparison on the left-right shoulder depth difference of the human body and the left-right shoulder depth difference threshold of the human body, and in response to the left-right shoulder depth difference of the human body not exceeding the left-right shoulder depth difference threshold of the human body, the left-right shoulder check and comparison result is passed;
[0052] Performing a head-shoulder verification comparison on the human head-shoulder depth difference and the human head-shoulder depth difference threshold, and in response to the human head-shoulder depth difference not exceeding the human head-shoulder depth difference threshold, the head-shoulder verification comparison result is passed;
[0053] In response to the left and right shoulder verification comparison results and the head and shoulder verification comparison results both being passed, the result of the head and shoulder rationality judgment is passed;
[0054] The head and shoulders continuity judgment includes:
[0055] According to the real-time data of the head and shoulder target, a number of head and shoulder detection points are extracted, and a number of head and shoulder movement trajectories are generated;
[0056] Tracking a number of the head and shoulder monitoring points through a multi-target tracking method to generate a head and shoulder movement trajectory;
[0057] Set the minimum distance for head and shoulders movement;
[0058] In response to the head-shoulder movement trajectory being continuous and the starting distance of the head-shoulder movement trajectory exceeding the head-shoulder movement minimum distance, the head-shoulder continuity judgment result is passed;
[0059] In response to both the head-shoulder rationality judgment result and the head-shoulder continuity judgment result being passed, the result of the head-shoulder target validity judgment is valid.
[0060] In one embodiment,
[0061] In response to the result of the head-shoulder target validity judgment being valid, a trailing behavior judgment is performed based on the target trajectory analysis, including:
[0062] In response to the result of the head-shoulder target validity judgment being valid, extracting all valid head-shoulder targets and obtaining the head-shoulder movement trajectory;
[0063] In response to the number of the head and shoulder movement tracks being no more than one, the result of the trailing behavior determination is that there is no trailing behavior;
[0064] In response to the number of the head and shoulder movement tracks being at least two, performing a tailing risk behavior detection;
[0065] In response to the three-dimensional space distance between the plurality of head and shoulder movement tracks being too close, the plurality of head and shoulder targets have a trailing risk behavior of being located adjacent to each other;
[0066] In response to the fact that the time difference between the starting points of the plurality of head and shoulder moving trajectories is too small and the moving speeds are close, the plurality of head and shoulder targets have a tailing risk behavior of synchronously starting and following the movement;
[0067] In response to the fact that the end positions of the plurality of head-shoulder movement trajectories are close and the arrival time at the end points is close, the plurality of head-shoulder targets have a tailgating risk behavior of arriving at the gate synchronously;
[0068] In response to the existence of at least two of the tailgating risk behaviors, the result of the tailgating behavior judgment is existence.
[0069] On the other hand, a gate tailgating detection device is provided, the device comprising:
[0070] A data acquisition module is used to obtain the head and shoulder data of the human body to obtain a three-dimensional data set of the human body;
[0071] A model generation module is used to optimize the YOLOX target detection model and build a head and shoulder 3D detection model in combination with the human 3D data set;
[0072] A head-shoulder target validity judgment module is used to obtain real-time images and perform head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model;
[0073] A following behavior judgment module, configured to respond to the result of the head-shoulder target validity judgment being valid, and to perform a following behavior judgment based on target trajectory analysis;
[0074] The tailgating warning module is used to issue a tailgating warning in response to the result of the tailgating behavior judgment being present.
[0075] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0076] Acquire human head and shoulder data to obtain a three-dimensional human data set;
[0077] The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset;
[0078] Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model;
[0079] In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis;
[0080] In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
[0081] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0082] Acquire human head and shoulder data to obtain a three-dimensional human data set;
[0083] The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset;
[0084] Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model;
[0085] In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis;
[0086] In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
[0087] The above-mentioned gate tailgating detection method, device, computer equipment and storage medium obtain the three-dimensional data of the human head and shoulders and optimize the YOLOX target detection model, use depth information to improve the detection accuracy, reduce the interference of objects on human features, reduce the occurrence of false detection and missed detection, and improve the accuracy of tailgating detection; at the same time, based on target trajectory analysis, it can timely judge the tailing behavior and issue a warning during the passage process, thereby realizing real-time and accurate tailing behavior warning. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 A diagram showing an application environment of a gate tailgating detection method in one embodiment;
[0089] Figure 2 A schematic diagram of a flow chart of a gate tailgating detection method in one embodiment;
[0090] Figure 3 It is a structural block diagram of a gate tailgating detection device in one embodiment;
[0091] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0092] 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.
[0093] The gate tailgate detection method provided in this application can be applied to Figure 1In the application environment shown. The detection terminal 101 communicates with the server 102 through the network. When the detection terminal 101 recognizes that a human body enters the gate channel, the collected information is sent to the server 102, and the server 102 returns the tail detection result after calculation. The detection terminal 101 can be, but is not limited to, a camera, an image acquisition device, and a recognition lens, and the server 102 can be implemented by an independent server or a server cluster composed of multiple servers.
[0094] In one embodiment, Figure 2 As shown, a gate tailgate detection method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0095] Step 201, obtaining human head and shoulder data to obtain a three-dimensional human data set.
[0096] The human head and shoulders data includes a binocular image of the human head and shoulders target.
[0097] Specifically, based on the human key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain the two-dimensional pixel coordinates of the head and shoulders; further calculation is performed based on the binocular image to obtain the depth value of each of the head and shoulder key points; based on the two-dimensional pixel coordinates of the head and shoulders and combined with the depth value, three-dimensional human head and shoulder information is obtained; the three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
[0098] Step 202: Optimize the YOLOX target detection model and build a head and shoulder 3D detection model in combination with the human 3D data set.
[0099] Among them, the YOLOX target detection model is a high-performance target detection model proposed based on the improvement of the original YOLO series algorithms. It has the characteristics of high precision and real-time performance. It can quickly detect and locate targets in images in a short time and is suitable for various computer vision tasks.
[0100] Specifically, the original decoupling head and loss function of the YOLOX target detection model are modified to obtain the three-dimensional detection decoupling head and three-dimensional detection loss function, and then the YOLOX extended model is obtained; the YOLOX extended model is trained with the human body three-dimensional dataset, and the head and shoulder three-dimensional detection model is obtained after optimizing the detection performance.
[0101] Step 203: Acquire a real-time image and make a head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model.
[0102] Wherein, the real-time image includes a left view of a human body and a right view of a human body;
[0103] Specifically, based on the head and shoulders three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulders target; according to the real-time data of the head and shoulders target, the rationality judgment and the continuity judgment of the head and shoulders are performed; in response to the result of the rationality judgment of the head and shoulders and the result of the continuity judgment of the head and shoulders being passed, the result of the validity judgment of the head and shoulders target is valid.
[0104] Step 204, in response to the result of the head-shoulder target validity judgment being valid, a following behavior judgment is performed based on the target trajectory analysis.
[0105] Specifically, in response to the result of the head and shoulder target validity judgment being valid, all valid head and shoulder targets are extracted, and the head and shoulder movement trajectory is obtained; in response to the number of head and shoulder movement trajectories being no more than one, the result of the trailing behavior judgment is non-existence; in response to the number of head and shoulder movement trajectories being at least two, a trailing risk behavior detection is performed; in response to the existence of at least two trailing risk behaviors, the result of the trailing behavior judgment is existence.
[0106] Step 205: In response to the result of the tailgating behavior determination being existence, a tailgating warning is issued.
[0107] Among them, the forms of tailgating warning include at least one of the following: sound alarm, light warning, and early closure of the gate.
[0108] In the above-mentioned gate tailgating detection method, by acquiring the three-dimensional data of the human head and shoulders and optimizing the YOLOX target detection model, the depth information is used to improve the detection accuracy, reduce the interference of objects on human features, reduce the occurrence of false detection and missed detection, and improve the accuracy of tailgating detection; at the same time, based on the target trajectory analysis, the tailing behavior can be judged in time during the passage process and a warning can be issued, thereby realizing real-time and accurate tailing behavior warning.
[0109] In one embodiment, obtaining human head and shoulder data to obtain a human three-dimensional data set includes:
[0110] Obtaining human head and shoulder data through a binocular lens disposed on the top of the gate, wherein the human head and shoulder data includes a binocular image of a human head and shoulder target;
[0111] Based on the human key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain the two-dimensional pixel coordinates of the head and shoulder, and the disparity values of the same head and shoulder key points are obtained;
[0112] Calibrate the binocular lens to obtain camera intrinsic parameters and camera extrinsic parameters;
[0113] Obtaining a depth value of each of the head and shoulder key points according to the camera intrinsic parameters, the camera extrinsic parameters and the disparity value;
[0114] According to the two-dimensional pixel coordinates of the head and shoulders, combined with the depth value, three-dimensional human head and shoulders information is obtained;
[0115] The three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
[0116] Specifically, this embodiment obtains three-dimensional information of the head and shoulder area through a binocular camera, which is more accurate than traditional two-dimensional image detection, and can effectively separate head and shoulder targets of different depths to avoid misjudgment due to occlusion; at the same time, by calibrating the internal and external parameters of the binocular camera, the accuracy of the depth information can be guaranteed, the reliability of the three-dimensional information is enhanced, and the system errors caused by hardware differences are reduced.
[0117] In one embodiment, the YOLOX target detection model is optimized and combined with the human body three-dimensional data set to construct a head and shoulder three-dimensional detection model, including:
[0118] Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head.
[0119] Based on the YOLOX loss function, the loss function of depth information is added to obtain the 3D detection loss function;
[0120] Obtaining a YOLOX extended model according to the three-dimensional detection decoupling head and the three-dimensional detection loss function;
[0121] Performing data processing according to the human body three-dimensional data set to obtain a training data set and a test data set;
[0122] The YOLOX extended model is trained and optimized through the training data set, and the detection performance is evaluated through the test data set;
[0123] In response to the detection performance evaluation result being excellent, the YOLOX extended model is deployed to the edge device to obtain a head and shoulder three-dimensional detection model.
[0124] Specifically, this embodiment introduces a network branch of three-dimensional information and combines depth information with the YOLOX model, thereby improving the detection capability of head and shoulder targets in complex scenes, especially in the case of dense traffic of multiple people, and can more accurately distinguish different targets; at the same time, a loss function of depth information is added, so that the model not only pays attention to the two-dimensional features of the target, but also considers the three-dimensional depth of the target, which can better distinguish different targets and reduce the false detection rate.
[0125] In one embodiment, the original decoupling head is modified to add a network branch of depth information to obtain a three-dimensional detection decoupling head, further comprising:
[0126] The information output by the original decoupling head includes: cls, which indicates the category of the target box, including N dimensions, where N is the number of categories; obj, which is used to determine whether the target box is foreground or background, including 1 dimension; Reg, which indicates the coordinate information of the target box, recorded as (x, y, w, h), where x is the horizontal coordinate of the upper left pixel of the target box in the image, y is the vertical coordinate value of the upper left pixel of the target box in the image, w is the pixel width of the target box, and h is the pixel height of the target box;
[0127] On the basis of the original decoupling head, the target category is set to 1, and a network branch of depth information is added, set to depth, which is used to represent the depth information of the human head and shoulders, denoted as (z l ,z h ,z r ), z l Indicates the longitudinal distance from the left shoulder of the human body to the detection position, z h represents the longitudinal distance from the center of the head to the detection position, z r Indicates the longitudinal distance from the right shoulder of the human body to the detection position;
[0128] Based on the YOLOX loss function, depth information is added to obtain the 3D detection loss function, which further includes:
[0129] The three-dimensional detection loss function is:
[0130] Loss = Loss_reg + Loss_obj + Loss_cls + Loss_depth, where Loss is the 3D detection loss function; Loss_reg represents the loss function of the detection position, which has two forms: iou_loss and giou_loss; Loss_obj represents the confidence of the target box, which is used to distinguish between target information and background information; Loss_cls represents the category score of the target, and Loss_depth represents the loss function of the depth information;
[0131] The calculation formula of the loss function of the depth information is:
[0132]
[0133] , where z represents the true depth value, satisfying z=(z l ,z h ,z r ); Represents the predicted depth value, satisfying in, Indicates the predicted longitudinal distance from the left shoulder of the human body to the detection position, represents the predicted longitudinal distance from the center of the head to the detection position, Represents the predicted longitudinal distance from the right shoulder of the human body to the detection position; δ is a hyperparameter used to control the smoothness of the loss function.
[0134] Specifically, this embodiment transforms the YOLOX decoupling head and adds a network branch of depth information, so that the model can not only output the category and position of the target, but also output the depth information at the same time, which can make the detection results richer and more accurate; in addition, the depth information loss function is introduced to make the optimization direction of the model more diversified and enhance the adaptability to three-dimensional scenes, especially in the case of occlusion or poor viewing angle, it can still accurately judge the three-dimensional information of the target, which is conducive to reducing the interference of objects on human features and reducing the occurrence of false detection and missed detection.
[0135] In one embodiment, the YOLOX extended model is trained and optimized by the training data set, and the detection performance is evaluated by the test data set, further comprising:
[0136] The YOLOX extended model is inferred using the test data set to obtain target detection results and depth prediction results;
[0137] Based on the target detection result, target detection index calculation is performed to obtain a target detection evaluation result, wherein the target detection index is used to evaluate the detection accuracy and precision of the model for the head and shoulder target, and the target detection index calculation content includes at least one of the following: average accuracy, precision and recall rate, F1-score, intersection-over-union ratio, missed detection rate and false detection rate;
[0138] Based on the depth prediction result, a depth prediction index is calculated to obtain a depth prediction evaluation result, wherein the depth prediction index is used to evaluate the prediction accuracy of the model for the depth information of the head and shoulder target, and the calculation content of the depth prediction index includes at least one of the following: mean absolute error, root mean square error, mean relative error, logarithmic root mean square error, and scale invariant error;
[0139] The target detection evaluation result and the depth prediction evaluation result are combined to perform a consistency check, wherein the purpose of the consistency check is to ensure that the model achieves excellent performance in both target detection and depth prediction, and that the results of the two are consistent in spatial position and logic. The content of the consistency check includes at least one of the following: detection and depth matching, spatial position consistency, error correlation analysis, and comprehensive scoring.
[0140] In response to the consistency check result being consistent, the detection performance evaluation result is excellent.
[0141] Specifically, this embodiment trains and evaluates the YOLOX extended model through the coordination of training data sets and test data sets, which can ensure the stability of the model optimization process and improve the detection accuracy and robustness of the model; in addition, through the combination of target detection results and depth prediction results, the consistency check ensures the overall performance of the detection model. Only when the two-dimensional and three-dimensional detection results are consistent, the evaluation results are considered to be excellent, which further improves the reliability of the model.
[0142] In one embodiment, real-time images are acquired, and based on the head-shoulder three-dimensional detection model, head-shoulder target validity judgment is performed, including:
[0143] Acquire a real-time image, wherein the real-time image includes a left view of a human body and a right view of a human body;
[0144] Based on the head and shoulder three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulder target, wherein the real-time data of the head and shoulder target includes at least one of the following: the depth difference between the left and right shoulders of the human body and the depth difference between the head and shoulder;
[0145] Based on the real-time data of the head and shoulders target, make a head and shoulders rationality judgment and a head and shoulders continuity judgment;
[0146] The rationality judgment of the head and shoulders includes:
[0147] Set the depth difference thresholds of the left and right shoulders and the head and shoulders of the human body;
[0148] Perform a left-right shoulder check and comparison on the left-right shoulder depth difference of the human body and the left-right shoulder depth difference threshold of the human body, and in response to the left-right shoulder depth difference of the human body not exceeding the left-right shoulder depth difference threshold of the human body, the left-right shoulder check and comparison result is passed;
[0149] Performing a head-shoulder verification comparison on the human head-shoulder depth difference and the human head-shoulder depth difference threshold, and in response to the human head-shoulder depth difference not exceeding the human head-shoulder depth difference threshold, the head-shoulder verification comparison result is passed;
[0150] In response to the left and right shoulder verification comparison results and the head and shoulder verification comparison results both being passed, the result of the head and shoulder rationality judgment is passed;
[0151] The head and shoulders continuity judgment includes:
[0152] According to the real-time data of the head and shoulder target, a number of head and shoulder detection points are extracted, and a number of head and shoulder movement trajectories are generated;
[0153] Tracking a number of the head and shoulder monitoring points through a multi-target tracking method to generate a head and shoulder movement trajectory;
[0154] Set the minimum distance for head and shoulders movement;
[0155] In response to the head-shoulder movement trajectory being continuous and the starting distance of the head-shoulder movement trajectory exceeding the head-shoulder movement minimum distance, the head-shoulder continuity judgment result is passed;
[0156] In response to both the head-shoulder rationality judgment result and the head-shoulder continuity judgment result being passed, the result of the head-shoulder target validity judgment is valid.
[0157] Specifically, this embodiment can filter out invalid head and shoulder information (such as luggage, object obstruction, etc.) by analyzing the left and right depth difference of the head and shoulders and the rationality and continuity of the head and shoulders, thereby ensuring that the detection results are more accurate; at the same time, through the continuity judgment of the head and shoulder movement trajectory, the behavior trajectory of the target in the passage can be effectively identified, further reducing false detection and missed detection caused by temporary occlusion of the target.
[0158] In one embodiment, in response to the result of the head-shoulder target validity judgment being valid, a trailing behavior judgment is performed based on the target trajectory analysis, including:
[0159] In response to the result of the head-shoulder target validity judgment being valid, extracting all valid head-shoulder targets and obtaining the head-shoulder movement trajectory;
[0160] In response to the number of the head and shoulder movement tracks being no more than one, the result of the trailing behavior determination is that there is no trailing behavior;
[0161] In response to the number of the head and shoulder movement tracks being at least two, performing a tailing risk behavior detection;
[0162] In response to the three-dimensional space distance between the plurality of head and shoulder movement trajectories being too close, the plurality of head and shoulder targets have a trailing risk behavior of being located adjacent to each other;
[0163] In response to the fact that the time difference between the starting points of the plurality of head and shoulder moving trajectories is too small and the moving speeds are close, the plurality of head and shoulder targets have a tailing risk behavior of synchronously starting and following the movement;
[0164] In response to the fact that the end positions of the plurality of head-shoulder movement trajectories are close and the arrival time at the end points is close, the plurality of head-shoulder targets have a tailgating risk behavior of arriving at the gate synchronously;
[0165] In response to the existence of at least two of the tailgating risk behaviors, the result of the tailgating behavior judgment is existence.
[0166] Specifically, this embodiment can accurately determine whether there is a tailgating behavior by comprehensively analyzing multiple factors such as the three-dimensional spatial distance between the head and shoulder targets, the starting time difference, the moving speed, and the end point position. By combining multiple conditions, the accuracy of the judgment is improved and misjudgment under simple conditions is avoided. At the same time, in complex scenarios where multiple people pass at the same time, the tailgating risk detection can accurately determine whether there is a tailgating behavior by analyzing the dynamic relationship between multiple targets, thereby improving the robustness of the system in practical applications.
[0167] It should be understood that although Figure 2 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 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0168] In one embodiment, Figure 3 As shown, a gate tailgating detection device is provided, including: a data acquisition module, a model generation module, a head-shoulder target validity judgment module, a tailgating behavior judgment module and a tailgating alarm module, wherein:
[0169] A data acquisition module is used to obtain the head and shoulder data of the human body to obtain a three-dimensional data set of the human body;
[0170] A model generation module is used to optimize the YOLOX target detection model and build a head and shoulder 3D detection model in combination with the human 3D data set;
[0171] A head-shoulder target validity judgment module is used to obtain real-time images and perform head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model;
[0172] A following behavior judgment module, configured to respond to the result of the head-shoulder target validity judgment being valid, and to perform a following behavior judgment based on target trajectory analysis;
[0173] The tailgating warning module is used to issue a tailgating warning in response to the result of the tailgating behavior judgment being present.
[0174] In one embodiment, the data acquisition module obtains human head and shoulder data through a binocular lens arranged on the top of the gate, wherein the human head and shoulder data includes a binocular image of a human head and shoulder target; based on a human key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain two-dimensional pixel coordinates of the head and shoulders, and the disparity values of the same head and shoulder key points are obtained; the binocular lens is calibrated to obtain camera intrinsic parameters and camera extrinsic parameters; according to the camera intrinsic parameters, the camera extrinsic parameters and the disparity value, the depth value of each head and shoulder key point is obtained; according to the two-dimensional pixel coordinates of the head and shoulders, combined with the depth value, three-dimensional human head and shoulder information is obtained; the three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
[0175] In one embodiment, the model generation module is modified based on the original decoupling head, adding a network branch of depth information to obtain a three-dimensional detection decoupling head; based on the YOLOX loss function, the loss function of depth information is added to obtain a three-dimensional detection loss function; according to the three-dimensional detection decoupling head and the three-dimensional detection loss function, a YOLOX extended model is obtained; according to the three-dimensional human body data set, data processing is performed to obtain a training data set and a test data set; the YOLOX extended model is trained and optimized through the training data set, and the detection performance is evaluated through the test data set; in response to the detection performance evaluation result being excellent, the YOLOX extended model is deployed to the edge device to obtain a head and shoulder three-dimensional detection model.
[0176] In one embodiment, the model generation module is also used to perform detection performance evaluation; the YOLOX extended model is inferred through the test data set to obtain target detection results and depth prediction results; based on the target detection results, target detection indicators are calculated to obtain target detection evaluation results; based on the depth prediction results, depth prediction indicators are calculated to obtain depth prediction evaluation results; the target detection evaluation results and the depth prediction evaluation results are combined to perform a consistency check, and in response to the consistency check result being consistent, the detection performance evaluation result is excellent.
[0177] In one embodiment, the head and shoulders validity judgment module is used to obtain a left view and a right view of a human body; based on the head and shoulders three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulders target; according to the real-time data of the head and shoulders target, a head and shoulders rationality judgment and a head and shoulders continuity judgment are performed; in response to the head and shoulders rationality judgment result and the head and shoulders continuity judgment result both being passed, the result of the head and shoulders target validity judgment is valid.
[0178] In one embodiment, in response to the result of the validity judgment of the head and shoulder target being valid, the tailing behavior judgment module extracts all valid head and shoulder targets and obtains the head and shoulder movement trajectory; in response to the number of the head and shoulder movement trajectories being no more than one, the result of the tailing behavior judgment is non-existence; in response to the number of the head and shoulder movement trajectories being at least two, tailing risk behavior detection is performed; in response to the three-dimensional spatial distance between several of the head and shoulder movement trajectories being too close, several of the head and shoulder targets have tailing risk behaviors of being located adjacent to each other; in response to the starting time difference of several of the head and shoulder movement trajectories being too small and the moving speeds being similar, several of the head and shoulder targets have tailing risk behaviors of starting synchronously and following each other; in response to the end point positions of several of the head and shoulder movement trajectories being close and the arrival time at the end point being close, several of the head and shoulder targets have tailing risk behaviors of arriving at the gate synchronously; in response to at least two of the tailing risk behaviors, the result of the tailing behavior judgment is existence.
[0179] The specific definition of the gate tailgating detection device can be found in the definition of the gate tailgating detection method above, which will not be repeated here. Each module in the above gate tailgating detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above 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.
[0180] 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 4 As shown. The computer device includes a processor, a memory, a network interface and a database 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 gate tailgating detection data. 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 gate tailgating detection method is implemented.
[0181] Those skilled in the art will understand that Figure 4 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.
[0182] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0183] Acquire human head and shoulder data to obtain a three-dimensional human data set;
[0184] The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset;
[0185] Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model;
[0186] In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis;
[0187] In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
[0188] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0189] Obtaining human head and shoulder data through a binocular lens disposed on the top of the gate, wherein the human head and shoulder data includes a binocular image of a human head and shoulder target;
[0190] Based on the human key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain the two-dimensional pixel coordinates of the head and shoulder, and the disparity values of the same head and shoulder key points are obtained;
[0191] Calibrate the binocular lens to obtain camera intrinsic parameters and camera extrinsic parameters;
[0192] Obtaining a depth value of each of the head and shoulder key points according to the camera intrinsic parameters, the camera extrinsic parameters and the disparity value;
[0193] According to the two-dimensional pixel coordinates of the head and shoulders, combined with the depth value, three-dimensional human head and shoulders information is obtained;
[0194] The three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
[0195] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0196] Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head.
[0197] Based on the YOLOX loss function, the loss function of depth information is added to obtain the 3D detection loss function;
[0198] Obtaining a YOLOX extended model according to the three-dimensional detection decoupling head and the three-dimensional detection loss function;
[0199] Performing data processing according to the human body three-dimensional data set to obtain a training data set and a test data set;
[0200] The YOLOX extended model is trained and optimized through the training data set, and the detection performance is evaluated through the test data set;
[0201] In response to the detection performance evaluation result being excellent, the YOLOX extended model is deployed to the edge device to obtain a head and shoulder three-dimensional detection model.
[0202] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0203] The YOLOX extended model is inferred using the test data set to obtain target detection results and depth prediction results;
[0204] Based on the target detection result, target detection index calculation is performed to obtain a target detection evaluation result, wherein the target detection index is used to evaluate the detection accuracy and precision of the model for the head and shoulder target, and the target detection index calculation content includes at least one of the following: average accuracy, precision and recall rate, F1-score, intersection-over-union ratio, missed detection rate and false detection rate;
[0205] Based on the depth prediction result, a depth prediction index is calculated to obtain a depth prediction evaluation result, wherein the depth prediction index is used to evaluate the prediction accuracy of the model for the depth information of the head and shoulder target, and the calculation content of the depth prediction index includes at least one of the following: mean absolute error, root mean square error, mean relative error, logarithmic root mean square error, and scale invariant error;
[0206] The target detection evaluation result and the depth prediction evaluation result are combined to perform a consistency check, wherein the purpose of the consistency check is to ensure that the model achieves excellent performance in both target detection and depth prediction, and that the results of the two are consistent in spatial position and logic. The content of the consistency check includes at least one of the following: detection and depth matching, spatial position consistency, error correlation analysis, and comprehensive scoring.
[0207] In response to the consistency check result being consistent, the detection performance evaluation result is excellent.
[0208] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0209] Acquire a real-time image, wherein the real-time image includes a left view of a human body and a right view of a human body;
[0210] Based on the head and shoulder three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulder target, wherein the real-time data of the head and shoulder target includes at least one of the following: the depth difference between the left and right shoulders of the human body and the depth difference between the head and shoulder;
[0211] Based on the real-time data of the head and shoulders target, make a head and shoulders rationality judgment and a head and shoulders continuity judgment;
[0212] The rationality judgment of the head and shoulders includes:
[0213] Set the depth difference thresholds of the left and right shoulders and the head and shoulders of the human body;
[0214] Perform a left-right shoulder check and comparison on the left-right shoulder depth difference of the human body and the left-right shoulder depth difference threshold of the human body, and in response to the left-right shoulder depth difference of the human body not exceeding the left-right shoulder depth difference threshold of the human body, the left-right shoulder check and comparison result is passed;
[0215] Performing a head-shoulder verification comparison on the human head-shoulder depth difference and the human head-shoulder depth difference threshold, and in response to the human head-shoulder depth difference not exceeding the human head-shoulder depth difference threshold, the head-shoulder verification comparison result is passed;
[0216] In response to the left and right shoulder verification comparison results and the head and shoulder verification comparison results both being passed, the result of the head and shoulder rationality judgment is passed;
[0217] The head and shoulders continuity judgment includes:
[0218] According to the real-time data of the head and shoulder target, a number of head and shoulder detection points are extracted, and a number of head and shoulder movement trajectories are generated;
[0219] Tracking a number of the head and shoulder monitoring points through a multi-target tracking method to generate a head and shoulder movement trajectory;
[0220] Set the minimum distance for head and shoulders movement;
[0221] In response to the head-shoulder movement trajectory being continuous and the starting distance of the head-shoulder movement trajectory exceeding the head-shoulder movement minimum distance, the head-shoulder continuity judgment result is passed;
[0222] In response to both the head-shoulder rationality judgment result and the head-shoulder continuity judgment result being passed, the result of the head-shoulder target validity judgment is valid.
[0223] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0224] In response to the result of the head-shoulder target validity judgment being valid, extracting all valid head-shoulder targets and obtaining the head-shoulder movement trajectory;
[0225] In response to the number of the head and shoulder movement tracks being no more than one, the result of the trailing behavior determination is that there is no trailing behavior;
[0226] In response to the number of the head and shoulder movement tracks being at least two, performing a tailing risk behavior detection;
[0227] In response to the three-dimensional space distance between the plurality of head and shoulder movement tracks being too close, the plurality of head and shoulder targets have a trailing risk behavior of being located adjacent to each other;
[0228] In response to the fact that the time difference between the starting points of the plurality of head and shoulder moving trajectories is too small and the moving speeds are close, the plurality of head and shoulder targets have a tailing risk behavior of synchronously starting and following the movement;
[0229] In response to the fact that the end positions of the plurality of head-shoulder movement trajectories are close and the arrival time at the end points is close, the plurality of head-shoulder targets have a tailgating risk behavior of arriving at the gate synchronously;
[0230] In response to the existence of at least two of the tailgating risk behaviors, the result of the tailgating behavior judgment is existence.
[0231] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0232] Acquire human head and shoulder data to obtain a three-dimensional human data set;
[0233] The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset;
[0234] Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model;
[0235] In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis;
[0236] In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
[0237] Those skilled 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 non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0238] The technical features of the above embodiments may be arbitrarily combined. 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.
[0239] 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 gate tailgating detection method, characterized in that: include: Acquire human head and shoulder data to obtain a three-dimensional human data set; The YOLOX target detection model is optimized, and a head and shoulder 3D detection model is constructed in combination with the human 3D dataset; Acquire real-time images and make head and shoulder target validity judgment based on the head and shoulder three-dimensional detection model; In response to the result of the head-shoulder target validity judgment being valid, performing a following behavior judgment based on target trajectory analysis; In response to the result of the tailgating behavior determination being that the tailgating behavior exists, a tailgating warning is issued.
2. A gate tailgating detection method according to claim 1, characterized in that: Obtain human head and shoulder data to obtain a 3D human data set, including: Acquire human head and shoulder data through a binocular lens disposed on the top of the gate, wherein the human head and shoulder data includes a binocular image of a human head and shoulder target; Based on the human body key point detection algorithm, the head and shoulder key points in the binocular image are extracted to obtain the two-dimensional pixel coordinates of the head and shoulder, and the disparity values of the same head and shoulder key points are obtained; Calibrate the binocular lens to obtain camera intrinsic parameters and camera extrinsic parameters; Obtaining a depth value of each of the head and shoulder key points according to the camera intrinsic parameters, the camera extrinsic parameters and the disparity value; According to the two-dimensional pixel coordinates of the head and shoulders, combined with the depth value, three-dimensional human head and shoulders information is obtained; The three-dimensional human head and shoulder information is integrated to obtain the three-dimensional human data set.
3. A gate tailgating detection method according to claim 1, characterized in that: The YOLOX target detection model is optimized and combined with the human body 3D dataset to build a head and shoulder 3D detection model, including: Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head. Based on the YOLOX loss function, the loss function of depth information is added to obtain the 3D detection loss function; Obtaining a YOLOX extended model according to the three-dimensional detection decoupling head and the three-dimensional detection loss function; Performing data processing according to the human body three-dimensional data set to obtain a training data set and a test data set; The YOLOX extended model is trained and optimized through the training data set, and the detection performance is evaluated through the test data set; In response to the detection performance evaluation result being excellent, the YOLOX extended model is deployed to the edge device to obtain a head and shoulder three-dimensional detection model.
4. A gate tailgating detection method according to claim 3, characterized in that: Based on the original decoupling head, the network branch with depth information is modified to obtain a 3D detection decoupling head, which further includes: The information output by the original decoupling head includes: cls, which indicates the category of the target box, including N dimensions, where N is the number of categories; obj, which is used to determine whether the target box is foreground or background, including 1 dimension; Reg, which indicates the coordinate information of the target box, recorded as (x, y, w, h), where x is the horizontal coordinate of the upper left pixel of the target box in the image, y is the vertical coordinate value of the upper left pixel of the target box in the image, w is the pixel width of the target box, and h is the pixel height of the target box; On the basis of the original decoupling head, the target category is set to 1, and a network branch of depth information is added, set to depth, which is used to represent the depth information of the human head and shoulders, denoted as (z l ,z h ,z r ), z l Indicates the longitudinal distance from the left shoulder of the human body to the detection position, z h represents the longitudinal distance from the center of the head to the detection position, z r Indicates the longitudinal distance from the right shoulder of the human body to the detection position; Based on the YOLOX loss function, depth information is added to obtain the 3D detection loss function, which further includes: The three-dimensional detection loss function is: Loss = Loss_reg + Loss_obj + Loss_cls + Loss_depth, where Loss is the 3D detection loss function; Loss_reg represents the loss function of the detection position, which has two forms: iou_loss and giou_loss; Loss_obj represents the confidence of the target box, which is used to distinguish between target information and background information; Loss_cls represents the category score of the target, and Loss_depth represents the loss function of the depth information; The calculation formula of the loss function of the depth information is: , Where z represents the real depth value, satisfying z=(z l ,z h ,z r ); Represents the predicted depth value, satisfying in, Indicates the predicted longitudinal distance from the left shoulder of the human body to the detection position, represents the predicted longitudinal distance from the center of the head to the detection position, Represents the predicted longitudinal distance from the right shoulder of the human body to the detection position; δ is a hyperparameter used to control the smoothness of the loss function.
5. A gate tailgating detection method according to claim 3, characterized in that: The YOLOX extended model is trained and optimized by the training data set, and the detection performance is evaluated by the test data set, further comprising: The YOLOX extended model is inferred using the test data set to obtain target detection results and depth prediction results; Based on the target detection result, a target detection index is calculated to obtain a target detection evaluation result; Based on the depth prediction result, a depth prediction index is calculated to obtain a depth prediction evaluation result; Combining the target detection evaluation result and the depth prediction evaluation result to perform a consistency check; In response to the consistency check result being consistent, the detection performance evaluation result is excellent.
6. A gate tailgating detection method according to claim 1, characterized in that: Acquire a real-time image and make a head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model, including: Acquire a real-time image, wherein the real-time image includes a left view of a human body and a right view of a human body; Based on the head and shoulder three-dimensional detection model, the left view and the right view of the human body are analyzed and detected to obtain real-time data of the head and shoulder target, wherein the real-time data of the head and shoulder target includes at least one of the following: the depth difference between the left and right shoulders of the human body and the depth difference between the head and shoulder; Based on the real-time data of the head and shoulders target, make a head and shoulders rationality judgment and a head and shoulders continuity judgment; The rationality judgment of the head and shoulders includes: Set the depth difference thresholds of the left and right shoulders of the human body and the depth difference thresholds of the head and shoulders; Perform a left-right shoulder check and comparison on the left-right shoulder depth difference of the human body and the left-right shoulder depth difference threshold of the human body, and in response to the left-right shoulder depth difference of the human body not exceeding the left-right shoulder depth difference threshold of the human body, the left-right shoulder check and comparison result is passed; Performing a head-shoulder verification comparison on the human head-shoulder depth difference and the human head-shoulder depth difference threshold, and in response to the human head-shoulder depth difference not exceeding the human head-shoulder depth difference threshold, the head-shoulder verification comparison result is passed; In response to the left and right shoulder verification comparison results and the head and shoulder verification comparison results both being passed, the result of the head and shoulder rationality judgment is passed; The head and shoulders continuity judgment includes: According to the real-time data of the head and shoulder target, a number of head and shoulder detection points are extracted, and a number of head and shoulder movement trajectories are generated; Tracking a number of the head and shoulder monitoring points through a multi-target tracking method to generate a head and shoulder movement trajectory; Set the minimum distance for head and shoulders movement; In response to the head-shoulder movement trajectory being continuous and the starting distance of the head-shoulder movement trajectory exceeding the head-shoulder movement minimum distance, the head-shoulder continuity judgment result is passed; In response to both the head-shoulder rationality judgment result and the head-shoulder continuity judgment result being passed, the result of the head-shoulder target validity judgment is valid.
7. A gate tailgating detection method according to claim 6, characterized in that: In response to the result of the head-shoulder target validity judgment being valid, a trailing behavior judgment is performed based on the target trajectory analysis, including: In response to the result of the head-shoulder target validity judgment being valid, extracting all valid head-shoulder targets and obtaining the head-shoulder movement trajectory; In response to the number of the head and shoulder movement tracks being no more than one, the result of the trailing behavior determination is that there is no trailing behavior; In response to the number of the head and shoulder movement tracks being at least two, performing a tailing risk behavior detection; In response to the three-dimensional space distance between the plurality of head and shoulder movement trajectories being too close, the plurality of head and shoulder targets have a trailing risk behavior of being located adjacent to each other; In response to the fact that the time difference between the starting points of the plurality of head and shoulder moving trajectories is too small and the moving speeds are close, the plurality of head and shoulder targets have a tailing risk behavior of synchronously starting and following the movement; In response to the fact that the end positions of the plurality of head-shoulder movement trajectories are close and the arrival time at the end points is close, the plurality of head-shoulder targets have a tailgating risk behavior of arriving at the gate synchronously; In response to the existence of at least two of the tailgating risk behaviors, the result of the tailgating behavior judgment is existence.
8. A gate tailing detection device, characterized in that: The device comprises: A data acquisition module is used to obtain the head and shoulder data of the human body to obtain a three-dimensional data set of the human body; A model generation module is used to optimize the YOLOX target detection model and build a head and shoulder 3D detection model in combination with the human 3D data set; A head-shoulder target validity judgment module is used to obtain real-time images and perform head-shoulder target validity judgment based on the head-shoulder three-dimensional detection model; A following behavior judgment module, configured to respond to the result of the head-shoulder target validity judgment being valid, and to perform a following behavior judgment based on target trajectory analysis; The tailgating warning module is used to issue a tailgating warning in response to the result of the tailgating behavior judgment being present.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: 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.