Smart campus security management method and system based on face recognition

Through deep learning and three-dimensional face reconstruction technology combined with expression change perception mechanisms, the problem of monitoring blind spots and recognition accuracy in traditional campus security management is solved, real-time and accurate security monitoring and abnormal behavior analysis are achieved, and the level of campus security is improved.

CN118334559BActive Publication Date: 2024-10-15SHANDONG HAIBO INFORMATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410596788.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-10-15
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

The traditional campus security management method has problems such as large monitoring blind spots, slow response speed, and low recognition accuracy. Especially in terms of personnel patrols and equipment layout, it is difficult to meet the needs. Existing face recognition technology can be used under different lighting conditions, angles, and wearing of masks or glasses. Difficulty in identification.

Method used

The RetinaFace model based on deep learning is combined with 3D face reconstruction technology and expression change perception mechanism to detect and identify people on campus through real-time video stream acquisition and preprocessing, dynamically adjust the face detection threshold, and utilize 3D face reconstruction and isolation forest Algorithms perform abnormal behavior analysis and monitoring.

Benefits of technology

It improves the efficiency and accuracy of campus security management, promptly identifies authorized and unauthorized personnel, detects abnormal behaviors, enhances security prevention capabilities, reduces the subjectivity of human judgment, and adapts to the recognition needs under different expression states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FDA0005034075050000051
    Figure FDA0005034075050000051
  • Figure FDA0005034075050000052
    Figure FDA0005034075050000052
  • Figure FT_1
    Figure FT_1
Patent Text Reader

Abstract

The present invention relates to the field of campus management technology, and specifically to a smart campus security management method and system based on face recognition, comprising the following steps: obtaining real-time video streams of various areas in the campus; preprocessing the video streams; using a deep learning algorithm to detect and identify faces in the preprocessed video frames; pre-entering the face information of students and faculty members into a repository, and inputting the detection and recognition results in S3 into the repository for comparison; if an unauthorized person is detected, immediately triggering an alarm and recording relevant information; continuously analyzing the behavior trajectory of authorized personnel to identify abnormal trajectories; for the problem of differentiated recognition, using partial face information, using three-dimensional face reconstruction technology, reconstructing a semi-virtual three-dimensional face, and comparing the reconstructed semi-virtual three-dimensional face with the repository. The present invention further enhances the campus's security prevention capabilities by continuously analyzing the behavior trajectory of authorized personnel, timely discovering and responding to abnormal behaviors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of campus management, and in particular to a smart campus safety management method and system based on face recognition. Background Art

[0002] With the development of society, campus safety issues are increasingly attracting people's attention. Traditional campus safety management methods have a series of problems: large monitoring blind spots, slow response speed, low recognition accuracy, etc. Especially in terms of personnel patrols and monitoring equipment deployment, the model that relies on manpower and fixed equipment can no longer meet the needs of campus safety management. In addition, although the existing face recognition technology has improved in recognition accuracy, it still has problems such as slow recognition speed and difficulty in recognition under different lighting, angles, and wearing masks or glasses.

[0003] In summary, the smart campus security management method based on face recognition has important significance and broad application prospects in improving the level of campus security management, improving the efficiency and accuracy of security management, and preventing and responding to security incidents. Summary of the invention

[0004] Based on the above objectives, the present invention provides a smart campus security management method and system based on face recognition.

[0005] The smart campus security management method based on face recognition includes the following steps:

[0006] S1: Obtain real-time video streams of various areas on campus;

[0007] S2: pre-process the video stream;

[0008] S3: Use deep learning algorithms to detect and recognize faces in preprocessed video frames;

[0009] S4: pre-enter the facial information of students and faculty members into a repository, and input the detection and recognition results in S3 into the repository for comparison, wherein the pre-entered facial information is for authorized personnel;

[0010] S5: If an unauthorized person is detected, an alarm is triggered immediately and relevant information is recorded;

[0011] S6: Continuously analyze the behavior trajectory of authorized personnel to identify abnormal trajectories;

[0012] S7: To address the differentiated recognition problems caused by different lighting, angles, and when people wear masks or glasses, we use partial facial information and 3D face reconstruction technology to reconstruct a semi-virtual 3D face. The reconstructed semi-virtual 3D face is compared with the repository, and a similarity threshold is set. If it exceeds 80%, it is identified as an authorized person, and if it is less than 80%, it is identified as an unauthorized person.

[0013] Furthermore, the deep learning algorithm in S3 adopts the RetinaFace model, which is a target detection model based on a deep convolutional neural network. The RetinaFace model structure includes a backbone network and a detection head. The backbone network adopts a lightweight backbone network (such as MobileNet, ResNet) for extracting image features, and the detection head is responsible for predicting the position and category information of the face frame at different scales.

[0014] The RetinaFace model adopts a single-shot multi-frame detection architecture and performs face detection of different scales through multi-layer convolution and feature pyramid networks. On each feature map, the RetinaFace model simultaneously predicts a series of anchor boxes, and predicts the category and position of each box through classification branches and regression branches. The output of the RetinaFace model includes the face confidence of each anchor box, the position of the face box, and the position of the face key points;

[0015] For each frame image in the video stream, it is input into the RetinaFace model for forward inference to obtain the position and key point information of each face. According to the face frame position information output by the RetinaFace model, the corresponding face area is captured from the original image. For the extracted face area image, the RetinaFace model is used to extract the face key point information for subsequent face recognition.

[0016] Furthermore, S3 also includes introducing an expression change perception mechanism, which includes an expression recognition module for identifying the expression state of the student, using an expression recognition model based on a recurrent neural network (RNN) to output confidence scores of various expressions, such as smiles, blinks, etc., and dynamically adjusting the face detection threshold of the RetinaFace model according to the expression confidence output by the expression recognition model;

