A method and device for intelligent perimeter detection
Through intelligent perimeter detection method, computer vision model and RTSP protocol are used to process video streams, and face feature codes and similarity matching are extracted, which solves the problems of insufficient fine granularity and signal disorder in traditional devices, and improves the generalization of artificial intelligence models. and system stability.
Patent Information
- Application Number
- CN202110803873.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-16
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-07-16
AI Technical Summary
Traditional perimeter intrusion detection equipment cannot distinguish the fine particle size categories of invasion. The generalization capability of artificial intelligence models is insufficient, resulting in identification errors and signal disorders. Especially when computer vision models detect continuous time series pictures, the target object appears and disappears unstable. Cause false alarms and system disorders.
Using intelligent perimeter detection method, a database is established by collecting authorized documents and photos, using computer vision models to extract face feature codes, and combining RTSP protocol to collect video streams for image frame processing, facial recognition and similarity matching are performed, and invasion is set Number of times thresholds, optimize matching scores and encoding frequency, and improve identification fault tolerance performance.
It improves the generalization ability of artificial intelligence models, reduces false positives, improves the fault tolerance performance of target recognition and tracking, solves the problem of object detection failure caused by model and environmental factors, and improves the stability and accuracy of the system.
Smart Images

Figure CN113591623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and detection equipment, and in particular to a method and equipment for intelligent perimeter detection. Background Art
[0002] Traditional perimeter intrusions can be detected using detectors, including infrared, microwave, cable, laser, video, radar or other sensors. However, these detection methods can only distinguish between large categories, and cannot distinguish specific fine-grained categories, such as the type of intrusion. With the process of artificial intelligence, the target object includes the application of face recognition algorithms in various industries. It can be applied to perimeter intrusion scenarios, and its advantage is that it can identify whether it is a person or an object. However, during the recognition process, due to insufficient generalization ability of the model and low quality of external data collection, recognition errors may occur, resulting in confusion in the reporting signal and system disorder.
[0003] The generalization ability of the AI model in the existing technology needs to be further improved to improve the overall system's tolerance for false alarms. When the computer vision model detects continuous time series images, the target object will disappear and reappear, causing signal disorder and disaster. There are many reasons for this problem, such as changes in the angle of the target object during detection, insufficient processing stability of the visual model, and other factors that lead to overall image frame quality problems. Summary of the invention
[0004] In order to solve the signal disappearance problem of perimeter intrusion detection, as well as the computing resources and transmission burden, and to improve the fault tolerance performance of target recognition and target tracking of perimeter intrusion in video scenes, the present invention provides a method and device for intelligent perimeter detection, and the specific technical solution is as follows.
[0005] A method for intelligent perimeter detection, comprising the steps of:
[0006] S1. Collect the ID photos of the authorized person and establish an authorization database;
[0007] S2. Use the trained computer vision recognition model to extract features from photos in the database.
[0008] S3. Obtain the recognized face code and store the acquired face feature code;
[0009] S4. Access surveillance video;
[0010] S5. Use RTSP protocol to collect video stream and process the video into frames;
[0011] S6. After the face is recognized, the face image is extracted and matched with the authorized database for similarity, and the number of intrusions is recorded for mismatches;
[0012] S7. Set a threshold for the number of intrusions, which is set based on the accuracy of the model in detecting faces and the number of times the video is encoded into picture frames per second.
[0013] Preferably, the ID photo shows the front of the head with clear facial features.
[0014] Preferably, the computer vision recognition model is trained using face data, and the deepface model is used to extract the corresponding face code through the penultimate fully connected layer.
[0015] Preferably, during the process of image frame processing of the video, the cv2.VideoCapture function accesses the video stream and uses the key frame I as the image basis, and uses the forward prediction frame P and the bidirectional interpolation frame B as the local change image data to uniformly encode the picture frame of the video.
[0016] Preferably, the picture frames are converted into Base64 code by the function videoCapture.read, and are input into the recognition algorithm interface, and the picture frames are transmitted to the computer recognition video model in chronological order to perform face recognition.
[0017] It is further preferred that, during face recognition, features are extracted from the face; the extracted face image is matched with the similarity of the authorized database, and a threshold of the matching score is set.
[0018] It is further preferred that the threshold of the matching score is 80%; when the number of faces that reach or exceed the threshold score is greater than 0, it is judged that the match is successful, and the number of intrusions recorded is 0; when the number of faces that reach or exceed the threshold score is 0, it is judged that the match is unsuccessful, and the number of intrusions recorded is increased by 1.
[0019] It is further preferred that when the threshold of the number of intrusions is reached, the warning model is activated; when the quality of video acquisition is improved, the threshold of the matching score is lowered; when the number of picture frames encoded per second increases, the threshold of the matching score is increased.
[0020] An intelligent perimeter detection device utilizes the above-mentioned intelligent perimeter detection method, including a video acquisition device, a face recognition control system and an alarm device. The video acquisition device is connected to the camera video data of the natural gas unmanned station. The face recognition control system records the number of intrusions after receiving the video data and controls the alarm device to sound an alarm.
[0021] It is further preferred that the face recognition control system compresses the video data and then detects the video.
[0022] The method and device for intelligent perimeter detection provided by the present invention have the following beneficial effects: the method can solve the problem that when a computer vision model detects a continuous time series of images, when a target object appears in the image during the period, the model makes intermittent detection errors. Implementing the method using a device can improve the generalization ability of the entire artificial intelligence model, thereby improving the fault tolerance of false alarms. In addition, the method also solves the problem of target detection failure caused by accidental problems caused by factors such as the environment and the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of 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 described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flow chart of a method for intelligent perimeter detection;
[0025] Figure 2 It is the working process diagram of the equipment. DETAILED DESCRIPTION
[0026] Combination Figure 1 and Figure 2 As shown, a specific implementation manner of a method and device for intelligent perimeter detection provided by the present invention is described.
[0027] A method for intelligent perimeter detection, comprising the steps of:
[0028] S1. Collect ID photos of authorized persons and establish an authorization database.
[0029] The ID photo shows the front of the head with clear facial features. The requirements for these pictures can be recent photos taken according to passport standards with clear facial features and no obstructions, and sitting upright.
[0030] S2. Use the trained computer vision recognition model to extract features from photos in the database.
[0031] The computer vision recognition model training uses face data for training, and uses the deepface model. The penultimate layer of full connection extracts the corresponding face code. The computer vision recognition face model can be selected as a model trained by a third party. The training method is to use a large amount of face training data. The recognition model used is deepface, and the penultimate layer of full connection is used to extract the corresponding face code; subsequent face recognition models are all this model, and the face recognition model can also use other face recognition models, but the model is required to be able to extract the feature code of the face.
[0032] S3. Obtain the recognized face code and store the acquired face feature code. The face code can be stored in a computer and saved in a face recognition control system, and data confidentiality measures can be set after saving.
[0033] S4. Access to surveillance video. For example, when used in a natural gas unattended station, the surveillance video data of the natural gas unattended station can be directly accessed. It can also be applied to LNG unloading scenarios to monitor the safety targets in the unloading scenario in real time until the target appears.
[0034] S5. Use the RTSP protocol to capture the video stream and perform image frame processing on the video.
[0035] Specifically, during the video image segmentation process, the cv2.VideoCapture function accesses the video stream and uses the key frame I as the image basis, and uses the forward prediction frame P and the bidirectional interpolation frame B as the local change image data to uniformly encode the video frame. The segmented image frames are converted to Base64 through the function videoCapture.read, and passed to the recognition algorithm interface, and the image frames are passed to the computer recognition video model in chronological order for face recognition.
[0036] S6. After the face is recognized, the face image is extracted and matched with the authorized database for similarity, and the number of intrusions is recorded for mismatches.
[0037] When recognizing a face, extract the features of the face; perform similarity matching on the extracted face image with the authorized database, and set the threshold of the matching score. The threshold of the matching score is 80%, and can also be set accordingly based on the accuracy of the visual model and experience; when the number of faces that reach or exceed the threshold score exceeds 0, it is judged as a successful match, indicating safety and no warning is required, and the number of intrusions recorded is 0; when the number of faces that reach or exceed the threshold score is 0, it is judged as an unsuccessful match, indicating unsafeness, the face is not authorized, and the number of intrusions recorded is increased by 1.
[0038] S7. Set a threshold for the number of intrusions, which is set based on the accuracy of the model in detecting faces and the number of times the video is encoded into picture frames per second.
[0039] You can set the number of intrusions to 3 as the threshold. When the threshold of the number of intrusions is reached, the warning model is started; when the quality of video acquisition improves, the threshold of the matching score is lowered; when the number of picture frames encoded per second increases, the threshold of the matching score is increased. Specifically, the threshold of the number of intrusions is designed based on the accuracy of the model in detecting faces and the number of times the video is encoded to the picture frames per second. When the accuracy of the face recognition model is very high and the quality of video acquisition is very high, the threshold can be set small. When the number of picture frames encoded per second is large, this threshold can be set larger. When the number of picture frames encoded per second is large, there will be consumption of computing performance, memory consumption, and transmission consumption. Therefore, parameters that encode a large number of picture frames per unit time are not recommended.
[0040] An intelligent perimeter detection device, using the above-mentioned intelligent perimeter detection method, includes a video acquisition device, a face recognition control system and an alarm device. The video acquisition device is connected to the camera video data of the natural gas unattended station. The face recognition control system records the number of intrusions after receiving the video data and controls the alarm device to sound an alarm. The face recognition control system compresses the video data and then detects the video. When encoding the video to the picture frame, a frequency of 3 frames per second can be used.
[0041] In this device, after the video stream is processed, the picture frame is encoded, and then the computer vision recognizes the target object and monitors the target in the scene in real time. When the target appears, the coordinates of the target are reported; when the target disappears and reaches 3 times, the target disappears is reported, and the control system accurately judges the result and issues corresponding instructions.
[0042] This method can solve the problem that when a computer vision model detects a continuous time series of images, the model will make intermittent detection errors when the target object appears in the image during the period. Using the device to implement this method can improve the generalization ability of the entire artificial intelligence model, thereby improving the fault tolerance of false alarms. In addition, this method also solves the problem of target detection failure caused by accidental problems caused by factors such as the environment and the model.
[0043] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for intelligent perimeter detection, characterized in that the steps include: S1. Collect the ID photos of the authorized person and establish an authorization database; S2. Use the trained computer vision recognition model to extract features from photos in the database. S3. Obtain the recognized face code and store the acquired face code; S4. Access surveillance video; S5. Use RTSP protocol to collect video stream and process the video into frames; S6. After the face is recognized, the face image is extracted and matched with the authorized database for similarity, and the number of intrusions is recorded for mismatches; S7. Set a threshold for the number of intrusions, which is set based on the accuracy of the model in detecting faces and the number of times the video is encoded into picture frames per second; During face recognition, features are extracted from the face; the extracted face image is matched with the authorized database for similarity, and a threshold for the matching score is set; The threshold of the matching score is 80%; when the number of faces that reach or exceed the threshold score exceeds 0, it is judged that the match is successful, and the number of intrusions recorded is 0; when the number of faces that reach or exceed the threshold score is 0, it is judged that the match is unsuccessful, and the number of intrusions recorded is increased by 1; When the threshold of the number of intrusions is reached, the warning model is started; when the quality of video acquisition is improved, the threshold of the matching score is lowered; when the number of encoded picture frames per second increases, the threshold of the matching score is increased.
2. The method of intelligent perimeter detection according to claim 1, characterized in that: The ID photo shows the front of the head with clear facial features.
3. The method of intelligent perimeter detection according to claim 1, characterized in that: The computer vision recognition model training is performed using face data, and the deepface model is used to extract the corresponding face code through the penultimate fully connected layer.
4. The method of intelligent perimeter detection according to claim 1, characterized in that: During the process of image frame processing of the video, the cv2.VideoCapture function accesses the video stream and takes the key frame I as the image basis, and uses the forward prediction frame P and the bidirectional interpolation frame B as the local change image data to uniformly encode the picture frame of the video.
5. The method of intelligent perimeter detection according to claim 4, characterized in that: During the image framing process, the image frames are converted into Base64 code through the function videoCapture.read, and are passed into the recognition algorithm interface. The image frames are sequentially transmitted to the computer recognition video model in chronological order to perform face recognition.
6. A device for intelligent perimeter detection, using the method for intelligent perimeter detection according to any one of claims 1 to 5, characterized in that: It includes a video acquisition device, a face recognition control system and an alarm device. The video acquisition device is connected to the camera video data of the natural gas unmanned station. The face recognition control system records the number of intrusions after receiving the video data and controls the alarm device to sound an alarm.
7. The intelligent perimeter detection device according to claim 6, characterized in that: The face recognition control system compresses the video data and then detects the video.
