Intelligent campus safety monitoring method and system based on artificial intelligence
By improving the artificial neural network optimized by whale algorithm and the dual attention long-term short-term automatic encoder model, the accuracy of fire prediction and air monitoring in smart campus safety monitoring is solved, and the prediction and monitoring effect is improved.
Patent Information
- Application Number
- CN202411693583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-25
AI Technical Summary
In the existing smart campus safety monitoring, campus fire prediction data has high-dimensional complex feature space and complex nonlinear relationships. Traditional artificial neural networks cannot efficiently capture features, resulting in poor prediction performance; campus air monitoring data has long-term span characteristics, and traditional long-term short-term memory network models are prone to decline in memory ability and disappearance in the memory capacity when processing long-term series, affecting the accuracy of prediction.
An artificial neural network optimized by improved whale algorithm is used to predict campus fires. By improving the update mechanism of adaptive parameters, and introducing inertial weights and super mutated parameters into the whale optimization algorithm, the prediction performance and generalization performance of the model are improved; a dual attention long short-term automatic encoder model is used for campus air monitoring, and through the combination of global attention blocks and self-attention blocks, important feature capture capabilities and dynamic feature adjustment capabilities are enhanced.
The improved whale algorithm optimized artificial neural network improves the accuracy and generalization ability of campus fire prediction, and the dual attention long short-term automatic encoder model improves the accuracy of campus air monitoring and ensures accurate capture of dynamic changes in air quality data.
Smart Images