[0017] When a high smile confidence is detected, the face detection threshold is lowered to increase the detection sensitivity of smiling faces; when a winking expression is detected, the threshold is lowered to increase the detection sensitivity of winking faces.

[0018] Furthermore, the expression recognition model is as follows:

[0019] Assume that the input facial feature sequence is x1, x2, ..., xT, where T represents the sequence length and xt represents the facial feature at the tth time step. The expression recognition model adopts a recurrent neural network structure based on a long short-term memory network:

[0020] ;

[0021] ;

[0022] in, It is The hidden state of time steps is is obtained by the softmax function. The probability distribution of expression classification at time steps, and are the weights and biases of the output layer;

[0023] The expression recognition model outputs confidence scores for various expressions:

[0024] Output of the expression recognition model is a probability distribution vector, which represents the confidence scores of various expressions. If there are C types of expressions, then The dimension is C, where each element y{t,c} represents the confidence score of the cth expression corresponding to the tth time step;

[0025] According to the expression confidence output by the expression recognition module, the face detection threshold of the RetinaFace model is dynamically adjusted. The specific steps are as follows:

[0026] Define threshold adjustment rules: Set a set of rules or functions to dynamically adjust the face detection threshold of the RetinaFace model according to the confidence level of the expression.

[0027] Furthermore, the S6 specifically includes:

[0028] S61, Activity area classification: Classify and grade various areas on campus according to security levels, including low-level activity areas and high-level activity areas. For example, classrooms, offices, archives, etc. belong to high-level activity areas, while corridors and public areas belong to low-level activity areas;

[0029] S62, abnormal trajectory detection: continuously monitor and identify authorized personnel entering various areas on campus. After confirming their identities through facial recognition technology, record their activity trajectories in different areas on campus. By monitoring the activity trajectories, when low-level personnel move to high-level activity areas, the alarm mechanism is triggered and an alarm message is sent to the security management personnel. The alarm message includes the description, time and location information of the abnormal event; the abnormal behavior pattern is also analyzed through the activity trajectory.

[0030] Furthermore, the activity track record includes:

[0031] Assigning a unique identifier to each person based on their location in the video stream;

[0032] Track the detected personnel, use a multi-target tracking algorithm to track the movement trajectory of each person in the video stream, and update their location information in real time (based on multiple video surveillance at various locations on campus);

[0033] In the video stream, the movement trajectory of each person is drawn in real time according to the real-time location information of the person. The image processing library (OpenCV) can be used to draw the trajectory.

[0034] The trajectory of each person is continuously updated based on the new location information, and the latest trajectory path is displayed in real time on the trajectory map.

[0035] Furthermore, the abnormal trajectory detection also includes crossing an obviously inaccessible area (i.e. abnormal behavior of climbing over a wall on campus), specifically including:

[0036] Establishment of fence map: Establish a digital fence map on campus, mark all fences and railings, and determine their boundaries and locations;

[0037] Cross-border detection: Analyze the recorded activity trajectories of personnel to detect whether there are any trajectories that cross the impassable areas marked on the fence map;

[0038] Abnormal alarm: When it is detected that a person's trajectory has crossed the impassable area marked on the fence map, the abnormal alarm mechanism is triggered to notify the security management personnel to handle it;

[0039] The wall diagram establishment includes:

[0040] Survey and map the campus to obtain the exact location and boundary information of the areas that are not passable by walls and railings on campus, use the Geographic Information System (GIS) to create a digitized map of the walls, and mark the walls and railings on the map.

[0041] Furthermore, the S7 specifically includes:

[0042] Extract partial information of the face area from the real-time video stream, including eye and nose feature points and areas;

[0043] Based on the extracted partial face information, a semi-virtual three-dimensional face model is reconstructed using three-dimensional face reconstruction technology;

[0044] Feature point extraction: detect the face image and use the key point detection algorithm to extract the key feature points of the eyes, nose and mouth;

[0045] Feature point matching: Match the extracted key feature points with the corresponding feature points in the known face model to establish the corresponding relationship between the feature points. Establishing the corresponding relationship between the feature points includes:

[0046] Input: Input image The feature point coordinate set , known face models The corresponding feature point coordinate set in ;

[0047] Output: Correspondence between feature points ,in, express The feature points in Indicates the corresponding The feature points in

[0048] for Each feature point in ,exist Find the nearest neighbor feature point in ; The corresponding relationship found Add to Repeat the above until all The corresponding feature points are found for the feature points in;

[0049] 3D face reconstruction: Based on the correspondence between feature points, a semi-virtual 3D face model is reconstructed using a 3D face reconstruction algorithm. Using samples from a known face database, a statistical model of face shape and texture is established through principal component analysis, and then an optimization algorithm is used to fit the extracted feature points to obtain a 3D face model.

[0050] Feature vectors are extracted from the reconstructed semi-virtual three-dimensional face and compared with the facial feature vectors in the repository. The similarity between the reconstructed semi-virtual three-dimensional face and each facial information in the repository is calculated using a similarity measurement method. If the similarity between the reconstructed semi-virtual three-dimensional face and a face in the repository exceeds the set threshold (80%), the person is identified as an authorized person; otherwise, he is considered an unauthorized person.

[0051] Furthermore, the abnormal behavior pattern in S62 includes:

[0052] Density analysis: Conduct density analysis on activity trajectories to identify areas where people gather and areas where regular activities take place. Abnormal behaviors usually occur in areas where regular activities take place.

[0053] Speed ​​analysis: Analyze the speed at which people move to detect abnormally high speeds or stagnation. Abnormal speeds may indicate running, chasing, or unusual activities.

