A campus protection automatic alarm method based on deep learning
By applying an automatic alarm system based on deep learning in school, analysis of video images and identifying the behavior of turning the wall, solve the problem of difficulty managing the wall of the wall in existing technology, and improved the timeliness and accuracy of safety protection.
Patent Information
- Application Number
- CN202211534405.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-11-29
AI Technical Summary
Existing school safety protection measures are difficult to effectively manage the behavior of overturning the wall, and are prone to omissions or mistakes, affecting the safety of people's lives.
Adopting a deep -learning campus protection automatic alarm method, through video image analysis, the two deep learning models are used to determine whether there is a surge of walls and setting alarm labels to remind.
The effective management of turning over the wall has been realized, reducing human errors, and improving the timeliness and accuracy of school safety protection.
Smart Images

Figure CN116824424B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a campus protection automatic alarm method based on deep learning. Background Art
[0002] Today's school security protection mostly relies on security guards and general surveillance. Security guards are responsible for patrolling and manually supervising whether there is any wall-climbing behavior. General surveillance usually only monitors designated areas to retain the monitored videos, or uses specific personnel to check the monitored videos to determine whether there is any wall-climbing behavior. No matter which method of monitoring is used, it will not guarantee effective management of wall-climbing behavior. It is inevitable that there will be omissions or mistakes, which will cause harm to people's lives and safety and cannot be resolved in time.
[0003] Therefore, the present invention proposes an automatic alarm method for campus protection based on deep learning. Summary of the invention
[0004] The present invention provides a campus protection automatic alarm method based on deep learning, which is used to perform image analysis by acquiring videos, and based on two deep learning models, it can effectively determine whether there is wall-climbing behavior, thereby achieving effective management.
[0005] The present invention provides a campus protection automatic alarm method based on deep learning, comprising:
[0006] Step 1: Collect the current area video of the target area, and perform image analysis on each video frame in the current area video;
[0007] Step 2: Based on the image analysis result, an image sequence of each video frame is obtained, and the image sequence of each video frame is sequentially input into the first deep learning model to obtain the frame content of each video frame;
[0008] Step 3: Determine whether the content of each frame meets the criteria to be analyzed;
[0009] Step 4: If all frame contents meet the requirements, continue to analyze the regional video at the next moment;
[0010] Step 5: If there is frame content within the standard boundary range to be analyzed, the initial appearance time of the corresponding frame content is calibrated, and the frame content at the initial appearance time is used as the initial content;
[0011] Step 6: If there is frame content that does not meet the criteria to be analyzed, extract the first content that does not meet the criteria to be analyzed, and perform type identification and action location on the first content based on the second deep learning model to obtain a danger value;
[0012] Step 7: When the danger value is higher than a preset value, an alarm tag is set for the first content, and a corresponding alarm reminder is made based on all the alarm tags set for the current area video.
[0013] Preferably, collecting a current area video of the target area and performing image analysis on each video frame in the current area video includes:
[0014] Based on a preset camera device, the target area is captured by video, and a current area video at the current moment is obtained;
[0015] According to a preset splitting accuracy, the video of the current area is split into frames to obtain a plurality of video frames;
[0016] Perform image analysis on each video frame.
[0017] Preferably, based on the image analysis result, obtaining an image sequence of each video frame includes:
[0018] Obtaining the image analysis result of each video frame, and determining the first grayscale line of the corresponding video frame according to the image analysis result, and at the same time, obtaining the regional wall map of the corresponding target area;
[0019] Optimizing the determined first grayscale line based on the regional wall map to obtain a second grayscale line;
[0020] Acquire an image block of a corresponding video frame according to the second grayscale line;
[0021] The block sequence of each image block is obtained respectively, and the image sequence of the corresponding video frame is constructed according to the division order of the corresponding video frame.
[0022] Preferably, the image sequence of each video frame is sequentially input into the first deep learning model to obtain the frame content of each video frame, including:
[0023] Determine an edge sequence and a middle sequence of each region block in each video frame;
[0024] Based on the first deep learning model, the intermediate sequence of each region block of the same video frame is analyzed sequentially, and at the same time, all edge sequences in the same video frame are analyzed simultaneously based on the first deep learning model;
[0025] Based on the sequential analysis results and the simultaneous analysis results, the frame content of the corresponding video frame is obtained.
[0026] Preferably, determining whether the content of each frame meets the criteria to be analyzed includes:
[0027] Obtaining a first index value of each content index in each frame content;
[0028] Comparing each first indicator value with the preset indicator value corresponding to the standard to be analyzed;
[0029] When all first indicator values in the corresponding frame content are less than the corresponding preset indicator value, it is determined that the corresponding frame content meets the criterion to be analyzed;
[0030] Otherwise, extracting a second index value whose first index value is not less than the corresponding index value from the corresponding frame content, and calculating a difference value;
[0031]
[0032] Wherein, n1 represents the number of second index values extracted from the corresponding frame content; represents the index weight of the i1th second index value; represents the i1th second index value; represents the standard index value that matches the i1th second index value;
[0033]
[0034] Among them, Y0 represents the judgment result of whether the corresponding frame content meets the standard to be analyzed; C0 represents the first threshold; C1 represents the second threshold; when Y0=0, it means that based on the extracted second indicator value, it is determined that the corresponding frame content does not meet the standard to be analyzed; when Y0=a, it means that based on the extracted second indicator value, it is determined that the corresponding frame content is within the boundary range of the standard to be analyzed, wherein a represents the boundary reference value; when Y0=1, it means that based on the extracted second indicator value, it is determined that the corresponding frame content meets the standard to be analyzed.
[0035] Preferably, extracting the first content that does not meet the criteria to be analyzed, and performing type identification and action location on the first content based on the second deep learning model to obtain a risk value includes:
[0036] Extract the first content, and identify the category of each first content based on the second deep learning model, and set a category label for each first content. At the same time, perform action positioning on each first content, and obtain an action profile of each action positioning;
[0037] When the category labels are all consistent, determining the posture change amount between the initial content and the first first content and the posture change amount between adjacent first contents in chronological order, and constructing a change trajectory of each limb position in the initial posture in the initial content;
[0038] Calculating a danger value of each first content according to the change trajectory and the current position of the area wall based on the change trajectory;
[0039]
[0040] Wherein, W represents the danger value corresponding to the first content; m1 represents the number of change trajectories; represents the change value of the j1th change trajectory; represents the trajectory reliability weight of the j1th change trajectory; Represents the wall reliability weight of the regional wall for the j1th change trajectory.
[0041] Preferably, when the risk value is higher than a preset value, setting an alarm tag for the first content includes:
[0042] Based on the danger-label database, obtaining an alarm label matching the danger value;
[0043] The alarm label is set on the corresponding first content.
[0044] Preferably, based on all the alarm tags set for the current area video, corresponding alarm reminders are performed, including:
[0045] Based on the set alarm tags, an alarm sequence of the current area video is constructed;
[0046] Based on the sequence analysis model, the alarm sequence is analyzed to obtain the corresponding alarm instruction and to issue an alarm reminder.
[0047] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0048] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying 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 of the present invention. In the accompanying drawings:
[0050] Figure 1 This is a flow chart of an automatic alarm method for campus protection based on deep learning in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0052] The present invention provides a campus protection automatic alarm method based on deep learning, such as Figure 1 As shown, including:
[0053] Step 1: Collect the current area video of the target area, and perform image analysis on each video frame in the current area video;
[0054] Step 2: Based on the image analysis result, an image sequence of each video frame is obtained, and the image sequence of each video frame is sequentially input into the first deep learning model to obtain the frame content of each video frame;
[0055] Step 3: Determine whether the content of each frame meets the criteria to be analyzed;
[0056] Step 4: If all frame contents meet the requirements, continue to analyze the regional video at the next moment;
[0057] Step 5: If there is frame content within the standard boundary range to be analyzed, the initial appearance time of the corresponding frame content is calibrated, and the frame content at the initial appearance time is used as the initial content;
[0058] Step 6: If there is frame content that does not meet the criteria to be analyzed, extract the first content that does not meet the criteria to be analyzed, and perform type identification and action location on the first content based on the second deep learning model to obtain a danger value;
[0059] Step 7: When the danger value is higher than a preset value, an alarm tag is set for the first content, and a corresponding alarm reminder is made based on all the alarm tags set for the current area video.
[0060] In this embodiment, the target area refers to an area such as a wall where wall-climbing behavior may occur.
[0061] In this embodiment, the current area video refers to the video collected for the current time period, for example, 3 seconds.
[0062] In this embodiment, each video frame refers to splitting 3s into 6 frames.
[0063] In this embodiment, image analysis refers to analyzing each video frame image, mainly to distinguish the wall from the real person, so as to facilitate the judgment of whether the person has climbed over the wall.
[0064] In this embodiment, the first deep learning model and the second deep learning model are both pre-trained, and the first deep learning model is mainly used to analyze the image sequence to determine the existing frame content, including the elimination of irrelevant pixels and the supplement of pixels, etc. The second deep learning model is mainly used to locate the type of behavior and behavioral actions in the content to determine whether there is any wall-circumvention behavior, and the preset value is set based on the wall-circumvention behavior.
[0065] In this embodiment, the frame content is actually still the information on the image, but the information on the frame content is more accurate, providing a basis for subsequent judgment on whether the criteria to be analyzed are met.
[0066] In this embodiment, the standard to be analyzed includes different comparison indicators, and the indicator reference values corresponding to different comparison indicators are different. They are all used as a reference to compare with the values of actual indicators included in the frame content to determine whether the standard to be analyzed is met.
[0067] In this embodiment, the alarm tag is to provide a basis for subsequent alarm reminders.
[0068] The present invention provides a campus protection automatic alarm method based on deep learning, which collects the current area video of the target area and performs image analysis on each video frame in the current area video, including:
[0069] Based on a preset camera device, the target area is captured by video, and a current area video at the current moment is obtained;
[0070] According to a preset splitting accuracy, the video of the current area is split into frames to obtain a plurality of video frames;
[0071] Perform image analysis on each video frame.
[0072] In this embodiment, the shooting devices are all pre-set.
[0073] The beneficial effect of the above technical solution is: by collecting video through the shooting device and splitting the video into frames according to the splitting accuracy, the number of frames that need to be analyzed can be effectively determined, thereby facilitating image analysis and providing a basis for whether there is subsequent wall-climbing behavior and alarm.
[0074] The present invention provides a campus protection automatic alarm method based on deep learning, which obtains an image sequence of each video frame based on image analysis results, including:
[0075] Obtaining the image analysis result of each video frame, and determining the first grayscale line of the corresponding video frame according to the image analysis result, and at the same time, obtaining the regional wall map of the corresponding target area;
[0076] Optimizing the determined first grayscale line based on the regional wall map to obtain a second grayscale line;
[0077] Acquire an image block of a corresponding video frame according to the second grayscale line;
[0078] The block sequence of each image block is obtained respectively, and the image sequence of the corresponding video frame is constructed according to the division order of the corresponding video frame.
[0079] In this embodiment, the image analysis result refers to the extraction of relevant first grayscale lines after grayscale processing of the image corresponding to the video frame. However, in the behavior of climbing over a wall, it is necessary to determine a more reasonable second grayscale line based on the wall, that is, to divide the corresponding frame image according to this line.
[0080] In this embodiment, the block sequence refers to the situation of each pixel in each image block after the frame image is divided, which can be converted into a sequence for analysis.
[0081] The beneficial effect of the above technical solution is: by determining and optimizing the grayscale lines in the video frame based on the image analysis results and the regional wall map, the frame image can be effectively divided and the relevant sequence can be obtained, providing a basis for subsequent analysis.
[0082] The present invention provides a campus protection automatic alarm method based on deep learning, which sequentially inputs an image sequence of each video frame into a first deep learning model to obtain the frame content of each video frame, including:
[0083] Determine an edge sequence and a middle sequence of each region block in each video frame;
[0084] Based on the first deep learning model, the intermediate sequence of each region block of the same video frame is analyzed sequentially, and at the same time, all edge sequences in the same video frame are analyzed simultaneously based on the first deep learning model;
[0085] Based on the sequential analysis results and the simultaneous analysis results, the frame content of the corresponding video frame is obtained.
[0086] In this embodiment, the edge sequence is composed of the grayscale values of the pixels at the outermost edge of the corresponding area block, and the middle sequence is composed of the grayscale values of the remaining pixels in the corresponding area block except the pixels at the outermost edge.
[0087] The beneficial effect of the above technical solution is that by analyzing the intermediate sequences in sequence, the proprietary information existing in each area block can be effectively determined, and by simultaneously analyzing the edge sequences, different area blocks can be effectively and reasonably fused and analyzed to ensure the reliability of the frame content.
[0088] In this embodiment, the alarm reminders corresponding to different combinations of alarm tags are also different.
[0089] The beneficial effect of the above technical solution is: by acquiring video for image analysis and based on two deep learning models, it is possible to effectively determine whether there is wall-climbing behavior, facilitate timely and effective alarm, and thus achieve effective management.
[0090] The present invention provides a campus protection automatic alarm method based on deep learning, which determines whether the content of each frame meets the standard to be analyzed, including:
[0091] Obtaining a first index value of each content index in each frame content;
[0092] Comparing each first indicator value with the preset indicator value corresponding to the standard to be analyzed;
[0093] When all first indicator values in the corresponding frame content are less than the corresponding preset indicator value, it is determined that the corresponding frame content meets the criterion to be analyzed;
[0094] Otherwise, extracting a second index value whose first index value is not less than the corresponding index value from the corresponding frame content, and calculating a difference value;
[0095]
[0096] Wherein, n1 represents the number of second index values extracted from the corresponding frame content; represents the index weight of the i1th second index value; represents the i1th second index value; represents the standard index value that matches the i1th second index value;
[0097]
[0098] Among them, Y0 represents the judgment result of whether the corresponding frame content meets the standard to be analyzed; C0 represents the first threshold; C1 represents the second threshold; when Y0=0, it means that based on the extracted second indicator value, it is determined that the corresponding frame content does not meet the standard to be analyzed; when Y0=a, it means that based on the extracted second indicator value, it is determined that the corresponding frame content is within the boundary range of the standard to be analyzed, wherein a represents the boundary reference value; when Y0=1, it means that based on the extracted second indicator value, it is determined that the corresponding frame content meets the standard to be analyzed.
[0099] In this embodiment, the indicators include: behavior indicators, posture indicators, change indicators, etc., wherein different preset indicator values are pre-set.
[0100] In this embodiment, the difference value is calculated based on the difference between different indicators and the corresponding weights.
[0101] The beneficial effect of the above technical solution is: by comparing the index values, the difference value is determined, and then by comparing the difference value, a reasonable judgment is made on whether the frame content meets the standard to be analyzed, providing a basis for the subsequent determination of the initial content.
[0102] The present invention provides a campus protection automatic alarm method based on deep learning, extracting first content that does not meet the standard to be analyzed, and performing type recognition and action positioning on the first content based on a second deep learning model to obtain a danger value, including:
[0103] Extract the first content, and identify the category of each first content based on the second deep learning model, and set a category label for each first content. At the same time, perform action positioning on each first content, and obtain an action profile of each action positioning;
[0104] When the category labels are all consistent, determining the posture change amount between the initial content and the first first content and the posture change amount between adjacent first contents in chronological order, and constructing a change trajectory of each limb position in the initial posture in the initial content;
[0105] Calculating a danger value of each first content according to the change trajectory and the current position of the area wall based on the change trajectory;
[0106]
[0107] Wherein, W represents the danger value corresponding to the first content; m1 represents the number of change trajectories; represents the change value of the j1th change trajectory; represents the trajectory reliability weight of the j1th change trajectory; Represents the wall reliability weight of the regional wall for the j1th change trajectory.
[0108] In this embodiment, the first content may refer to the content of a certain frame.
[0109] In this embodiment, category identification is mainly used to determine whether the corresponding frame has any wall-circling behavior. That is, if there is wall-circling behavior or a wall-circling trend, a category label is set, mainly to reasonably distinguish different frames.
[0110] In this embodiment, the amount of posture change is based on the changes in different limbs of person 1 . For example, finger 1 moves from position 1 to position 2. At this time, position 1 - position 2 is the amount of posture change of finger 1 .
[0111] In this embodiment, the time sequence refers to the time for sequentially photographing and collecting the split frames.
[0112] In this embodiment, the initial content is to determine an initial frame, and based on the initial frame, a change track with subsequent first content is determined.
[0113] In this embodiment, the current position of the regional wall is used to determine whether the behavior at the moment can be determined as wall-climbing behavior corresponding to different wall positions.
[0114] In this embodiment, the track reliability weight and the wall reliability weight are both preset, and the weights corresponding to different tracks at different locations are different.
[0115] In this embodiment, in the wall-climbing behavior, there will be a large change trajectory due to the wall climbing action, and in the process of determining whether there is a wall climbing behavior, it will be judged according to the corresponding wall and the height of the wall, so the danger value determined in different frames may be different.
[0116] The beneficial effect of the above technical solution is: by identifying the first content and determining the action outline of the first content, the existing change trajectory can be effectively determined, and by combining it with the current position of the wall, the danger value of the first content can be calculated to provide a reasonable basis for subsequent alarms.
[0117] The present invention provides a campus protection automatic alarm method based on deep learning, when the danger value is higher than a preset value, setting an alarm tag for the first content, including:
[0118] Based on the danger-label database, obtaining an alarm label matching the danger value;
[0119] The alarm label is set on the corresponding first content.
[0120] In this embodiment, the danger-label database contains different danger values and alarm labels matching the danger values.
[0121] The beneficial effect of the above technical solution is that by obtaining the alarm tag from the database, it is convenient to set a matching tag for the corresponding first content, thereby facilitating alarm.
[0122] The present invention provides a campus protection automatic alarm method based on deep learning, which performs corresponding alarm reminders based on all alarm tags set for the current area video, including:
[0123] Based on the set alarm tags, an alarm sequence of the current area video is constructed;
[0124] Based on the sequence analysis model, the alarm sequence is analyzed to obtain the corresponding alarm instruction and to issue an alarm reminder.
[0125] In this embodiment, since the alarm labels corresponding to different risk values are different, after the alarm sequence is constructed, the sequence is analyzed according to the model to effectively obtain the alarm instruction.
[0126] In this embodiment, the alarm instruction is obtained mainly to remind the person climbing over the wall and the supervisory personnel, so as to play an effective supervisory role.
[0127] The beneficial effect of the above technical solution is that by analyzing the alarm sequence based on the sequence analysis model, it is easy to obtain the alarm instruction for alarm reminder.
[0128] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A campus protection automatic alarm method based on deep learning, characterized in that: include: Step 1: Collect the current area video of the target area, and perform image analysis on each video frame in the current area video; Step 2: Based on the image analysis result, an image sequence of each video frame is obtained, and the image sequence of each video frame is sequentially input into the first deep learning model to obtain the frame content of each video frame; Step 3: Determine whether the content of each frame meets the criteria to be analyzed; Step 4: If all frame contents meet the requirements, continue to analyze the regional video at the next moment; Step 5: If there is frame content within the standard boundary range to be analyzed, the initial appearance time of the corresponding frame content is calibrated, and the frame content at the initial appearance time is used as the initial content; Step 6: If there is frame content that does not meet the criteria to be analyzed, extract the first content that does not meet the criteria to be analyzed, and perform type identification and action location on the first content based on the second deep learning model to obtain a danger value; Step 7: When the danger value is higher than a preset value, an alarm tag is set for the first content, and a corresponding alarm reminder is made based on all the alarm tags set for the video in the current area; Wherein, based on the image analysis result, an image sequence of each video frame is obtained, including: Obtaining the image analysis result of each video frame, and determining the first grayscale line of the corresponding video frame according to the image analysis result, and at the same time, obtaining the regional wall map of the corresponding target area; Optimizing the determined first grayscale line based on the regional wall map to obtain a second grayscale line; Acquire an image block of a corresponding video frame according to the second grayscale line; Obtaining a block sequence of each image block respectively, and constructing an image sequence of the corresponding video frame according to the division order of the corresponding video frame; The image sequence of each video frame is sequentially input into the first deep learning model to obtain the frame content of each video frame, including: Determine an edge sequence and a middle sequence of each region block in each video frame; Based on the first deep learning model, the intermediate sequence of each region block of the same video frame is analyzed sequentially, and at the same time, all edge sequences in the same video frame are analyzed simultaneously based on the first deep learning model; Based on the sequential analysis results and the simultaneous analysis results, the frame content of the corresponding video frame is obtained; The first content that does not meet the criteria to be analyzed is extracted, and the type and action of the first content are identified and located based on the second deep learning model to obtain the danger value, including: Extract the first content, and identify the category of each first content based on the second deep learning model, and set a category label for each first content. At the same time, perform action positioning on each first content, and obtain an action profile of each action positioning; When the category labels are all consistent, determining the posture change amount between the initial content and the first first content and the posture change amount between adjacent first contents in chronological order, and constructing a change trajectory of each limb position in the initial posture in the initial content; The danger value of each first content is calculated according to the change trajectory and the current position of the area wall based on the change trajectory.
2. The campus protection automatic alarm method based on deep learning as claimed in claim 1 is characterized in that: Collecting a current area video of the target area, and performing image analysis on each video frame in the current area video, including: Based on a preset camera device, the target area is video captured, and a current area video at the current moment is obtained; According to a preset splitting accuracy, the video of the current area is split into frames to obtain a plurality of video frames; Perform image analysis on each video frame.
3. The campus protection automatic alarm method based on deep learning as claimed in claim 1 is characterized in that: Determine whether the content of each frame meets the criteria to be analyzed, including: Obtaining a first index value of each content index in each frame content; Comparing each first indicator value with the preset indicator value corresponding to the standard to be analyzed; When all first indicator values in the corresponding frame content are less than the corresponding preset indicator value, it is determined that the corresponding frame content meets the criterion to be analyzed; Otherwise, extract the second index value whose first index value is not less than the corresponding index value from the corresponding frame content, and calculate the difference value C. By comparing the difference values, a reasonable judgment is made on whether the frame content meets the standard to be analyzed, specifically: Among them, Y0 represents the judgment result of whether the corresponding frame content meets the standard to be analyzed; C0 represents the first threshold; C1 represents the second threshold; when Y0=0, it means that based on the extracted second indicator value, it is determined that the corresponding frame content does not meet the standard to be analyzed; when Y0=a, it means that based on the extracted second indicator value, it is determined that the corresponding frame content is within the boundary range of the standard to be analyzed, wherein a represents the boundary reference value; when Y0=1, it means that based on the extracted second indicator value, it is determined that the corresponding frame content meets the standard to be analyzed.
4. The campus protection automatic alarm method based on deep learning as claimed in claim 1 is characterized in that: When the risk value is higher than a preset value, setting an alarm tag for the first content includes: Based on the danger-label database, obtaining an alarm label matching the danger value; The alarm label is set on the corresponding first content.
5. The campus protection automatic alarm method based on deep learning as claimed in claim 1 is characterized in that: Based on all the alarm tags set for the current area video, corresponding alarm reminders are made, including: Based on the set alarm tags, an alarm sequence of the current area video is constructed; Based on the sequence analysis model, the alarm sequence is analyzed to obtain the corresponding alarm instruction and issue an alarm reminder.
Citation Information
Patent Citations
Weakly supervised anomaly detection method based on temporal consistency
CN109034062A
Target event detection method and device, computer equipment and storage medium
CN111860140A