Park security and protection method and system based on image recognition

By introducing image recognition-based technology into the park security system, multiple types of target detection and behavioral analysis are realized, and problems such as limited monitoring coverage and slow response speed of traditional security systems are solved, and the intelligence level and efficiency of park security management are improved.

CN119888620AActive Publication Date: 2025-04-25GUANGZHOU ZHIYE ENERGY SAVING TECH +1

Patent Information

Application Number
CN202510030016.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-25
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

Traditional park security systems have problems such as limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis capabilities and low intelligence, making it difficult to effectively ensure the safety of parks and equipment.

Method used

The park security method based on image recognition is adopted, video data is collected through high-definition cameras, edge detection and occlusion detection are performed, and a pre-trained object detection model and time series analysis model is used to realize multi-type object detection, behavioral analysis and dynamic security strategy adjustment.

Benefits of technology

It greatly improves the security efficiency of the park, reduces the false alarm rate, improves the response speed, and achieves comprehensive protection of potential security threats in the park, effectively ensuring the safety of the park and its internal equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888620A_ABST
    Figure CN119888620A_ABST
Patent Text Reader

Abstract

The invention provides a park security method and system based on image recognition, and relates to the technical field of security monitoring, and the method comprises the steps: collecting real-time video data in a park through a high-definition camera, carrying out the edge detection and shielding object detection of the video data, and obtaining the preprocessed image data; performing multi-type target detection and classification on the preprocessed image data through a pre-trained target detection model, and identifying and positioning target position data; analyzing a target behavior based on the target position data through a time sequence analysis model in combination with an optical flow method, identifying an abnormal behavior and triggering an alarm mechanism; and dynamically adjusting the management authority and the security access strategy of the park based on the abnormal behavior detection result. According to the invention, through intelligent monitoring and analysis, all-around protection of potential security threats in the park is realized, so that the security of the park and internal equipment thereof is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of security monitoring, and in particular to a campus security method and system based on image recognition. Background Art

[0002] With the acceleration of urbanization and the development of modern park construction, the security management needs of parks have become increasingly important. Security issues in parks not only involve personal and property safety, but also the normal operation of various facilities and equipment in the park, especially in industrial parks, commercial parks or scientific research parks where there are a large number of personnel activities and equipment operation. Security issues are more prominent. At present, traditional park security systems mainly rely on physical barriers (such as fences, access control), manual patrols and simple monitoring and alarm systems. These methods have the following deficiencies in practical applications: 1. Limited monitoring coverage: Traditional camera monitoring systems usually have fixed monitoring angles and ranges, and cannot provide all-round, all-around monitoring. Especially in some large parks, there are blind spots and monitoring blind spots, which are easily exploited by criminals.

[0003] 2. Slow response: 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 surveillance video for identification and confirmation, which usually takes a certain amount of time, resulting in slow response and inability to achieve a quick response to emergency situations.

[0004] 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 activities, equipment misoperation, etc.), and false alarms or missed alarms often occur, reducing the reliability of the security system and the user's trust.

[0005] 4. Weak data analysis capabilities: The data collected by traditional security systems are mainly in the form of video recordings. The data volume is huge and unstructured, making it difficult to conduct effective data analysis and mining, and unable to provide in-depth decision-making support for the security management of the park.

[0006] 5. Low intelligence: Most current security systems are passive response types, lacking intelligent analysis and active defense capabilities. The system cannot dynamically adjust security strategies according to changes in the on-site environment, nor can it actively identify and warn of possible security threats in the park.

[0007] Since traditional security systems mainly rely on manpower and simple alarm devices, they have limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis capabilities and low intelligence, making it difficult to effectively ensure the safety of the park and equipment. Therefore, an intelligent security system that can combine image recognition is urgently needed as an effective solution to achieve real-time monitoring and early warning of various abnormal situations in the park. Summary of the invention

