Anti-intrusion system based on face recognition and method thereof
Through the use of face -based anti -invasion systems in the construction site and other places, the use of drone and face recognition technology to solve the problem of low prevention and invasion efficiency in existing technologies and the monitoring of blind spots in existing technologies. Invasion monitoring.
Patent Information
- Application Number
- CN202411445431.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the anti-invasion measures in construction sites, factory parks and other places are inefficient and consume a lot of manpower and material resources. Surveillance cameras are prone to blind spots and it is difficult to effectively prevent illegal invasion.
Using face -based anti -invasion system, obtaining the detection pictures within the venue through drones, using human characteristic models and face recognition technology to determine whether there are illegal intruders, and control the drone to track and alarm.
The monitoring without dead ends, avoiding monitoring blind spots, improving the efficiency of invasion, reducing human and material investment, and being able to identify and deal with illegal invasion in a timely manner.
Smart Images

Figure CN119380469A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security protection, and in particular to an anti-intrusion system and method based on face recognition. Background Art
[0002] At present, for some specific places, such as construction sites, factory parks, manors and other places, surveillance cameras are often installed in multiple micro-public places. This is a large expense for the place, and the cameras are generally installed in fixed positions for monitoring, or a large angle of monitoring is achieved through a pan-tilt system. However, these monitoring methods are all passive monitoring, and foreign intruders can easily find the blind spots of the cameras, thereby avoiding monitoring and committing crimes. In addition, ground control is also carried out through manual patrols. These two control methods are not only inefficient, but also consume a lot of manpower and material resources. Summary of the invention
[0003] In order to solve the above problems existing in the prior art, the present invention proposes the following technical solutions:
[0004] In the first aspect, the present invention provides an anti-intrusion system based on face recognition, comprising: an acquisition unit for acquiring a detection image in a venue; a first judgment unit for judging whether there is a human body in the detection image; a second judgment unit for judging whether the human body has a face; a face recognition unit for performing face recognition on the face; a third judgment unit for judging whether the human body is an illegal intruder based on the recognition result of the face recognition unit; and an alarm unit for sending an alarm signal to drive away the human body when it is judged to be an illegal intruder, and at the same time sending the real-time positioning of the human body and the alarm signal to the mobile terminal.
[0005] A second aspect: The present invention provides an anti-intrusion method based on face recognition, comprising the following steps:
[0006] S1, using drones to obtain detection images within the scene;
[0007] S2, determining whether there is a human body in the detection image;
[0008] S3, determining whether the human body has a face, if yes, proceeding to step S4, otherwise determining that the human body is an illegal intrusion;
[0009] S4, performing face recognition on the face;
[0010] S5, determining whether the human body is illegally intruding;
[0011] S6, if the person is an illegal intruder, the drone is controlled to track him and issue an alarm.
[0012] Preferably, step S1 includes: obtaining a real-time video stream through a camera set on the drone, parsing the real-time video stream to obtain a picture to be analyzed, the picture to be analyzed includes an intra-frame coded frame and a predictive coded frame, and obtaining an optical flow component value of the picture to be analyzed; if the optical flow component value of the picture to be analyzed is greater than a first preset threshold, selecting the picture to be analyzed as a detection picture.
[0013] Preferably, step S2 includes: collecting human image samples and non-human image samples, classifying, labeling and training them, and obtaining a human feature model; using k different rectangular frames to nominate on the convolutional feature layer of the detection image, and screening out candidate areas where human bodies may exist, where k is a positive integer; extracting human features from the candidate areas respectively; using the human feature model to classify and regress the features, and identify whether there is a human body in the detection image; if it is identified that there is a human body in the detection image, performing border position regression processing on the human body to obtain a human body frame.
[0014] Preferably, step S3 includes: performing vertical Y-direction integration on the human body silhouette to obtain a projection histogram; searching the projection histogram downward from the top of the human head, using the first local minimum point as the dividing point between the head and the torso, segmenting the head and torso of the detected human body according to the dividing point, performing skin color-based face detection on the head area image, and judging whether the human body has a face based on the face detection.
[0015] Preferably, step S4 includes: loading a local face library and feature vectors; normalizing the face image to an angle that conforms to the feature extraction of the face image; marking the characteristic parts of the face used for face recognition, accurately calibrating the position and size of the face in the image, and screening key features, and using the features as a benchmark to extract and preprocess the features in a targeted manner; using geometric correction, median filtering, sharpening, and standardized face images with the same grayscale value range; calculating the Euclidean distance between the key features and the feature vectors in the local face library, and performing threshold determination.
[0016] Preferably, the step S5 comprises: when all Euclidean distances are greater than a threshold, determining that the human body is an illegal intrusion.
[0017] Preferably, step S6 includes: when it is determined that a human body is illegally intruding, controlling the drone to track the human body and obtain the real-time location of the human body, sending an alarm signal through the broadcast on the drone to drive it away, and at the same time sending the real-time location of the human body and the alarm signal to the mobile terminal.
[0018] The beneficial effects of the present invention are:
[0019] By using drones instead of manual patrols, when a person is detected in the venue, facial recognition is performed to determine whether the person is an internal staff member or a person allowed to enter the venue. When the person is identified as an illegal intruder, the drone is controlled to track the person and obtain the real-time location of the person, and an alarm signal is sent through the drone's broadcast to drive the person away. At the same time, the real-time location and alarm signal of the person are sent to the mobile terminal. In this way, the use of fixed cameras can be reduced, and the drone can take full-angle photos of the venue during the patrol process to avoid blind spots in monitoring. In addition, using drones instead of ground personnel to patrol can not only improve patrol efficiency but also greatly reduce the investment in manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flow chart of an anti-intrusion method based on face recognition provided by an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of an anti-intrusion system based on face recognition provided by another embodiment of the present invention;
[0022] Figure 3 A schematic diagram of the detection model training process provided by an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of a specific implementation flow of step S1 in an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of a specific implementation process of step S2 in an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of the specific implementation process of steps S4-S5 of an embodiment of the present invention. DETAILED DESCRIPTION
[0026] See also Figure 1 , which is a flow chart of an anti-intrusion method based on face recognition provided by an embodiment of the present invention. As can be seen from the figure, it includes the following steps:
[0027] S1, using drones to obtain detection images within the scene;
[0028] The drones conduct circular patrols in construction sites, factory parks, military bases, estates and other places along pre-set routes, and obtain real-time video streams in the sites through cameras installed on the drones.
[0029] See also Figure 4 ,The camera obtains real-time video stream, and the processor parses the real-time video stream to obtain the picture to be analyzed.
[0030] Generally, there are three types of coded frames in a video stream: intra-coded frames (I frames), predictive coded frames (P frames), and bidirectional coded frames (B frames). I frames use only the spatial correlation of the frame for video compression, P frames use forward reference frames for temporal domain predictive coding, and B frames use forward and backward bidirectional reference frames for temporal domain predictive coding. Usually, I frames have a low compression ratio, slightly better image quality, and are the basis of P frames and B frames, so I frames should be selected for analysis first, followed by P frames that contain more information. Since the time difference between two adjacent I frames is relatively long, several P frames should also be selected between two adjacent I frames as images to be analyzed to prevent key information from being missed.
[0031] Furthermore, the optical flow component value of the image to be analyzed is obtained.
[0032] This example uses the change of pixels in the image sequence in the time domain and the correlation between adjacent frames to find the corresponding relationship between the previous frame and the current frame, thereby calculating the motion information of the object between adjacent frames. The optical flow field is to find the movement speed and direction of each pixel in the image through a picture sequence. This embodiment obtains the optical flow component value of the picture to be analyzed by using the sparse optical flow calculation method: In the formula, is the optical flow component value, which indicates the movement offset of the corner point in the x direction. The larger the value, that is, the larger the motion offset in the x direction, the larger the difference between the two frames of images. If the optical flow component value of the image to be analyzed is greater than the first preset threshold, the image to be analyzed is selected as the detection image.
[0033] In the specific implementation, the first preset threshold is set to 1.2. If the optical flow component value of the image to be analyzed is greater than 1.2, it is determined that the difference between the image to be analyzed and the previous frame image is large. In order to avoid omissions in the detection results, the image to be analyzed should be selected as the detection image for the next step of analysis.
[0034] It should be noted that those skilled in the art can also determine the difference between the image to be analyzed and the previous frame image by obtaining the motion offset of the image in the y direction, and select the image to be analyzed by themselves, thereby improving both the accuracy and efficiency of detection.
[0035] S2, determining whether there is a human body in the detection image;
[0036] See also Figure 3 ,In the specific implementation, it is necessary to train the human ,feature model.
[0037] Collect human image samples and non-human image samples, classify, label and train them to obtain human feature models. Collect a large number of human image samples and non-human image samples, use special tools to label them, and divide them into training samples and test samples. The training samples are used to train the parameters of the model, and the test samples are used to test the effect of the model. This example uses 20,000 human image samples and non-human image samples, and uses the ImgLabel tool to label the areas and categories. Divide them into training set and test set in a ratio of 7:3.
[0038] See also Figure 5 , k different rectangular boxes are used to nominate on the convolutional feature layer of the detection image to screen out candidate areas where human bodies may exist, where k is a positive integer.
[0039] Furthermore, human body features are extracted from the candidate regions respectively.
[0040] In the specific implementation, the extracted image features mainly include: image texture features, edge features and motion features. (1) Texture features mainly include the grayscale histogram, edge direction histogram, grayscale co-occurrence matrix, etc. (2) Edge features directly show the outline of the image, mainly including the perimeter, area, aspect ratio (principal axis ratio), dispersion, compactness, etc. (3) Motion features are related to motion behavior, generally including motion center of mass, speed, displacement, gradient, etc.
[0041] In the specific implementation, the entire image is input and the Darknet51 network is used to automatically obtain the features of the image.
[0042] The features are classified and regressed using a human feature model to identify whether the detection image contains a human body; if it is identified that the detection image contains a human body, a frame position regression process is performed on the human body to obtain a human body frame.
[0043] In the specific implementation, the Feature Map after feature extraction is classified into two categories to determine whether it contains a human body, and then k regression models (each corresponding to a different Anchor Box) are used to adjust the position and size of the candidate box, and finally the human body is classified.
[0044] In this example, the model further processes the predicted values of the bounding boxes of each Feature in the Feature Map (the relative coordinates of the center point and the relative width and height of the box) to obtain the actual values. The predicted center coordinates are normalized using the sigmoid function, and the actual coordinates are obtained by adding the offset value of the current Feature relative to the upper left corner of the image. The predicted object width and height are normalized using the exp function, and then multiplied by the width and height of the prior box corresponding to the current Anchor Box to obtain the actual width and height. The width and height of the prior box corresponding to each Anchor Box can be obtained by clustering the data set.
[0045] This embodiment uses the detection and classification model and GPU to determine whether each area contains a specific type of target. The detection model is Darknet, and the classifier is the YOLOV3 model based on the focal loss function. The detected human body is then processed by the frame position regression post-processing operation to obtain the final human body frame.
[0046] S3, determining whether the human body has a face.
[0047] This embodiment performs vertical Y-direction integration on the human body silhouette to obtain a projection histogram; the projection histogram is searched downward from the top of the human head, and the first local minimum point is used as the dividing point between the head and the torso. The head and torso of the detected human body are segmented according to the dividing point, and face detection based on skin color is performed on the head area image, and whether the human body has a face is determined based on the face detection.
[0048] This embodiment uses a color segmentation method to perform skin color-based face detection on the head area image. Since there are certain distribution characteristics between the face color and the background color, that is, the difference between the face skin color and the background color, the distribution of skin color in the background and the edge rule can be used to detect the face. Usually, there is a certain difference between the skin color of the face and the background, and the color range of the face skin has a certain color area, such as the shape of the face is approximately oval; and the face is located in a certain area of the photo, and the skin color is relatively balanced. Therefore, when the picture contains a face, the color block belonging to the face can be determined based on the color area; and due to the difference in color between the face and the background, the edge of the face can be roughly determined.
[0049] S4, performing face recognition on the face.
[0050] See also Figure 6 In this embodiment, before performing face recognition, a local face database is first established, recent face images of staff members are collected in advance to establish the local face database, features are extracted from the face images in the local face database, and then the local face database and the face features in the face database are stored.
[0051] In the embodiment of the present invention, the face recognition process mainly includes six parts: loading database, face correction, feature characterization, data preprocessing, feature extraction, and similarity comparison.
[0052] Specifically:
[0053] Load database – load local face library labels and feature vectors into the face recognition model;
[0054] Face normalization: Input the captured face image into the model. The model first detects the face in the image, normalizes the face, and performs 3D rotation on the side face. The face image is normalized to an angle that meets the feature extraction of the face image.
[0055] Feature characterization: After face correction, the model characterizes the features on the face; the model marks the characteristic parts of the face used for face recognition, accurately calibrates the position and size of the face in the image, selects key features, and uses the features as a benchmark to extract and preprocess the features in a targeted manner;
[0056] Data preprocessing: Since the human face has quite complex details and the environment will have a great impact on face recognition, the light compensation, grayscale transformation, histogram equalization, and normalization of the face image are performed to obtain the same size, and geometric correction, median filtering, sharpening, and standardized face images with the same grayscale value range are used;
[0057] Feature extraction - using convolutional neural networks to learn face images into 128-dimensional feature vectors;
[0058] Similarity comparison - calculate the Euclidean distance between the key features and the feature vectors in the local face library, and make threshold decisions.
[0059] S5, determining whether the human body is illegally intruding.
[0060] See also Figure 6 , compare the 128-dimensional feature vector of the face with the feature vector in the local database, calculate the Euclidean distance, and make a threshold judgment. When the Euclidean distance is less than the threshold, it is judged that the person is not an illegal intruder; if all Euclidean distances are greater than the threshold, the person is judged as an illegal intruder.
[0061] S6, if the person is an illegal intruder, the drone is controlled to track him and issue an alarm.
[0062] When a person is determined to be illegally intruding, the drone is controlled to track the person and obtain the real-time location of the person, and an alarm signal is sent through the drone's broadcast to drive the person away. At the same time, the real-time location of the person and the alarm signal are sent to the mobile terminal so that security personnel can understand the dynamic information of the intruder in a timely manner.
[0063] See also Figure 2 , which is a schematic diagram of an anti-intrusion system based on face recognition provided by an embodiment of the present invention; as shown in the figure, the system 100 includes: an acquisition unit 101, used to acquire a detection image in the venue; a first judgment unit 102, used to judge whether there is a human body in the detection image; a second judgment unit 103, used to judge whether the human body has a face; a face recognition unit 104, used to perform face recognition on the face; a third judgment unit 105, used to judge whether the human body is an illegal intruder according to the recognition result of the face recognition unit; an alarm unit 106, used to send an alarm signal to drive away the human body when it is determined that the human body is an illegal intruder, and at the same time send the real-time positioning of the human body and the alarm signal to the mobile terminal.
[0064] In one embodiment, the acquisition unit 101 acquires a real-time video stream through a camera set on a drone, parses the real-time video stream, obtains a picture to be analyzed, the picture to be analyzed includes an intra-coded frame and a predictive coded frame, and obtains an optical flow component value of the picture to be analyzed; if the optical flow component value of the picture to be analyzed is greater than a first preset threshold, the picture to be analyzed is selected as a detection picture.
[0065] In one embodiment, the first judgment unit 102 collects human image samples and non-human image samples, classifies, labels and trains them, and obtains a human feature model; uses k different rectangular boxes to nominate on the convolution feature layer of the detection image to screen out candidate areas where human bodies may exist, where k is a positive integer; extracts human features from the candidate areas respectively; uses the human feature model to classify and regress the features to identify whether there is a human body in the detection image.
[0066] In one embodiment, the second judgment unit 103 performs a vertical Y-direction integration on the human body silhouette to obtain a projection histogram; the projection histogram is searched downward from the top of the human head, and the first local lowest point is used as the dividing point between the head and the torso. The head and torso of the detected human body are segmented according to the dividing point, and face detection based on skin color is performed on the head area image, and whether the human body has a face is determined based on the face detection.
[0067] In one embodiment, the face recognition unit 104 loads a local face library and feature vectors; normalizes the face image to an angle that is consistent with the face image feature extraction; marks the feature parts of the face used for face recognition, accurately calibrates the position and size of the face in the image, and selects key features, and uses the features as a reference to extract and preprocess the features in a targeted manner; uses geometric correction, median filtering, sharpening, and standardized face images with the same grayscale value range; calculates the Euclidean distance between the key features and the feature vectors in the local face library, and performs threshold determination.
[0068] In one embodiment, the third judgment unit 105 compares the 128-dimensional feature vector of the face with the feature vector in the local database, calculates the Euclidean distance, and performs a threshold judgment. When the Euclidean distance is less than the threshold, it is determined that the human body is not an illegal intruder; if all Euclidean distances are greater than the threshold, the human body is determined to be an illegal intruder.
[0069] In one embodiment, the alarm unit 106 is used to control the drone to track the human body and obtain the real-time location of the human body when it is determined that the human body is illegally intruding, and to send an alarm signal through the broadcast on the drone to drive the human body away. At the same time, the real-time location of the human body and the alarm signal are sent to the mobile terminal so that security personnel can timely understand the dynamic information of the intruder.
[0070] The above is a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An anti-intrusion system based on face recognition, characterized in that: The system includes: an acquisition unit, which is used to acquire a detection image in the venue; a first judgment unit, which is used to judge whether there is a human body in the detection image; a second judgment unit, which is used to judge whether the human body has a face; a face recognition unit, which is used to perform face recognition on the face; a third judgment unit, which is used to judge whether the human body is an illegal intruder based on the recognition result of the face recognition unit; and an alarm unit, which is used to send an alarm signal to drive away the human body when it is determined that the human body is an illegal intruder, and at the same time send the real-time positioning of the human body and the alarm signal to the mobile terminal.
2. An anti-intrusion method based on face recognition, characterized in that: The following steps are involved: S1, using drones to obtain detection images within the scene; S2, determining whether there is a human body in the detection image; S3, determining whether the human body has a face, if yes, proceeding to step S4, otherwise determining that the human body is an illegal intrusion; S4, performing face recognition on the face; S5, determining whether the human body is illegally intruding; S6, if the person is an illegal intruder, the drone is controlled to track him and issue an alarm.
3. The anti-intrusion method based on face recognition as claimed in claim 2, characterized in that: The step S1 includes: obtaining a real-time video stream through a camera set on the drone, parsing the real-time video stream to obtain a picture to be analyzed, the picture to be analyzed includes an intra-frame coded frame and a predictive coded frame, and obtaining an optical flow component value of the picture to be analyzed; if the optical flow component value of the picture to be analyzed is greater than a first preset threshold, selecting the picture to be analyzed as a detection picture.
4. The anti-intrusion method based on face recognition as claimed in claim 3, characterized in that: The step S2 includes: collecting human image samples and non-human image samples, classifying, labeling and training them, and obtaining a human feature model; using k different rectangular frames to nominate on the convolution feature layer of the detection image, and screening out candidate areas where human bodies may exist, where k is a positive integer; extracting human body features from the candidate areas respectively; using the human feature model to classify and regress the features, and identify whether the detection image contains a human body; if it is identified that the detection image contains a human body, performing border position regression processing on the human body to obtain a human body frame.
5. The anti-intrusion method based on face recognition as claimed in claim 4, characterized in that: The step S3 includes: performing a vertical Y-direction integration on the human body silhouette to obtain a projection histogram; searching the projection histogram downward from the top of the human head, using the first local minimum point as the dividing point between the head and the torso, segmenting the head and torso of the detected human body according to the dividing point, performing skin color-based face detection on the head area image, and judging whether the human body has a face according to the face detection.
6. The anti-intrusion method based on face recognition as claimed in claim 5, characterized in that: The step S4 includes: loading a local face library and feature vectors; normalizing the face image to an angle that meets the feature extraction of the face image; marking the feature parts of the face used for face recognition, accurately calibrating the position and size of the face in the image, and screening key features, and using the features as a reference to extract and preprocess the features in a targeted manner; using geometric correction, median filtering, sharpening, and standardized face images with the same grayscale value range; calculating the Euclidean distance between the key features and the feature vectors in the local face library, and performing threshold determination.
7. The anti-intrusion method based on face recognition as claimed in claim 6, characterized in that: The step S5 includes: when all Euclidean distances are greater than a threshold, determining that the human body is an illegal intrusion.
8. The anti-intrusion method based on face recognition as claimed in claim 7, characterized in that: The step S6 includes: when it is determined that a human body is illegally intruding, controlling the drone to track the human body and obtain the real-time location of the human body, sending an alarm signal through the broadcast on the drone to drive it away, and at the same time sending the real-time location of the human body and the alarm signal to the mobile terminal.
Citation Information
Patent Citations
Unmanned plane automation detection target and tracking method
CN105447459A
Automatic identification method and alarm system for wearing state of work clothes and hats based on video
CN109117827A
Method, system and terminal for realizing wearing identification of safety helmet and computer readable storage medium
CN109670441A
Face recognition detection method and system based on mobile terminal edge calculation
CN111241975A
Human eye positioning method based on improved integral projection method
CN111860423A
Cited By
Unmanned aerial vehicle control method and system for real-time operation
CN121115829A