[0054] Trajectory shape analysis: Analyze the shape of the activity trajectory to detect abnormal path shapes, including sudden changes in direction and circling behaviors, which may indicate unclear intentions or evasive behavior;

[0055] Activity time analysis: Analyze the time distribution of personnel activities and identify whether there are irregular activity time periods. Activities that occur during non-working hours or non-class hours are considered abnormal behaviors.

[0056] Duration analysis: Analyze the duration of a person's stay in a certain area to detect whether there is an abnormally long stay, which indicates a potential threat or theft;

[0057] The identification of the abnormal behavior pattern adopts the isolation forest algorithm, and the isolation forest algorithm specifically includes:

[0058] Data preparation: Convert the activity trajectory data into a format suitable for the isolation forest algorithm. Each trajectory point is taken as a sample, including its location coordinates and timestamp features. Other related features, such as speed and acceleration, can also be added.

[0059] Feature engineering: Perform feature engineering on trajectory points to extract distance features, speed features, and acceleration features;

[0060] Construct an isolation forest model: Use the isolation forest algorithm to model the prepared trajectory data. During the construction process, randomly select features and split the data. By cutting the trajectory point data, the abnormal trajectory points are isolated.

[0061] Anomaly analysis: Based on the isolation forest model, anomaly detection is performed on the trajectory data. The isolation forest algorithm divides trajectory points into two categories: normal points and abnormal points. Abnormal points represent trajectories that do not conform to normal behavior patterns.

[0062] The smart campus security management system based on face recognition is used to implement the above-mentioned smart campus security management method based on face recognition, and includes the following modules:

[0063] Face recognition module: responsible for obtaining real-time video streams from various areas on campus, preprocessing the obtained video streams, detecting and identifying faces, and using deep learning algorithms to detect and identify faces in preprocessed video frames to obtain face information;

[0064] Repository management module: pre-enter the facial information of students and faculty members, and manage the repository for comparison with the facial information detected in real time;

[0065] Abnormal behavior detection module: Continuously analyze the behavior trajectory of authorized personnel and identify abnormal behaviors, including setting up multi-level areas, identifying problems of low-level authorized personnel entering high-level areas, and crossing inaccessible areas, to achieve real-time monitoring and early warning of campus safety;

[0066] Expression recognition module: Uses an expression recognition model based on a recurrent neural network to identify students’ expression states and dynamically adjusts the face detection threshold according to the expression confidence level to improve the accuracy of face recognition under different expression states;

[0067] Abnormal behavior pattern analysis module: Use the isolation forest algorithm to analyze the behavior trajectory and analyze the abnormal behavior pattern;

[0068] Alarm and recording module: When abnormal behavior is found, the alarm is triggered immediately and relevant information is recorded so that security managers can take countermeasures;

[0069] 3D face reconstruction module: Based on partial face information, 3D face reconstruction technology is used to reconstruct a semi-virtual 3D face model for solving differential recognition problems.

[0070] Beneficial effects of the present invention:

[0071] The present invention, combined with video surveillance stream, deep learning algorithm and trajectory analysis technology, can comprehensively improve the level of campus security management. Through the acquisition of real-time video stream and face recognition technology, it can effectively monitor the activities of people on campus, timely identify authorized and unauthorized personnel, and effectively prevent illegal intrusions and people sneaking into the campus. At the same time, by continuously analyzing the behavior trajectory of authorized personnel, abnormal behavior can be discovered and responded to in a timely manner, further enhancing the campus's security prevention capabilities.

[0072] The present invention uses machine learning algorithms such as isolation forest to detect abnormal activity trajectories, which can automatically identify abnormal behaviors and avoid the shortcomings of traditional manual patrols and the subjectivity of human judgment. The algorithm can quickly and accurately analyze trajectory data, identify abnormal trajectories, and display them intuitively through visualization, so that security managers can more efficiently discover and respond to potential security threats, effectively improving the efficiency and accuracy of security management.

[0073] The present invention can not only effectively monitor abnormal trajectories, but also includes crossing obviously inaccessible areas (such as campus wall climbing behavior) and introducing expression change perception mechanism to strengthen comprehensive prevention of abnormal behavior on campus. Through the monitoring of real-time video streams in various areas of the campus and abnormal trajectory detection, various abnormal behaviors, including illegal intrusion and cross-border behavior, can be discovered and responded to in a timely manner, thereby effectively maintaining campus safety and order. After the expression change perception mechanism is introduced, it has the ability to optimize and adjust intelligent security management strategies in real time. Through the expression recognition model based on the recurrent neural network, it can dynamically adjust the face detection threshold of the RetinaFace model according to the expression state of the student's age and the confidence score of various expressions output according to the expression confidence output by the expression recognition model, so that the system can more flexibly adapt to the face recognition needs under different expression states, and improve the intelligence and real-time performance of the security management strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0075] Figure 1 A schematic diagram of a management method flow chart of an embodiment of the present invention;

[0076] Figure 2 This is a schematic diagram of the functional modules of a management system according to an embodiment of the present invention;

[0077] Figure 3 It is a logical schematic diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0078] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0079] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0080] like Figure 1 As shown, the smart campus security management method based on face recognition includes the following steps:

[0081] S1: Obtain real-time video streams of various areas on campus;

[0082] Deploy high-definition cameras in important areas and entrances and exits of the campus, including the main entrance, teaching buildings, dormitory areas, and sports venues. Connect all cameras to the campus' central monitoring system, ensure real-time data transmission through wireless networks, adopt secure network protocols and encryption measures to protect the security and privacy of video streams, use real-time video stream acquisition software, connect to camera equipment, and continuously collect video streams from each camera.

[0083] S2: pre-process the video stream;