[0008] In view of this, and in response to the shortcomings of existing park security systems, the present invention proposes a park security method and system based on image recognition, which uses image recognition to conduct real-time monitoring of the park, can greatly improve the park security efficiency, reduce the false alarm rate and increase the response speed, and can issue early warnings in time when abnormal situations occur. Through intelligent monitoring and analysis, it can achieve all-round protection against potential security threats in the park, thereby effectively ensuring the safety of the park and its internal equipment.

[0009] The present invention is implemented by the following technical solutions: In a first aspect, the present invention provides a campus security method based on image recognition, the method comprising the following steps: Real-time video data in the park is collected through high-definition cameras, and edge detection and occlusion detection are performed on the video data to obtain pre-processed image data; The pre-trained target detection model is used to detect and classify multiple types of targets on the pre-processed image data, and the target position data is identified and located; Analyze the target behavior based on the target location data through the time series analysis model combined with the optical flow method, identify abnormal behavior and trigger the alarm mechanism; Dynamically adjust the park’s management authority and security access policies based on abnormal behavior monitoring results.

[0010] As a further solution of the present invention, when edge detection is performed on video data, edges are extracted based on 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 and vertical directions.

[0011] As a further solution of the present invention, edge detection is performed on video data, comprising the following steps: Image grayscale: grayscale the input color video frame, where:

[0012] In the formula, is a grayscale image, R, G, B Respectively represent the pixel values ​​of the red, green, and blue channels in a color image; The Sobel operator is used to perform convolution operations 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, respectively; the convolution kernel used by the Sobel operator in the horizontal direction is:

[0013] In the formula, is the gradient image obtained by applying the Sobel operator in the horizontal direction, which indicates the edge strength of the image in the horizontal direction; The convolution kernel used by the Sobel operator in the vertical direction is:

[0014] In the formula, The gradient image obtained by applying the Sobel operator in the vertical direction represents the edge strength of the image in the vertical direction; The calculated horizontal gradient image is:

[0015] The calculated vertical gradient image is:

[0016] Calculate the gradient magnitude and direction: Calculate the gradient magnitude and direction of each pixel based on the calculated horizontal and vertical gradient images, and retain the pixels whose gradient magnitude is greater than the preset edge threshold as the edge; the gradient magnitude of each pixel is:

[0017] The direction of each pixel is:

[0018] The pixel points as edges are:

[0019] In the formula, is the gradient magnitude image, which represents the total edge strength at each pixel, synthesized by the horizontal and vertical gradients through the Euclidean norm; is the edge image after binarization, indicating the existence of an edge. 1 or 255 indicates an edge, and 0 indicates a non-edge. Threshold is the edge threshold. The pixel will be marked as an edge only when the gradient amplitude is greater than this edge threshold.

[0020] As a further solution of the present invention, when performing occlusion detection on video data, changes in static background are captured by background modeling, and moving targets in dynamic scenes are identified by motion detection.

[0021] As a further solution of the present invention, when performing occlusion detection on video data and capturing changes in a static background by background modeling, the following steps are included: The first several frames of the video data are counted and the background model is initialized using a mixed Gaussian model, where the background of each pixel is modeled by multiple Gaussian distributions; For each frame of video data, the matching degree between the current value of each pixel and the background model is calculated. When the matching degree reaches the matching threshold, the background model is updated, otherwise the pixel is regarded as the foreground. The current frame is compared to the background model, foreground pixels are identified, and foreground objects in the video data are identified.

[0022] As a further solution of the present invention, the calculation formula for calculating the matching degree between the current value of each pixel and the background model is:

[0023] In the formula, is the probability distribution of pixels 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; The conditions for comparing the current frame with the background model are:

[0024] in, is the matching threshold set, It is the foreground detection mask, which is used to indicate whether the current pixel is the foreground, 1 indicates the foreground, and 0 indicates the background; For the background model at position The pixel value at .

[0025] As a further solution of the present invention, when performing occlusion detection on video data and identifying moving targets in dynamic scenes through motion detection, the following steps are included: Calculate the difference image between the current frame and the previous frame to extract the moving object; Thresholding 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; The results of motion detection are combined with the foreground results of background modeling to enhance the detection of occluders.

