Water conservancy anti-theft alarm system based on visual technology
By adopting a deep learning abnormal behavior detection model based on vision technology in the anti-theft system of water conservancy facilities, the problem that existing systems cannot realize unattended monitoring and automatic analysis and processing is solved, and the abnormal identification efficiency and targeted safety protection measures are improved.
Patent Information
- Application Number
- CN202411558519.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-11
AI Technical Summary
The existing anti-theft system of water conservancy facilities cannot achieve unattended monitoring, and it relies on a large amount of manpower to participate in operation and maintenance. The monitoring system lacks automatic analysis and processing capabilities, resulting in false alarms and missed reports.
Adopt a water conservancy anti-theft alarm system based on vision technology, including data acquisition and processing module, model building module, training module, detection module, result output module and early warning module. Deep learning technology is used to build an abnormal behavior detection model, automatically identify abnormal patterns and provide early warning .
It improves the efficiency and accuracy of abnormal situation identification, reduces the false alarm rate, enhances the sensitivity to abnormal events, and improves the targetedness of security protection measures through detailed abnormal behavior records.
Smart Images

Figure CN119418506A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of machine vision, and more particularly to a water conservancy anti-theft alarm system based on vision technology. Background Art
[0002] Water conservancy facilities are important infrastructure for social and economic development, and are widely used in flood control and drainage, irrigation and water supply, hydropower generation, shipping and other fields. With the development of society and the increasing number of water conservancy projects, the safety of water conservancy facilities has become increasingly prominent. In recent years, due to the relatively remote geographical location of water conservancy facilities, they are easily targeted by criminals for destruction and theft, causing serious economic losses and safety hazards to society. Therefore, improving the security level of water conservancy facilities is an urgent task.
[0003] Traditional water conservancy anti-theft measures mainly include physical protection measures (such as fences, door locks) and personnel patrols. However, this type of method has some obvious limitations: it is impossible to monitor around the clock and the labor cost is high; most of the technical solutions for protecting water conservancy facilities on the market still require a large number of people to participate in operation and maintenance, and cannot achieve true unmanned operation, especially in remote areas. The difficulty in staffing makes it difficult to improve the security level; although the existing monitoring system can collect video data, the identification of abnormal situations often relies on manual observation and judgment, lacks effective automatic analysis and processing capabilities, and is prone to false alarms and missed reports.
[0004] Therefore, how to improve the efficiency and accuracy of identifying abnormal situations is an urgent problem that technical personnel in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides a water conservancy anti-theft alarm system based on visual technology, which helps to improve the efficiency and accuracy of identifying abnormal situations.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A water conservancy anti-theft alarm system based on visual technology, comprising: a data acquisition and processing module, a model building module, a training module, a detection module, a result output module and an early warning module;
[0008] The data acquisition and processing module is used to obtain video data in the water conservancy facility monitoring scene and perform preprocessing to obtain a training data set;
[0009] The model building module is used to build an abnormal behavior detection model including a feature extractor, a position encoding layer, an encoder, a classification network and a regression network;
[0010] The training module is used to train the abnormal behavior detection model based on the training data set and the total loss function to obtain a trained abnormal behavior detection model;
[0011] The detection module is used to obtain the video data to be detected and pre-process it before inputting it into the trained abnormal behavior detection model to obtain the abnormal detection result and the start and end time of the abnormal behavior;
[0012] The result output module is used to obtain a final detection result based on the abnormality detection result and the start and end time of the abnormal behavior;
[0013] The early warning module is used to make corresponding early warning prompts based on the final detection result.
[0014] Preferably, the data acquisition and processing module includes: a data acquisition unit, a frame processing unit, a data enhancement unit and a data annotation unit;
[0015] The data acquisition unit is used to obtain video data including normal behavior and abnormal behavior in the water conservancy facility monitoring scene;
[0016] The frame processing unit is used to divide the video data into a plurality of continuous frame images, and convert all the frame images into a set size to obtain a frame image data set;
[0017] The data enhancement unit is used to perform an image enhancement operation based on the frame image data set to obtain an enhanced image data set;
[0018] The data annotation unit is used to annotate the abnormal behavior type and the start and end time of the abnormal behavior based on the enhanced image data set, and obtain the annotated data set as the training data set.
[0019] Preferably, the feature extractor uses a pre-trained ResNet50 as a basic network, removes the last fully connected layer, and is used to perform feature extraction based on the training data set to obtain a feature vector for each frame image.
[0020] Preferably, the position encoding layer is used to generate a position encoding based on the feature vector to obtain a coded feature vector;
[0021] The position code is generated in the following way:
[0022] For even dimensions:
[0023] For odd dimensions:
[0024] Among them, P(A,2i) represents the position encoding value of dimension 2i at position index A, A represents the position index of the frame image, i represents the dimension index, and d represents the dimension of the feature vector.
[0025] Preferably, the encoder comprises: a first encoding layer, a second encoding layer and a third encoding layer connected in sequence;
[0026] The encoder is used to receive the encoding feature vector and input it into the first encoding layer to obtain a first encoding feature;
[0027] The first coding feature is input into the second coding layer to obtain a second coding feature;
[0028] The second coding feature is input into the third coding layer to obtain a coding sequence feature.
[0029] Preferably, the first encoding layer, the second encoding layer and the third encoding layer have the same structure, and all include: a first self-attention mechanism layer, a first layer normalization unit, a feedforward neural network and a second layer normalization unit;
[0030] The data processing processes of the first coding layer, the second coding layer and the third coding layer are the same, which are:
[0031] Input the input feature to the first self-attention mechanism layer to obtain the first intermediate feature;
[0032] The input feature is fused with the first intermediate feature and input into the first layer normalization unit to obtain a second intermediate feature;
[0033] The second intermediate feature is input into the feedforward neural network to obtain a third intermediate feature;
[0034] The third intermediate feature is fused with the second intermediate feature and input into the second layer normalization unit to obtain an output feature.
[0035] Preferably, the classification network comprises: a first fully connected layer, a first activation layer, a multi-scale convolutional layer, a pooling layer, a first Dropout layer, a second fully connected layer, a second activation layer and a global pooling layer;
[0036] The classification network is used to receive the coding sequence features and input them into the first fully connected layer and the first activation layer in sequence to obtain first extracted features;
[0037] The first extracted features are input into the multi-scale convolutional layer to obtain multi-scale fusion features;
[0038] The multi-scale fusion features are sequentially input into the pooling layer, the first Dropout layer, the second fully connected layer, the second activation layer and the global pooling layer to obtain the anomaly detection result.
[0039] Preferably, the regression network comprises: a second self-attention mechanism layer, a first normalization layer, a third fully connected layer, a third activation layer, a batch normalization layer, a second Dropout layer, a fourth fully connected layer, a second normalization layer and an output layer;
[0040] The regression network is used to receive the encoding sequence feature and input it into the second self-attention mechanism layer to obtain a first processing feature;
[0041] The first intermediate feature is fused with the coding sequence feature to obtain a first fused feature;
[0042] The first fusion feature is sequentially input to the first normalization layer, the third fully connected layer and the third activation layer to obtain a second processed feature;
[0043] The second intermediate feature is sequentially input into the batch normalization layer, the second Dropout layer and the fourth fully connected layer to obtain a third processed feature;
[0044] The third processing feature is fused with the second processing feature to obtain a second fused feature;
[0045] The second fusion feature is sequentially input into the second normalization layer and the output layer to obtain the start and end time of the abnormal behavior.
[0046] Preferably, the result output module includes: a judgment unit and an information generation unit;
[0047] The judging unit is used to obtain the duration of the abnormal behavior based on the start and end time of the abnormal behavior, and judge whether there is abnormal behavior in the abnormal detection result. If not, no information is generated. If so, whether the duration of the abnormal behavior is greater than a set value is judged; if so, serious abnormality information is generated; if not, general abnormality information is generated;
[0048] The information generating unit is used to generate the final detection result based on the serious abnormality information or the general abnormality information.
[0049] Preferably, it also includes a data storage and analysis module;
[0050] The data storage and analysis module is used to store all the collected video data to be detected, the corresponding final detection results and the early warning prompt information, and perform statistical analysis based on the video data to be detected and the corresponding final detection results to generate an analysis report.
[0051] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a water conservancy anti-theft alarm system based on visual technology, which has the following beneficial effects:
[0052] 1. The present invention utilizes the feature extractor (such as pre-trained ResNet50) in deep learning technology as well as the position encoding layer, encoder, classification network and regression network. The system can automatically identify complex abnormal patterns and continuously improve the accuracy as more data accumulates, reducing the false alarm rate while also enhancing the sensitivity to abnormal events.
[0053] 2. When an abnormal situation is detected, the system can not only give a warning message quickly, but also provide detailed start and end time of the abnormal behavior. By recording the start and end time and type of abnormal behavior, it can not only be used for immediate response, but also can be used as a valuable data asset for subsequent analysis. By studying these historical data, potential safety hazard patterns can be discovered, and then the monitoring strategy can be adjusted or the safety protection measures in specific areas can be strengthened.
[0054] 3. By setting a reasonable abnormal behavior duration threshold, the system can filter out short-term and harmless behavior changes (such as animals passing by, etc.) to a certain extent, thereby reducing the false alarm rate. At the same time, for those situations that do pose a threat but do not reach a serious level, appropriate attention can be given to avoid the omission of important information.
[0055] 4. By accurately calculating the duration of abnormal behavior and distinguishing between general and serious anomalies based on preset time thresholds, the system can more accurately assess the urgency of the incident. This hierarchical processing mechanism helps ensure that resources are prioritized to the situations that need the most attention, thereby improving response efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0057] Figure 1 A schematic diagram of the structure of a water conservancy anti-theft alarm system based on visual technology provided by the present invention.
[0058] Figure 2 This is a schematic diagram of the abnormal behavior detection model structure provided by the present invention.
[0059] Figure 3This is a schematic diagram of the coding layer structure provided by the present invention.
[0060] Figure 4 This is a schematic diagram of the classification network structure provided by the present invention.
[0061] Figure 5 This is a schematic diagram of the regression network structure provided by the present invention.
[0062] Figure 6 This is a flow chart of the judgment method of the judgment unit provided by the present invention.
[0063] Figure 7 A schematic flow chart of a water conservancy anti-theft alarm method based on visual technology provided by the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] Example 1
[0066] like Figure 1 As shown, the embodiment of the present invention discloses a water conservancy anti-theft alarm system based on visual technology, including: a data acquisition and processing module, a model building module, a training module, a detection module, a result output module and an early warning module;
[0067] The data acquisition and processing module is used to obtain video data in the water conservancy facility monitoring scenario and perform preprocessing to obtain a training data set;
[0068] A model building module, used to build an abnormal behavior detection model including a feature extractor, a position encoding layer, an encoder, a classification network, and a regression network;
[0069] A training module, used to train the abnormal behavior detection model based on the training data set and the total loss function to obtain a trained abnormal behavior detection model;
[0070] The detection module is used to obtain the video data to be detected and pre-process it before inputting it into the trained abnormal behavior detection model to obtain the abnormal detection result and the start and end time of the abnormal behavior;
[0071] A result output module is used to obtain the final detection result based on the abnormal detection result and the start and end time of the abnormal behavior;
[0072] The early warning module is used to provide corresponding early warning prompts based on the final detection results.
[0073] Example 2
[0074] The embodiment of the invention discloses a water conservancy anti-theft alarm system based on visual technology, comprising: a data acquisition and processing module, a model building module, a training module, a detection module, a result output module and an early warning module.
[0075] The data acquisition and processing module is used to obtain video data in the water conservancy facility monitoring scenario and perform preprocessing to obtain a training data set:
[0076] Preferably, the data acquisition and processing module includes: a data acquisition unit, a frame processing unit, a data enhancement unit and a data annotation unit;
[0077] Data acquisition unit: used to obtain video data including normal and abnormal behaviors in water conservancy facility monitoring scenarios;
[0078] Frame processing unit: used to divide the video data into multiple continuous frame images, and convert all the frame images into a set size to obtain a frame image data set;
[0079] A data enhancement unit, used for performing an image enhancement operation based on the frame image data set to obtain an enhanced image data set;
[0080] The data annotation unit is used to annotate the abnormal behavior type and the start and end time of the abnormal behavior based on the enhanced image data set, and obtain the annotated data set as the training data set.
[0081] Preferably, the image enhancement operation in this embodiment adopts random cropping, horizontal flipping and color jittering operations to improve the generalization ability of the model.
[0082] Model building blocks such as Figure 2 As shown, it is used to build an abnormal behavior detection model including a feature extractor, a position encoding layer, an encoder, a classification network and a regression network.
[0083] Preferably, the feature extractor uses a pre-trained ResNet50 as the basic network, removes the last fully connected layer, and is used to extract features based on the training data set to obtain a feature vector for each frame image.
[0084] Preferably, the position encoding layer is used to generate a position encoding based on the feature vector to obtain a coded feature vector;
[0085] The position code is generated using sine and cosine functions, specifically:
[0086] For even dimensions:
[0087] For odd dimensions:
[0088] Among them, P(A,2i) represents the position encoding value with dimension 2i at position index A, A represents the position index of the frame image, i represents the dimension index, d represents the dimension of the feature vector, and P(A,2i+1) represents the position encoding value with dimension 2i+1 at position index A.
[0089] Preferably, a position coding layer is used to generate and add position coding to a feature vector, so that the encoder can capture timing information and perceive the position information of each frame image.
[0090] Preferably, the periodicity of the sine function is used to represent the relative relationship between the positions of different frame images. As the dimension i increases, the exponential term 10000 in the denominator 2i / d will change, resulting in fluctuation patterns of different frequencies, allowing the model to learn the complex relationship between different distance positions in the input sequence. This encoding method allows positions with the same relative distance to have similar encoding differences even at different absolute positions, which helps to understand the structure of sequence data.
[0091] Preferably, the encoder comprises: a first encoding layer, a second encoding layer and a third encoding layer connected in sequence;
[0092] The encoder is used to receive the encoded feature vector and input it into the first encoding layer to obtain a first encoded feature;
[0093] The first coding feature is input into the second coding layer to obtain a second coding feature;
[0094] The second coding feature is input into the third coding layer to obtain the coding sequence feature.
[0095] Preferably, the encoder in this embodiment adopts a Transformer encoder.
[0096] Preferably, Figure 3 As shown, the first coding layer, the second coding layer and the third coding layer have the same structure, and all include: a first self-attention mechanism layer, a first layer normalization unit, a feedforward neural network and a second layer normalization unit;
[0097] The data processing process of the first coding layer, the second coding layer and the third coding layer is the same, which is:
[0098] The input features are input to the first self-attention mechanism layer to obtain the first intermediate features;
[0099] The input feature is fused with the first intermediate feature and then input into the first layer normalization unit to obtain the second intermediate feature;
[0100] The second intermediate feature is input into the feedforward neural network to obtain the third intermediate feature;
[0101] The third intermediate feature is fused with the second intermediate feature and input into the second layer normalization unit to obtain the output feature.
[0102] Preferably, by adding a first self-attention mechanism layer, the model focuses on different parts of the sequence, thereby better capturing long-distance dependencies.
[0103] Preferably, by performing residual connections after the first self-attention mechanism layer and the feedforward neural network, it can help alleviate the gradient vanishing problem and make deep networks easier to train. Layer normalization helps stabilize the distribution of hidden layers, speed up the training process, and reduce the risk of overfitting.
[0104] Preferably, the feedforward neural network includes: two layers of fully connected networks and a ReLU activation function, and the ReLU activation function is located between the two layers of fully connected networks.
[0105] Preferably, Figure 4 As shown, the classification network includes: a first fully connected layer, a first activation layer, a multi-scale convolutional layer, a pooling layer, a first Dropout layer, a second fully connected layer, a second activation layer, and a global pooling layer;
[0106] A classification network, used for receiving the coding sequence features and sequentially inputting them into a first fully connected layer and a first activation layer to obtain a first extracted feature;
[0107] First, the extracted features are input into the multi-scale convolution layer to obtain multi-scale fusion features;
[0108] The multi-scale fusion features are sequentially input into the pooling layer, the first Dropout layer, the second fully connected layer, the second activation layer and the global pooling layer to obtain the anomaly detection results.
[0109] Preferably, in this embodiment, the first activation layer adopts the ReLU activation function, and the second activation layer adopts the Softmax activation function.
[0110] Preferably, the multi-scale convolution layer includes three parallel one-dimensional convolution layers, three activation layers, a concatenation layer and a maximum pooling layer;
[0111] The three parallel one-dimensional convolutional layers include: the first convolutional layer, the second convolutional layer and the third convolutional layer, with corresponding convolution kernel sizes of 3, 5 and 7; each convolutional layer is connected to an activation layer.
[0112] The first extracted features are input into the first convolution layer, the second convolution layer and the third convolution layer respectively, and the first scale features, the second scale features and the third scale features are obtained through activation layer processing respectively;
[0113] The first scale feature, the second scale feature, and the third scale feature are all input to the concatenation layer and concatenated along the feature dimension (i.e., the last dimension) to obtain the concatenation feature;
[0114] The concatenated features are input into the maximum pooling layer to obtain multi-scale fusion features.
[0115] Preferably, the activation layers in the multi-scale convolutional layer of this embodiment all use ReLU activation function.
[0116] Preferably, Figure 5 As shown, the regression network includes: a second self-attention mechanism layer, a first normalization layer, a third fully connected layer, a third activation layer, a batch normalization layer, a second Dropout layer, a fourth fully connected layer, a second normalization layer and an output layer;
[0117] A regression network is used to receive the encoding sequence features and input them into the second self-attention mechanism layer to obtain the first processed features;
[0118] The first intermediate feature is fused with the coding sequence feature to obtain a first fused feature;
[0119] The first fusion feature is sequentially input to the first normalization layer, the third fully connected layer and the third activation layer to obtain the second processed feature;
[0120] The second intermediate feature is sequentially input into the batch normalization layer, the second Dropout layer, and the fourth fully connected layer to obtain the third processed feature;
[0121] The third processing feature is fused with the second processing feature to obtain a second fused feature;
[0122] The second fusion feature is input into the second normalization layer and the output layer in sequence to obtain the start and end time of the abnormal behavior.
[0123] Preferably, the third activation layer of this embodiment adopts a ReLU activation function.
[0124] The training module is used to train the abnormal behavior detection model based on the training data set and the total loss function to obtain a trained abnormal behavior detection model.
[0125] Preferably, in order to optimize the classification and regression tasks simultaneously, this embodiment adopts a multi-task loss function as the total loss function L Z :
[0126] L Z =αL CE +βL MSE
[0127]
[0128]
[0129] Among them, α and β represent classification hyperparameters and regression hyperparameters, respectively, which are used to adjust the importance of the two types of tasks. CE represents the classification loss function, N represents the number of samples, y i represents the annotation (label) of sample i, represents the probability distribution of sample i output by the model, L MSE represents the regression loss function, t i represents the actual abnormal behavior duration of sample i, represents the duration of sample i predicted by the model.
[0130] Preferably, the optimizer adopts the Adam optimizer, and the initial learning rate is set to 0.001.
[0131] The detection module is used to obtain the video data to be detected and pre-process it before inputting it into the trained abnormal behavior detection model to obtain the abnormal detection results and the start and end time of the abnormal behavior:
[0132] Preferably, after obtaining the video data to be detected, preprocessing is performed, the video data to be detected is divided into a plurality of frame images to be detected, and the images are input into a trained abnormal behavior detection model for detection.
[0133] The result output module is used to obtain the final detection result based on the anomaly detection result and the start and end time of the abnormal behavior:
[0134] Preferably, the result output module includes: a judgment unit and an information generation unit;
[0135] Judgment unit, such as Figure 6 As shown, it is used to obtain the duration of abnormal behavior based on the start and end time of abnormal behavior, and determine whether there is abnormal behavior in the abnormal detection result. If not, no information is generated. If so, it is determined whether the duration of abnormal behavior is greater than a set value; if so, severe abnormal information is generated; if not, general abnormal information is generated;
[0136] The information generating unit is used to generate a final detection result based on the serious abnormality information or the general abnormality information.
[0137] The early warning module is used to provide corresponding early warning prompts based on the final detection results.
[0138] Preferably, the early warning module includes: a receiving and analyzing unit, an on-site early warning unit and a remote early warning unit;
[0139] A receiving and analyzing unit, used to receive and analyze the final detection result, generate first warning information based on the serious abnormality information and send it to the on-site warning unit and the remote warning unit respectively; generate second warning information based on the general abnormality information and send it to the on-site warning unit;
[0140] An on-site early warning unit, used to receive the first early warning information or the second early warning information, and to monitor the on-site sound and light alarm prompts;
[0141] The remote warning unit is used to receive the first warning information and generate serious warning information, and send the serious warning information to the mobile terminal of the designated contact.
[0142] Preferably, it also includes a data storage and analysis module;
[0143] The data storage and analysis module is used to store all the collected video data to be detected, the corresponding final detection results and early warning prompt information, and to perform statistical analysis based on the video data to be detected and the corresponding final detection results to generate an analysis report.
[0144] Example 3
[0145] like Figure 7 As shown, the embodiment of the present invention discloses a water conservancy anti-theft alarm method based on visual technology, comprising:
[0146] Obtain video data in water conservancy facility monitoring scenarios and perform preprocessing to obtain a training data set;
[0147] Build an abnormal behavior detection model including feature extractor, position encoding layer, encoder, classification network and regression network;
[0148] The abnormal behavior detection model is trained based on the training data set and the total loss function to obtain a trained abnormal behavior detection model;
[0149] After obtaining the pre-processed video data to be detected, it is input into the trained abnormal behavior detection model to obtain the abnormal detection results and the start and end time of the abnormal behavior;
[0150] The final detection result is obtained based on the abnormal detection result and the start and end time of the abnormal behavior;
[0151] Provide corresponding early warning prompts based on the final test results.
[0152] Preferably, obtaining a training data set specifically includes:
[0153] Obtain video data including normal and abnormal behaviors in water conservancy facility monitoring scenarios;
[0154] The video data is divided into a plurality of continuous frame images, and all the frame images are converted into a set size to obtain a frame image data set;
[0155] Performing an image enhancement operation based on the frame image data set to obtain an enhanced image data set;
[0156] Based on the enhanced image dataset, the abnormal behavior type and the beginning and end time of the abnormal behavior are annotated, and the annotated dataset is obtained as the training dataset.
[0157] Preferably, the abnormal behavior detection model data processing process is:
[0158] The training data set is input into the feature extractor for feature extraction to obtain the feature vector of each frame image;
[0159] The feature vector is input to the position encoding layer to generate the position encoding and obtain the encoded feature vector;
[0160] The encoded feature vector is input into the encoder to obtain the encoded sequence features;
[0161] The encoded sequence features are input into the classification network and regression network respectively, and the anomaly detection results and the start and end time of the abnormal behavior are obtained accordingly.
[0162] Preferably, the classification network includes: a first fully connected layer, a first activation layer, a multi-scale convolutional layer, a pooling layer, a first Dropout layer, a second fully connected layer, a second activation layer and a global pooling layer;
[0163] The encoded sequence features are sequentially input into the first fully connected layer and the first activation layer to obtain the first extracted features;
[0164] First, the extracted features are input into the multi-scale convolution layer to obtain multi-scale fusion features;
[0165] The multi-scale fusion features are sequentially input into the pooling layer, the first Dropout layer, the second fully connected layer, the second activation layer and the global pooling layer to obtain the anomaly detection results.
[0166] Preferably, the regression network includes: a second self-attention mechanism layer, a first normalization layer, a third fully connected layer, a third activation layer, a batch normalization layer, a second Dropout layer, a fourth fully connected layer, a second normalization layer and an output layer;
[0167] The encoded sequence features are input into the second self-attention mechanism layer to obtain the first processed features;
[0168] The first intermediate feature is fused with the coding sequence feature to obtain a first fused feature;
[0169] The first fusion feature is sequentially input to the first normalization layer, the third fully connected layer and the third activation layer to obtain the second processed feature;
[0170] The second intermediate feature is sequentially input into the batch normalization layer, the second Dropout layer, and the fourth fully connected layer to obtain the third processed feature;
[0171] The third processing feature is fused with the second processing feature to obtain a second fused feature;
[0172] The second fusion feature is input into the second normalization layer and the output layer in sequence to obtain the start and end time of the abnormal behavior.
[0173] Preferably, obtaining the final test result specifically includes:
[0174] Obtain the duration of abnormal behavior based on the start and end time of the abnormal behavior;
[0175] Determine whether there is abnormal behavior in the anomaly detection results;
[0176] If it does not exist, no information is generated;
[0177] If it exists, determine whether the duration of abnormal behavior is greater than the set value;
[0178] If yes, a serious exception message is generated; if no, a general exception message is generated;
[0179] Generate final detection results based on severe abnormal information or general abnormal information.
[0180] Example 4
[0181] Based on the same inventive concept, the present invention also provides a computer device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0182] Memory, used to store computer programs;
[0183] The processor, when used to execute the program stored in the memory, can implement a water conservancy anti-theft alarm method based on visual technology as in Example 3.
[0184] The electronic device may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute a water conservancy anti-theft alarm method based on visual technology in Example 3.
[0185] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0186] It can be seen from the above technical solutions that the present invention discloses a water conservancy anti-theft alarm system based on visual technology, which has the following beneficial effects:
[0187] 1. The present invention utilizes the feature extractor (such as pre-trained ResNet50) in deep learning technology as well as the position encoding layer, encoder, classification network and regression network. The system can automatically identify complex abnormal patterns and continuously improve the accuracy as more data accumulates, reducing the false alarm rate while also enhancing the sensitivity to abnormal events.
[0188] 2. When an abnormal situation is detected, the system can not only give a warning message quickly, but also provide detailed start and end time of the abnormal behavior. By recording the start and end time and type of abnormal behavior, it can not only be used for immediate response, but also can be used as a valuable data asset for subsequent analysis. By studying these historical data, potential safety hazard patterns can be discovered, and then the monitoring strategy can be adjusted or the safety protection measures in specific areas can be strengthened.
[0189] 3. By setting a reasonable abnormal behavior duration threshold, the system can filter out short-term and harmless behavior changes (such as animals passing by, etc.) to a certain extent, thereby reducing the false alarm rate. At the same time, for those situations that do pose a threat but do not reach a serious level, appropriate attention can be given to avoid the omission of important information.
[0190] 4. By accurately calculating the duration of abnormal behavior and distinguishing between general and serious anomalies based on preset time thresholds, the system can more accurately assess the urgency of the incident. This hierarchical processing mechanism helps ensure that resources are prioritized to the situations that need the most attention, thereby improving response efficiency.
[0191] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0192] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A water conservancy anti-theft alarm system based on visual technology, characterized in that: include: Data collection and processing module, model building module, training module, detection module, result output module and early warning module; The data acquisition and processing module is used to obtain video data in the water conservancy facility monitoring scene and perform preprocessing to obtain a training data set; The model building module is used to build an abnormal behavior detection model including a feature extractor, a position encoding layer, an encoder, a classification network and a regression network; The training module is used to train the abnormal behavior detection model based on the training data set and the total loss function to obtain a trained abnormal behavior detection model; The detection module is used to obtain the video data to be detected and pre-process it before inputting it into the trained abnormal behavior detection model to obtain the abnormal detection result and the start and end time of the abnormal behavior; The result output module is used to obtain a final detection result based on the abnormality detection result and the start and end time of the abnormal behavior; The early warning module is used to make corresponding early warning prompts based on the final detection result.
2. According to the vision technology-based water conservancy anti-theft alarm system of claim 1, it is characterized in that: The data acquisition and processing module includes: a data acquisition unit, a frame processing unit, a data enhancement unit and a data annotation unit; The data acquisition unit is used to obtain video data including normal behavior and abnormal behavior in the water conservancy facility monitoring scene; The frame processing unit is used to divide the video data into a plurality of continuous frame images, and convert all the frame images into a set size to obtain a frame image data set; The data enhancement unit is used to perform an image enhancement operation based on the frame image data set to obtain an enhanced image data set; The data annotation unit is used to annotate the abnormal behavior type and the start and end time of the abnormal behavior based on the enhanced image data set, and obtain the annotated data set as the training data set.
3. According to claim 2, a water conservancy anti-theft alarm system based on visual technology is characterized in that: The feature extractor uses the pre-trained ResNet50 as the basic network, removes the last fully connected layer, and is used to perform feature extraction based on the training data set to obtain a feature vector for each frame image.
4. According to claim 3, a water conservancy anti-theft alarm system based on visual technology is characterized in that: The position encoding layer is used to generate a position encoding based on the feature vector to obtain a coded feature vector; The position code is generated in the following way: For even dimensions: For odd dimensions: Among them, P(A,2i) represents the position encoding value of dimension 2i at position index A, A represents the position index of the frame image, i represents the dimension index, and d represents the dimension of the feature vector.
5. The water conservancy anti-theft alarm system based on visual technology according to claim 4 is characterized in that: The encoder comprises: a first encoding layer, a second encoding layer and a third encoding layer connected in sequence; The encoder is used to receive the encoding feature vector and input it into the first encoding layer to obtain a first encoding feature; The first coding feature is input into the second coding layer to obtain a second coding feature; The second coding feature is input into the third coding layer to obtain a coding sequence feature.
6. The water conservancy anti-theft alarm system based on visual technology according to claim 5 is characterized in that: The first coding layer, the second coding layer and the third coding layer have the same structure, and all include: a first self-attention mechanism layer, a first layer normalization unit, a feedforward neural network and a second layer normalization unit; The data processing processes of the first coding layer, the second coding layer and the third coding layer are the same, which are: Input the input feature to the first self-attention mechanism layer to obtain the first intermediate feature; The input feature is fused with the first intermediate feature and input into the first layer normalization unit to obtain a second intermediate feature; The second intermediate feature is input into the feedforward neural network to obtain a third intermediate feature; The third intermediate feature is fused with the second intermediate feature and input into the second layer normalization unit to obtain an output feature.
7. The water conservancy anti-theft alarm system based on visual technology according to claim 5 is characterized in that: The classification network includes: a first fully connected layer, a first activation layer, a multi-scale convolutional layer, a pooling layer, a first Dropout layer, a second fully connected layer, a second activation layer and a global pooling layer; The classification network is used to receive the coding sequence features and input them into the first fully connected layer and the first activation layer in sequence to obtain first extracted features; The first extracted features are input into the multi-scale convolutional layer to obtain multi-scale fusion features; The multi-scale fusion features are sequentially input into the pooling layer, the first Dropout layer, the second fully connected layer, the second activation layer and the global pooling layer to obtain the anomaly detection result.
8. The water conservancy anti-theft alarm system based on visual technology according to claim 5 is characterized in that: The regression network includes: a second self-attention mechanism layer, a first normalization layer, a third fully connected layer, a third activation layer, a batch normalization layer, a second Dropout layer, a fourth fully connected layer, a second normalization layer and an output layer; The regression network is used to receive the encoding sequence feature and input it into the second self-attention mechanism layer to obtain a first processing feature; The first intermediate feature is fused with the coding sequence feature to obtain a first fused feature; The first fusion feature is sequentially input to the first normalization layer, the third fully connected layer and the third activation layer to obtain a second processed feature; The second intermediate feature is sequentially input into the batch normalization layer, the second Dropout layer and the fourth fully connected layer to obtain a third processed feature; The third processing feature is fused with the second processing feature to obtain a second fused feature; The second fusion feature is sequentially input into the second normalization layer and the output layer to obtain the start and end time of the abnormal behavior.
9. The water conservancy anti-theft alarm system based on visual technology according to claim 1 is characterized in that: The result output module includes: a judgment unit and an information generation unit; The judging unit is used to obtain the duration of the abnormal behavior based on the start and end time of the abnormal behavior, and judge whether there is abnormal behavior in the abnormal detection result. If not, no information is generated. If so, whether the duration of the abnormal behavior is greater than a set value is judged; if so, serious abnormality information is generated; if not, general abnormality information is generated; The information generating unit is used to generate the final detection result based on the serious abnormality information or the general abnormality information.
10. The water conservancy anti-theft alarm system based on visual technology according to claim 1 is characterized in that: Also includes a data storage analysis module; The data storage and analysis module is used to store all the collected video data to be detected, the corresponding final detection results and the early warning prompt information, and perform statistical analysis based on the video data to be detected and the corresponding final detection results to generate an analysis report.