[0084] According to the needs of the face recognition system, the resolution of the video stream is adjusted to ensure that the video clarity is sufficient for effective face detection. At the same time, the processing speed and data storage are optimized. The video stream is converted from the RGB color space to a grayscale image or other color space suitable for face recognition to reduce the amount of data and increase the processing speed. The median filter denoising is applied to process each frame in the video stream to remove image noise and improve the accuracy of face recognition. The edge information in the video image is enhanced through edge detection to highlight the contours and feature points of the face to facilitate subsequent feature extraction.

[0085] S3: Use deep learning algorithms to detect and recognize faces in preprocessed video frames;

[0086] S4: The facial information of students and faculty members is pre-entered into the repository, and the detection and recognition results in S3 are input into the repository for comparison. The pre-entered facial information is for authorized personnel;

[0087] The facial information of students, faculty and staff is collected on campus, and their identity information, such as student ID and work ID, is recorded to form a face-identity correspondence. The collected facial information and its corresponding identity information are stored in a special database or file as a repository. The face detected by the RetinaFace model in S3 is recognized, and its feature vector or other representation is obtained. It is then matched and compared with the pre-entered facial information in the repository. If the detection and recognition result successfully matches the facial information in the repository, the person is deemed to be an authorized person and can pass the identity authentication. Otherwise, he is deemed to be an unauthorized person.

[0088] S5: If an unauthorized person is detected, an alarm is triggered immediately and relevant information is recorded;

[0089] S6: Continuously analyze the behavior trajectory of authorized personnel to identify abnormal trajectories (classify the activity areas of authorized personnel, alarm when low-level authorized personnel enter the activity area of ​​high-level authorized personnel, alarm when authorized personnel cross the obviously impassable area, including the wall and railing area, alarm; if it is a visitor, temporary authorization can be performed on site, temporary authorization area is set in the storage library, authorization time is set, and the authorization is cleared when the authorization time exceeds);

[0090] S7: To address the differentiated recognition problems caused by different lighting, angles, and when people wear masks or glasses, we use partial facial information and 3D face reconstruction technology to reconstruct a semi-virtual 3D face. The reconstructed semi-virtual 3D face is compared with the repository, and a similarity threshold is set. If it exceeds 80%, it is identified as an authorized person, and if it is less than 80%, it is identified as an unauthorized person.

[0091] The deep learning algorithm in S3 uses the RetinaFace model, which is an object detection model based on a deep convolutional neural network. The RetinaFace model structure includes a backbone network and a detection head. The backbone network uses a lightweight backbone network (such as MobileNet and ResNet) to extract image features, and the detection head is responsible for predicting the location and category information of the face frame at different scales.

[0092] The RetinaFace model uses a single-shot multi-frame detection architecture and performs face detection at different scales through multi-layer convolution and feature pyramid networks. On each feature map, the RetinaFace model simultaneously predicts a series of anchor boxes and predicts the category and position of each box through classification and regression branches. The output of the RetinaFace model includes the face confidence of each anchor box, the position of the face box, and the position of the face key points.

[0093] The RetinaFace model can effectively cope with multi-scale and multi-pose face detection tasks by detecting faces at different scales simultaneously. It uses a lightweight backbone network and a multi-scale feature pyramid network to improve the detection speed and accuracy of the model. By classifying and regressing the position of each anchor box, the RetinaFace model can accurately locate the face area in the image and provide the location information of the key points of the face, providing a basis for subsequent face recognition and feature extraction.

[0094] Based on a large-scale face dataset, the RetinaFace model is trained or fine-tuned to adapt to face detection tasks in a campus environment and to improve the accuracy and robustness of the model.

[0095] For each frame image in the video stream, it is input into the RetinaFace model for forward inference to obtain the position and key point information of each face. According to the face frame position information output by the RetinaFace model, the corresponding face area is captured from the original image. For the extracted face area image, the RetinaFace model is used to extract the face key point information for subsequent face recognition.

[0096] Considering that the majority of people on campus are students, the thresholds and parameters of the face detection algorithm are adjusted according to the changes in students' expressions at different ages to improve the adaptability of the model in different age groups and expression states. Therefore, S3 also includes the introduction of an expression change perception mechanism, which includes an expression recognition module for identifying students' expression states, and an expression recognition model based on a recurrent neural network (RNN) to output confidence scores for various expressions, such as smiles and blinks. The face detection threshold of the RetinaFace model is dynamically adjusted based on the expression confidence output by the expression recognition model.

[0097] When a high smile confidence is detected, the face detection threshold is lowered to increase the detection sensitivity of smiling faces; when a winking expression is detected, the threshold is lowered to increase the detection sensitivity of winking faces.

[0098] The expression recognition model is as follows:

[0099] Assume that the input facial feature sequence is x1, x2, ..., xT, where T represents the sequence length and xt represents the facial feature at the tth time step. The expression recognition model adopts a recurrent neural network structure based on a long short-term memory network:

[0100] ;

[0101] ;

[0102] in, It is The hidden state of time steps is is obtained by the softmax function. The probability distribution of expression classification at time steps, and are the weights and biases of the output layer;

[0103] The expression recognition model outputs confidence scores for various expressions:

[0104] Output of the expression recognition model is a probability distribution vector, which represents the confidence scores of various expressions. If there are C types of expressions, then The dimension is C, where each element y{t,c} represents the confidence score of the cth expression corresponding to the tth time step;

[0105] According to the expression confidence output by the expression recognition module, the face detection threshold of the RetinaFace model is dynamically adjusted. The specific steps are as follows:

[0106] Define threshold adjustment rules: Set a set of rules or functions to dynamically adjust the face detection threshold of the RetinaFace model according to the confidence level of the expression. For example, you can set the following rules:

[0107] When a high smile confidence is detected, the face detection threshold is lowered;

[0108] When high blink confidence is detected, the face detection threshold is lowered.

[0109] Real-time update threshold: In the real-time application process, according to the expression confidence output by the expression recognition module, the face detection threshold of the RetinaFace model is updated in real time according to the pre-set rules.

[0110] According to the updated threshold, when performing face detection on each frame of image, the dynamically adjusted threshold is used for detection to meet the needs of face detection under different expression states.

[0111] S6 specifically includes:

[0112] S61, Activity area classification: Classify and grade various areas on campus according to security levels, including low-level activity areas and high-level activity areas. For example, classrooms, offices, archives, etc. belong to high-level activity areas, while corridors and public areas belong to low-level activity areas;

[0113] S62, abnormal trajectory detection: continuously monitor and identify authorized personnel entering various areas on campus. After confirming their identities through facial recognition technology, record their activity trajectories in different areas on campus. By monitoring the activity trajectories, when low-level personnel move to high-level activity areas, the alarm mechanism is triggered and an alarm message is sent to the security management personnel. The alarm message includes the description, time and location information of the abnormal event; the abnormal behavior pattern is also analyzed through the activity trajectory.

[0114] Activity track records include:

[0115] Assigning a unique identifier to each person based on their location in the video stream;

[0116] Track the detected personnel, use a multi-target tracking algorithm to track the movement trajectory of each person in the video stream, and update their location information in real time (based on multiple video surveillance at various locations on campus);

[0117] In the video stream, the movement trajectory of each person is drawn in real time according to the real-time location information of the person. The image processing library (OpenCV) can be used to draw the trajectory.

[0118] The trajectory of each person is continuously updated based on the new location information, and the latest trajectory path is displayed in real time on the trajectory map.

[0119] The multi-target tracking algorithm is used to track the positions of multiple targets in a video sequence. Its core is to achieve continuous tracking of the target by associating the target position information at each moment with the tracking result at the previous moment. The following is the principle and application of a commonly used multi-target tracking algorithm - Kalman filter:

[0120] Kalman filter: In multi-target tracking, the Kalman filter is used to predict and update the position and velocity of the target.

[0121] State model: defines the state vector of the target, usually including information such as position and velocity, and represents the position of the target in the state space.

[0122] State prediction: Predict the target state at the next moment based on the state transition equation of the dynamic system and the external control input.

[0123] Measurement update: Compare the actual observed measurement value with the predicted value and update the estimate of the target state based on measurement noise and system noise.

[0124] Error covariance update: Updates the uncertainty in the state estimate to reflect the effects of prediction error and measurement error.

[0125] Algorithm steps:

[0126] Initialization: Initialize the state estimate vector and covariance matrix.

[0127] Prediction: Based on the system dynamic model, predict the target state and covariance at the next moment.

[0128] Update: Based on the measured and predicted values, the Kalman gain is calculated and the state estimate and covariance matrix are updated.

[0129] Repeat: The prediction and update steps are repeated continuously to achieve continuous tracking of the target.

[0130] Application to multi-target tracking:

[0131] Target initialization: For each newly detected target, initialize its state estimate vector and covariance matrix.

[0132] Target prediction: For a tracked target, predict its state at the next moment based on its current state estimate and the system dynamic model.

[0133] Target update: Compare the new observations with the predicted values ​​and use the Kalman filter to update the state estimate and covariance of the target.

[0134] Trajectory management: Manage the trajectories of objects based on the state estimate of each object, and perform trajectory association and segmentation as needed.

[0135] Abnormal trajectory detection also includes crossing obvious inaccessible areas (i.e. abnormal behavior of climbing over the wall on campus), including:

[0136] Establishment of fence map: Establish a digital fence map on campus, mark all fences and railings, and determine their boundaries and locations;

[0137] Cross-border detection: Analyze the recorded activity trajectories of personnel to detect whether there are any trajectories that cross the impassable areas marked on the fence map;

[0138] Abnormal alarm: When it is detected that a person's trajectory has crossed the impassable area marked on the fence map, the abnormal alarm mechanism is triggered to notify the security management personnel to handle it;

[0139] The creation of the fence diagram includes:

[0140] Survey and map the campus to obtain the exact location and boundary information of the areas that are not passable by walls and railings on campus, use the Geographic Information System (GIS) to create a digitized map of the walls, and mark the walls and railings on the map.

[0141] To map the trajectory map and the campus wall map into a unified space, in order to realize the trajectory crossing analysis, the following steps are taken:

[0142] Make sure that the track map and campus fence map use the same local coordinate system within the campus.

[0143] Cartographic calibration was performed on the trajectory map and campus wall map to match their positions and scales in geographic space, the trajectory map was superimposed on the campus wall map, and using GIS software to ensure that they were in the same space, the trajectory map was superimposed on the wall map as a layer, and its position and size were adjusted to fit the campus map.

[0144] The superimposed trajectory map and wall map were spatially analyzed, and the intersection analysis and spatial query provided by GIS software were used to identify whether the trajectory crossed the wall area to detect whether the trajectory intersected with the boundary of the wall map.

[0145] Based on the results of the spatial analysis, determine whether the trajectory crosses the impassable area marked by the fence map. If the trajectory intersects the boundary of the fence map or crosses the fence area, it can be determined as an out-of-bounds behavior.

[0146] S7 specifically includes:

[0147] Extract partial information of the face area from the real-time video stream, including eye and nose feature points and areas;

[0148] Based on the extracted partial face information, a semi-virtual three-dimensional face model is reconstructed using three-dimensional face reconstruction technology;

