An AI-based campus intrusion detection and response system
By using an AI-based campus intrusion detection system, YOLOv5 and LSTM algorithms are used to analyze video stream data. Combined with event density and disturbance behavior recognition, the system achieves automated optimization of dynamic risk assessment and early warning response for campus intrusion behavior. This solves the problems of misjudgment and insufficient response timeliness of traditional systems, and improves the accuracy and response speed of detection.
Patent Information
- Application Number
- CN202510885933.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-06-30
AI Technical Summary
Traditional campus intrusion detection systems are prone to misjudgment when dealing with multiple targets moving simultaneously or sudden changes in ambient lighting, resulting in a high false alarm rate. They also have difficulty distinguishing between real intrusion behavior and equipment erroneous triggering. Moving object detection algorithms have blind spots in analyzing the trajectory continuity of slowly moving or intermittent targets, leading to insufficient response timeliness.
An AI-based campus intrusion detection and response system is adopted. The system acquires video stream data through the target trajectory acquisition module, uses the YOLOv5 algorithm to extract two-dimensional coordinate trajectories, combines the event density analysis module and the disturbance behavior recognition module, uses the LSTM model to analyze the vector angle change, generates density increment and disturbance markers, calls the Hungarian algorithm to match thermal imaging equipment, and adjusts the equipment frame rate for joint control.
It improves the sensitivity and accuracy of abnormal situational awareness in complex scenarios, enhances the ability to capture camouflage behavior and irregular movement patterns, reduces reliance on manual verification, shortens response delay, and forms a fully automated security system.
Smart Images

