Park security method and system based on image recognition
By using an image recognition-based campus security method, which utilizes high-definition cameras and pre-trained models to process video data, identify abnormal behaviors, and dynamically adjust strategies, the system solves the problems of low monitoring coverage, response speed, false alarm rate, and low level of intelligence in traditional security systems, thus achieving efficient and intelligent campus security management.
Patent Information
- Application Number
- CN202510030016.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-01-08
AI Technical Summary
Traditional park security systems suffer from limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis capabilities, and low level of intelligence, making it difficult to effectively protect the safety of the park and its equipment.
An image recognition-based campus security method is adopted, which uses high-definition cameras to collect video data, performs edge detection and occlusion detection, and combines pre-trained target detection models and time series analysis models to identify abnormal behaviors and trigger alarm mechanisms, dynamically adjusting management permissions and security access policies.
It improves the real-time performance and accuracy of monitoring, enables precise detection of multiple types of targets, intelligent behavior analysis, reduces false alarm rates, dynamically adjusts security strategies, and enhances the intelligence level and efficiency of park security management.
Smart Images

Figure CN119888620B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of security monitoring, and particularly relates to a park security method and system based on image recognition. BACKGROUND
[0002] With the acceleration of urbanization and the development of modern park construction, the security management needs of parks have become increasingly important. The security problems in parks not only involve personal and property safety, but also concern the normal operation of various facilities and equipment in the park, especially in industrial parks, commercial parks or research parks with a large number of personnel activities and equipment operation, security problems are more prominent. At present, the traditional park security system mainly relies on physical barriers (such as fences, access control), manual patrol and simple monitoring alarm systems. These methods have the following shortcomings in practical application:
[0003] 1. Limited monitoring coverage: Traditional camera monitoring systems usually have fixed monitoring angles and ranges, and cannot achieve omnidirectional and dead-angle-free monitoring. Especially in some large parks, there are blind spots and monitoring dead angles, which are easily exploited by criminals.
[0004] 2. Slow response speed: Traditional security systems usually rely on manual judgment and response. Once an abnormal situation occurs, such as illegal intrusion, fire or equipment failure, security personnel need to rely on monitoring videos for identification and confirmation, which usually takes a certain amount of time, resulting in slow response speed and inability to achieve rapid response to emergency situations.
[0005] 3. High false alarm rate: Existing alarm systems, such as infrared alarms, door magnetic switches, etc., are easily affected by environmental factors (such as wind, animal activity, equipment malfunction, etc.), often resulting in false alarms or missed alarms, reducing the reliability of the security system and the trust of users.
[0006] 4. Weak data analysis capability: The data collected by traditional security systems mainly exists in the form of video recordings, with a large amount of unstructured data, making it difficult to effectively analyze and mine data, and unable to provide in-depth decision support for park security management.
[0007] 5. Low degree of intelligence: Current security systems are mostly passive response types, lacking intelligent analysis and proactive defense capabilities. The system cannot dynamically adjust security strategies according to changes in the field environment, nor can it achieve proactive identification and early warning of potential security threats in the park.
[0008] Since the traditional security system mainly relies on manpower and simple alarm devices, there are problems of limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis capability and low intelligent degree, which is difficult to effectively protect the safety of the park and equipment. Therefore, an intelligent security system combined with image recognition is needed as an effective solution to realize real-time monitoring and early warning of various abnormal situations in the park. SUMMARY
[0009] Therefore, in view of the shortcomings of the existing park security system, the present application provides a park security method and system based on image recognition, which uses image recognition to monitor the park in real time, can greatly improve the park security efficiency, reduce the false alarm rate and improve the response speed, can timely issue early warning when abnormal situation occurs, through intelligent monitoring and analysis, realize all-round protection of potential security threats in the park, so as to effectively protect the safety of the park and its internal equipment.
[0010] The application adopts the following technical solutions:
[0011] In a first aspect, the application provides a park security method based on image recognition, which comprises the following steps:
[0012] Real-time video data in the park is collected by a high-definition camera, and edge detection and occlusion detection are performed on the video data to obtain pre-processed image data;
[0013] The pre-processed image data is detected and classified by a pre-trained target detection model to identify and locate the target position data;
[0014] The target behavior is analyzed based on the target position data by a time series analysis model combined with an optical flow method, the abnormal behavior is identified and the alarm mechanism is triggered;
[0015] The management authority and security access strategy of the park are dynamically adjusted based on the abnormal behavior monitoring result.
[0016] As a further scheme of the application, when performing edge detection on the video data, the edges are extracted according to the gradient information of the images in the real-time video data, and the edge positions in the images are determined by calculating the gradients of the images in the horizontal and vertical directions.
[0017] As a further scheme of the application, the edge detection on the video data comprises the following steps:
[0018] Image graying: the input color video frame is graying processed, wherein:
[0019]
[0020] In the formula, for a gray-scale image, R, G, B respectively represent the pixel values of red, green and blue channels in a color image;
[0021] The Sobel operator is applied to the gray-scale image in horizontal and vertical directions respectively using convolution kernels to calculate the gradient images in horizontal and vertical directions respectively; wherein the convolution kernel used by the Sobel operator in the horizontal direction is:
[0022]
[0023] wherein, is the gradient image obtained by applying the Sobel operator in the horizontal direction, representing the edge intensity of the image in the horizontal direction;
[0024] The convolution kernel used by the Sobel operator in the vertical direction is:
[0025]
[0026] wherein, is the gradient image obtained by applying the Sobel operator in the vertical direction, representing the edge intensity of the image in the vertical direction;
[0027] The gradient image in the horizontal direction calculated is:
[0028]
[0029] The gradient image in the vertical direction calculated is:
[0030]
[0031] The gradient amplitude and direction of each pixel are calculated according to the gradient images in horizontal and vertical directions calculated, and the pixel points with gradient amplitude greater than a preset edge threshold are retained as edges; wherein the gradient amplitude of each pixel is:
[0032]
[0033] The direction of each pixel is:
[0034]
[0035] The pixel points as edges are:
[0036]
[0037] wherein, is the gradient amplitude image, representing the total edge intensity at each pixel, synthesized by the gradients in horizontal and vertical directions through Euclidean norm; For the binarized edge image, 1 or 255 represents an edge, and 0 represents a non-edge. Threshold is an edge threshold, and only when the gradient amplitude is greater than the edge threshold, the pixel is marked as an edge.
[0038] As a further scheme of the present application, when performing occlusion detection on video data, changes in a static background are captured by background modeling, and moving targets in a dynamic scene are identified by motion detection.
[0039] As a further scheme of the present application, when performing occlusion detection on video data, changes in a static background are captured by background modeling, and moving targets in a dynamic scene are identified by motion detection.
[0040] The first several frames of video data are counted, and a background model is initialized using a Gaussian mixture model, wherein the background of each pixel is modeled by multiple Gaussian distributions;
[0041] The matching degree of the current value of each pixel of each frame of video data with the background model is calculated, and when the matching degree reaches a matching threshold, the background model is updated, otherwise the pixel is regarded as foreground;
[0042] The current frame is compared with the background model to identify foreground pixels and identify foreground objects in the video data.
[0043] As a further scheme of the present application, the calculation formula for calculating the matching degree of the current value of each pixel with the background model is:
[0044]
[0045] In the formula, is the probability distribution of the pixel in the background model, K is the number of Gaussian distributions, is the weight of the kth distribution, is the kth Gaussian distribution, is the mean, is the covariance matrix;
[0046] The condition for comparing the current frame with the background model is:
[0047]
[0048] wherein, is a set matching threshold, is a foreground detection mask, used to represent whether the current pixel is foreground, 1 represents foreground, and 0 represents background; is the pixel value of the background model at position .
[0049] As a further scheme of the present application, when the moving target in the dynamic scene is identified by the motion detection in the occlusion detection of the video data, the following steps are included:
[0050] The difference image of the current frame and the previous frame is calculated, and the moving object is extracted;
[0051] The threshold processing is performed on the difference image to generate the binary motion detection mask;
[0052] The morphological operation is performed on the motion mask to remove the noise and enhance the target region;
[0053] The result of the motion detection is combined with the foreground result of the background modeling to enhance the detection of the occlusion.
[0054] As a further scheme of the present application, the difference image of the current frame and the previous frame is calculated, wherein the calculation formula of the inter-frame difference is:
[0055]
[0056] In the formula, is the difference image of the current frame and the previous frame, which represents the motion of the pixel at position at time t; is the pixel value at position at time t, i.e. the pixel value of the current frame; is the pixel value at position at time t-1, i.e. the pixel value of the previous frame;
[0057] When the threshold processing is performed on the difference image, the calculation formula of the threshold processing is:
[0058]
[0059] In the formula, is the binary motion detection mask, which represents which pixels in the current frame have moved, 1 representing motion and 0 representing stillness;
[0060] When the result of the motion monitoring is combined with the foreground result of the background modeling, the calculation formula is:
[0061]
[0062] In the formula, is the final foreground mask, which combines the results of the background modeling and the motion detection and represents the foreground region.
[0063] As a further scheme of the present application, when the preprocessed image data is detected and classified by the pre-trained target detection model, the target detection model is pre-trained based on the YOLO model, the preprocessed image data is scaled, the scaled image pixel value is normalized to the interval [0, 1], the image data is expanded into a four-dimensional tensor, a convolution operation is applied to the input image to generate a feature map; based on the feature map, a plurality of bounding boxes and their class probabilities for each grid cell are predicted to obtain the target position data recognized and located by the pre-trained target detection model.
[0064] As a further scheme of the present application, the target behavior is analyzed based on the target position data by a time series analysis model combined with an optical flow method, including the following steps:
[0065] The target detection model is pre-trained by the YOLO model to detect the target in each frame of image, and the center point of the target is extracted from the bounding box coordinates as the position data;
[0066] The displacement of the target between frames is calculated by the Lucas-Kanade method, and the trajectory of the target is updated using the displacement calculated by the optical flow to obtain the motion trajectory of the target;
[0067] The ARIMA model is used for modeling, and the time series model is trained to identify the normal behavior pattern of the target;
[0068] The trajectory data at the current time is input into the time series model to predict the next motion position, and the predicted target position is compared with the actual position to calculate the error;
[0069] If the error exceeds the set threshold, it is determined as an abnormal behavior, and when the abnormal behavior is detected, the system triggers the alarm mechanism.
[0070] In a second aspect, the present application also includes a park security system based on image recognition, which comprises:
[0071] The data acquisition module is used for collecting real-time video data in the park by a high-definition camera, and performing edge detection and occlusion detection on the video data to obtain preprocessed image data;
[0072] The target detection module is used for detecting and classifying multiple types of targets by a pre-trained target detection model on the preprocessed image data to identify and locate the target position data;
[0073] The abnormality recognition module is used for analyzing the target behavior based on the target position data by a time series analysis model combined with an optical flow method to identify abnormal behavior and trigger an alarm mechanism;
[0074] The permission management module is configured to dynamically adjust the management permission and the security access strategy of the park based on the abnormal behavior monitoring result.
[0075] The application further includes a computer device, comprising at least one processor, and a memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image recognition-based park security method.
[0076] The application further includes a computer readable storage medium, which stores computer instructions for enabling the computer to execute the image recognition-based park security method.
[0077] Compared with the prior art, the image recognition-based park security method and system have the following beneficial effects:
[0078] 1. Improved real-time and accuracy: real-time video data in the park is collected by a high-definition camera, which can finely capture the dynamic situation in the park and ensure that the monitoring system has high resolution and high definition. Image data preprocessing using edge detection and occlusion detection technology can effectively eliminate interference factors, enhance the accuracy of target detection, and improve the robustness of the system.
[0079] 2. Realize accurate detection of multiple types of targets: the pre-trained target detection model is used to detect and classify multiple types of targets in the preprocessed image data, which can not only identify different types of targets (such as personnel, vehicles, animals, etc.), but also accurately locate the position data of the targets. This multi-type target detection function can meet the complex security needs in the park and improve the overall security management capability of the park.
[0080] 3. Realize intelligent behavior analysis and abnormal identification: combined with the time series analysis model and the optical flow method, the behavior pattern of the target can be analyzed based on the historical position data of the target. By modeling and analyzing the motion trajectory of the target, the system can identify abnormal behaviors (such as abnormal wandering, unauthorized entry, etc.) and timely trigger the alarm mechanism. This function effectively improves the intelligence level of the system and can actively identify potential threats to prevent problems before they occur.
[0081] 4. Dynamic security management and policy adjustment: The system of the present application can dynamically adjust the management permissions and security access policies of the park based on the results of abnormal behavior detection. When abnormal behavior is detected in a certain area, the system can automatically strengthen the monitoring intensity of that area, restrict the entry of unauthorized personnel, or temporarily close the access rights of sensitive areas. This dynamic adjustment function makes the park security system more flexible and efficient, enabling it to quickly respond to actual situations and provide higher levels of security.
[0082] 5. Overall system optimization and resource conservation are achieved: Through intelligent behavior analysis and anomaly detection, the system can reduce false positive and false negative rates, optimizing resource allocation. For example, the system can reduce attention to the area when normal behavior is detected, allocating more resources to potentially dangerous areas, thereby improving system efficiency and reducing overall operating costs. The system of the present application can automatically adjust management permissions and access policies, reducing the need for human intervention and reducing labor costs while enhancing the execution and timeliness of security policies.
[0083] These aspects or other aspects of the present application will be more apparent in the following description of the embodiments. It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed in the exemplary embodiments or the related art description will be briefly introduced below. The drawings are used to provide further understanding of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application, and do not constitute a limitation of the present application. In the drawings:
[0085] Figure 1 Flowchart of the park security method based on image recognition of the embodiments of the present application.
[0086] Figure 2 Flowchart of capturing changes in static background through background modeling in the park security method based on image recognition of the embodiments of the present application.
[0087] Figure 3 Flowchart of identifying moving targets in dynamic scenes through motion detection in the park security method based on image recognition of the embodiments of the present application.
[0088] Figure 4 Flowchart of analysis through time series analysis model combined with optical flow method in the park security method based on image recognition of the embodiments of the present application. DETAILED DESCRIPTION
[0089] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0090] In some of the processes described in this specification and in the claims, and in the accompanying drawings, operations can occur in different sequences and / or concurrently than described herein. The sequences of operations are merely examples and are not limited to the specific orders in which the operations are presented herein. Further, the sequences of operations are not limited to the specific orders in which the operations are presented herein, unless specified otherwise. Additionally, some of the operations can be performed and / or implemented by one or more components of the systems described herein, in some embodiments. The operations described herein can be implemented by one or more components of the systems described herein, in some embodiments. The description herein of a process or processes is not intended to limit the process or processes to the specific operations described herein, unless specified otherwise. Rather, the processes described herein include any number of additional operations and / or operations with different sequences, and the processes described herein can be combined with other processes in any manner.
[0091] The technical solutions in the exemplary embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.
[0092] Since the traditional security system mainly relies on manpower and simple alarm devices, there are problems of limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis capability, and low intelligentization degree, which makes it difficult to effectively protect the safety of the park and the equipment. The park security method and system based on image recognition provided by the present application uses image recognition to monitor the park in real time, which can greatly improve the park security efficiency, reduce the false alarm rate and improve the response speed, can timely issue early warning when abnormal situation occurs, and through intelligent monitoring and analysis, realizes all-round protection of potential security threats in the park, thereby effectively protecting the safety of the park and the internal equipment.
[0093] The technical solutions of the present application will be further described below with reference to specific embodiments:
[0094] Referring to Figure 1 as shown, Figure 1 A flowchart of a park security method based on image recognition provided by the present application. The park security method based on image recognition provided in an embodiment of the present application includes the following steps:
[0095] Step S10, real-time video data in the park is collected by a high-definition camera, and edge detection and occlusion detection are performed on the video data to obtain preprocessed image data;
[0096] Step S20, the preprocessed image data is detected and classified by a pre-trained target detection model to identify and locate target position data;
[0097] Step S30, the target behavior is analyzed based on the target position data by a time series analysis model combined with an optical flow method, and an abnormal behavior is identified to trigger an alarm mechanism;
[0098] Step S40, the management authority and security access strategy of the park are dynamically adjusted based on the abnormal behavior monitoring result.
[0099] In this embodiment, when the edge detection is performed on the video data, the edge is extracted according to the gradient information of the image in the real-time video data, and the edge position in the image is determined by calculating the gradient of the image in the horizontal direction and the vertical direction.
[0100] The edge detection on the video data includes the following steps:
[0101] Image graying: the input color video frame is graying processed, wherein:
[0102]
[0103] In the formula, is a gray image, R, G, B respectively represent the pixel values of the red, green and blue channels in the color image;
[0104] The Sobel operator is applied to the gray image in the horizontal direction and the vertical direction using convolution kernels respectively, and the gradient images in the horizontal direction and the vertical direction are calculated respectively; wherein the convolution kernel used by the Sobel operator in the horizontal direction is:
[0105]
[0106] In the formula, is the gradient image obtained by applying the Sobel operator in the horizontal direction, which represents the edge intensity of the image in the horizontal direction;
[0107] The convolution kernel used by the Sobel operator in the vertical direction is:
[0108]
[0109] In the formula, is the gradient image obtained by applying the Sobel operator in the vertical direction, which represents the edge intensity of the image in the vertical direction;
[0110] The calculated horizontal gradient image is:
[0111]
[0112] The calculated vertical gradient image is:
[0113]
[0114] Calculating the gradient magnitude and direction: according to the calculated horizontal and vertical gradient images, the gradient magnitude and direction of each pixel are calculated, and the pixel points with a gradient magnitude greater than a preset edge threshold are retained as edges; wherein the gradient magnitude of each pixel is:
[0115]
[0116] The direction of each pixel is:
[0117]
[0118] The pixel points that are edges are:
[0119]
[0120] In the formula, is the gradient magnitude image, indicating the total edge intensity at each pixel, synthesized by the horizontal and vertical gradients through the Euclidean norm; is the binarized edge image, indicating the presence or absence of edges, 1 or 255 indicating edges, and 0 indicating non-edges; Threshold is the edge threshold, and only when the gradient magnitude is greater than this edge threshold, the pixel will be marked as an edge.
[0121] For example, when processing a video, each frame is a 640x480 pixel grayscale image. Each frame will go through the above steps to extract a binary image containing edges. These edge images are combined in order to form an edge video stream, showing the contour information of the objects in the video.
[0122] In this embodiment, when performing occluder detection on video data, changes in the static background are captured through background modeling, and moving targets in the dynamic scene are identified through motion detection.
[0123] Wherein, referring to Figure 2 When performing occluder detection on video data, changes in the static background are captured through background modeling, including the following steps:
[0124] Step S101: Statistically analyze the first few frames of the video data and initialize the background model using a Gaussian mixture model, where the background of each pixel is modeled by multiple Gaussian distributions.
[0125] Step S102: Calculate the matching degree between the current value of each pixel and the background model for each frame of video data. When the matching degree reaches the matching threshold, update the background model; otherwise, treat the pixel as the foreground.
[0126] Step S103: Compare the current frame with the background model to identify foreground pixels and foreground objects in the video data.
[0127] The formula for calculating the matching degree between the current value of each pixel and the background model is as follows:
[0128]
[0129] In the formula, Let K represent the probability distribution of pixels in the background model, where K is the number of Gaussian distributions. These are the weights of the k-th distribution. It is the k-th Gaussian distribution. The mean, It is the covariance matrix;
[0130] The conditions for comparing the current frame with the background model are:
[0131]
[0132] in, For the set matching threshold, This is a foreground detection mask used to indicate whether the current pixel is foreground; 1 indicates foreground and 0 indicates background. For the background model in position The pixel value at that location.
[0133] For example, when processing a segment of park surveillance video, a Gaussian mixture model is first used to construct a background model to identify changes in the static background. Then, an inter-frame differencing method is used to identify moving targets in the video. Finally, the two are combined to obtain the final foreground mask containing occlusions and moving targets. Through further processing, these foreground regions can be used to trigger alarms, track targets, or adjust park security strategies.
[0134] In this embodiment, see Figure 2 As shown, when performing occlusion detection on video data and identifying moving targets in a dynamic scene through motion detection, the following steps are included:
[0135] Step S201: Calculate the difference image between the current frame and the previous frame, and extract the moving objects;
[0136] Step S202, threshold processing is performed on the difference image to generate a binary motion detection mask;
[0137] Step S203, morphological operation is performed on the motion mask to remove noise and enhance the target region;
[0138] Step S204, the result of motion detection is combined with the foreground result of background modeling to enhance the detection of the occluder.
[0139] wherein, the difference image between the current frame and the previous frame is calculated, wherein the calculation formula of the inter-frame difference is:
[0140]
[0141] In the formula, is the difference image of the current frame and the previous frame, indicating the motion of the pixel at position at time t; is the pixel value at position at time t, that is, the pixel value of the current frame; is the pixel value at position at time t-1, that is, the pixel value of the previous frame;
[0142] When threshold processing is performed on the difference image, the calculation formula of the threshold processing is:
[0143]
[0144] In the formula, is the binary motion detection mask, indicating which pixels in the current frame have motion, 1 indicating motion and 0 indicating stillness;
[0145] When the result of motion monitoring is combined with the foreground result of background modeling, the calculation formula is:
[0146]
[0147] In the formula, is the final foreground mask, which combines the results of background modeling and motion detection, indicating the foreground region.
[0148] In this embodiment, when the preprocessed image data is detected and classified by the pre-trained target detection model, the target detection model is pre-trained based on the YOLO model, the preprocessed image data is scaled, the scaled image pixel value is normalized to the interval [0, 1], the image data is expanded to a four-dimensional tensor, a convolution operation is applied to the input image to generate a feature map, and the pre-trained target detection model identifies and locates the target position data based on the feature map.
[0149] wherein the image is scaled to the input size required by the YOLO model, the input fixed size can be 416x416 or 608x608 to match the input of the YOLO model, then the image pixel value is normalized to the range [0, 1] to improve the convergence speed of the model, the image data is expanded to a four-dimensional tensor, and a batch dimension is added to adapt to the model input. When the YOLO model extracts features, a convolution layer is first used to extract image features, and the convolution operation is to apply a convolution operation to the input image to generate a feature map. The convolution operation of each layer is represented as:
[0150]
[0151] wherein, is the feature map of the i-th layer, and are the convolution kernel weight and bias of the i-th layer, represents the convolution operation, is an activation function defined as . When predicting the multiple bounding boxes and their class probabilities of each grid cell based on the feature map, each grid cell predicts B bounding boxes, and each bounding box is represented by the following four parameters: center coordinates (x, y) and width and height (w, h).
[0152] For example, when a YOLOv3 model is used to detect targets in an image of 640x480, the steps are as follows: 1. Input image: the original image size is 640x480, which is scaled to 416x416.
[0153] 2. Model prediction: the feature map output by the YOLOv3 model has a size of 13x13x255.
[0154] 1. Input image: the original image size is 640x480, which is scaled to 416x416. 2. Model prediction: the feature map output by the YOLOv3 model has a size of 13x13x255.
[0155] 1. Input image: the original image size is 640x480, which is scaled to 416x416. 13x13, each cell predicts 3 bounding boxes, a total of 169 cells, a total of 507 bounding boxes.
[0156] 3. Bounding box adjustment: adjust the coordinates of these bounding boxes, convert to the size of the original image.
[0157] 4. Non-maximum suppression: apply NMS algorithm to remove bounding boxes with low confidence and overlap, and finally retain the target with the highest confidence.
[0158] In this embodiment, referring to Figure 3 As shown, the target behavior is analyzed based on the target position data by the time series analysis model combined with the optical flow method, including the following steps:
[0159] Step S301, the pre-trained YOLO model is used for target detection on each frame of image, and the bounding box coordinates of the target are obtained, and the center point of the target is extracted from the bounding box coordinates as position data;
[0160] Step S302, the displacement of the target between frames is calculated by Lucas-Kanade, and the trajectory of the target is updated using the displacement calculated by the optical flow, and the motion trajectory of the target is obtained;
[0161] Step S303, modeling is performed by ARIMA model, and a time series model is trained to identify the normal behavior pattern of the target;
[0162] Step S304, the trajectory data at the current time is input into the time series model to predict the next motion position, and the predicted target position is compared with the actual position to calculate the error;
[0163] Step S305, if the error exceeds the set threshold, it is determined as abnormal behavior, and when the abnormal behavior is detected, the system triggers the alarm mechanism.
[0164] The park security method based on image recognition of the application can capture the dynamic situation in the park in detail by collecting real-time video data in the park through a high-definition camera, and ensure that the monitoring system has high resolution and high definition. The image data preprocessing is carried out by using edge detection and occlusion detection technology, which can effectively eliminate interference factors, enhance the accuracy of target detection, and improve the robustness of the system. The pre-trained target detection model is used for multi-type target detection and classification of the preprocessed image data, which can not only identify different types of targets (such as personnel, vehicles, animals, etc.), but also accurately locate the position data of the target. This multi-type target detection function can meet the complex security needs in the park and improve the overall security management capability of the park.
[0165] The application combines time series analysis model and optical flow method, can analyze the behavior pattern of the target based on the historical position data of the target. By modeling and analyzing the motion trajectory of the target, the system can identify abnormal behavior (such as abnormal wandering, unauthorized entry, etc.) and trigger the alarm mechanism in time. This function effectively improves the intelligent level of the system, can actively identify potential threats and prevent trouble before it happens.
[0166] It should be understood that although the above steps are described in a certain order, these steps are not necessarily executed in the above order. Unless explicitly stated herein, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, part of the steps of the present embodiment can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0167] In one embodiment, the present application provides an image recognition-based park security system for executing the above-mentioned image recognition-based park security method, which comprises:
[0168] A data acquisition module is configured to acquire real-time video data in the park through a high-definition camera, and perform edge detection and occlusion detection on the video data to obtain preprocessed image data.
[0169] A target detection module is configured to detect and classify multiple types of targets in the preprocessed image data through a pre-trained target detection model, and identify and locate target position data.
[0170] An anomaly recognition module is configured to analyze target behavior based on target position data through a time series analysis model combined with an optical flow method, identify abnormal behavior, and trigger an alarm mechanism.
[0171] A permission management module is configured to dynamically adjust the management permissions and security access strategies of the park based on the abnormal behavior monitoring results.
[0172] In the present embodiment, the image recognition-based park security system adopts the steps of the above-mentioned image recognition-based park security method when executed, therefore, the running process of the image recognition-based park security system in the present embodiment will not be introduced in detail.
[0173] In summary, the park security method and system based on image recognition of the present application aims to improve the intelligent level of park safety management. The method and system collect real-time dynamic video data in the park through high-definition cameras, preprocess the image data using edge detection and occlusion detection technology, then detect and classify multiple types of targets in the image through a pre-trained target detection model, accurately identify and locate the target position. The system also combines time series analysis model and optical flow method to intelligently analyze the behavior of the target, can identify abnormal behavior and trigger the alarm mechanism in time. In addition, the system can dynamically adjust the management authority and security access strategy of the park based on the detection results of abnormal behavior, so as to realize efficient and safe management of the park.
[0174] The present application collects real-time high-definition video data in the park through high-definition cameras, combines edge detection and occlusion detection technology, can effectively filter interference and ensure the accuracy of subsequent image processing. This processing method ensures the high quality of data and helps to improve the overall performance of the system. The system of the present application uses a pre-trained target detection model to accurately detect and classify multiple types of targets from preprocessed image data. This multi-target detection capability can adapt to complex park environments, identify different types of targets such as people, vehicles, and animals, and provide more comprehensive security coverage. The system has good scalability and can be customized according to the specific needs of different parks, such as adding more target types, optimizing abnormal behavior recognition algorithms, or adjusting permission management strategies. The system can also adapt to different sizes of park environments and has wide application prospects. The park security method and system based on image recognition of the present application provide a comprehensive and intelligent security solution for parks through efficient data collection and processing, accurate multi-target detection, intelligent behavior analysis, and dynamic permission management. The system not only improves the security of the park, but also optimizes resource allocation and reduces operating costs, has significant practical value and market potential.
[0175] In one embodiment, a computer device is also provided in the embodiment of the present application, comprising at least one processor, and a memory connected with the at least one processor in communication, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to make the at least one processor execute the steps of the park security method based on image recognition.
[0176] In one embodiment, the present application also provides a computer readable storage medium, which stores computer instructions for making the computer execute the steps of the park security method based on image recognition.
[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware by a computer program represented by computer instructions. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments of the methods. Any reference to memory, storage, database or other medium used in each embodiment provided in the present application can include at least one of non-volatile and volatile memory.
[0178] The non-volatile memory can include read-only memory, magnetic tape, floppy disk, flash memory or optical memory, etc. The volatile memory can include random access memory or external cache memory. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory or dynamic random access memory, etc.
[0179] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An image recognition-based park security method, characterized by, The method comprises the following steps: Collect real-time video data in the park through a high-definition camera, and perform edge detection and occlusion detection on the video data to obtain preprocessed image data; Detect and classify multiple types of targets on the preprocessed image data through a pre-trained target detection model, and identify and locate target position data; Analyze target behavior based on the target position data through a time series analysis model combined with an optical flow method, identify abnormal behavior, and trigger an alarm mechanism; Dynamically adjust the management authority and security access strategy of the park based on the abnormal behavior monitoring results; When detecting the occlusion of the video data, changes in the static background are captured through background modeling, moving targets in the dynamic scene are identified through motion detection, and changes in the static background are captured through background modeling, comprising the following steps: Statistical analysis of the first few frames of video data, using a Gaussian mixture model to initialize the background model, wherein the background of each pixel is modeled by multiple Gaussian distributions; Calculate the matching degree of each pixel's current value and the background model for each frame of video data, update the background model when the matching degree reaches the matching threshold, otherwise consider the pixel as foreground; Compare the current frame with the background model to identify foreground pixels and foreground objects in the video data; When identifying moving targets in the dynamic scene through motion detection, the following steps are included: Calculate the difference image between the current frame and the previous frame, and extract the moving object; Threshold processing is performed on the difference image to generate a binary motion detection mask; Perform morphological operations on the motion mask to remove noise and enhance the target area; Combine the results of motion detection with the foreground results of background modeling to enhance the detection of occlusions; When calculating the difference image between the current frame and the previous frame, the calculation formula for inter-frame difference is: In the formula, is the difference image of the current frame and the previous frame, indicating the motion of the pixel at position at time t; is the pixel value at position at time t, that is, the pixel value of the current frame; is the pixel value at position at time t-1, that is, the pixel value of the previous frame; When threshold processing is performed on the difference image, the calculation formula for threshold processing is: In the formula, is the binary motion detection mask, indicating which pixels in the current frame have motion, 1 indicating motion and 0 indicating stillness; When combining the results of motion monitoring with the foreground results of background modeling, the calculation formula is: In the formula, The result of background modeling is combined with the result of motion detection to represent the foreground region as a final foreground mask. 2.The image recognition-based park security method of claim 1, wherein, When performing edge detection on the video data, the edges are extracted based on the gradient information of the image in the real-time video data, and the edge positions in the image are determined by calculating the gradients in the horizontal and vertical directions. 3.The image recognition-based park security method of claim 2, wherein, Edge detection on video data includes the following steps: Image graying: grayscale processing is performed on the input color video frame; Apply the Sobel operator to perform convolution operation on the grayscale image using convolution kernels in the horizontal and vertical directions, respectively, to calculate the gradient images in the horizontal and vertical directions; According to the calculated horizontal and vertical gradient images, calculate the gradient amplitude and direction of each pixel, and retain the pixel points with gradient amplitude greater than the preset edge threshold as edges. 4.The image recognition-based park security method of claim 1, wherein When performing multi-type target detection and classification on pre-processed image data using a pre-trained target detection model, the target detection model is pre-trained based on the YOLO model. The pre-processed image data is scaled, and the pixel values of the scaled image are normalized to the [0, 1] interval. The image data is expanded into a four-dimensional tensor, and a convolution operation is applied to the input image to generate a feature map. Based on the feature map, multiple bounding boxes and their class probabilities for each grid cell are predicted, thus obtaining the target location data that the pre-trained target detection model can identify and locate. 5.The image recognition-based park security method of claim 4, wherein, The target behavior is analyzed based on target location data using a time series analysis model combined with optical flow methods, including the following steps: The pre-trained YOLO model is used to detect objects in each frame of the image, obtain the bounding box coordinates of the objects, and extract the center point of the objects as the location data from the bounding box coordinates. The target's displacement between frames is calculated using Lucas-Kanade, and the target's trajectory is updated using the displacement calculated by optical flow to obtain the target's motion trajectory; By modeling with an ARIMA model, a time series model is trained to identify the normal behavioral patterns of the target. The trajectory data at the current moment is input into the time series model to predict the next movement position. The predicted target position is compared with the actual position, and the error is calculated. If the error exceeds the set threshold, it is judged as abnormal behavior. When abnormal behavior is detected, the system triggers an alarm mechanism.
6. An image recognition-based park security system, characterized by, The system is used to perform the steps of the image recognition-based campus security method as described in any one of claims 1-5, the system comprising: The data acquisition module is used to acquire real-time video data within the park through high-definition cameras, and to perform edge detection and occlusion detection on the video data to obtain pre-processed image data. The target detection module is used to detect and classify multiple types of targets in pre-processed image data using a pre-trained target detection model, and to identify and locate the target location data. The anomaly detection module is used to analyze target behavior based on target location data by combining time series analysis model with optical flow method, identify abnormal behavior and trigger alarm mechanism; The access control module is used to dynamically adjust the management permissions and security access policies of the park based on the results of abnormal behavior monitoring.
Citation Information
Patent Citations
Method of detecting moving target under static background
CN107154053A
Campus stray animal detection method and system based on inter-frame difference
CN117132938A
Workshop security system and method based on visual multi-modal analysis
CN117935452A
Intelligent inspection device and alarm method
CN118658126A