[0026] As a further solution of the present invention, a difference image between the current frame and the previous frame is calculated, wherein the calculation formula for the difference between frames is:

[0027] In the formula, is the difference image between the current frame and the previous frame, indicating that at time t, position The motion of the pixel at At time t, the position The pixel value at , that is, the pixel value of the current frame; At time t-1, the position The pixel value at is the pixel value of the previous frame; When threshold processing is performed on the difference image, the calculation formula for the threshold processing is:

[0028] In the formula, It is the binary motion detection mask, which indicates which pixels have moved in the current frame, 1 indicates movement, and 0 indicates stillness; When the results of motion monitoring are combined with the foreground results of background modeling, the calculation formula is:

[0029] In the formula, For the final foreground mask, the results of background modeling and motion detection are combined to represent the foreground area.

[0030] As a further solution of the present invention, when detecting and classifying multiple types of targets on preprocessed image data through a pre-trained target detection model, the pre-processed image data is scaled based on the YOLO model, the scaled image pixel values ​​are normalized to the [0, 1] interval, and 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 category probabilities of each grid unit are predicted, and the pre-trained target detection model is used to identify and locate the target position data.

[0031] As a further solution of the present invention, the target behavior is analyzed based on the target position data by combining the time series analysis model with the optical flow method, including the following steps: Use the pre-trained YOLO model to detect the target in each frame, obtain the bounding box coordinates of the target, and extract the center point of the target from the bounding box coordinates as the position data; The displacement of the target between frames is calculated by Lucas-Kanade, and the displacement calculated by optical flow is used to update the trajectory of the target to obtain the motion trajectory of the target; The ARIMA model is used to build a model and train the time series model to identify the normal behavior pattern of the target; Input the current trajectory data into the time series model to predict the next movement position, compare the predicted target position with the actual position, and calculate the error; If the error exceeds the set threshold, it is judged as abnormal behavior. When abnormal behavior is detected, the system triggers an alarm mechanism.

[0032] In a second aspect, the present invention also includes a campus security system based on image recognition, the system comprising: The data acquisition module is used to 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 pre-processed image data; The target detection module is used to detect and classify multiple types of targets on the preprocessed image data through the pre-trained target detection model, and identify and locate the target position data; The anomaly recognition module is used to analyze the target behavior based on the target location data by combining the time series analysis model with the optical flow method, identify abnormal behavior and trigger the alarm mechanism; The authority management module is used to dynamically adjust the park's management authority and security access strategy based on abnormal behavior monitoring results.

[0033] The present invention also includes a computer device, comprising: at least one processor, and a memory communicatively connected to 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 so that the at least one processor executes the campus security method based on image recognition.

[0034] The present invention also includes a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the campus security method based on image recognition.

[0035] Compared with the prior art, the campus security method and system based on image recognition provided by the present invention has the following beneficial effects: 1. Improved real-time performance and accuracy: Real-time video data in the park is collected through high-definition cameras, which can accurately capture the dynamic situation in the park and ensure that the monitoring system has high resolution and high definition. The use of edge detection and occlusion detection technology for image data preprocessing can effectively eliminate interference factors, enhance the accuracy of target detection, and improve the robustness of the system.

[0036] 2. Accurate detection of multiple types of targets: The pre-trained target detection model detects and classifies multiple types of targets on pre-processed image data, which can not only identify different types of targets (such as people, vehicles, animals, etc.), but also accurately locate the location data of the targets. This multi-type target detection function can meet the complex security needs of the park and improve the overall security management capabilities of the park.

[0037] 3. Intelligent behavior analysis and anomaly identification: Combining the time series analysis model and the optical flow method, the behavior pattern of the target can be analyzed based on its historical location data. By modeling and analyzing the target's motion trajectory, the system can identify abnormal behaviors (such as abnormal wandering, unauthorized entry, etc.) and trigger the alarm mechanism in time. This function effectively improves the intelligence level of the system, and can actively identify potential threats and prevent them before they happen.