[0149] Feature point extraction: Detect the face image and use the key point detection algorithm to extract the key feature points of the eyes, nose, and mouth; the key point detection algorithm is based on deep learning methods, such as the convolutional neural network (CNN) based model:

[0150] Input: face image I

[0151] Output: Coordinates of key feature points such as eyes, nose, mouth, etc. (xi,yi)

[0152] Algorithm steps:

[0153] Use the trained deep learning model (CNN-based facial key point detection model) to predict the input face image and obtain the prediction results of the key points.

[0154] The prediction result is usually a coordinate set containing multiple key points, including the coordinates of key feature points such as eyes, nose, and mouth. According to the prediction result, the coordinates of key feature points such as eyes, nose, and mouth are extracted.

[0155] Feature point matching: Match the extracted key feature points with the corresponding feature points in the known face model to establish the corresponding relationship between the feature points. Establishing the corresponding relationship between the feature points includes:

[0156] Input: Input image The feature point coordinate set , known face models The corresponding feature point coordinate set in ;

[0157] Output: Correspondence between feature points ,in, express The feature points in Indicates the corresponding The feature points in

[0158] for Each feature point in ,exist Find the nearest neighbor feature point in ; The corresponding relationship found Add to Repeat the above until all The corresponding feature points are found for the feature points in;

[0159] 3D face reconstruction: Based on the correspondence between feature points, a semi-virtual 3D face model is reconstructed using a 3D face reconstruction algorithm. Using samples from a known face database, a statistical model of face shape and texture is established through principal component analysis, and then an optimization algorithm is used to fit the extracted feature points to obtain a 3D face model.

[0160] Feature vectors are extracted from the reconstructed semi-virtual three-dimensional face and compared with the facial feature vectors in the repository. The similarity between the reconstructed semi-virtual three-dimensional face and each facial information in the repository is calculated using a similarity measurement method. If the similarity between the reconstructed semi-virtual three-dimensional face and a face in the repository exceeds the set threshold (80%), the person is identified as an authorized person; otherwise, he is considered an unauthorized person.

[0161] Abnormal behavior patterns in S62 include:

[0162] Density analysis: Conduct density analysis on activity trajectories to identify areas where people gather and areas where regular activities take place. Abnormal behaviors usually occur in areas where regular activities take place.

[0163] Speed ​​analysis: Analyze the speed at which people move to detect abnormally high speeds or stagnation. Abnormal speeds may indicate running, chasing, or unusual activities.

[0164] Trajectory shape analysis: Analyze the shape of the activity trajectory to detect abnormal path shapes, including sudden changes in direction and circling behaviors, which may indicate unclear intentions or evasive behavior;

[0165] Activity time analysis: Analyze the time distribution of personnel activities and identify whether there are irregular activity time periods. Activities that occur during non-working hours or non-class hours are considered abnormal behaviors.

[0166] Duration analysis: Analyze the duration of a person's stay in a certain area to detect whether there is an abnormally long stay, which indicates a potential threat or theft;

[0167] The identification of abnormal behavior patterns uses the isolation forest algorithm, which specifically includes:

[0168] Data preparation: Convert the activity trajectory data into a format suitable for the isolation forest algorithm. Each trajectory point is taken as a sample, including its location coordinates and timestamp features. Other related features, such as speed and acceleration, can also be added.

[0169] Feature engineering: Perform feature engineering on trajectory points to extract distance features, speed features, and acceleration features;

[0170] Construct an isolation forest model: Use the isolation forest algorithm to model the prepared trajectory data. During the construction process, randomly select features and split the data. By cutting the trajectory point data, the abnormal trajectory points are isolated.

[0171] Anomaly analysis: Based on the isolation forest model, anomaly detection is performed on the trajectory data. The isolation forest algorithm divides trajectory points into two categories: normal points and abnormal points. Abnormal points represent trajectories that do not conform to normal behavior patterns.

[0172] The analysis of abnormal trajectories by the isolation forest algorithm is as follows:

[0173] 1. Calculate the path length of the sample point: The path length is a feature of a sample point, which is used to describe the abnormality of the point. The path length is calculated by accumulating the distance between the trajectory points. Let represents a set of trajectory points, where Indicates The feature vector of the trajectory point, represents the dimension of the feature, then The path length of a trajectory point is expressed as: in, Indicates The path length of each trajectory point.

[0174] 2. Build an isolation forest model: The isolation forest algorithm mainly determines outliers based on path length. First, it is necessary to build an isolation forest model to determine parameters such as the number of trees in the forest and the maximum depth of each tree. During the training process, each tree will randomly select a part of the sample points and features for segmentation until an isolated leaf node is obtained.

[0175] 3. Anomaly analysis: For each sample point, the value calculated by the path length can be used to determine whether it is an anomaly point. The shorter the path length, the more likely it is an anomaly point. Set a threshold , if the path length is less than the threshold, the sample point is marked as an outlier.

[0176] 4. Visual analysis: The abnormal points are visualized on the trajectory map so that users can intuitively understand the location and distribution of abnormal trajectories. The abnormal points can be marked with different colors or symbols to distinguish them from normal trajectory points.

[0177] 5. Subsequent processing: Further analysis and processing of abnormal trajectories can be carried out. The abnormal trajectories can be combined with other information (such as camera monitoring images) to verify whether the abnormal behavior actually exists and take corresponding countermeasures.

[0178] like Figure 2 As shown, the smart campus security management system based on face recognition is used to implement the above-mentioned smart campus security management method based on face recognition, and includes the following modules:

[0179] Face recognition module: responsible for obtaining real-time video streams from various areas on campus, preprocessing the obtained video streams, detecting and identifying faces, and using deep learning algorithms to detect and identify faces in preprocessed video frames to obtain face information;