Figure CN119516700A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart campus, and specifically refers to a smart campus security monitoring method and system based on artificial intelligence. Background Art
[0002] Smart campus safety monitoring uses artificial intelligence technology to conduct comprehensive and automated monitoring of the campus environment. By analyzing real-time data, it can realize campus fire prediction and campus air monitoring, aiming to prevent safety hazards, ensure the safety of teachers and students and the good operation of the campus environment, thereby improving the level of campus safety.
[0003] However, in the existing smart campus safety monitoring process, there is a technical problem that the data involved in campus fire prediction has a high-dimensional and complex feature space and complex nonlinear relationships, and the traditional artificial neural network cannot efficiently capture these features, resulting in poor model prediction performance; there is a technical problem that the data involved in campus air monitoring has the characteristics of a long time span, and the traditional long short-term memory network model is prone to decreased memory ability and gradient disappearance when processing long time series, and it is easy to ignore information at critical moments, affecting the accuracy of model prediction. Summary of the invention
[0004] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a smart campus safety monitoring method and system based on artificial intelligence. In view of the technical problem that in the existing smart campus safety monitoring process, the data involved in campus fire prediction has a high-dimensional and complex feature space and has complex nonlinear relationships, and the traditional artificial neural network cannot efficiently capture these features, resulting in poor model prediction performance, this solution creatively adopts an artificial neural network optimized by an improved whale algorithm to predict campus fires, improves the updating mechanism of adaptive parameters, and introduces inertia weights and super mutation parameters into the whale optimization algorithm to accelerate the convergence speed of the algorithm and better balance the global search and local search, thereby improving the model prediction performance, It also improves the generalization performance of the model and enhances the effectiveness of campus fire prediction. In the existing smart campus safety monitoring process, the data involved in campus air monitoring has the characteristics of long time span. The traditional long short-term memory network model is prone to memory loss and gradient disappearance when processing long time series, and it is easy to ignore the information at critical moments, which affects the technical problem of model prediction accuracy. This scheme creatively adopts a dual attention long-term and short-term autoencoder model for campus air monitoring. Through the combination of global attention blocks and self-attention blocks, it enhances the ability to capture important features and the ability to dynamically adjust features, thereby ensuring that the model can more accurately capture the dynamic changes in air quality data and improve the accuracy of campus air monitoring.
[0005] The technical solution adopted by the present invention is as follows: The present invention provides an artificial intelligence-based smart campus safety monitoring method, which comprises the following steps:
[0006] Step S1: data preparation;
[0007] Step S2: data preprocessing;
[0008] Step S3: Campus fire prediction;
[0009] Step S4: Campus air monitoring;
[0010] Step S5: Smart campus security monitoring.
[0011] Further, in step S1, the data preparation is used to collect raw data required for smart campus safety monitoring, specifically collecting fire sensor data and air quality data through sensors to obtain campus safety data;
[0012] The fire sensing data includes smoke sensing data, temperature sensing data and flame detection data;
[0013] The air quality data includes humidity, wind speed, PM2.5 concentration, nitrogen dioxide concentration, sulfur dioxide concentration, carbon dioxide concentration and ozone concentration.
[0014] Furthermore, in step S2, the data preprocessing is specifically to preprocess the campus safety data through data cleaning, denoising, outlier removal and missing value filling to obtain high-quality campus safety data.
[0015] Further, in step S3, the campus fire prediction is used to predict the campus fire risk level, specifically using an artificial neural network optimized by an improved whale algorithm to perform campus fire prediction to obtain the campus fire risk level, including the following steps:
[0016] Step S31: Improvement of the whale optimization algorithm, specifically by improving the updating mechanism of the adaptive parameters and introducing the inertia weight and super mutation parameters into the whale optimization algorithm, to improve the whale optimization algorithm, and obtain an improved whale algorithm, including the following steps:
[0017] Step S311: Algorithm initialization, specifically initializing the number of whales, setting the maximum number of iterations, selecting the model accuracy as the fitness function, and randomly generating the initial whale positions, which are used to represent the model hyperparameter combination;
[0018] Step S312: Improve the updating mechanism of the adaptive parameters, and calculate the position update coefficient by the adaptive parameters. The calculation formula is:
[0019] ;
[0020] Where a is the adaptive parameter, cos(·) is the cosine function, π is the circumference of a circle, t is the iteration index, and T max is the maximum number of iterations, α is the speed constant used to control the speed of change, A is the position update coefficient used to control the range of whale movement, and rand is a random number in the range of (0,1);
[0021] Step S313: Calculate the whale fitness value, specifically, calculate the fitness value of each whale position through the fitness function, and select the whale position with the best fitness value as the optimal whale position;
[0022] Step S314: Calculate the inertia weight, the calculation formula is:
[0023] ;
[0024] Where w is the inertia weight, is the first constant of amplitude, is the second amplitude constant, and the first amplitude constant and the second amplitude constant are used to control the change amplitude of the inertia weight;
[0025] Step S315: Use the inertia weight to update the whale position to obtain an improved whale update position. The calculation formula is:
[0026] ;
[0027] In the formula, pos new (t+1) is the improved whale update position, pos best (t) is the optimal whale position in the tth iteration, D best is the distance between the current whale position and the optimal whale position, p is a strategy factor in the range of (0,1), which is used to randomly select a hunting strategy. When p<0.5, the shrinking and encircling strategy with inertia weight is selected to update the whale position. When p≥0.5, the spiral trajectory strategy with inertia weight is selected to update the whale position. D is the distance between the current whale position and the prey. e is the base of the natural logarithm. b is a logarithmic parameter used to control the shape of the spiral trajectory. r is a random number in the range of (-1,1) used to control the angle of the spiral motion.
[0028] Step S316: Update the whale position by using the traditional shrinking and encircling strategy and the spiral trajectory strategy to obtain the traditional whale update position. The calculation formula is:
[0029] ;
[0030] In the formula, It is the traditional whale update position;
[0031] Step S317: Control the whale position update through super mutation parameters, the calculation formula is:
[0032] ;
[0033] ;
[0034] Where M is the super mutation parameter, fit is the fitness value of the current whale position, and fit min is the minimum fitness value, fit max is the maximum fitness value, pos(t+1) is the updated whale position, and R is a random factor in the range of (0,1) used to control the whale position update method;
[0035] Step S318: Iterating the whale position, specifically, iterating the whale position by repeatedly executing steps S312 to S317 until the maximum number of iterations is reached;
[0036] Step S32: constructing an artificial neural network optimized by an improved whale algorithm, specifically constructing an artificial neural network infrastructure, and using the improved whale algorithm to tune parameters of the artificial neural network to obtain an artificial neural network optimized by the improved whale algorithm;
[0037] Step S33: constructing a campus fire prediction model, specifically by training the artificial neural network optimized by the improved whale algorithm to obtain the campus fire prediction model;
[0038] Step S34: Calculate the campus fire risk level, specifically use the fire sensor data in the campus safety high-quality data, perform campus fire prediction through the campus fire prediction model, and obtain the campus fire risk level, which includes extremely low risk, low risk, medium risk, high risk and extremely high risk.
[0039] Further, in step S4, the campus air monitoring is used to monitor the campus air quality, specifically using a dual attention long-term and short-term autoencoder model to perform campus air monitoring to obtain campus air monitoring information;
[0040] The dual attention long-short term autoencoder model comprises an input layer, a long-short term encoder layer, a global attention block, a long-short term decoder layer, a self-attention block and a dense layer;
[0041] The long-term and short-term encoder layer is used to capture the temporal characteristics in the data;
[0042] The global attention block is used to capture important information related to the current time step from all time steps;
[0043] The long-term and short-term decoder layer is used for sequence reconstruction;
[0044] The self-attention block is used to capture the dependencies between each time step in the decoding process;
[0045] The campus air monitoring includes the following steps:
[0046] Step S41: constructing an input layer, specifically receiving air quality data in campus safety quality data as input data of the model through the input layer;
[0047] Step S42: constructing a long-short term encoder layer, specifically using N long-short term memory units to form an encoder, obtaining a long-short term encoder layer, and processing the input data through the long-short term encoder layer to obtain a coding hidden state and a coding unit state;
[0048] Step S43: construct a global attention block, specifically, apply a global attention mechanism to capture important time steps from all encoding hidden states to obtain a context vector;
[0049] Step S44: constructing a long short-term decoder layer, specifically using N long short-term memory units to form a decoder to obtain a long short-term decoder layer, and processing the encoding hidden state, the encoding unit state and the context vector through the long short-term decoder layer to obtain a decoding hidden state;
[0050] Step S45: construct a self-attention block, specifically, apply the self-attention mechanism to process the decoded hidden state, further extract important time steps, and obtain self-attention;
[0051] Step S46: construct a dense layer, specifically, process the self-attention through a fully connected layer to obtain a prediction result;
[0052] Step S47: constructing a campus air monitoring model, specifically by constructing an input layer, a long-term and short-term encoder layer, a self-attention block, and a dense layer, constructing a dual-attention long-term and short-term autoencoder model, and performing model training to obtain a campus air monitoring model;
[0053] Step S48: Calculate campus air monitoring information, perform campus air monitoring through a campus air monitoring model, and obtain campus air monitoring information, wherein the campus air monitoring information includes excellent, good, light pollution, moderate pollution, and heavy pollution.
[0054] Furthermore, in step S5, the smart campus safety monitoring is used to monitor the campus environmental safety, specifically to generate a campus safety monitoring report based on the campus fire risk level and the campus air monitoring information. When it is detected that the campus fire risk level reaches high risk or above or the campus air monitoring information reaches moderate pollution or above, an alarm reminder is sent to campus administrators and teachers and students via text messages.
[0055] The artificial intelligence-based smart campus safety monitoring system provided by the present invention includes: a data preparation module, a data preprocessing module, a campus fire prediction module, a campus air monitoring module and a smart campus safety monitoring module;
[0056] The data preparation module is used for data preparation, obtains campus safety data through data preparation, and sends the campus safety data to the data preprocessing module;
[0057] The data preprocessing module is used for data preprocessing, and obtains campus safety high-quality data through data preprocessing, and sends the campus safety high-quality data to the campus fire prediction module and the campus air monitoring module;
[0058] The campus fire prediction module is used for campus fire prediction, obtains the campus fire risk level through campus fire prediction, and sends the campus fire risk level to the smart campus safety monitoring module;
[0059] The campus air monitoring module is used for campus air monitoring, obtains campus air monitoring information through campus air monitoring, and sends the campus air monitoring information to the smart campus safety monitoring module;
[0060] The smart campus safety monitoring module is used for smart campus safety monitoring. Through smart campus safety monitoring, a campus safety monitoring report is generated and an alarm reminder is issued.
[0061] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0062] (1) In view of the technical problem that the data involved in campus fire prediction in the existing smart campus safety monitoring process has a high-dimensional and complex feature space and complex nonlinear relationships, and the traditional artificial neural network cannot efficiently capture these features, resulting in poor model prediction performance, this solution creatively uses an artificial neural network optimized by an improved whale algorithm to predict campus fires. By improving the update mechanism of adaptive parameters and introducing inertia weights and super mutation parameters in the whale optimization algorithm, the algorithm convergence speed is accelerated, and the global search and local search are better balanced, which not only improves the model prediction performance, but also improves the generalization performance of the model, and enhances the effectiveness of campus fire prediction;
[0063] (2) In view of the fact that the data involved in campus air monitoring has a long time span in the existing smart campus safety monitoring process, the traditional long short-term memory network model is prone to memory loss and gradient disappearance when processing long time series, and it is easy to ignore the information at key moments, which affects the technical problem of model prediction accuracy. This scheme creatively adopts a dual attention long-term and short-term autoencoder model for campus air monitoring. By combining the global attention block and the self-attention block, it enhances the ability to capture important features and the ability to dynamically adjust features, thereby ensuring that the model can more accurately capture the dynamic changes in air quality data and improve the accuracy of campus air monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A schematic diagram of the process of the smart campus safety monitoring method based on artificial intelligence provided by the present invention;
[0065] Figure 2 A schematic diagram of an artificial intelligence-based smart campus safety monitoring system provided by the present invention;
[0066] Figure 3 is a schematic diagram of the process of step S3;
[0067] Figure 4 It is a schematic diagram of the process of step S4.
[0068] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0069] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0070] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0071] Example 1, see Figure 1 The present invention provides an artificial intelligence-based smart campus safety monitoring method, which comprises the following steps:
[0072] Step S1: data preparation;
[0073] Step S2: data preprocessing;
[0074] Step S3: Campus fire prediction;
[0075] Step S4: Campus air monitoring;
[0076] Step S5: Smart campus security monitoring.
[0077] Example 2, see Figure 1 ,This embodiment is based on the above embodiment. In step S1, the data preparation is used to collect the original data required for smart campus safety monitoring, specifically, to collect fire sensor data and air quality data through sensors to obtain campus safety data;
[0078] The fire sensing data includes smoke sensing data, temperature sensing data and flame detection data;
[0079] The air quality data includes humidity, wind speed, PM2.5 concentration, nitrogen dioxide concentration, sulfur dioxide concentration, carbon dioxide concentration and ozone concentration.
[0080] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, the data preprocessing is specifically to preprocess the campus safety data through data cleaning, denoising, outlier removal and missing value filling to obtain high-quality campus safety data.
[0081] Example 4, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S3, the campus fire prediction is used to predict the campus fire risk level. Specifically, the artificial neural network optimized by the improved whale algorithm is used to perform campus fire prediction to obtain the campus fire risk level, including the following steps:
[0082] Step S31: Improvement of the whale optimization algorithm, specifically by improving the updating mechanism of the adaptive parameters and introducing the inertia weight and super mutation parameters into the whale optimization algorithm, to improve the whale optimization algorithm, and obtain an improved whale algorithm, including the following steps:
[0083] Step S311: Algorithm initialization, specifically initializing the number of whales, setting the maximum number of iterations, selecting the model accuracy as the fitness function, and randomly generating the initial whale positions, which are used to represent the model hyperparameter combination;
[0084] Step S312: Improve the updating mechanism of the adaptive parameters, and calculate the position update coefficient by the adaptive parameters. The calculation formula is:
[0085] ;
[0086] Where a is the adaptive parameter, cos(·) is the cosine function, π is the circumference of a circle, t is the iteration index, and T max is the maximum number of iterations, α is the speed constant used to control the speed of change, A is the position update coefficient used to control the range of whale movement, and rand is a random number in the range of (0,1);
[0087] Step S313: Calculate the whale fitness value, specifically, calculate the fitness value of each whale position through the fitness function, and select the whale position with the best fitness value as the optimal whale position;
[0088] Step S314: Calculate the inertia weight, the calculation formula is:
[0089] ;
[0090] Where w is the inertia weight, is the first constant of amplitude, is the second amplitude constant, and the first amplitude constant and the second amplitude constant are used to control the change amplitude of the inertia weight;
[0091] Step S315: Use the inertia weight to update the whale position to obtain an improved whale update position. The calculation formula is:
[0092] ;
[0093] In the formula, pos new (t+1) is the improved whale update position, pos best (t) is the optimal whale position in the tth iteration, D best is the distance between the current whale position and the optimal whale position, p is a strategy factor in the range of (0,1), which is used to randomly select a hunting strategy. When p<0.5, the shrinking and encircling strategy with inertia weight is selected to update the whale position. When p≥0.5, the spiral trajectory strategy with inertia weight is selected to update the whale position. D is the distance between the current whale position and the prey. e is the base of the natural logarithm. b is a logarithmic parameter used to control the shape of the spiral trajectory. r is a random number in the range of (-1,1) used to control the angle of the spiral motion.
[0094] Step S316: Update the whale position by using the traditional shrinking and encircling strategy and the spiral trajectory strategy to obtain the traditional whale update position. The calculation formula is:
[0095] ;
[0096] In the formula, It is the traditional whale update position;
[0097] Step S317: Control the whale position update through super mutation parameters, the calculation formula is:
[0098] ;
[0099] ;
[0100] Where M is the super mutation parameter, fit is the fitness value of the current whale position, and fit min is the minimum fitness value, fit max is the maximum fitness value, pos(t+1) is the updated whale position, and R is a random factor in the range of (0,1) used to control the whale position update method;
[0101] Step S318: Iterating the whale position, specifically, iterating the whale position by repeatedly executing steps S312 to S317 until the maximum number of iterations is reached;
[0102] Step S32: constructing an artificial neural network optimized by an improved whale algorithm, specifically constructing an artificial neural network infrastructure, and using the improved whale algorithm to tune parameters of the artificial neural network to obtain an artificial neural network optimized by the improved whale algorithm;
[0103] Step S33: constructing a campus fire prediction model, specifically by training the artificial neural network optimized by the improved whale algorithm to obtain the campus fire prediction model;
[0104] Step S34: Calculate the campus fire risk level, specifically using the fire sensor data in the campus safety high-quality data, and predicting the campus fire through the campus fire prediction model to obtain the campus fire risk level, wherein the campus fire risk level includes extremely low risk, low risk, medium risk, high risk and extremely high risk;
[0105] By performing the above operations, in order to solve the technical problem that in the existing smart campus safety monitoring process, the data involved in campus fire prediction has a high-dimensional and complex feature space and complex nonlinear relationships, and the traditional artificial neural network cannot efficiently capture these features, resulting in poor model prediction performance, this solution creatively uses an artificial neural network optimized by an improved whale algorithm to predict campus fires. By improving the update mechanism of adaptive parameters and introducing inertia weights and super mutation parameters in the whale optimization algorithm, the algorithm convergence speed is accelerated, and the global search and local search are better balanced, which not only improves the model prediction performance, but also improves the generalization performance of the model, thereby enhancing the effectiveness of campus fire prediction.
[0106] Example 5, see Figure 1 and Figure 4 , this embodiment is based on the above embodiment. In step S4, the campus air monitoring is used to monitor the campus air quality, specifically using a dual attention long-term and short-term autoencoder model to perform campus air monitoring to obtain campus air monitoring information;
[0107] The dual attention long-short term autoencoder model comprises an input layer, a long-short term encoder layer, a global attention block, a long-short term decoder layer, a self-attention block and a dense layer;
[0108] The long-term and short-term encoder layer is used to capture the temporal characteristics in the data;
[0109] The global attention block is used to capture important information related to the current time step from all time steps;
[0110] The long-term and short-term decoder layer is used for sequence reconstruction;
[0111] The self-attention block is used to capture the dependencies between each time step in the decoding process;
[0112] The campus air monitoring includes the following steps:
[0113] Step S41: constructing an input layer, specifically receiving air quality data in campus safety quality data as input data of the model through the input layer;
[0114] Step S42: constructing a long-short term encoder layer, specifically using N long-short term memory units to form an encoder, obtaining a long-short term encoder layer, and processing the input data through the long-short term encoder layer to obtain a coding hidden state and a coding unit state;
[0115] Step S43: construct a global attention block, specifically, apply a global attention mechanism to capture important time steps from all encoding hidden states to obtain a context vector;
[0116] Step S44: constructing a long short-term decoder layer, specifically using N long short-term memory units to form a decoder to obtain a long short-term decoder layer, and processing the encoding hidden state, the encoding unit state and the context vector through the long short-term decoder layer to obtain a decoding hidden state;
[0117] Step S45: construct a self-attention block, specifically, apply the self-attention mechanism to process the decoded hidden state, further extract important time steps, and obtain self-attention. The calculation formula is:
[0118] ;
[0119] ;
[0120] Where Q is the query vector, W q is the query weight, h is the decoded hidden state, K is the key vector, and W k is the key weight, V is the value vector, W v is the value weight, Att self is self-attention, softmax(·) is the softmax activation function, T is the transposition operation, and d k is the key vector dimension;
[0121] Step S46: construct a dense layer, specifically, process the self-attention through a fully connected layer to obtain a prediction result;
[0122] Step S47: constructing a campus air monitoring model, specifically by constructing an input layer, a long-term and short-term encoder layer, a self-attention block, and a dense layer, constructing a dual-attention long-term and short-term autoencoder model, and performing model training to obtain a campus air monitoring model;
[0123] Step S48: Calculate campus air monitoring information, perform campus air monitoring through a campus air monitoring model, and obtain campus air monitoring information, wherein the campus air monitoring information includes excellent, good, lightly polluted, moderately polluted, and heavily polluted;
[0124] By performing the above operations, in view of the fact that in the existing smart campus safety monitoring process, the data involved in campus air monitoring has the characteristics of a long time span, and the traditional long short-term memory network model is prone to memory loss and gradient disappearance when processing long time series, and is prone to ignoring information at critical moments, affecting the technical problem of model prediction accuracy, this solution creatively adopts a dual attention long-term and short-term autoencoder model for campus air monitoring. Through the combination of global attention blocks and self-attention blocks, it enhances the ability to capture important features and dynamically adjust features, thereby ensuring that the model can more accurately capture the dynamic changes in air quality data and improve the accuracy of campus air monitoring.
[0125] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the smart campus safety monitoring is used to monitor the campus environmental safety. Specifically, a campus safety monitoring report is generated by combining the campus fire risk level and the campus air monitoring information. When it is detected that the campus fire risk level reaches a high risk or above or the campus air monitoring information reaches moderate pollution or above, an alarm reminder is sent to campus administrators and teachers and students via text messages.
[0126] Embodiment 7, see Figure 2 , this embodiment is based on the above embodiment, and the artificial intelligence-based smart campus safety monitoring system provided by the present invention includes: a data preparation module, a data preprocessing module, a campus fire prediction module, a campus air monitoring module and a smart campus safety monitoring module;
[0127] The data preparation module is used for data preparation, obtains campus safety data through data preparation, and sends the campus safety data to the data preprocessing module;
[0128] The data preprocessing module is used for data preprocessing, and obtains campus safety high-quality data through data preprocessing, and sends the campus safety high-quality data to the campus fire prediction module and the campus air monitoring module;
[0129] The campus fire prediction module is used for campus fire prediction, obtains the campus fire risk level through campus fire prediction, and sends the campus fire risk level to the smart campus safety monitoring module;
[0130] The campus air monitoring module is used for campus air monitoring, obtains campus air monitoring information through campus air monitoring, and sends the campus air monitoring information to the smart campus safety monitoring module;
[0131] The smart campus safety monitoring module is used for smart campus safety monitoring. Through smart campus safety monitoring, a campus safety monitoring report is generated and an alarm reminder is issued.
[0132] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0133] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0134] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A smart campus safety monitoring method based on artificial intelligence, characterized by: The method comprises the following steps: Step S1: data preparation; Step S2: data preprocessing; Step S3: Campus fire prediction, used to predict the campus fire risk level, specifically using an artificial neural network optimized by an improved whale algorithm to predict campus fires and obtain the campus fire risk level; Step S4: Campus air monitoring, used to monitor campus air quality, specifically using a dual attention long-term and short-term autoencoder model to perform campus air monitoring and obtain campus air monitoring information; The dual attention long-short term autoencoder model comprises an input layer, a long-short term encoder layer, a global attention block, a long-short term decoder layer, a self-attention block and a dense layer; The long-term and short-term encoder layer is used to capture the temporal characteristics in the data; The global attention block is used to capture important information related to the current time step from all time steps; The long-term and short-term decoder layer is used for sequence reconstruction; The self-attention block is used to capture the dependencies between each time step in the decoding process; Step S5: Smart campus security monitoring.
2. The method for intelligent campus safety monitoring based on artificial intelligence according to claim 1 is characterized in that: In step S3, the campus fire prediction includes the following steps: Step S31: improving the whale optimization algorithm, specifically by improving the updating mechanism of the adaptive parameters and introducing the inertia weight and super mutation parameters into the whale optimization algorithm, improving the whale optimization algorithm to obtain an improved whale algorithm; Step S32: constructing an artificial neural network optimized by an improved whale algorithm, specifically constructing an artificial neural network infrastructure, and using the improved whale algorithm to tune parameters of the artificial neural network to obtain an artificial neural network optimized by the improved whale algorithm; Step S33: constructing a campus fire prediction model, specifically by training the artificial neural network optimized by the improved whale algorithm to obtain the campus fire prediction model; Step S34: Calculate the campus fire risk level, specifically use the fire sensor data in the campus safety high-quality data, perform campus fire prediction through the campus fire prediction model, and obtain the campus fire risk level, which includes extremely low risk, low risk, medium risk, high risk and extremely high risk.
3. The method for intelligent campus safety monitoring based on artificial intelligence according to claim 2 is characterized in that: In step S31, the whale optimization algorithm is improved, including the following steps: Step S311: Algorithm initialization, specifically initializing the number of whales, setting the maximum number of iterations, selecting the model accuracy as the fitness function, and randomly generating the initial whale positions, which are used to represent the model hyperparameter combination; Step S312: Improve the updating mechanism of the adaptive parameters, and calculate the position update coefficient by the adaptive parameters. The calculation formula is: ; Where a is the adaptive parameter, cos(·) is the cosine function, π is the circumference of a circle, t is the iteration index, and T max is the maximum number of iterations, α is the speed constant used to control the speed of change, A is the position update coefficient used to control the range of whale movement, and rand is a random number in the range of (0,1); Step S313: Calculate the whale fitness value, specifically, calculate the fitness value of each whale position through the fitness function, and select the whale position with the best fitness value as the optimal whale position; Step S314: Calculate the inertia weight, the calculation formula is: ; Where w is the inertia weight, is the first constant of amplitude, is the second amplitude constant, and the first amplitude constant and the second amplitude constant are used to control the change amplitude of the inertia weight; Step S315: Use the inertia weight to update the whale position to obtain an improved whale update position. The calculation formula is: ; In the formula, pos new (t+1) is the improved whale update position, pos best (t) is the optimal whale position in the tth iteration, D best is the distance between the current whale position and the optimal whale position, p is a strategy factor in the range of (0,1), which is used to randomly select a hunting strategy. When p<0.5, the shrinking and encircling strategy with inertia weight is selected to update the whale position. When p≥0.5, the spiral trajectory strategy with inertia weight is selected to update the whale position. D is the distance between the current whale position and the prey. e is the base of the natural logarithm. b is a logarithmic parameter used to control the shape of the spiral trajectory. r is a random number in the range of (-1,1) used to control the angle of the spiral motion. Step S316: Update the whale position by using the traditional shrinking and encircling strategy and the spiral trajectory strategy to obtain the traditional whale update position. The calculation formula is: ; In the formula, It is the traditional whale update position; Step S317: Control the whale position update through super mutation parameters, the calculation formula is: ; ; Where M is the super mutation parameter, fit is the fitness value of the current whale position, and fit min is the minimum fitness value, fit max is the maximum fitness value, pos(t+1) is the updated whale position, and R is a random factor in the range of (0,1) used to control the whale position update method; Step S318: Whale position iteration, specifically, performing whale position iteration by repeatedly executing steps S312 to S317 until a maximum number of iterations is reached.
4. The method for intelligent campus safety monitoring based on artificial intelligence according to claim 3 is characterized in that: In step S4, the campus air monitoring includes the following steps: Step S41: constructing an input layer, specifically receiving air quality data in campus safety quality data as input data of the model through the input layer; Step S42: constructing a long-short term encoder layer, specifically using N long-short term memory units to form an encoder, obtaining a long-short term encoder layer, and processing the input data through the long-short term encoder layer to obtain a coding hidden state and a coding unit state; Step S43: construct a global attention block, specifically, apply a global attention mechanism to capture important time steps from all encoding hidden states to obtain a context vector; Step S44: constructing a long short-term decoder layer, specifically using N long short-term memory units to form a decoder to obtain a long short-term decoder layer, and processing the encoding hidden state, the encoding unit state and the context vector through the long short-term decoder layer to obtain a decoding hidden state; Step S45: construct a self-attention block, specifically, apply the self-attention mechanism to process the decoded hidden state, further extract important time steps, and obtain self-attention; Step S46: construct a dense layer, specifically, process the self-attention through a fully connected layer to obtain a prediction result; Step S47: constructing a campus air monitoring model, specifically by constructing an input layer, a long-term and short-term encoder layer, a self-attention block, and a dense layer, constructing a dual-attention long-term and short-term autoencoder model, and performing model training to obtain a campus air monitoring model; Step S48: Calculate campus air monitoring information, perform campus air monitoring through a campus air monitoring model, and obtain campus air monitoring information, wherein the campus air monitoring information includes excellent, good, light pollution, moderate pollution, and heavy pollution.
5. The method for intelligent campus safety monitoring based on artificial intelligence according to claim 4 is characterized in that: In step S5, the smart campus safety monitoring is used to monitor the campus environmental safety, specifically to generate a campus safety monitoring report based on the campus fire risk level and campus air monitoring information. When it is detected that the campus fire risk level reaches high risk or above or the campus air monitoring information reaches moderate pollution or above, an alarm reminder is sent to campus administrators and teachers and students via text messages.
6. The method for intelligent campus safety monitoring based on artificial intelligence according to claim 5 is characterized in that: In step S1, the data preparation is used to collect the raw data required for smart campus safety monitoring, specifically collecting fire sensor data and air quality data through sensors to obtain campus safety data; The fire sensing data includes smoke sensing data, temperature sensing data and flame detection data; The air quality data includes humidity, wind speed, PM2.5 concentration, nitrogen dioxide concentration, sulfur dioxide concentration, carbon dioxide concentration and ozone concentration; In step S2, the data preprocessing is specifically to preprocess the campus safety data through data cleaning, denoising, outlier removal and missing value filling to obtain high-quality campus safety data.
7. An artificial intelligence-based smart campus safety monitoring system, used to implement the artificial intelligence-based smart campus safety monitoring method as described in any one of claims 1 to 6, characterized in that: It includes data preparation module, data preprocessing module, campus fire prediction module, campus air monitoring module and smart campus safety monitoring module.
8. The artificial intelligence-based smart campus safety monitoring system according to claim 7 is characterized in that: The data preparation module is used for data preparation, obtains campus safety data through data preparation, and sends the campus safety data to the data preprocessing module; The data preprocessing module is used for data preprocessing, and obtains campus safety high-quality data through data preprocessing, and sends the campus safety high-quality data to the campus fire prediction module and the campus air monitoring module; The campus fire prediction module is used for campus fire prediction, obtains the campus fire risk level through campus fire prediction, and sends the campus fire risk level to the smart campus safety monitoring module; The campus air monitoring module is used for campus air monitoring, obtains campus air monitoring information through campus air monitoring, and sends the campus air monitoring information to the smart campus safety monitoring module; The smart campus safety monitoring module is used for smart campus safety monitoring. Through smart campus safety monitoring, a campus safety monitoring report is generated and an alarm reminder is issued.