[0038] 4. Dynamic security management and policy adjustment: The system of the present invention can dynamically adjust the management authority and security access policy of the park based on the abnormal behavior detection results. When abnormal behavior is detected in a certain area, the system can automatically strengthen the monitoring of the 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, and can respond quickly according to the actual situation, providing a higher level of security.

[0039] 5. Achieved overall system optimization and resource conservation: Through intelligent behavior analysis and anomaly detection, the system can reduce false alarm rates and missed alarm rates and optimize resource allocation. For example, when the system detects normal behavior, it can pay less attention to the area and allocate more resources to potential dangerous areas, thereby improving the system's operating efficiency and reducing overall operating costs. The system of the present invention can automatically adjust management permissions and access policies, reducing the need for manual intervention, reducing labor costs, and enhancing the execution and timeliness of security strategies.

[0040] These and other aspects of the present invention will be more clearly understood 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 invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the exemplary embodiments or related technical descriptions. The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings: Figure 1The figure is a flow chart of a campus security method based on image recognition according to an embodiment of the present invention.

[0042] Figure 2 The present invention is a flowchart of capturing changes in a static background through background modeling in a campus security method based on image recognition according to an embodiment of the present invention.

[0043] Figure 3 The present invention is a flow chart of identifying moving targets in dynamic scenes through motion detection in a campus security method based on image recognition according to an embodiment of the present invention.

[0044] Figure 4 The present invention is a flowchart of an image recognition-based campus security method according to an embodiment of the present invention, which uses a time series analysis model combined with an optical flow method for analysis. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0047] The following will be combined with the drawings in the exemplary embodiments of the present invention to clearly and completely describe the technical solutions in the exemplary embodiments of the present invention. Obviously, the exemplary embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0048] Since traditional security systems mainly rely on manpower and simple alarm devices, they have problems such as limited monitoring coverage, slow response speed, high false alarm rate, weak data analysis ability, and low intelligence, making it difficult to effectively ensure the safety of the park and equipment. The present invention 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 increase the response speed, and can issue early warnings in time when abnormal situations occur. Through intelligent monitoring and analysis, it can achieve all-round protection against potential security threats in the park, thereby effectively ensuring the safety of the park and its internal equipment.

[0049] The technical solution of the present invention is further described below in conjunction with specific embodiments: See also Figure 1 As shown, Figure 1 A flow chart of a campus security method based on image recognition provided by the present invention. A campus security method based on image recognition provided in one embodiment of the present invention comprises the following steps: Step S10: collect real-time video data in the park through a high-definition camera, and perform edge detection and obstruction detection on the video data to obtain pre-processed image data; Step S20: 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; Step S30: Analyze the target behavior based on the target position data by combining the time series analysis model with the optical flow method, identify abnormal behavior and trigger an alarm mechanism; Step S40: Dynamically adjust the management authority and security access strategy of the park based on the abnormal behavior monitoring results.

[0050] In this embodiment, when edge detection is performed on video data, edges are extracted based on gradient information of the image in the real-time video data, and the edge positions in the image are determined by calculating the gradients of the image in the horizontal and vertical directions.

[0051] The edge detection of the video data includes the following steps: Image grayscale: grayscale the input color video frame, where:

[0052] In the formula, is a grayscale image, R, G, B Respectively represent the pixel values ​​of the red, green, and blue channels in a color image; The Sobel operator is used to perform convolution operations 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, respectively; the convolution kernel used by the Sobel operator in the horizontal direction is:

[0053] In the formula, is the gradient image obtained by applying the Sobel operator in the horizontal direction, which indicates the edge strength of the image in the horizontal direction; The convolution kernel used by the Sobel operator in the vertical direction is:

[0054] In the formula, The gradient image obtained by applying the Sobel operator in the vertical direction represents the edge strength of the image in the vertical direction; The calculated horizontal gradient image is:

[0055] The calculated vertical gradient image is:

[0056] Calculate the gradient magnitude and direction: Calculate the gradient magnitude and direction of each pixel based on the calculated horizontal and vertical gradient images, and retain the pixels whose gradient magnitude is greater than the preset edge threshold as the edge; the gradient magnitude of each pixel is:

[0057] The direction of each pixel is:

[0058] The pixel points as edges are:

[0059] In the formula, is the gradient magnitude image, which represents the total edge strength at each pixel, synthesized by the horizontal and vertical gradients through the Euclidean norm; is the edge image after binarization, indicating the existence of an edge. 1 or 255 indicates an edge, and 0 indicates a non-edge. Threshold is the edge threshold. The pixel will be marked as an edge only when the gradient amplitude is greater than this edge threshold.

[0060] For example, when processing a video, each frame is a grayscale image of 640x480 pixels. Each frame will go through the above steps to extract a binary image containing edges. These edge images are combined in sequence to form an edge video stream, which shows the contour information of the object in the video.

[0061] In this embodiment, when performing occlusion detection on video data, changes in static background are captured through background modeling, and moving targets in dynamic scenes are identified through motion detection.

[0062] Among them, see Figure 2 As shown, when detecting occlusions in video data and capturing changes in a static background through background modeling, the following steps are included: Step S101, performing statistics on the first several frames of the video data, and initializing the background model using a mixed Gaussian model, wherein the background of each pixel is modeled by multiple Gaussian distributions; 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, regard the pixel as the foreground. Step S103: compare the current frame with the background model, identify foreground pixels, and identify foreground objects in the video data.

[0063] The calculation formula for calculating the matching degree between the current value of each pixel and the background model is:

[0064] In the formula, is the probability distribution of pixels 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; The conditions for comparing the current frame with the background model are:

[0065] in, is the matching threshold set, It is the foreground detection mask, which is used to indicate whether the current pixel is the foreground, 1 indicates the foreground, and 0 indicates the background; For the background model at position The pixel value at .

[0066] For example, when processing a video of a campus surveillance video, the background model is first constructed using a mixed Gaussian model to identify changes in the static background. Then, the inter-frame difference method is combined to identify moving targets in the video. Finally, the two are combined to obtain the final foreground mask containing occluders and moving targets. Through further processing, these foreground areas can be used to trigger alarms, track targets, or adjust campus security strategies.

[0067] In this embodiment, see Figure 2 As shown, when performing occlusion detection on video data and identifying moving targets in dynamic scenes through motion detection, the following steps are included: Step S201, calculating the difference image between the current frame and the previous frame, and extracting the moving object; Step S202, performing threshold processing on the difference image to generate a binary motion detection mask; Step S203: performing morphological operations on the motion mask to remove noise and enhance the target area; Step S204: Combine the result of motion detection with the foreground result of background modeling to enhance the detection of occluders.

[0068] Among them, the difference image between the current frame and the previous frame is calculated, and the calculation formula for the difference between frames is:

[0069] In the formula, is the difference image between the current frame and the previous frame, indicating that at time t, position The motion of the pixel at At time t, the position The pixel value at , that is, the pixel value of the current frame; At time t-1, the position The pixel value at is the pixel value of the previous frame; When performing threshold processing on the difference image, the calculation formula for the threshold processing is:

[0070] In the formula, It is the binary motion detection mask, which indicates which pixels have moved in the current frame, 1 indicates movement, and 0 indicates stillness; When the results of motion monitoring are combined with the foreground results of background modeling, the calculation formula is:

[0071] In the formula, For the final foreground mask, the results of background modeling and motion detection are combined to represent the foreground area.

[0072] In this embodiment, when detecting and classifying multiple types of targets on the preprocessed image data through the pretrained target detection model, the preprocessed image data is scaled based on the YOLO model pre-trained target detection model, the scaled image pixel values ​​are normalized to the [0, 1] interval, and 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 category probabilities of each grid unit are predicted, and the pre-trained target detection model is used to identify and locate the target position data.