[0180] Repository management module: pre-enter the facial information of students and faculty members, and manage the repository for comparison with the facial information detected in real time;

[0181] Abnormal behavior detection module: Continuously analyze the behavior trajectory of authorized personnel and identify abnormal behaviors, including setting up multi-level areas, identifying problems of low-level authorized personnel entering high-level areas, and crossing inaccessible areas, to achieve real-time monitoring and early warning of campus safety;

[0182] Expression recognition module: Uses an expression recognition model based on a recurrent neural network to identify students’ expression states and dynamically adjusts the face detection threshold according to the expression confidence level to improve the accuracy of face recognition under different expression states;

[0183] Abnormal behavior pattern analysis module: Use the isolation forest algorithm to analyze the behavior trajectory and analyze the abnormal behavior pattern;

[0184] Alarm and recording module: When abnormal behavior is found, the alarm is triggered immediately and relevant information is recorded so that security managers can take countermeasures;

[0185] 3D face reconstruction module: Based on partial face information, 3D face reconstruction technology is used to reconstruct a semi-virtual 3D face model for solving differential recognition problems.

[0186] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.

[0187] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A smart campus safety management method based on face recognition, characterized in that: The following steps are involved: S1: Obtain real-time video streams of various areas on campus; S2: pre-process the video stream; S3: Use a deep learning algorithm to detect and identify faces in the preprocessed video frames. The deep learning algorithm uses a RetinaFace model. The RetinaFace model is a target detection model based on a deep convolutional neural network. The RetinaFace model structure includes a backbone network and a detection head. The backbone network uses a lightweight backbone network to extract image features, and the detection head is responsible for predicting the position and category information of the face frame at different scales. The RetinaFace model adopts a single-shot multi-frame detection architecture and performs face detection of different scales through multi-layer convolution and feature pyramid networks. On each feature map, the RetinaFace model simultaneously predicts a series of anchor boxes, and predicts the category and position of each box through classification branches and regression branches. The output of the RetinaFace model includes the face confidence of each anchor box, the position of the face box, and the position of the face key points; For each frame of the video stream, input it into the RetinaFace model for forward inference to obtain the position and key point information of each face. According to the face frame position information output by the RetinaFace model, the corresponding face area is intercepted from the original image. For the extracted face area image, the RetinaFace model is used to extract the face key point information for subsequent face recognition. The S3 also includes introducing an expression change perception mechanism, which includes an expression recognition module for identifying the expression state of the student, using an expression recognition model based on a recurrent neural network (RNN) to output confidence scores of various expressions, and dynamically adjusting the face detection threshold of the RetinaFace model according to the expression confidence output by the expression recognition model; When a high smile confidence is detected, the face detection threshold is lowered to increase the detection sensitivity of smiling faces; when a blinking expression is detected, the threshold is lowered to increase the detection sensitivity of blinking faces; The expression recognition model is as follows: Assume that the input facial feature sequence is x1, x2, ..., xT, where T represents the sequence length and xt represents the facial feature at the tth time step. The expression recognition model adopts a recurrent neural network structure based on a long short-term memory network: h t =LSTM(x t ,h t-1 ); y t =softmax(W out h t +b out ): Among them, h t is the hidden state at the tth time step, y t is the probability distribution of expression classification at the tth time step obtained by the softmax function, W out and b out are the weights and biases of the output layer; The expression recognition model outputs confidence scores for various expressions: The output yt of the expression recognition model is a probability distribution vector, which represents the confidence scores of various expressions. If there are C types of expressions, the dimension of yt is C, where each element y {t, c} represents the confidence score of the cth expression corresponding to the tth time step; According to the expression confidence output by the expression recognition module, the face detection threshold of the RetinaFace model is dynamically adjusted. The specific steps are as follows: Define threshold adjustment rules: set a set of rules or functions to dynamically adjust the face detection threshold of the RetinaFace model according to the confidence level of the expression; S4: pre-enter the facial information of students and faculty members into a repository, and input the detection and recognition results in S3 into the repository for comparison, wherein the pre-entered facial information is for authorized personnel; S5: If an unauthorized person is detected, an alarm is triggered immediately and relevant information is recorded; S6: Continuously analyze the behavior trajectory of authorized personnel to identify abnormal trajectories; S7: To address the differential recognition issues caused by different lighting conditions, angles, and when people wear masks or glasses, we use partial facial information and 3D face reconstruction technology to reconstruct a semi-virtual 3D face. We then compare the reconstructed semi-virtual 3D face with the repository, and set a similarity threshold of more than 80% to identify the person as an authorized person, and less than 80% to identify the person as an unauthorized person. The S6 specifically includes: S61, Activity Area Classification: Classify and grade various areas on campus according to security levels, including low-level activity areas and high-level activity areas; S62, abnormal trajectory detection: continuously monitor and identify authorized personnel entering various areas on campus. After confirming their identities through face recognition technology, record their activity trajectories in different areas on campus. By monitoring the activity trajectories, when low-level personnel move to high-level activity areas, the alarm mechanism is triggered and an alarm message is sent to the security management personnel. The alarm message includes the description, time and location information of the abnormal event; the abnormal behavior pattern is also analyzed through the activity trajectory; The activity track record includes: Assigning a unique identifier to each person based on their location in the video stream; Track the trajectory of the detected persons, use a multi-target tracking algorithm to track the movement trajectory of each person in the video stream, and update their location information in real time; In the video stream, the movement trajectory of each person is drawn in real time based on the person's real-time location information; Continuously update the trajectory of each person based on new location information, and display the latest trajectory path in real time on the trajectory map; The abnormal trajectory detection also includes crossing an obviously inaccessible area, specifically including: Establishment of fence map: Establish a digital fence map on campus, mark all fences and railings, and determine their boundaries and locations; Cross-border detection: Analyze the recorded activity trajectories of personnel to detect whether there are any trajectories that cross the impassable areas marked on the fence map; Abnormal alarm: When it is detected that a person's trajectory has crossed the impassable area marked on the fence map, the abnormal alarm mechanism is triggered to notify the security management personnel to handle it; The wall diagram establishment includes: Survey and map the campus to obtain the exact location and boundary information of the areas that are not passable by walls and railings on campus, use the geographic information system to create a digitized map of the walls, and mark the walls and railings on the map.