Figure CN120580776B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an AI-based campus intrusion detection and response system. Background Technology
[0002] Image recognition technology involves a technical system that uses optical sensors to collect feature information of target objects and convert it into digital signals for pattern recognition. Its core components include image acquisition equipment deployment schemes, feature extraction algorithm design, recognition model training and optimization processes, and multi-source data fusion processing mechanisms. It is primarily applied in security monitoring scenarios for dynamic target tracking and abnormal behavior analysis. Traditional park intrusion detection and response systems refer to perimeter protection systems based on a fixed-view surveillance camera network architecture. They employ static background modeling technology combined with moving object detection algorithms, setting fixed warning zone boundary thresholds. When a moving object is detected crossing a preset electronic fence, an infrared sensor generates an alarm signal, and the perimeter protection system relies on a manual monitoring center for video image verification.
[0003] Traditional systems, limited by fixed-viewpoint monitoring and static background modeling techniques, are prone to misjudgment when dealing with multiple moving targets or sudden changes in ambient lighting. Their rigid detection mechanism based on preset electronic fences is difficult to adapt to non-threatening moving scenarios such as swaying vegetation or animal intrusion, resulting in a high false alarm rate. The response mode relying on manual verification has insufficient timeliness at night or in severe weather conditions. The triggering method of single-point infrared sensors cannot effectively distinguish between real intrusion behavior and equipment erroneous triggering. The moving object detection algorithm has blind spots in the trajectory continuity analysis of slowly moving or intermittently stationary targets, resulting in the risk of missing key threats. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an AI-based campus intrusion detection and response system.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: an AI-based campus intrusion detection and response system includes:
[0006] The target trajectory acquisition module is used to acquire video stream data through the image sensing terminal, call the YOLOv5 algorithm to extract the two-dimensional coordinate trajectory of the target, establish a unique ID mark and record the displacement vector, and transmit the trajectory data to the event density analysis module.
[0007] The event density analysis module is used to acquire the trajectory data based on the time window, calculate the ratio of the number of new event frames to the time span, compare the difference between the current increase rate and the historical average rate, and generate a density increment marker when the difference of consecutive cycles exceeds the dynamic density threshold, and transmit the density increment marker to the response joint control execution module.
[0008] The disturbance behavior recognition module is used to acquire target motion vector data, call the LSTM model to analyze the vector angle change sequence, calculate the cosine similarity of the angle between adjacent vectors, and generate a disturbance mark when the number of sign reversals exceeds the set threshold and the angle change exceeds the threshold. The disturbance mark is then transmitted to the response control execution module.
[0009] The response joint control execution module is used to receive the density increasing marker and the disturbance marker, call the Hungarian algorithm to match the coordinate mapping relationship between the thermal imaging device and the target, adjust the device frame rate to a set multiple, and generate joint control commands.
[0010] As a further aspect of the present invention, the trajectory data specifically includes a two-dimensional coordinate sequence, a unique identifier, and displacement vector parameters. The density increment markers include the event frame time ratio, the increase rate difference, and the number of times the period threshold is exceeded. The disturbance markers specifically refer to the vector angle sequence, the similarity fluctuation value, and the sign reversal frequency. The joint control command includes a device coordinate mapping table, a frame rate adjustment factor, and thermal imaging linkage parameters.
[0011] As a further aspect of the present invention, the dynamic density threshold is obtained by optimizing historical event data using the gradient descent method, including inputting the historical event rate value into the loss function and iteratively adjusting the threshold parameter until the weighted sum of the false alarm rate and the false negative rate is minimized.
[0012] The threshold for the number of symbol reversals and the threshold for angle changes are determined based on the 95th percentile of the statistical distribution of 100 abnormal behavior samples.
[0013] The device frame rate adjustment factor = target displacement rate in meters per second × device response coefficient / reference frame rate, where the device response coefficient is in the range of 0.2-0.5.
[0014] As a further aspect of the present invention, the target trajectory acquisition module includes:
[0015] The video stream acquisition submodule acquires optical signal streams through image sensing terminals, captures dynamic images using a frame rate adaptive mechanism, converts the original analog signal into digital matrix format, segments data units according to the time axis and adds millisecond-level timestamps to generate video stream data.
[0016] The coordinate parsing submodule inputs the video stream data into the YOLOv5 feature extraction network, extracts the target edge features through three layers of convolutional kernels, eliminates overlapping detection boxes by non-maximum suppression algorithm, calculates the horizontal and vertical coordinates of the target center point and constructs a spatiotemporal mapping table to generate a two-dimensional coordinate sequence.
[0017] The trajectory identification submodule calls the two-dimensional coordinate sequence to construct a motion trajectory map, uses the Hungarian algorithm to match the target position at adjacent time points, predicts the trajectory offset through Kalman filtering, calculates the coordinate difference between consecutive frames to construct a set of displacement parameters, assigns a unique coded identifier to the complete motion path, and generates trajectory data.
[0018] As a further aspect of the present invention, the Kalman filter predicts the trajectory offset and combines it with the Hungarian algorithm to correct the target position matching error through the predicted value, thereby improving the continuity of the target ID across frames.
[0019] As a further aspect of the present invention, the event density analysis module includes:
[0020] The trajectory capture submodule divides the trajectory data into a preset time window to obtain trajectory data segments, compares the event records of adjacent time nodes frame by frame, counts the number of newly added event frames, and divides the value by the window time span to obtain the event rate value.
[0021] The rate difference calculation sub-module extracts the event rate value of the current time window and calculates the rate change magnitude compared to the previous window using the following formula:
[0022] ;
[0023] Calculate the dynamic difference parameter by performing an algebraic difference calculation between the current growth rate and the benchmark value to generate the rate difference coefficient;
[0024] in, Represents the dynamic difference parameter. This represents the current window event rate value, in frames per second. This represents the event rate value of the preceding window. This represents the time window span coefficient, with a value ranging from 0.8 to 1.2. The sliding weight factor representing the i-th adjacent window is allocated according to an exponential decay law. This represents the rate value of the i-th adjacent window. This represents the baseline rate value, calculated as the historical 30-day average. This represents the total number of adjacent windows, a fixed value of 5.
[0025] The marker generation submodule sets up a continuous period counter. When the rate difference coefficient is detected to exceed the dynamic density threshold three times in a row, the increment judgment logic is activated and the density increment marker is output.
[0026] As a further aspect of the present invention, the disturbance behavior recognition module includes:
[0027] The motion vector acquisition submodule acquires the displacement data of the target's three-dimensional coordinate system, extracts the displacement increment at a fixed sampling interval, constructs vector magnitude and orientation angle parameters, and uses a moving average algorithm to denoise the raw data to generate a motion vector set.
[0028] The included angle time series analysis submodule constructs an LSTM network structure. The input layer receives the motion vector set, the hidden layer stores the time step features, calculates the ratio of the dot product of adjacent vectors to the product of the magnitude, establishes a spatial direction change sequence, extracts the radian change gradient of continuous time steps through bidirectional window scanning, and outputs the included angle time series features.
[0029] The disturbance feature determination submodule performs a first-order difference operation on the included angle time sequence features, detects the start and end positions of the negative value interval, sets a threshold for the number of sign reversals and an angle change threshold, and when the cumulative number of reversals exceeds the threshold and the total radian change reaches the benchmark, it performs a logical AND operation to combine the determination conditions and obtains the disturbance mark.
[0030] As a further aspect of the present invention, the baseline value of the total radian change is 1.5π radians, which is determined by testing the median of the cumulative radian change of 200 abnormal trajectories.
[0031] As a further aspect of the present invention, the response control execution module includes:
[0032] The instruction parsing submodule receives the density incrementing marker and the disturbance marker, verifies the timestamp and coordinate data format, extracts the three-dimensional coordinates and priority coefficients from the markers, performs a logical AND operation to merge the valid bits of the two markers, and generates a set of control parameters.
[0033] The device matching submodule constructs a two-dimensional matrix of the thermal imaging device ID and the control parameter set, calculates the Euclidean distance between the device's field of view coverage radius and the target coordinates, uses the Hungarian algorithm to iteratively solve for the minimum path cost, updates the device status identifier, and outputs a mapping table.
[0034] The frame rate control submodule establishes a frame rate adjustment coefficient calculation model based on the device response delay and target displacement rate in the mapping table, performs a multiplication operation on the reference frame rate and the adjustment coefficient, encapsulates the device address code and control parameters, and obtains the joint control command.
[0035] As a further aspect of the present invention, the conversion relationship between the device response delay and the target displacement rate is: frame rate adjustment factor = target displacement rate × device response coefficient / reference frame rate;
[0036] The target displacement rate is measured in meters per second, the device response coefficient ranges from 0.2 to 0.5, and the reference frame rate is 30 frames per second.
[0037] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0038] In this invention, by integrating spatiotemporal feature analysis of target trajectories with motion vector pattern recognition, dynamic risk assessment and early warning response optimization of intrusion behavior are achieved. Multidimensional data association calculation and incremental event density monitoring are employed to effectively improve the sensitivity and accuracy of abnormal situation perception in complex scenarios. By combining continuous temporal modeling of motion vectors and disturbance feature extraction, the ability to capture camouflage behavior and irregular motion patterns is enhanced. Through intelligent matching and adaptive parameter adjustment of multi-source sensing devices, a closed-loop control link between environmental perception and response execution is constructed, significantly reducing the reliance on manual review, shortening the response delay from behavior recognition to handling actions, and forming a fully automated security system covering early warning analysis and coordinated handling. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating the overall structure of the system of the present invention;
[0040] Figure 2 This is an internal flowchart of the target trajectory acquisition module of the present invention;
[0041] Figure 3 This is an internal flowchart of the event density analysis module of the present invention;
[0042] Figure 4 This is an internal flowchart of the disturbance behavior recognition module of the present invention;
[0043] Figure 5 This is an internal flowchart of the response control execution module of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.
[0045] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.
[0046] Please see Figure 1 and Figure 2This invention provides a technical solution: an AI-based campus intrusion detection and response system comprising:
[0047] The target trajectory acquisition module is used to acquire video stream data through the image sensing terminal, call the YOLOv5 algorithm to extract the two-dimensional coordinate trajectory of the target, establish a unique ID mark and record the displacement vector, and transmit the trajectory data to the event density analysis module.
[0048] The target trajectory acquisition module includes:
[0049] The video stream acquisition submodule acquires optical signal streams through image sensing terminals, captures dynamic images using a frame rate adaptive mechanism, converts the original analog signal into digital matrix format, segments data units according to the time axis and adds millisecond-level timestamps to generate video stream data.
[0050] The video stream acquisition submodule first acquires an optical signal stream with a resolution of 1920x1080 pixels using a Hikvision iDS-2CD7A47E-IZHS image sensing terminal deployed on the perimeter wall of the park, 4 meters above the ground and at a 30-degree downward angle. The CMOS image sensor within the terminal converts the captured photon information into analog electrical signals, which are then quantized into a digital matrix by a 12-bit analog-to-digital converter (ADC). A frame rate adaptive mechanism is activated; the system calculates the average rate of change of pixel grayscale values between two consecutive frames in real time. When this rate of change is less than 0.5%, the system determines it as a low-dynamic scene and sets the acquisition frame rate to 15 frames per second; when the rate of change is greater than or equal to 0.5%, it is determined as a high-dynamic scene and the acquisition frame rate is increased to 30 frames per second. For example, in... At that time, the average pixel change rate was 0.2%, and the frame rate was set to 15 frames per second; At a certain moment, due to the entry of personnel into the frame, the change rate jumped to 1.8%, and the frame rate automatically adjusted to 30 frames per second. Each data unit, i.e., each frame of image, is immediately synchronized with the park's central time server via Network Time Protocol (NTP) after generation, and a timestamp accurate to milliseconds is appended, in the format YYYYMMDDHHMMSS.sss, for example, "20250620093015.123". Ultimately, these timestamped digital matrix sequences constitute the video stream data transmitted to the coordinate resolution submodule.
[0051] The coordinate parsing submodule is based on video stream data input into the YOLOv5 feature extraction network. It extracts target edge features through three layers of convolutional kernels, uses non-maximum suppression algorithm to eliminate overlapping detection boxes, calculates the horizontal and vertical coordinates of the target center point and constructs a spatiotemporal mapping table to generate a two-dimensional coordinate sequence.
[0052] After receiving the video stream data, the coordinate resolution submodule inputs each frame of image data (e.g., a 1920x1080 numerical matrix) into the feature extraction network of a pre-trained YOLOv5s model. The first convolutional layer of this network has a 6x6 kernel size and a stride of 2, used to quickly reduce the image size and extract coarse-grained features; the second convolutional layer has a 3x3 kernel size and a stride of 2, extracting more refined edge and corner information; the third convolutional layer also has a 3x3 kernel size and a stride of 1, performing deep integration of the feature maps from the previous layer. In a given frame, the model initially identifies two overlapping detection boxes that may belong to the same pedestrian: BoxA (confidence 0.92) and BoxB (confidence 0.88). The Non-Maximum Suppression (NMS) algorithm is then activated, calculating the Intersection over Union (IoU) ratio of the two boxes, which is calculated by dividing the area of their intersection by the area of their union. If the calculated IoU value is 0.7, which is higher than the preset NMS threshold of 0.6, the system will eliminate the detection box Box B with lower confidence. The pixel coordinates of the retained Box A are... The system then calculates the horizontal and vertical coordinates of the center point of the detection frame, using the following calculation method: as well as Substituting the values, the center point coordinates are (542, 360). This coordinate, along with the corresponding frame's timestamp "20250620093015.156", is recorded in a spatiotemporal mapping table. This table's data structure is a two-dimensional array, with each row containing [timestamp, x-coordinate, y-coordinate]. After continuous processing, a two-dimensional coordinate sequence is formed, for example, [[20250620093015.123, 540, 355], [20250620093015.156, 542, 360],...].
[0053] The trajectory identification submodule calls a two-dimensional coordinate sequence to construct a motion trajectory map, uses the Hungarian algorithm to match the target position at adjacent time points, predicts the trajectory offset through Kalman filtering, calculates the coordinate difference between consecutive frames to construct a set of displacement parameters, assigns a unique coded identifier to the complete motion path, and generates trajectory data.
[0054] The Kalman filter predicts the trajectory offset and combines it with the Hungarian algorithm for matching. The predicted value is used to correct the target position matching error and improve the continuity of target IDs across frames.
[0055] The trajectory data specifically consists of a two-dimensional coordinate sequence, a unique identifier, and displacement vector parameters.
[0056] The trajectory identification submodule calls the generated two-dimensional coordinate sequence to construct the motion trajectory map. At time points... (Corresponding to frame F1), the system detected target A with coordinates (542, 360). At the next time point... (Corresponding to frame F2), the system detects two targets, B1(545,366) and B2(810,450). At this time, the Kalman filter module first predicts that target A's position at time F2 should be (544.5,365.8) based on the velocity and acceleration state of target A in F1. Then, the Hungarian algorithm constructs a cost matrix and calculates the Euclidean distance between the predicted position of target A and the positions of all newly detected targets. ; The algorithm selects the lowest-cost matching pair, (A, B1). Therefore, the system determines that B1 is a continuation of target A in the next frame and assigns B1 a unique identifier for target A (e.g., a UUID "f47ac10b-58cc-4372-a567-0e02b2c3d479"). Simultaneously, the Kalman filter state uses B1's actual measured position (545, 366) to refine its internal model. The coordinate differences between consecutive frames are calculated and a set of displacement parameters is constructed; for example, the displacement vector from F1 to F2 is... After the complete movement path of target A (e.g., all coordinates from entering the field of view to leaving the field of view) is completed, the system assigns it a unique coded identifier "Path_20250620_0017". The final generated trajectory data integrates these three parts of information to form a structured data object: {Unique identifier: "f47ac10b-58cc-4372-a567-0e02b2c3d479", trajectory code: "Path_20250620_0017", data: [[timestamp, x, y, ... , ],…]}.in , This represents the displacement vector parameter.
[0057] Please see Figure 1 and Figure 3 The event density analysis module is used to acquire trajectory data based on time windows, calculate the ratio of the number of new event frames to the time span, compare the difference between the current increase rate and the historical average rate, and generate a density increment marker when the difference of consecutive cycles exceeds the dynamic density threshold. The density increment marker is then passed to the response control execution module.
[0058] The event density analysis module includes:
[0059] The trajectory capture submodule divides the trajectory data into segments according to a preset time window, compares the event records of adjacent time nodes frame by frame, counts the number of newly added event frames, and performs a division operation between the value and the window time span to obtain the event rate value.
[0060] The trajectory capture submodule divides the trajectory data received from the target trajectory acquisition module into segments according to a preset 2-second time window. For example, a time window might start and end at 10:00:00 to 10:00:02 on June 20, 2025. At the start of the window, the system records the set of unique identifiers (IDs) within the current field of view as {ID_A, ID_B}. At the end of the window, the set is updated to {ID_A, ID_B, ID_C, ID_D}. The submodule compares the event records at the two time points using set difference operations, and counts the newly added event IDs as {ID_C, ID_D}, thus the number of newly added event frames is 2. Subsequently, this value is divided by the window time span (2 seconds) to obtain the event rate value of the current window. This process is repeated after each time window ends, generating a series of consecutive event rate values.
[0061] The rate difference calculation sub-module extracts the event rate value of the current time window and calculates the rate change magnitude compared to the previous window, using the formula:
[0062] ;
[0063] Calculate the dynamic difference parameter by performing an algebraic difference calculation between the current growth rate and the benchmark value to generate the rate difference coefficient;
[0064] in, Represents the dynamic difference parameter. This represents the current window event rate value, in frames per second. This represents the event rate value of the preceding window. This represents the time window span coefficient, with a value ranging from 0.8 to 1.2. The sliding weight factor representing the i-th adjacent window is allocated according to an exponential decay law. This represents the rate value of the i-th adjacent window. This represents the baseline rate value, calculated as the historical 30-day average. This represents the total number of adjacent windows, a fixed value of 5.
[0065] The rate difference calculation submodule extracts the event rate values for the current time window (e.g., 10:00:02-10:00:04). And calculate its rate compared to the preceding window (10:00:00-10:00:02). The magnitude of the change. This calculation is performed using the following formula:
[0066] ;
[0067] In this formula, The dynamic difference parameter is a quantitative indicator that measures the drastic change in the rate of change of an event. The calculation logic lies in combining the instantaneous changes in event rates with recent historical fluctuation trends. (The left side of the formula...) By calculating the current window rate (Unit: frames / second) and preceding window rate The absolute value of the difference Then take its square root to smooth out sudden, sharp fluctuations; then divide by the time window span coefficient. This yields a standardized instantaneous rate of change. The summation term on the right-hand side of the formula... Through the recent Rate of historical windows Perform a weighted summation and compare it with the baseline rate. A comparison is made to assess the overall level of recent volatility. Among these, the weighting factors... The exponential decay over time gives greater importance to recent data. Ultimately, multiplying the left-hand side reflecting instantaneous changes with the right-hand side reflecting recent trends yields a dynamic difference parameter that captures both sudden events and cyclical fluctuations. The advantage of this formula lies in combining instantaneous changes (square root term) with historical relative fluctuations (summation term), making... It is more sensitive to real abnormal events, and has better robustness to regular, periodic peak traffic, effectively distinguishing between occasional gatherings and the initial stage of real intrusion risks.
[0068] First, assign values to each parameter. Assume the event rate value for the current time window (TC). The calculated event rate is 1.8 frames per second. (Event rate value for the preceding time window (TP)). 1.0 frames per second. Time window span coefficient. The value was determined experimentally. The experiment used 500 hours of surveillance video footage from the park under different weather conditions and time periods. The system was tested within the interval [0.8, 1.2] with a step size of 0.05 to evaluate the false positive rate (FPR) and false negative rate (FNR) for each set of values. Ultimately, it was found that when... When the value is 0.95, the weighted evaluation function To obtain the minimum value, therefore, set... Total number of adjacent windows Fixed at 5. Sliding weight factor. According to the exponential decay law The weights are then allocated as follows: , , , , This set of weights is based on historical data analysis, with a decay coefficient of 0.4 chosen to balance the influence of old and new data. Rate values of adjacent windows (From most recent to furthest) retrieved from historical records, as follows: Frames per second. Baseline rate value. This is calculated by extracting the event rate values for the same time period each day (e.g., 10:00 AM to 11:00 AM) over the past 30 days and then calculating their arithmetic mean. For example, if the total number of new events during this time period over 30 days is 10,800, and the total duration is... ,but Frames per second. Substitute the above values into the formula to calculate:
[0069] Summation term calculation:
[0070] ;
[0071] ;
[0072] The result 24.314 is a quantified indicator of the rate of increase in event density.
[0073] The tag generation submodule sets up a continuous period counter. When the rate difference coefficient is detected to break through the dynamic density threshold three times in a row, the increment judgment logic is activated and the density increment tag is output.
[0074] The dynamic density threshold is obtained by optimizing historical event data using the gradient descent method, which includes inputting the historical event rate value into the loss function and iteratively adjusting the threshold parameter until the weighted sum of the false positive rate and the false negative rate is minimized.
[0075] The density increment markers include the event frame time ratio, the difference in the rate of increase, and the number of times the period threshold is exceeded.
[0076] The tag generation submodule internally sets up a continuous period counter, initially set to 0. The dynamic density threshold setting process is as follows: collect 500 event segments labeled "abnormal clustering" and 500 "normal peaks" from historical data, and extract the data from each segment. Value. These Using the values as input, gradient descent is applied to optimize a loss function. ,in It is the dynamic density threshold. It is an indicator function (it takes 1 when the condition is true, and 0 otherwise). and These are the penalty weights for false positives and false negatives (e.g., set to 0.7 and 0.3 respectively). Adjusted through 200 iterations. until the loss function The value converges to a minimum. The dynamic density threshold calculated using this method is 15.0. Comparing the rate difference coefficient of 24.314 obtained from the previous example with this threshold of 15.0... This is considered a breakthrough. At this point, the continuous cycle counter increments by 1, becoming 1. In the next two consecutive time windows, if the calculated... If the value remains greater than 15.0, the counter will accumulate to 3. When the counter value reaches 3, the increment judgment logic is activated, and the system generates a density increment flag. This flag is a data structure with the following content: {Event frame time ratio: 1.8 frames / second, increment rate difference: 24.314, number of times the period threshold is exceeded: 3}.
[0077] Please see Figure 1 and Figure 4 The disturbance behavior recognition module is used to acquire target motion vector data, call the LSTM model to analyze the vector angle change sequence, calculate the cosine similarity of the angle between adjacent vectors, and generate a disturbance mark when the number of sign reversals exceeds the set threshold and the angle change exceeds the threshold. The disturbance mark is then passed to the response control execution module.
[0078] The disturbance behavior recognition module includes:
[0079] The motion vector acquisition submodule acquires the displacement data of the target's three-dimensional coordinate system, extracts the displacement increment at a fixed sampling interval, constructs vector magnitude and orientation angle parameters, and uses a moving average algorithm to denoise the raw data to generate a motion vector set.
[0080] The motion vector acquisition submodule obtains displacement data of a specified target from the target trajectory acquisition module, such as a continuous two-dimensional coordinate sequence of the target ID "f47ac10b-58cc-4372-a567-0e02b2c3d479". The system extracts displacement increments at a fixed sampling interval of 100 milliseconds (i.e., every 3 frames, at 30fps). For example, in , , , At that time, the target coordinates are P0(545,366), P1(548,372), P2(550,380), and P3(547,386). This constructs three original displacement vectors: , , Subsequently, the system applies a moving average algorithm with a window size of 3 to denoise these raw data. The first vector after processing... The calculation method is as follows However, to maintain temporal correspondence, in practical applications, alignment with the center is usually performed, for example, with smoothed vectors. It is calculated from its nearest neighbor vector: Applying this algorithm to a longer sequence of vectors yields a smoothed set of motion vectors, where each vector contains a magnitude of... and direction angle parameter.
[0081] The included angle time series analysis submodule constructs an LSTM network structure. The input layer receives a set of motion vectors, the hidden layer stores time step features, calculates the ratio of the dot product of adjacent vectors to the product of their magnitudes, establishes a spatial direction change sequence, extracts the radian change gradient of continuous time steps through bidirectional window scanning, and outputs the included angle time series features.
[0082] The angle-based timing analysis submodule constructs a Long Short-Term Memory (LSTM) network structure containing an input layer, a hidden layer, and an output layer. The hidden layer has 64 units. The input layer receives the denoised motion vector set, such as a sequence. In each time step of the LSTM, the hidden layer updates its internal cell state based on the current input vector and the hidden state of the previous time step. The core computation involves analyzing the directional changes between adjacent vectors. For two consecutive vectors in a sequence, for example... and The system calculates their dot product. and their respective module lengths and The cosine value of the included angle, i.e., the cosine similarity, is determined by... The calculation yielded a spatial orientation variation sequence, i.e., a time series composed of cosine similarity values, for example... The LSTM network learns the temporal dependencies in this sequence through its gating mechanism. Then, a bidirectional window scans the sequence, extracting the gradient of continuous radian changes around each time point. The rate of change of the angle is used as the temporal feature output.
[0083] The disturbance feature determination submodule performs a first-order difference operation on the included angle time series features, detects the start and end positions of the negative value interval, sets a threshold for the number of sign reversals and an angle change threshold, and when the cumulative number of reversals exceeds the threshold and the total radian change reaches the baseline, it performs a logical AND operation to combine the determination conditions and obtains the disturbance mark.
[0084] The baseline value for the total change in radians is The radian value was determined by testing the median of the cumulative radian changes of 200 abnormal trajectories.
[0085] The thresholds for the number of sign reversals and the threshold for angle changes were determined based on the 95th percentile of the statistical distribution of 100 samples of abnormal behavior.
[0086] The perturbation markers specifically refer to the vector angle sequence, similarity fluctuation value, and sign reversal frequency.
[0087] The perturbation feature determination submodule receives the aforementioned included angle temporal features, i.e., the cosine similarity sequence. First, a first-order difference operation is performed on the sequence to obtain the rate of change sequence: [-0.06, -1.08, -0.22, 1.33, ...]. The system detects the start and end positions of the negative value interval in the difference sequence. When the sequence value changes from positive to negative (e.g., from 0.85 to -0.23), it is recorded as a sign inversion. The system counts the number of sign inversions within a preset time window (e.g., 5 seconds). The threshold for the number of sign inversions is set based on statistical analysis of 100 groups of labeled abnormal behavior samples (such as wandering back and forth, fighting).
[0088]
[0089] Table 1: Statistical Distribution of Sign Reversal Count in Abnormal Behavior Samples
[0090] As shown in Table 1, the statistical data of these 100 samples were sorted, and their 95th percentile was taken. Assuming the calculated 95th percentile is 4, the sign reversal threshold was set to 4. The angle change threshold was set based on the analysis of the cumulative radian changes of 200 abnormal trajectories, calculating the total turning angle of these trajectories within 5 seconds. ), and take the median of the total steering angles of all samples. If the calculated median is If the radius is 270 degrees, then it is set as the baseline value for the total radius change. When a target's trajectory accumulates more than 4 sign reversals within 5 seconds, and its total cumulative radius change is greater than... At the same time, logical AND operation The result is true. At this point, the system merges the decision conditions and generates a disturbance marker, which is specifically a data object containing {vector angle sequence:} Similarity fluctuation value: [-0.06, -1.08, -0.22, ...], Sign reversal frequency: 4 times / 5 seconds}.
[0091] Please see Figure 1 and Figure 5 The response joint control execution module is used to receive density increment markers and disturbance markers, call the Hungarian algorithm to match the mapping relationship between the thermal imaging device and the target coordinates, adjust the device frame rate to a set multiple, and generate joint control commands;
[0092] The response and control execution module includes:
[0093] The instruction parsing submodule receives density-increasing markers and disturbance markers, verifies the timestamp and coordinate data format, extracts the three-dimensional coordinates and priority coefficients from the markers, performs logical AND operations to merge the valid bits of the two markers, and generates a set of control parameters.
[0094] The instruction parsing submodule receives density increment markers from the event density analysis module and perturbation markers from the perturbation behavior recognition module at its input. For example, at time 2025-06-20 10:00:15.200, the system receives a density increment marker for the target ID “f47ac10b-58cc-4372-a567-0e02b2c3d479” with a timestamp of 10:00:14.800; simultaneously, it receives a perturbation marker for the same target with a timestamp of 10:00:15.100. The system first verifies the difference between the two timestamps. If the time interval is less than the preset 1-second association window, it is considered a valid association event. Next, the system verifies the coordinate data format in the markers, confirming it is a (x,y) floating-point number format. The system extracts the latest 3D coordinates of the target from the markers (assuming the Z coordinate is obtained through mapping to a fixed ground surface, and is (547,386,0)) and their respective priority coefficients. The priority coefficient for density-increasing markers is set based on the number of times the target exceeds the limit, for example, 0.6 for 3 exceedances; the priority coefficient for disturbance markers is set based on the reversal frequency, for example, 0.8 for 4 reversals / 5 seconds. The system performs a logical AND operation to confirm that the valid bits of both markers are 1. Finally, the two priority coefficients are multiplied to obtain the final comprehensive priority. The coordinates and priorities are integrated to generate a set of control parameters: {Target ID: "f47ac10b-...", coordinates: (547, 386, 0), priority: 0.48}.
[0095] The device matching submodule constructs a two-dimensional matrix of thermal imaging device ID and control parameter set, calculates the Euclidean distance between the device's field of view coverage radius and the target coordinates, uses the Hungarian algorithm to iteratively solve for the minimum path cost, updates the device status identifier, and outputs a mapping table.
[0096] The device matching submodule receives the aforementioned set of control parameters. Three Dahua DH-TPC-PT8621A thermal imaging devices are deployed in the park, with device IDs T-Cam01, T-Cam02, and T-Cam03. The system constructs a two-dimensional matrix of thermal imaging device IDs and control parameter sets. This matrix is used to calculate the matching cost between each available device and the target. The core of the cost calculation is the Euclidean distance between the center point of the device's field of view and the target coordinates. Assume that the center point of T-Cam01's field of view currently points to coordinates (600, 400), and T-Cam02 points to (200, 200). The target coordinates are (547, 386). Calculate the distance:
[0097] rice; rice;
[0098] The Hungarian algorithm uses these distances as cost inputs and iteratively solves for the allocation scheme that minimizes the total cost. In this single-objective scenario, the algorithm selects the T-Cam01 with the lowest cost for matching. The system then updates the status identifier of T-Cam01 to "Tracking" and outputs a mapping table with the following content: {Target ID: "f47ac10b-...", Allocation Device ID: "T-Cam01"}.
[0099] The frame rate control submodule establishes a frame rate adjustment coefficient calculation model based on the device response delay and target displacement rate in the mapping table, performs a multiplication operation on the reference frame rate and the adjustment coefficient, encapsulates the device address code and control parameters, and obtains the joint control command.
[0100] The conversion relationship between the device response delay and the target displacement rate is: frame rate adjustment factor = target displacement rate × device response coefficient / reference frame rate;
[0101] The target displacement rate is measured in meters per second, the device response coefficient ranges from 0.2 to 0.5, and the reference frame rate is 30 frames per second.
[0102] The joint control command includes the device coordinate mapping table, frame rate adjustment factor, and thermal imaging linkage parameters.
[0103] The frame rate adjustment submodule locks onto device T-Cam01 based on the output mapping table. The system establishes a frame rate adjustment coefficient calculation model to adjust the device's frame rate in real time. This adjustment is based on device response latency and target displacement rate. Device response latency, including network latency and gimbal rotation latency, is obtained through device calibration tests; for example, the average response latency of T-Cam01 is 150 milliseconds. Target displacement rate is obtained from motion vector acquisition; for example, the latest smoothed vector magnitude corresponds to 3.5 meters per second. The device response coefficient is set through an experiment involving 200 tracking tests. In the experiment, different coefficient values were selected within the range of 0.2 to 0.5 to observe which coefficient value optimally keeps the target in the center of the frame at different target speeds. Experimental data shows that for moving targets at 3-5 meters per second, a coefficient of 0.4 performs best. Therefore, the device response coefficient is set to 0.4. The baseline frame rate is the device's default 30 frames per second. The frame rate adjustment factor is calculated as follows: Substitute the values: The new frame rate will be The frame rate is 32 frames per second (fps), which is rounded down to 32 fps. Finally, the system encapsulates the device address code (e.g., the IP address of T-Cam01), the control parameters (new frame rate 32 fps), and the thermal imaging linkage parameters (e.g., switching to "Human Highlight" mode) together to form the final control command, which is then sent to the T-Cam01's control interface via the network: {Device Address: "192.168.1.101", Frame Rate: 32, Thermal Imaging Mode: "HumanHighlight", Target Coordinates: [547, 386, 0]}.
[0104] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the scope of protection defined by the claims of the present invention.
Claims
1. An AI-based park intrusion detection and response system, characterized in that, The system comprises: The target trajectory acquisition module is used for acquiring video stream data through an image sensing terminal, calling a YOLOv5 algorithm to extract a target two-dimensional coordinate trajectory, establishing a unique ID mark and recording a displacement vector, and delivering the trajectory data to an event density analysis module; The event density analysis module is used for acquiring the trajectory data based on a time window, calculating a ratio of a number of newly added event frames to a time span, comparing a difference between a current increase rate and a historical average rate, generating a density increase mark when a difference value of a continuous period exceeds a dynamic density threshold value, and delivering the density increase mark to a response joint control execution module; The disturbance behavior recognition module is used for acquiring target motion vector data, calling an LSTM model to analyze a vector angle change sequence, calculating a cosine similarity of adjacent vector angles, generating a disturbance mark when a symbol inversion frequency exceeds a set symbol inversion frequency threshold value and an angle change exceeds a threshold value, and delivering the disturbance mark to the response joint control execution module; The response joint control execution module is used for receiving the density increase mark and the disturbance mark, calling a Hungarian algorithm to match a thermal imaging device and a target coordinate mapping relationship, adjusting a device frame frequency to a set multiple, and generating a joint control instruction; The response joint control execution module comprises: The instruction analysis submodule receives the density increase mark and the disturbance mark, checks a timestamp and a coordinate data format, extracts three-dimensional coordinates and a priority coefficient in the marks, performs a logical AND operation to merge valid bits of the two marks, and generates a control parameter set; The device matching submodule constructs a two-dimensional matrix of thermal imaging device IDs and the control parameter set, calculates a Euclidean distance between a device field of view angle coverage radius and a target coordinate, iteratively solves a minimum path cost by using a Hungarian algorithm, updates a device state identifier, and outputs a mapping relationship table; The frame frequency regulation submodule establishes a frame frequency adjustment coefficient calculation model according to a device response delay and a target displacement rate in the mapping relationship table, performs a multiplication operation on a reference frame frequency and the adjustment coefficient, encapsulates a device address code and a regulation parameter, and obtains the joint control instruction. 2.The AI-based park intrusion detection and response system according to claim 1, wherein, The trajectory data specifically is a two-dimensional coordinate sequence, a unique identity identifier, and a displacement vector parameter, the density increase mark includes an event frame time ratio, an increase rate difference value, and a period threshold value exceeding frequency, the disturbance mark specifically refers to a vector angle sequence, a similarity fluctuation value, and a symbol inversion frequency, and the joint control instruction contains a device coordinate mapping table, a frame frequency adjustment multiple, and a thermal imaging linkage parameter. 3.The AI-based park intrusion detection and response system according to claim 2, characterized in that, The dynamic density threshold value is obtained by optimizing and calculating historical event data by using a gradient descent method, including inputting a historical event rate value into a loss function and iteratively adjusting a threshold value parameter until a weighted sum of a false alarm rate and a missed alarm rate is minimum; The symbol inversion frequency threshold value and the angle change threshold value are determined based on a 95th percentile of a statistical distribution of 100 groups of abnormal behavior samples; The frame frequency adjustment multiple = target displacement rate (unit: meter per second) * device response coefficient / reference frame frequency, wherein the device response coefficient takes an interval value of 0.2-0.
5. 4.The AI-based park intrusion detection and response system according to claim 3, characterized in that, The target trajectory acquisition module comprises: The video stream acquisition sub-module acquires optical signal stream through an image sensing terminal, captures dynamic pictures by using a frame rate adaptive mechanism, converts original analog signals into digital matrix format, divides data units according to time axis and adds millisecond-level time stamps, and generates video stream data; The coordinate analysis sub-module inputs the video stream data into a YOLOv5 feature extraction network, extracts target edge features through three layers of convolution kernels, eliminates overlapping detection boxes by using a non-maximum suppression algorithm, calculates target center point horizontal and vertical coordinate values, constructs a time-space mapping table, and generates a two-dimensional coordinate sequence; The trajectory identification sub-module calls the two-dimensional coordinate sequence to construct a motion trajectory atlas, matches adjacent time point target positions by using a Hungarian algorithm, predicts trajectory offset by using Kalman filtering, calculates coordinate difference values between continuous frames to construct a displacement parameter set, assigns a unique coding identifier to a complete motion path, and generates trajectory data. 5.The AI-based park intrusion detection and response system according to claim 4, characterized in that, The Kalman filtering prediction trajectory offset is combined with the Hungarian algorithm matching to correct target position matching errors through a prediction value, thereby improving the continuity of cross-frame target IDs. 6.The AI-based park intrusion detection and response system according to claim 5, characterized in that, The event density analysis module includes: The trajectory intercepting sub-module divides the trajectory data according to a preset time window to obtain a trajectory data segment, compares event records of adjacent time nodes frame by frame, counts the number of newly added event frames, performs division operation on the value and the window time span, and obtains an event rate value; The rate difference calculation sub-module extracts the event rate value of the current time window and calculates the rate change amplitude with the previous window by using the formula: ; The dynamic difference parameter is calculated, the current amplitude rate is calculated by algebraic difference with a reference value, and a rate difference coefficient is generated; wherein, represents a dynamic difference parameter, represents a current window event rate value, unit: frame / s, represents a previous window event rate value, represents a time window span coefficient, value range 0.8-1.2, represents a sliding weight factor of the i-th adjacent window, which is distributed according to an exponential decay law, represents a rate value of the i-th adjacent window, represents a reference rate value, which is the average value of the past 30 days, represents the total number of adjacent windows, a fixed value 5; The label generation sub-module sets a continuous period counter, activates an incremental judgment logic when the rate difference coefficient breaks through a dynamic density threshold value for three consecutive times, and outputs a density increase label. 7.The AI-based park intrusion detection and response system according to claim 6, characterized in that, The disturbance behavior recognition module includes: The motion vector acquisition sub-module acquires target three-dimensional coordinate system displacement data, extracts displacement increments at a fixed sampling interval, constructs vector module length and direction angle parameters, performs noise reduction processing on original data by using a sliding mean algorithm, and generates a motion vector set; The angle time sequence analysis sub-module constructs an LSTM network structure, the input layer receives the motion vector set, the hidden layer stores time step features, the adjacent vector dot product and module length product ratio are calculated, a spatial direction change sequence is established, the radian change gradient of continuous time steps is extracted by bidirectional window scanning, and an angle time sequence feature is outputted; The disturbance feature judgment sub-module performs first-order difference operation on the angle time sequence feature, detects the start and end positions of the negative value interval, sets a symbol inversion frequency threshold value and an angle change threshold value, when the cumulative inversion frequency exceeds the threshold value and the radian change total amount reaches a reference value, performs logical AND operation to merge the judgment conditions, and obtains a disturbance label. 8.The AI-based park intrusion detection and response system according to claim 7, characterized in that, The radian change total amount reference value is 1.5π radians, which is determined by testing 200 groups of abnormal trajectories. 9.The AI-based park intrusion detection and response system according to claim 8, wherein, The conversion relationship between the device response delay and the target displacement rate is frame frequency adjustment multiple = target displacement rate × device response coefficient / reference frame frequency; The target displacement rate has a unit of meters per second, the device response coefficient has a value ranging from 0.2 to 0.5, and the reference frame frequency has a value of 30 frames per second.
Citation Information
Patent Citations
Infrared image target detection method and system based on deep learning
CN118644723A
Distributed monitoring campus safety early warning method and system
CN118887598A