[0073] Among them, the image is scaled to the input size required by the YOLO model. The fixed size of the input can be 416×416 or 608×608 to match the input of the YOLO model. Then the image pixel values ​​are normalized to the range of [0, 1] to improve the convergence speed of the model. The image data is expanded into a four-dimensional tensor and the batch dimension is added to adapt to the model input. When the YOLO model performs feature extraction, the convolution layer is first used to extract image features. The convolution operation is to apply the convolution operation to the input image to generate a feature map. The convolution operation of each layer is expressed as:

[0074] In the formula, It is The feature map of the layer, and They are The convolution kernel weights and biases of the layer, represents the convolution operation, is the activation function, defined as .

[0075] Based on the feature map, when predicting multiple bounding boxes and their category probabilities for each grid cell, 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).

[0076] For example, when using the YOLOv3 model to detect an object on a 640x480 image, the steps are as follows: 1. Input image: The original image size is 640×480, which is scaled to 416×416.

[0077] 2. Model prediction: The feature map size output by the YOLOv3 model is 13×13, and each cell predicts 3 bounding boxes, a total of 169 cells are predicted, and a total of 507 bounding boxes.

[0078] 3. Bounding box adjustment: Adjust the coordinates of these bounding boxes and convert them to the size of the original image.

[0079] 4. Non-maximum suppression: Apply the NMS algorithm to remove bounding boxes with low confidence and overlap, and finally retain the target with the highest confidence.

[0080] In this embodiment, see Figure 3 As shown, the target behavior is analyzed based on the target position data by combining the time series analysis model with the optical flow method, including the following steps: Step S301: Detect the target on each frame of the image using the pre-trained YOLO model to obtain the bounding box coordinates of the target, and extract the center point of the target from the bounding box coordinates as position data; Step S302, using Lucas-Kanade to calculate the displacement of the target between frames, and using the displacement calculated by optical flow to update the trajectory of the target to obtain the motion trajectory of the target; Step S303: Modeling is performed through the ARIMA model, and the normal behavior pattern of the target is identified by training the time series model; Step S304: input the trajectory data at the current moment into the time series model to predict the next movement position, compare the predicted target position with the actual position, and calculate the error; Step S305: If the error exceeds the set threshold, it is determined to be abnormal behavior. When abnormal behavior is detected, the system triggers an alarm mechanism.

[0081] The present invention provides a park security method based on image recognition. By collecting real-time video data in the park through a high-definition camera, it is possible to accurately capture the dynamic situation in the park and ensure that the monitoring system has high resolution and high definition. The use of edge detection and occlusion detection technology for image data preprocessing can effectively eliminate interference factors, enhance the accuracy of target detection, and improve the robustness of the system. The preprocessed image data is detected and classified into multiple types of targets through a pre-trained target detection model, which can not only identify different types of targets (such as personnel, vehicles, animals, etc.), but also accurately locate the location data of the target. This multi-type target detection function can meet the complex security needs in the park and enhance the overall security management capabilities of the park.

[0082] The present invention combines the time series analysis model and the optical flow method to analyze the behavior pattern of the target based on its historical location data. By modeling and analyzing the target's motion trajectory, the system can identify abnormal behaviors (such as abnormal wandering, unauthorized entry, etc.) and trigger the alarm mechanism in time. This function effectively improves the intelligence level of the system, and can actively identify potential threats and prevent them before they happen.

[0083] It should be understood that, although described in a certain order, these steps are not necessarily performed in sequence in the above order. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, a part of the steps of the present embodiment may include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a part of the steps or stages in other steps or other steps.

[0084] In one embodiment, the present invention provides a campus security system based on image recognition, which is used to execute the above-mentioned campus security method based on image recognition, and the system includes: The data acquisition module is used to 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 pre-processed image data; The target detection module is used to detect and classify multiple types of targets on the preprocessed image data through the pre-trained target detection model, and identify and locate the target position data; The anomaly recognition module is used to analyze the target behavior based on the target location data by combining the time series analysis model with the optical flow method, identify abnormal behavior and trigger the alarm mechanism; The authority management module is used to dynamically adjust the park's management authority and security access strategy based on abnormal behavior monitoring results.