2. The smart campus safety management method based on face recognition according to claim 1 is characterized in that: The S7 specifically includes: Extract partial information of face area from real-time video stream; Based on the extracted partial face information, a semi-virtual three-dimensional face model is reconstructed using three-dimensional face reconstruction technology; Feature point extraction: detect the face image and use the key point detection algorithm to extract the key feature points of the eyes, nose and mouth; Feature point matching: Match the extracted key feature points with the corresponding feature points in the known face model to establish the corresponding relationship between the feature points. Establishing the corresponding relationship between the feature points includes: Input: Feature point coordinates of input image I1 The corresponding feature point coordinate set in the known face model M Output: Correspondence between feature points R = {(p1, p M ), (p2, p M ),…,(p n , p M )}, where p i represents the feature point in I1, p M Represents the corresponding feature point in M; For each feature point (x 1i ,y 1i ), in P M Find the nearest neighbor feature point (x Mi ,y Mi ); the corresponding relationship (p i , p M ) is added to R; repeat the above until all feature points in P1 have found corresponding feature points; 3D face reconstruction: Based on the correspondence between feature points, a semi-virtual 3D face model is reconstructed using a 3D face reconstruction algorithm. Using samples from a known face database, a statistical model of face shape and texture is established through principal component analysis, and then an optimization algorithm is used to fit the extracted feature points to obtain a 3D face model. Feature vectors are extracted from the reconstructed semi-virtual three-dimensional face and compared with the facial feature vectors in the repository. The similarity between the reconstructed semi-virtual three-dimensional face and each facial information in the repository is calculated using a similarity measurement method. If the similarity between the reconstructed semi-virtual three-dimensional face and a face in the repository exceeds a set threshold, the person is identified as an authorized person; otherwise, he is considered an unauthorized person.

3. The smart campus safety management method based on face recognition according to claim 1 is characterized in that: The abnormal behavior patterns in S62 include: Density analysis: Conduct density analysis on activity trajectories to identify areas where people gather and areas where regular activities occur; Speed ​​analysis: Analyze the speed of personnel movement to detect whether there is abnormal high-speed movement or stagnation; Trajectory shape analysis: Analyze the shape of the activity trajectory to detect whether there are abnormal path shapes, including sudden changes in direction and circling behavior; Activity time analysis: Analyze the time distribution of personnel activities and identify whether there are irregular activity time periods. Activities that occur during non-working hours or non-class hours are considered abnormal behaviors. Duration analysis: Analyze the duration of a person's stay in a certain area to detect whether there is an abnormally long stay, which indicates a potential threat or theft; The identification of the abnormal behavior pattern adopts the isolation forest algorithm, and the isolation forest algorithm specifically includes: Data preparation: Convert activity trajectory data into a format suitable for the isolation forest algorithm. Each trajectory point is taken as a sample, including its location coordinates and timestamp features. Feature engineering: Perform feature engineering on trajectory points to extract distance features, speed features, and acceleration features; Construct an isolation forest model: Use the isolation forest algorithm to model the prepared trajectory data. During the construction process, randomly select features and split the data. By cutting the trajectory point data, the abnormal trajectory points are isolated. Anomaly analysis: Based on the isolation forest model, anomaly detection is performed on the trajectory data. The isolation forest algorithm divides trajectory points into two categories: normal points and abnormal points. Abnormal points represent trajectories that do not conform to normal behavior patterns.

4. A smart campus security management system based on face recognition, used to implement the smart campus security management method based on face recognition as described in any one of claims 1 to 3, characterized in that: Includes the following modules: Face recognition module: responsible for obtaining real-time video streams from various areas on campus, preprocessing the obtained video streams, detecting and identifying faces, and using deep learning algorithms to detect and identify faces in preprocessed video frames to obtain face information; Repository management module: pre-enter the facial information of students and faculty members, and manage the repository for comparison with the facial information detected in real time; Abnormal behavior detection module: Continuously analyze the behavior trajectory of authorized personnel and identify abnormal behaviors, including setting up multi-level areas, identifying problems of low-level authorized personnel entering high-level areas, and crossing inaccessible areas, to achieve real-time monitoring and early warning of campus safety; Expression recognition module: Uses an expression recognition model based on a recurrent neural network to identify students’ expression states and dynamically adjusts the face detection threshold according to the expression confidence level to improve the accuracy of face recognition under different expression states; Abnormal behavior pattern analysis module: Use the isolation forest algorithm to analyze the behavior trajectory and analyze the abnormal behavior pattern; Alarm and recording module: When abnormal behavior is found, the alarm is triggered immediately and relevant information is recorded so that security managers can take countermeasures; 3D face reconstruction module: Based on partial face information, 3D face reconstruction technology is used to reconstruct a semi-virtual 3D face model for solving differential recognition problems.

Citation Information

Patent Citations

  • Embedded face recognition management system

    CN108898125A

  • Face recognition campus area early warning method and system for K12 education stage

    CN111209814A

  • Intelligent box-based intelligent campus supervision method, system and equipment

    CN112528732A

  • Face track system applied to interior and periphery of campus

    CN114419824A

  • Monitoring management system for smart campus

    CN116563797A