Campus violence early warning system
By dividing the time periods prone to violent incidents in the campus violence early warning system, combined with primary and secondary video, audio recognition models and differential privacy technology, the audio data of the privacy area is processed, which solves the problem of privacy area monitoring and achieves high-precision monitoring. Violent behavior identification and early warning ensure privacy protection and incident investigation efficiency.
Patent Information
- Application Number
- CN202410736625.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
The existing campus violence monitoring system cannot effectively monitor private areas such as dormitories and toilets, causing these places to become hot spots for violent incidents, and video surveillance cannot provide full 24-hour coverage, resulting in safety blind spots.
Divide the periods prone to violent incidents, use a combination of primary and secondary video and audio recognition models, and combine differential privacy technology to process audio data in privacy areas to improve the accuracy of violent behavior recognition, and store and provide early warning when violent behavior is identified .
It achieves high-precision identification and early warning of violent behaviors, ensures privacy protection, avoids monitoring violations in privacy areas, and improves the efficiency of investigating violent incidents.
Smart Images

Figure CN118761867A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of education management, and in particular to a school violence early warning system. Background Art
[0002] School violence refers to acts that occur within the school and cause harm or threats to students, faculty, staff, or others through physical, verbal, or other means. It seriously affects the school's educational order and the physical and mental health of students. School violence is a serious social problem that requires the joint efforts of schools, families, and society to prevent and resolve.
[0003] The current monitoring method is mainly video surveillance. The school has a large flow of people and many monitoring points. Security personnel cannot keep an eye on hundreds of video screens at the same time, nor can they guarantee effective 24-hour monitoring. At the same time, due to privacy and ethical factors, cameras cannot be installed in places such as dormitories and toilets, forming blind spots for campus security monitoring, making dormitories and toilets a high-incidence area for violent incidents. Summary of the invention
[0004] The present invention divides a time period when violent incidents are prone to occur, and uses a primary video recognition model and a primary audio recognition model to respectively recognize primary video data and primary audio data acquired during a current monitoring time period during a non-violent incident prone time period, and uses a secondary video recognition model and a secondary audio recognition model with higher accuracy to respectively recognize secondary video data and secondary audio data acquired during a current monitoring time period during a violent incident prone time period, thereby achieving reasonable use of computing resources and ensuring the accuracy of identifying violent behavior.
[0005] A school violence early warning system, comprising:
[0006] A conventional data acquisition module, used to acquire primary video data or secondary video data and primary audio data or secondary audio data of a current detection time period;
[0007] The conventional area database module is used to store the conventional video data and conventional audio data of the current monitoring time period;
[0008] A private audio data acquisition module is used to acquire private audio data in the current monitoring period;
[0009] A violent behavior recognition module is used to send the primary video data to the primary video recognition model for processing or the secondary video data to the secondary video recognition model for processing according to the current time period, and output the primary video recognition result or the secondary video recognition result; and send the primary audio data to the primary audio recognition model for processing or the secondary audio data to the secondary audio recognition model for processing according to the current time period, and output the primary audio recognition result or the secondary audio recognition result; and send the private audio data to the private audio recognition model for processing, and output the private audio recognition result;
[0010] Violence incident audio storage module: used to store private audio data acquired during the current monitoring period when there is violence;
[0011] A violence warning response module is used to determine whether there is violent behavior based on the first-level video recognition result or the second-level video recognition result, the first-level audio recognition result or the second-level audio recognition result, and the private audio recognition result; if there is violent behavior, violence warning measures are executed;
[0012] The invention also includes a campus violence early warning method applied to a campus violence early warning system, and the specific steps are as follows:
[0013] S1: The campus area is divided into a regular area and a privacy area. The regular area includes all areas on campus where cameras can be legally installed, and the privacy area includes sensitive areas on campus where cameras are not allowed to be installed. For the regular area, the regular video data and regular audio data of the current monitoring time period are obtained, and the regular video data and regular audio data are stored in the regular area database. For the privacy area, the audio data of the current monitoring time period is collected, and the collected audio data is processed using differential privacy technology to obtain the privacy audio data.
[0014] S2: For conventional areas, determine whether the current time is in a period when violent incidents are prone to occur. If the current time is not in a period when violent incidents are prone to occur, perform video frame extraction on the conventional video data obtained in the current monitoring time period with an extraction interval of 4T to obtain Q first-level video frames, and form the Q first-level video frames into first-level video data; evenly divide the conventional audio data obtained in the current monitoring time period into Q audio clips, perform short-time Fourier transform on each audio clip, convert the audio clip into a spectrogram, obtain Q first-level spectrogram data, and form the Q first-level spectrogram data into first-level audio data; input the first-level video data and the first-level audio data obtained in the current monitoring time period into the first-level video recognition model and the first-level audio recognition model respectively, obtain the first-level video recognition results and the first-level audio recognition results, and determine whether there is violent behavior based on the first-level video recognition results and the first-level audio recognition results;
[0015] If the current time is in a period prone to violent incidents, video frame extraction is performed on the conventional video data obtained in the current monitoring time period at an extraction interval T to obtain 4Q secondary video frames, and the 4Q secondary video frames are composed of secondary video data; the conventional audio data obtained in the current monitoring time period is evenly divided into 4Q audio segments, and each audio segment is short-time Fourier transform, the audio segment is converted into a spectrogram, and 4Q secondary spectrogram data are obtained, and the 4Q secondary spectrogram data are composed of secondary audio data; the secondary video data and secondary audio data obtained in the current monitoring time period are respectively input into the secondary video recognition model and the secondary audio recognition model to obtain secondary video recognition results and secondary audio recognition results, and whether there is violent behavior is determined according to the secondary video recognition results and the secondary audio recognition results;
[0016] For the privacy area, the privacy audio data obtained during the current monitoring period is input into the privacy audio recognition model to obtain the privacy audio recognition result, and whether there is violence is determined based on the privacy audio recognition result;
[0017] S3: If it is determined that violent behavior exists, violence warning measures are implemented; otherwise, no response is required.
[0018] Preferably, the specific steps for dividing the time periods when violent incidents are prone to occur are as follows:
[0019] A1: Set a regular cycle of violent events;
[0020] A2: Obtain the violence time data of all violent events that occurred in the previous violent event regular cycle of the current violent event regular cycle on campus, and form the obtained violence time data in the previous violent event regular cycle into a violence time data set;
[0021] A3: Divide a day into several time periods. For each time period, count the violent time data matching the time period in the violent time dataset, and obtain the proportion of violent events in each time period.
[0022] A4: Set a time period distinction threshold. For each time period, if the proportion of violent incidents in the time period is greater than the time period distinction threshold, the time period is classified as a time period prone to violent incidents.
[0023] A5: Repeat operations A2 to A4 in each regular cycle of violent events to obtain a time period during which violent events are prone to occur in the current regular cycle of violent events.
[0024] Preferably, the primary video recognition model is established based on the LSTM model, including Q primary video recognition LSTM units, 1 first fully connected layer and 1 first output layer; wherein the primary video recognition LSTM unit is used to process each primary video frame in the primary video data; the first fully connected layer is used to perform feature mapping and nonlinear transformation on the outputs of all primary video recognition LSTM units; the first output layer is used to convert the output of the first fully connected layer into a primary video recognition result;
[0025] The specific steps for training the first-level video recognition model are as follows:
[0026] Obtain several first-level video data training samples with labeled first-level video recognition results, the first-level video data training samples contain Q+1 video frames arranged in chronological order, and divide all first-level video data training samples into a first-level video training set and a first-level video test set; use the first-level video training set to train the first-level video recognition model with initialized parameters, and then use the first-level video test set to test the first-level video recognition model, obtain the first-level video evaluation result, set the first-level video training condition, and if the first-level video evaluation result meets the first-level video training condition, output the trained first-level video recognition model; otherwise, use the first-level video training set to continue training the first-level video recognition model.
[0027] Preferably, the primary audio recognition model is established based on the LSTM model, including Q primary audio recognition LSTM units, 1 second fully connected layer and 1 second output layer; wherein the primary audio recognition LSTM unit is used to gradually process the primary spectrogram data in the primary audio data; the second fully connected layer is used to further extract features from the outputs of all primary audio recognition LSTM layers; the second output layer is used to convert the output of the second fully connected layer into a primary audio recognition result;
[0028] The specific steps for training the first-level audio recognition model are as follows:
[0029] Obtain several first-level audio data training samples with labeled first-level audio recognition results, the first-level audio data training samples contain Q+1 spectrograms arranged in chronological order, and divide all the first-level audio data training samples into a first-level audio training set and a first-level audio test set; use the first-level audio training set to train the first-level audio recognition model with initialized parameters, and then use the first-level audio test set to test the first-level audio recognition model to obtain the first-level audio evaluation result; set the first-level audio training conditions, if the first-level audio evaluation result meets the first-level audio training conditions, output the trained first-level audio recognition model; otherwise, continue to use the first-level audio training set to train the first-level audio recognition model.
[0030] Preferably, the secondary video recognition model is established based on the LSTM model, including 4Q secondary video recognition LSTM units, 1 third fully connected layer and 1 third output layer;
[0031] The specific steps for training the secondary video recognition model are as follows:
[0032] Obtain several secondary video data training samples with labeled secondary video recognition results, the secondary video data training samples contain 4Q+1 video frames arranged in chronological order, and divide all secondary video data training samples into a secondary video training set and a secondary video test set; use the secondary video training set to train the secondary video recognition model with initialized parameters, and then use the secondary video test set to test the secondary video recognition model, obtain the secondary video evaluation result, set the secondary video training condition, and if the secondary video evaluation result meets the secondary video training condition, output the trained secondary video recognition model; otherwise, use the secondary video training set to continue training the secondary video recognition model;
[0033] The secondary audio recognition model is built based on the LSTM model, including 4Q secondary audio recognition LSTM units, 1 fourth fully connected layer and 1 fourth output layer;
[0034] The specific steps for training the secondary audio recognition model are as follows:
[0035] Obtain several secondary audio data training samples with annotated secondary audio recognition results, the secondary audio data training samples contain 4Q+1 frequency spectrograms arranged in chronological order, and divide all secondary audio data training samples into a secondary audio training set and a secondary audio test set; use the secondary audio training set to train the secondary audio recognition model with initialized parameters, and then use the secondary audio test set to test the secondary audio recognition model to obtain the secondary audio evaluation result; set the secondary audio training conditions, if the secondary audio evaluation result meets the secondary audio training conditions, output the trained secondary audio recognition model; otherwise, continue to use the secondary audio training set to train the secondary audio recognition model.
[0036] Preferably, the privacy audio recognition model is established based on the Transformer model, and the privacy audio recognition model introduces a multi-head self-attention mechanism and uses a differential privacy optimization algorithm in training;
[0037] The specific steps for training the privacy audio recognition model are as follows:
[0038] Obtain several private audio data training samples with labeled private audio recognition results, and divide all private audio data training samples with labeled private audio recognition results into a private audio recognition training set and a private audio recognition test set; use the private audio recognition training set to train the private audio recognition model, and then use the private audio recognition test set to test the private audio recognition model to obtain the private audio recognition evaluation result; set the private audio training conditions, and if the private audio recognition evaluation result meets the private audio training conditions, output the trained private audio recognition model; otherwise, continue to use the private audio recognition training set to continue training the private audio recognition model.
[0039] Preferably, the specific operation of using differential privacy technology to process the collected audio data in S1 to obtain the private audio data includes:
[0040] The audio data collected during the current monitoring time period is divided into multiple audio segments, and each audio segment is short-time Fourier transformed to convert the audio segment into a spectrogram to obtain the spectrogram data to be processed; Gaussian noise is added to each obtained spectrogram data to be processed to obtain privacy spectrogram data; the obtained privacy spectrogram data are combined into privacy audio data.
[0041] Preferably, for the privacy area, if violent behavior is analyzed, the private audio data obtained in the current monitoring time period is stored; otherwise, the private audio data obtained in the current monitoring time period is not stored; the specific implementation method is as follows:
[0042] B1: Create a temporary storage area for private audio and a storage area for violent incident audio, and set the temporary storage period and incident storage period;
[0043] B2: storing the private audio data acquired during the current temporary storage period in the private audio temporary storage area, and using the private audio data acquired during the current temporary storage period to overwrite the private audio data acquired during the previous temporary storage period;
[0044] B3: Determine whether there is a violent act based on the private audio recognition results obtained during the current monitoring period. If it is determined that there is a violent act, extract the private audio data in the current private audio temporary storage area and store it in the violent event audio storage area. Take the current time point as the starting point of the incident storage period, and store all the private audio data obtained during the current incident storage period in the violent event audio storage area.
[0045] B4: Repeat A2-A3 operations.
[0046] The present invention has the following advantages:
[0047] 1. The present invention divides the time period when violent incidents are prone to occur, and uses the primary video recognition model and the primary audio recognition model to respectively recognize the primary video data and the primary audio data obtained in the current monitoring time period during the non-violent incident prone time period, and uses the secondary video recognition model and the secondary audio recognition model with higher accuracy to respectively recognize the secondary video data and the secondary audio data obtained in the current monitoring time period during the violent incident prone time period, thereby achieving the rational use of computing resources and ensuring the recognition accuracy of violent behavior.
[0048] 2. The present invention uses a privacy audio recognition model for the privacy area and processes the collected audio data; at the same time, the privacy audio data is only stored when violent behavior is identified, thereby achieving privacy protection of the audio data without affecting the investigation of violent incidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 The diagram is a structural diagram of a campus violence early warning system used in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to enable persons skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0051] A school violence early warning system, such as Figure 1 As shown, including:
[0052] A conventional data acquisition module, used to acquire primary video data or secondary video data and primary audio data or secondary audio data of a current detection time period;
[0053] The conventional area database module is used to store the conventional video data and conventional audio data of the current monitoring time period;
[0054] A private audio data acquisition module is used to acquire private audio data in the current monitoring period;
[0055] A violent behavior recognition module is used to send the primary video data to the primary video recognition model for processing or the secondary video data to the secondary video recognition model for processing according to the current time period, and output the primary video recognition result or the secondary video recognition result; and send the primary audio data to the primary audio recognition model for processing or the secondary audio data to the secondary audio recognition model for processing according to the current time period, and output the primary audio recognition result or the secondary audio recognition result; and send the private audio data to the private audio recognition model for processing, and output the private audio recognition result;
[0056] Violence incident audio storage module: used to store private audio data acquired during the current monitoring period when there is violence;
[0057] A violence warning response module is used to determine whether there is violent behavior based on the first-level video recognition result or the second-level video recognition result, the first-level audio recognition result or the second-level audio recognition result, and the private audio recognition result; if there is violent behavior, violence warning measures are executed;
[0058] The invention also includes a campus violence early warning method applied to a campus violence early warning system, and the specific steps are as follows:
[0059] S1: The campus area is divided into regular areas and privacy areas. Regular areas include all areas on campus where cameras can be legally installed, such as campus roads, teaching building exterior walls and other public areas; privacy areas include sensitive areas on campus where cameras are not allowed to be installed, such as toilets, dormitories and other private areas; for regular areas, obtain regular video data and regular audio data for the current monitoring period, and store the regular video data and regular audio data in the regular area database to facilitate subsequent investigations into violent incidents; for privacy areas, collect audio data for the current monitoring period, and use differential privacy technology to process the collected audio data to obtain privacy audio data. Differential privacy technology is a data analysis method that protects personal privacy. It aims to provide data analysis results while ensuring that the privacy of individual data is not leaked. The application of differential privacy technology can effectively solve the monitoring problem of privacy areas in the campus violence early warning system. Differential privacy technology can maintain data availability and effectiveness as much as possible while ensuring data privacy.
[0060] S2: For conventional areas, determine whether the current time is in a period when violent incidents are prone to occur. If the current time is not in a period when violent incidents are prone to occur, perform video frame extraction on the conventional video data obtained in the current monitoring time period with an extraction interval of 4T to obtain Q first-level video frames, and form the Q first-level video frames into first-level video data; evenly divide the conventional audio data obtained in the current monitoring time period into Q audio clips, perform short-time Fourier transform on each audio clip, convert the audio clip into a spectrogram, obtain Q first-level spectrogram data, and form the Q first-level spectrogram data into first-level audio data; input the first-level video data and the first-level audio data obtained in the current monitoring time period into the first-level video recognition model and the first-level audio recognition model respectively, obtain the first-level video recognition results and the first-level audio recognition results, and determine whether there is violent behavior based on the first-level video recognition results and the first-level audio recognition results;
[0061] If the current time is in a period when violent incidents are prone to occur, then video frame extraction is performed on the conventional video data obtained in the current monitoring time period with an extraction interval T to obtain 4Q secondary video frames, and the 4Q secondary video frames are composed of secondary video data. Since the smaller the time interval T, the more video frames are extracted, in order to make the recognition accuracy in the period when violent incidents are prone to occur higher, the time interval here is T; the conventional audio data obtained in the current monitoring time period is evenly divided into 4Q audio clips, and each audio clip is short-time Fourier transformed to convert the audio clip into a spectrogram to obtain 4Q secondary spectrogram data, and the 4Q secondary spectrogram data are composed of secondary audio data; the secondary video data and secondary audio data obtained in the current monitoring time period are respectively input into the secondary video recognition model and the secondary audio recognition model to obtain the secondary video recognition results and the secondary audio recognition results, and it is judged whether there is violent behavior according to the secondary video recognition results and the secondary audio recognition results;
[0062] For private areas, since video data cannot be obtained, only audio data can be used for analysis. In private areas such as dormitories and toilets, the proportion of violent incidents is relatively high. Therefore, no time period is divided for private areas, and a more accurate private audio recognition model is used. The specific operation is: input the private audio data obtained in the current monitoring time period into the private audio recognition model, obtain the private audio recognition result, and judge whether there is violent behavior based on the private audio recognition result;
[0063] S3: If it is determined that there is violence, violence warning measures will be implemented; otherwise, no response is required; violence warning measures may include triggering sound and light alarms or sending alarm notifications to relevant management personnel. Triggering sound and light alarms can deter the perpetrators and prevent the continuation of violence; sending alarm notifications to relevant management personnel such as teachers and security guards so that when a violent incident occurs, the management personnel can quickly rush to the scene, stop the violence, and take control measures.
[0064] Specific steps for the division of time periods prone to violent incidents:
[0065] A1: Set the regular cycle of violent incidents. The regular cycle of violent incidents can be determined according to the number of violent incidents that have occurred in history. If the number of violent incidents is small, the regular cycle of violent incidents can be set longer. If the number of violent incidents is large, the regular cycle of violent incidents can be set shorter.
[0066] A2: Obtain the violence time data of all violent events that occurred in the previous violent event regular cycle of the current violent event regular cycle on campus, and form the obtained violence time data in the previous violent event regular cycle into a violence time data set;
[0067] A3: Divide a day into several time periods. For each time period, count the violent time data matching the time period in the violent time dataset, and obtain the proportion of violent events in each time period.
[0068] A4: Set a time period distinction threshold. For each time period, if the proportion of violent incidents in the time period is greater than the time period distinction threshold, the time period is classified as a time period prone to violent incidents.
[0069] A5: Repeat A2-A4 in each regular cycle of violent incidents to obtain the time periods in which violent incidents are prone to occur within the current regular cycle of violent incidents. The time periods are divided into the time periods in which violent incidents are prone to occur, so that the school can perform high-precision identification in the time periods with a high probability of violent incidents. While improving the identification accuracy, it also saves computing resources in other time periods.
[0070] The first-level video recognition model is established based on the LSTM model, including Q first-level video recognition LSTM units, 1 first fully connected layer and 1 first output layer; the first-level video recognition LSTM unit is used to process each first-level video frame in the first-level video data; the first fully connected layer is used to perform feature mapping and nonlinear transformation on the outputs of all first-level video recognition LSTM units; the first output layer is used to convert the output of the first fully connected layer into a first-level video recognition result;
[0071] The specific steps for training the first-level video recognition model are as follows:
[0072] A number of first-level video data training samples with annotated first-level video recognition results are obtained, the first-level video data training samples contain Q+1 video frames arranged in chronological order, wherein Q video frames are used to input the first-level video recognition model, and the last video frame is used to annotate the results, and all first-level video data training samples are divided into a first-level video training set and a first-level video test set; the first-level video training set is used to train the first-level video recognition model with initialized parameters, and then the first-level video test set is used to test the first-level video recognition model, and the first-level video evaluation results are obtained. The first-level video evaluation results include indicators such as accuracy, recall rate, and F1 score. First-level video training conditions are set, such as accuracy threshold, number of training rounds, or performance improvement standard. If the first-level video evaluation results meet the first-level video training conditions, the trained first-level video recognition model is output; otherwise, the first-level video training set is used to continue training the first-level video recognition model.
[0073] The first-level audio recognition model is established based on the LSTM model, including Q first-level audio recognition LSTM units, 1 second fully connected layer and 1 second output layer; the first-level audio recognition LSTM unit is used to gradually process a quarter of the spectrum data in the first-level audio data; the second fully connected layer is used to further extract features from the outputs of all first-level audio recognition LSTM layers; the second output layer is used to convert the output of the second fully connected layer into the first-level audio recognition result;
[0074] The specific steps for training the first-level audio recognition model are as follows:
[0075] Obtain several first-level audio data training samples with labeled first-level audio recognition results, the first-level audio data training samples contain Q+1 spectrograms arranged in chronological order, the spectrograms can highlight the important features of the audio data, and divide all the first-level audio data training samples into a first-level audio training set and a first-level audio test set; use the first-level audio training set to train the first-level audio recognition model with initialized parameters, and then use the first-level audio test set to test the first-level audio recognition model to obtain the first-level audio evaluation result; set the first-level audio training conditions, if the first-level audio evaluation result meets the first-level audio training conditions, then output the trained first-level audio recognition model; otherwise, continue to use the first-level audio training set to train the first-level audio recognition model.
[0076] The secondary video recognition model is built based on the LSTM model, including 4Q secondary video recognition LSTM units, 1 third fully connected layer and 1 third output layer; the secondary video recognition model has a large number of secondary video recognition LSTM units, so the accuracy of the secondary video recognition model is higher than that of the primary video recognition model, but at the same time, the computing resources required by the secondary video recognition model are also higher than those of the primary video recognition model;
[0077] The specific steps for training the secondary video recognition model are as follows:
[0078] Obtain several secondary video data training samples with labeled secondary video recognition results, the secondary video data training samples contain 4Q+1 video frames arranged in chronological order, and divide all secondary video data training samples into a secondary video training set and a secondary video test set; use the secondary video training set to train the secondary video recognition model with initialized parameters, and then use the secondary video test set to test the secondary video recognition model, obtain the secondary video evaluation result, set the secondary video training condition, and if the secondary video evaluation result meets the secondary video training condition, output the trained secondary video recognition model; otherwise, use the secondary video training set to continue training the secondary video recognition model;
[0079] The secondary audio recognition model is built based on the LSTM model, including 4Q secondary audio recognition LSTM units, 1 fourth fully connected layer and 1 fourth output layer; the secondary audio recognition model has a larger number of secondary audio recognition LSTM units, so the accuracy of the secondary audio recognition model is also higher than that of the primary audio recognition model, but at the same time, the computing resources required by the secondary audio recognition model are also higher than those of the primary audio recognition model;
[0080] The specific steps for training the secondary audio recognition model are as follows:
[0081] Obtain several secondary audio data training samples with annotated secondary audio recognition results, the secondary audio data training samples contain 4Q+1 frequency spectrograms arranged in chronological order, and divide all secondary audio data training samples into a secondary audio training set and a secondary audio test set; use the secondary audio training set to train the secondary audio recognition model with initialized parameters, and then use the secondary audio test set to test the secondary audio recognition model to obtain the secondary audio evaluation result; set the secondary audio training conditions, if the secondary audio evaluation result meets the secondary audio training conditions, output the trained secondary audio recognition model; otherwise, continue to use the secondary audio training set to train the secondary audio recognition model.
[0082] The privacy audio recognition model is built on the Transformer model, which introduces a multi-head self-attention mechanism and uses a differential privacy optimization algorithm in training. The Transformer model is a neural network architecture mainly used to process sequence data. It has achieved remarkable success in fields such as natural language processing and speech recognition. The core feature of the Transformer model is the self-attention mechanism, which allows the model to consider all other elements in the sequence when processing each element of the sequence, thereby capturing the complex relationship between elements. Compared with the LSTM model, the Transformer model can process all elements in the sequence in parallel due to the self-attention mechanism, which makes it more efficient during training. At the same time, the self-attention mechanism can consider sequence information more comprehensively.
[0083] The specific steps for training the privacy audio recognition model are as follows:
[0084] Obtain several private audio data training samples with labeled private audio recognition results, and divide all private audio data training samples with labeled private audio recognition results into a private audio recognition training set and a private audio recognition test set; use the private audio recognition training set to train the private audio recognition model, and then use the private audio recognition test set to test the private audio recognition model to obtain the private audio recognition evaluation result; set the private audio training conditions, and if the private audio recognition evaluation result meets the private audio training conditions, output the trained private audio recognition model; otherwise, continue to use the private audio recognition training set to continue training the private audio recognition model.
[0085] In S1, differential privacy technology is used to process the collected audio data. The specific operations to obtain private audio data include:
[0086] The audio data collected during the current monitoring time period is divided into multiple audio segments, and each audio segment is short-time Fourier transformed, the audio segments are converted into spectrograms, and the spectrogram data to be processed is obtained; short-time Fourier transform is a method of decomposing a signal into a time-frequency representation, which can reveal the frequency components of the signal at different time points; according to the requirements of differential privacy, the noise level to be added is determined, and Gaussian noise is added to each obtained spectrogram data to be processed. Gaussian noise is randomly drawn from a normal distribution with a specific mean and variance to obtain privacy spectrogram data. These data maintain the original spectral characteristics while increasing the protection of individual privacy; the obtained privacy spectrogram data are combined into privacy audio data.
[0087] For the privacy area, if violent behavior is analyzed, the private audio data obtained during the current monitoring period will be stored; otherwise, the private audio data obtained during the current monitoring period will not be stored; the specific implementation method is as follows:
[0088] B1: Create a private audio temporary storage area and a violent incident audio storage area. The private audio temporary storage area is used to temporarily store the most recent private audio data. The violent incident audio storage area is used to store the private audio data for a long time when a violent incident is confirmed to have occurred, so as to facilitate subsequent investigations of the violent incident. At the same time, set a temporary storage period and an incident storage period. Both the temporary storage period and the incident storage period are a time range. The temporary storage period is used to determine the storage duration of the private audio data in the private audio temporary storage area. The incident storage period is used to determine the storage duration of the private audio data when a violent act occurs.
[0089] B2: storing the private audio data acquired during the current temporary storage period in the private audio temporary storage area, and using the private audio data acquired during the current temporary storage period to overwrite the private audio data acquired during the previous temporary storage period;
[0090] B3: Determine whether there is a violent act based on the private audio recognition results obtained during the current monitoring period. If it is determined that there is a violent act, extract the private audio data in the current private audio temporary storage area and store it in the violent event audio storage area. Take the current time point as the starting point of the incident storage period, and store all the private audio data obtained during the current incident storage period in the violent event audio storage area.
[0091] B4: Repeat A2-A3 operations to store private audio data only when violent behavior is identified. If no violent behavior is identified, private audio data will only be stored for a short period of time.
[0092] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention. Parts not described in detail in this specification belong to the prior art known to those skilled in the art.
Claims
1. A campus violence early warning system, characterized in that: include: A conventional data acquisition module, used to acquire primary video data or secondary video data and primary audio data or secondary audio data of a current detection time period; The conventional area database module is used to store the conventional video data and conventional audio data of the current monitoring time period; A private audio data acquisition module is used to acquire private audio data in the current monitoring period; A violent behavior recognition module, used to send the primary video data to the primary video recognition model for processing or send the secondary video data to the secondary video recognition model for processing according to the current time period, and output the primary video recognition result or the secondary video recognition result; And according to the current time period, the primary audio data is sent to the primary audio recognition model for processing or the secondary audio data is sent to the secondary audio recognition model for processing, and the primary audio recognition result or the secondary audio recognition result is output; At the same time, the private audio data is sent to the private audio recognition model for processing, and the private audio recognition result is output; Violence incident audio storage module: used to store private audio data acquired during the current monitoring period when there is violence; A violence warning response module is used to determine whether there is violent behavior based on the first-level video recognition result or the second-level video recognition result, the first-level audio recognition result or the second-level audio recognition result, and the private audio recognition result; if there is violent behavior, violence warning measures are executed; The invention also includes a campus violence early warning method applied to a campus violence early warning system, and the specific steps are as follows: S1: The campus area is divided into regular areas and privacy areas. Regular areas include all areas on campus where cameras can be legally installed, and privacy areas include sensitive areas on campus where cameras are not allowed to be installed. For the conventional area, obtain the conventional video data and conventional audio data of the current monitoring time period, and store the conventional video data and conventional audio data in the conventional area database; for the privacy area, collect the audio data of the current monitoring time period, and use the differential privacy technology to process the collected audio data to obtain the privacy audio data; S2: For conventional areas, determine whether the current time is in a period when violent incidents are prone to occur. If the current time is not in a period when violent incidents are prone to occur, perform video frame extraction on the conventional video data obtained in the current monitoring time period with an extraction interval of 4T to obtain Q first-level video frames, and form the Q first-level video frames into first-level video data; evenly divide the conventional audio data obtained in the current monitoring time period into Q audio clips, perform short-time Fourier transform on each audio clip, convert the audio clip into a spectrogram, obtain Q first-level spectrogram data, and form the Q first-level spectrogram data into first-level audio data; input the first-level video data and the first-level audio data obtained in the current monitoring time period into the first-level video recognition model and the first-level audio recognition model respectively, obtain the first-level video recognition results and the first-level audio recognition results, and determine whether there is violent behavior based on the first-level video recognition results and the first-level audio recognition results; If the current time is in a period prone to violent incidents, video frame extraction is performed on the conventional video data obtained in the current monitoring time period at an extraction interval T to obtain 4Q secondary video frames, and the 4Q secondary video frames are composed of secondary video data; the conventional audio data obtained in the current monitoring time period is evenly divided into 4Q audio segments, and each audio segment is short-time Fourier transform, the audio segment is converted into a spectrogram, and 4Q secondary spectrogram data are obtained, and the 4Q secondary spectrogram data are composed of secondary audio data; the secondary video data and secondary audio data obtained in the current monitoring time period are respectively input into the secondary video recognition model and the secondary audio recognition model to obtain secondary video recognition results and secondary audio recognition results, and whether there is violent behavior is determined according to the secondary video recognition results and the secondary audio recognition results; For the privacy area, the privacy audio data obtained during the current monitoring period is input into the privacy audio recognition model to obtain the privacy audio recognition result, and whether there is violence is determined based on the privacy audio recognition result; S3: If it is determined that there is violence, violence warning measures are implemented; Otherwise, no response is required.
2. A campus violence early warning system according to claim 1, characterized in that: Specific steps for the division of time periods prone to violent incidents: A1: Set a regular cycle of violent events; A2: Obtain the violence time data of all violent events that occurred in the previous violent event regular cycle of the current violent event regular cycle on campus, and form the obtained violence time data in the previous violent event regular cycle into a violence time data set; A3: Divide a day into several time periods. For each time period, count the violent time data matching the time period in the violent time dataset, and obtain the proportion of violent events in each time period. A4: Set a time period distinction threshold. For each time period, if the proportion of violent incidents in the time period is greater than the time period distinction threshold, the time period is classified as a time period prone to violent incidents. A5: Repeat operations A2 to A4 in each regular cycle of violent events to obtain a period of high incidence of violent events in the current regular cycle of violent events.
3. A campus violence early warning system according to claim 2, characterized in that: The first-level video recognition model is established based on the LSTM model, including Q first-level video recognition LSTM units, 1 first fully connected layer and 1 first output layer; the first-level video recognition LSTM unit is used to process each first-level video frame in the first-level video data; the first fully connected layer is used to perform feature mapping and nonlinear transformation on the outputs of all first-level video recognition LSTM units; the first output layer is used to convert the output of the first fully connected layer into a first-level video recognition result; The specific steps for training the first-level video recognition model are as follows: Obtain several first-level video data training samples with labeled first-level video recognition results, the first-level video data training samples contain Q+1 video frames arranged in chronological order, and divide all first-level video data training samples into a first-level video training set and a first-level video test set; use the first-level video training set to train the first-level video recognition model with initialized parameters, and then use the first-level video test set to test the first-level video recognition model, obtain the first-level video evaluation result, set the first-level video training condition, and if the first-level video evaluation result meets the first-level video training condition, output the trained first-level video recognition model; otherwise, use the first-level video training set to continue training the first-level video recognition model.
4. A campus violence early warning system according to claim 3, characterized in that: The first-level audio recognition model is established based on the LSTM model, including Q first-level audio recognition LSTM units, 1 second fully connected layer and 1 second output layer; the first-level audio recognition LSTM unit is used to gradually process each first-level spectrogram data in the first-level audio data; the second fully connected layer is used to further extract features from the outputs of all first-level audio recognition LSTM layers; the second output layer is used to convert the output of the second fully connected layer into a first-level audio recognition result; The specific steps for training the first-level audio recognition model are as follows: Obtain several first-level audio data training samples with labeled first-level audio recognition results, the first-level audio data training samples contain Q+1 spectrograms arranged in chronological order, and divide all the first-level audio data training samples into a first-level audio training set and a first-level audio test set; use the first-level audio training set to train the first-level audio recognition model with initialized parameters, and then use the first-level audio test set to test the first-level audio recognition model to obtain the first-level audio evaluation result; set the first-level audio training conditions, if the first-level audio evaluation result meets the first-level audio training conditions, output the trained first-level audio recognition model; otherwise, continue to use the first-level audio training set to train the first-level audio recognition model.
5. A campus violence early warning system according to claim 4, characterized in that: The secondary video recognition model is built based on the LSTM model, including 4Q secondary video recognition LSTM units, 1 third fully connected layer and 1 third output layer; The specific steps for training the secondary video recognition model are as follows: Obtain several secondary video data training samples with labeled secondary video recognition results, the secondary video data training samples contain 4Q+1 video frames arranged in chronological order, and divide all secondary video data training samples into a secondary video training set and a secondary video test set; Use the secondary video training set to train the secondary video recognition model with initialized parameters, and then use the secondary video test set to test the secondary video recognition model, obtain the secondary video evaluation results, set the secondary video training conditions, and output the trained secondary video recognition model if the secondary video evaluation results meet the secondary video training conditions; otherwise, use the secondary video training set to continue training the secondary video recognition model; the secondary audio recognition model is established based on the LSTM model, including 4Q secondary audio recognition LSTM units, 1 fourth fully connected layer and 1 fourth output layer; The specific steps for training the secondary audio recognition model are as follows: Obtain several secondary audio data training samples with labeled secondary audio recognition results, the secondary audio data training samples contain 4Q+1 spectrograms arranged in chronological order, and divide all secondary audio data training samples into a secondary audio training set and a secondary audio test set; The secondary audio recognition model with initialized parameters is trained using the secondary audio training set, and then the secondary audio recognition model is tested using the secondary audio test set to obtain the secondary audio evaluation result; Set the secondary audio training conditions. If the secondary audio evaluation result meets the secondary audio training conditions, output the trained secondary audio recognition model; otherwise, continue to use the secondary audio training set to train the secondary audio recognition model.
6. A campus violence early warning system according to claim 5, characterized in that: The privacy audio recognition model is built on the Transformer model. The privacy audio recognition model introduces a multi-head self-attention mechanism and uses a differential privacy optimization algorithm in training. The specific steps for training the privacy audio recognition model are as follows: Obtain several private audio data training samples with marked private audio recognition results, and divide all private audio data training samples with marked private audio recognition results into a private audio recognition training set and a private audio recognition test set; use the private audio recognition training set to train the private audio recognition model, and then use the private audio recognition test set to test the private audio recognition model to obtain a private audio recognition evaluation result; set a private audio training condition, and if the private audio recognition evaluation result meets the private audio training condition, output the trained private audio recognition model; Otherwise, continue to train the private audio recognition model using the private audio recognition training set.
7. A campus violence early warning system according to claim 6, characterized in that: In S1, differential privacy technology is used to process the collected audio data. The specific operations to obtain private audio data include: The audio data collected during the current monitoring time period is divided into multiple audio segments, and each audio segment is short-time Fourier transformed to convert the audio segment into a spectrogram to obtain the spectrogram data to be processed; Gaussian noise is added to each obtained spectrogram data to be processed to obtain privacy spectrogram data; the obtained privacy spectrogram data are combined into privacy audio data.
8. A campus violence early warning system according to claim 7, characterized in that: For the privacy area, if violent behavior is analyzed, the private audio data obtained during the current monitoring period will be stored; otherwise, the private audio data obtained during the current monitoring period will not be stored; the specific implementation method is as follows: B1: Create a temporary storage area for private audio and a storage area for violent incident audio, and set the temporary storage period and incident storage period; B2: storing the private audio data acquired in the current temporary storage period in the private audio temporary storage area, and using the private audio data acquired in the current temporary storage period to overwrite the private audio data acquired in the previous temporary storage period; B3: Determine whether there is a violent act based on the private audio recognition results obtained during the current monitoring period. If it is determined that there is a violent act, extract the private audio data in the current private audio temporary storage area and store it in the violent event audio storage area. Take the current time point as the starting point of the incident storage period, and store all the private audio data obtained during the current incident storage period in the violent event audio storage area. B4: Repeat A2-A3 operations.
Citation Information
Cited By
Voice signal edge processing system and method for audio monitoring
CN120932682A