[0085] In this embodiment, the campus security system based on image recognition adopts the steps of the aforementioned campus security method based on image recognition during execution. Therefore, the operation process of the campus security system based on image recognition will not be introduced in detail in this embodiment.

[0086] In summary, the park security method and system based on image recognition of the present invention is intended to improve the intelligent level of park security management. The method and system collect dynamic video data in the park in real time through high-definition cameras, use edge detection and occlusion detection technology to pre-process image data, and 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 the time series analysis model and the optical flow method to perform intelligent analysis of the target's behavior, which can identify abnormal behavior and trigger the alarm mechanism in time. In addition, based on the detection results of abnormal behavior, the system can dynamically adjust the park's management authority and security access strategy, thereby achieving efficient and safe management of the park.

[0087] The present invention uses a high-definition camera to collect high-definition video data in the park in real time, and combines edge detection and obstruction detection technology to 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 invention adopts a pre-trained target detection model, which can accurately detect and classify multiple types of targets on the pre-processed image data. This multi-target detection capability can adapt to complex park environments, identify different types of targets such as personnel, vehicles, animals, etc., 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 authority management strategies. The system can also adapt to park environments of different sizes and has broad application prospects. The park security method and system based on image recognition of the present invention provide a comprehensive and intelligent security solution for the park through efficient data collection and processing, multi-target accurate detection, intelligent behavior analysis and dynamic authority management. The system not only improves the security of the park, but also optimizes resource allocation, reduces operating costs, and has significant practical value and market potential.

[0088] In one embodiment, a computer device is also provided in an embodiment of the present invention, comprising at least one processor and a memory communicatively connected to 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 so that the at least one processor performs the steps of the campus security method based on image recognition.

[0089] In one embodiment, the present invention further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the steps of the campus security method based on image recognition.

[0090] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be realized by instructing the relevant hardware through a computer program represented by computer instructions, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.

[0091] Non-volatile memory may include read-only memory, magnetic tape, floppy disk, flash memory or optical storage, etc. Volatile memory may include random access memory or external cache memory. As an illustration and not limitation, RAM may be in various forms, such as static random access memory or dynamic random access memory, etc.

[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A campus security method based on image recognition, characterized in that: The method comprises the following steps: Real-time video data in the park is collected through high-definition cameras, and edge detection and occlusion detection are performed on the video data to obtain pre-processed image data; The pre-trained target detection model is used to detect and classify multiple types of targets on the pre-processed image data, and the target position data is identified and located; Analyze the target behavior based on the target location data through the time series analysis model combined with the optical flow method, identify abnormal behavior and trigger the alarm mechanism; Dynamically adjust the park’s management authority and security access policies based on abnormal behavior monitoring results.

2. The campus security method based on image recognition as claimed in claim 1, characterized in that: When performing edge detection on video data, the edge is extracted based on 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 and vertical directions.

3. The campus security method based on image recognition as claimed in claim 2, characterized in that: Edge detection of video data includes the following steps: Image grayscale: grayscale the input color video frame; Apply the Sobel operator to perform convolution operations on the grayscale image using convolution kernels in the horizontal and vertical directions respectively, and calculate the gradient images in the horizontal and vertical directions respectively; According to the calculated horizontal and vertical gradient images, the gradient magnitude and direction of each pixel are calculated, and the pixel points with gradient magnitude greater than the preset edge threshold are retained as edges.

4. The campus security method based on image recognition as claimed in claim 3, characterized in that: When performing occlusion detection on video data, changes in static backgrounds are captured through background modeling, and moving targets in dynamic scenes are identified through motion detection.

5. The campus security method based on image recognition as claimed in claim 4, characterized in that: When performing occlusion detection on video data and capturing changes in a static background through background modeling, the following steps are involved: The first several frames of the video data are counted and the background model is initialized using a mixed Gaussian model, where the background of each pixel is modeled by multiple Gaussian distributions; For each frame of video data, the matching degree between the current value of each pixel and the background model is calculated. When the matching degree reaches the matching threshold, the background model is updated, otherwise the pixel is regarded as the foreground. The current frame is compared to the background model, foreground pixels are identified, and foreground objects in the video data are identified.

6. The campus security method based on image recognition as claimed in claim 5, characterized in that: When performing occlusion detection on video data and identifying moving targets in dynamic scenes through motion detection, the following steps are included: Calculate the difference image between the current frame and the previous frame to extract the moving object; Thresholding 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; The results of motion detection are combined with the foreground results of background modeling to enhance the detection of occluders.

7. The campus security method based on image recognition as claimed in claim 6, characterized in that: Calculate the difference image between the current frame and the previous frame, where the calculation formula for the frame difference is: In the formula, is the difference image between the current frame and the previous frame, indicating that at time t, position The motion of the pixel at At time t, the position The pixel value at , that is, the pixel value of the current frame; At time t-1, the position The pixel value at is the pixel value of the previous frame; When performing threshold processing on the difference image, the calculation formula for the threshold processing is: In the formula, It is the binary motion detection mask, which indicates which pixels have moved in the current frame, 1 indicates movement, and 0 indicates stillness; When the results of motion monitoring are combined with the foreground results of background modeling, the calculation formula is: In the formula, For the final foreground mask, the results of background modeling and motion detection are combined to represent the foreground area.

8. The campus security method based on image recognition according to claim 1, characterized in that: When detecting and classifying multiple types of targets on the preprocessed image data through the pretrained target detection model, the preprocessed image data is scaled based on the YOLO model, the pixel values ​​of the scaled image are normalized to the interval [0, 1], and 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, multiple bounding boxes and their category probabilities of each grid unit are predicted, and the pretrained target detection model is used to identify and locate the target position data.

9. The campus security method based on image recognition as claimed in claim 8, characterized in that: The target behavior is analyzed based on the target position data by combining the time series analysis model with the optical flow method, including the following steps: Use the pre-trained YOLO model to detect the target in each frame, obtain the bounding box coordinates of the target, and extract the center point of the target from the bounding box coordinates as the position data; The displacement of the target between frames is calculated by Lucas-Kanade, and the displacement calculated by optical flow is used to update the trajectory of the target to obtain the motion trajectory of the target; The ARIMA model is used to build a model and train the time series model to identify the normal behavior pattern of the target; Input the current trajectory data into the time series model to predict the next movement position, compare the predicted target position with the actual position, and calculate the error; If the error exceeds the set threshold, it is judged as abnormal behavior. When abnormal behavior is detected, the system triggers an alarm mechanism.

10. A campus security system based on image recognition, characterized in that: The system is used to execute the steps of the campus security method based on image recognition as described in any one of claims 1 to 9, and the system includes: The data acquisition module is used to 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 pre-processed image data; The target detection module is used to detect and classify multiple types of targets on the preprocessed image data through the pre-trained target detection model, and identify and locate the target position data; The anomaly recognition module is used to analyze the target behavior based on the target location data by combining the time series analysis model with the optical flow method, identify abnormal behavior and trigger the alarm mechanism; The authority management module is used to dynamically adjust the park's management authority and security access strategy based on abnormal behavior monitoring results.

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

  • Outdoor operation safety monitoring method based on indoor and outdoor positioning system

    CN117496431A

  • Workshop security system and method based on visual multi-modal analysis

    CN117935452A

  • Smart park multi-source data dynamic monitoring and real-time analysis system and method

    CN118072255A

Cited By

  • AI-based behavior control method and system

    CN120220251A

  • A behavior control method and system based on AI

    CN120220251B

  • AI-based security and protection monitoring video analysis method and system

    CN120495963A

  • Anti-intrusion monitoring and early warning method and system

    CN121747041A

  • An intrusion prevention monitoring and early warning method and system

    CN121747041B