Abnormal event detection method and device based on monitoring video, equipment, storage medium and product

By performing aggregation processing and feature fusion on the current and previous two frames of images in the surveillance video, and calculating similarity information to determine the detection score, the problem of inaccurate abnormal event detection in surveillance videos is solved and real-time and accurate abnormal event detection is achieved. , improving the monitoring efficiency of surveillance videos.

CN118628973APending Publication Date: 2024-09-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410562352.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The detection of abnormal events in surveillance videos in the existing technology is inaccurate and not timely, and it is impossible to effectively detect whether abnormal events occur in the image.

Method used

By obtaining the current image frame and the previous two consecutive frames in the surveillance video, input it into the preset abnormal event detection model for aggregation processing and feature fusion, calculate the similarity information to determine the detection score, and generate an abnormality if the score exceeds the threshold Prompt information.

Benefits of technology

It achieves real-time detection of abnormal conditions, improves the timeliness and detection accuracy of security prevention, avoids omissions in manual detection, digs out the changes in timing characteristics between abnormal events and normal events, and improves the monitoring efficiency of surveillance videos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628973A
    Figure CN118628973A
Patent Text Reader

Abstract

The invention provides an abnormal event detection method based on a monitoring video, and relates to the field of image processing. The method comprises the following steps: acquiring three continuous video frames of a monitoring video; inputting the first two frames into a preset abnormal event detection model to obtain two predicted video frames; respectively carrying out aggregation processing on the first two frames and the two predicted video frames to obtain a first aggregation feature and a second aggregation feature; calculating the similarity between the two aggregation features to obtain similarity information corresponding to a third frame in the three continuous video frames; determining a detection score corresponding to the third frame according to the similarity information; and if the detection score of the third frame is greater than or equal to the preset threshold, determining that an abnormal event occurs in the third frame, and generating and sending out abnormal prompt information. According to the method and the device, similarity comparison of the image frames can be performed based on the time sequence, so that difference of time sequence characteristic changes between the abnormal event and the normal event is mined, missing detection and false detection of a single abnormal event are avoided, and the monitoring efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method, device, equipment, storage medium and product for detecting abnormal events based on surveillance video. Background Art

[0002] Monitoring equipment can be set up in the bank, and then images can be collected and processed based on the monitoring equipment to determine whether an abnormal event has occurred, such as the appearance of a suspicious person.

[0003] In the prior art, each frame of an image can be detected to determine whether there is an abnormal event in the image.

[0004] However, in the above method, a separate detection is performed on the image, which may lead to inaccurate detection and fail to effectively detect whether an abnormal event occurs in the image. Summary of the invention

[0005] The present application provides a monitoring video-based abnormal event detection, device, equipment, storage medium and product to solve the technical problem of inaccurate and untimely abnormal event detection in monitoring.

[0006] In a first aspect, the present application provides a method for detecting abnormal events based on surveillance videos, comprising:

[0007] Acquire an initial current image frame in the surveillance video, and acquire consecutive initial first image frames and initial second image frames located before the current image frame; wherein the initial second image frame is located after the initial first image frame;

[0008] Inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame;

[0009] Aggregating the initial second image frame and the initial current image frame to obtain a first aggregate feature; and aggregating the predicted second image frame and the predicted current image frame to obtain a second aggregate feature;

[0010] Calculating the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame;

[0011] Determine a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame; wherein the detection score represents the probability of an abnormal event occurring in the initial current image frame;

[0012] If it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt information is generated and issued; wherein the abnormal prompt information indicates that an abnormal event has occurred in the initial current image frame.

[0013] In a possible implementation, the initial first image frame and the initial second image frame are input into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame, including:

[0014] Inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features;

[0015] Performing feature fusion on the multiple superimposed features to obtain image feature information;

[0016] Based on the preset abnormal event detection model, a regression operation is performed on the image feature information to obtain the predicted second image frame and the predicted current image frame.

[0017] In a possible implementation, the initial first image frame and the initial second image frame are input into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features, including:

[0018] Repeat the following steps until the first preset condition is reached:

[0019] Input the initial first image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial first image frame; input the initial second image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1;

[0020] Performing feature superposition processing on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain an i-th superimposed feature;

[0021] The initial first image frame is updated to the i-th feature map corresponding to the initial first image frame, and the initial second image frame is updated to the i-th feature map corresponding to the initial second image frame; and the value of i is determined to be i+1.

[0022] In a possible implementation manner, the similarity information corresponding to the initial current image frame is

[0023]

[0024] Among them, f ts is the first aggregation feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

[0025] In a possible implementation, determining a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame includes:

[0026] Obtaining a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio;

[0027] A detection score corresponding to the initial current image frame is determined according to the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and similarity information corresponding to the initial current image frame.

[0028] In a possible implementation manner, obtaining a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio includes:

[0029] Determine similarity information corresponding to each image frame in a plurality of image frames located before the initial current image frame;

[0030] Determine the maximum similarity information among the numerical values ​​represented by the similarity information corresponding to each image frame in the multiple image frames as the preset maximum peak signal-to-noise ratio; and determine the maximum similarity information among the numerical values ​​represented by the similarity information corresponding to each image frame in the multiple image frames as the preset minimum peak signal-to-noise ratio.

[0031] In a possible implementation, the detection score corresponding to the initial current image frame is

[0032]

[0033] Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

[0034] In a possible implementation, the method further includes:

[0035] Acquire multiple image frames, and extract key frames from the multiple image frames to obtain multiple image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames;

[0036] Based on the image units to be trained, the initial model is trained to obtain the preset abnormal event detection model.

[0037] In a possible implementation, training an initial model based on the image unit to be trained to obtain the preset abnormal event detection model includes:

[0038] Repeat the following steps until the second preset condition is reached:

[0039] Inputting the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame;

[0040] Aggregating the initial second key frame and the initial third key frame to obtain first feature information; and aggregating the predicted second key frame and the predicted third key frame to obtain second feature information;

[0041] Calculating the similarity between the first feature information and the second feature information to obtain similarity information corresponding to the initial third key frame;

[0042] If it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than a second preset threshold, the parameters in the initial model are updated based on a gradient descent algorithm.

[0043] In a possible implementation, the initial first key frame and the initial second key frame are input into an initial model to obtain a predicted second key frame and a predicted third key frame, including:

[0044] Inputting the initial first key frame and the initial second key frame into a preset abnormal event detection model for superposition processing to obtain a plurality of processing features;

[0045] Performing feature fusion on the multiple processing features to obtain processing feature information;

[0046] A regression operation is performed on the processed feature information based on the preset abnormal event detection model to obtain the predicted second key frame and the predicted third key frame.

[0047] In a possible implementation, the initial first key frame and the initial second key frame are input into a preset abnormal event detection model for superposition processing to obtain multiple processing features, including:

[0048] Repeat the following steps until the third preset condition is reached:

[0049] Input the initial first key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial first key frame; input the initial second key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1;

[0050] Performing feature superposition processing on the j-th feature map corresponding to the initial first key frame and the j-th feature map corresponding to the initial second key frame to obtain a j-th processed feature;

[0051] The initial first key frame is updated to the j-th feature map corresponding to the initial first key frame, and the initial second key frame is updated to the j-th feature map corresponding to the initial second key frame; and the value of j is determined to be j+1.

[0052] In a second aspect, the present application provides an abnormal event detection device based on surveillance video, comprising:

[0053] A first acquisition unit is used to acquire an initial current image frame in the surveillance video, and acquire a continuous initial first image frame and an initial second image frame located before the current image frame; wherein the initial second image frame is located after the initial first image frame;

[0054] A first processing unit, configured to input the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame;

[0055] A second processing unit, configured to perform aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature;

[0056] A third processing unit, configured to perform aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregated feature;

[0057] a calculating unit, configured to calculate a similarity between the first aggregate feature and the second aggregate feature, and obtain similarity information corresponding to the initial current image frame;

[0058] A first determination unit, configured to determine a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame; wherein the detection score represents a probability of an abnormal event occurring in the initial current image frame;

[0059] a second determining unit, configured to determine that an abnormal event occurs in the initial current image frame if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold;

[0060] The fourth processing unit is used to generate and issue abnormal prompt information; wherein the abnormal prompt information represents that an abnormal event occurs in the initial current image frame.

[0061] In a possible implementation manner, the first processing unit includes:

[0062] A first processing module, used for inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features;

[0063] A fusion module, used for fusing the multiple superimposed features to obtain image feature information;

[0064] The second processing module is used to perform regression operation processing on the image feature information based on the preset abnormal event detection model to obtain the predicted second image frame and the predicted current image frame.

[0065] In a possible implementation, the first processing module includes:

[0066] Repeat the following submodules until the first preset condition is met:

[0067] A first processing submodule, used for inputting the initial first image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial first image frame;

[0068] A second processing submodule, used for inputting the initial second image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1;

[0069] A third processing submodule is used to perform feature superposition processing on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain an i-th superimposed feature;

[0070] A first updating submodule, used for updating the initial first image frame to an i-th feature map corresponding to the initial first image frame;

[0071] A second updating submodule, used for updating the initial second image frame to an i-th feature map corresponding to the initial second image frame;

[0072] The first determining submodule is used to determine that the value of i is i+1.

[0073] In a possible implementation manner, the similarity information corresponding to the initial current image frame is

[0074]

[0075] Among them, f ts is the first aggregation feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

[0076] In a possible implementation manner, the first determining unit includes:

[0077] A first acquisition module, used to acquire a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio;

[0078] The first determination module is used to determine the detection score corresponding to the initial current image frame according to the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and the similarity information corresponding to the initial current image frame.

[0079] In a possible implementation, the first acquisition module includes:

[0080] A second determination submodule, used to determine similarity information corresponding to each image frame in a plurality of image frames before the initial current image frame;

[0081] A third determination submodule is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is the preset maximum peak signal-to-noise ratio;

[0082] The fourth determination submodule is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is the preset minimum peak signal-to-noise ratio.

[0083] In a possible implementation, the detection score corresponding to the initial current image frame is

[0084]

[0085] Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

[0086] In a possible implementation, the device further includes:

[0087] A second acquisition unit, used for acquiring multiple image frames;

[0088] a fifth processing unit, configured to extract key frames from the plurality of image frames to obtain a plurality of image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames;

[0089] A training unit is used to train the initial model based on the image unit to be trained to obtain the preset abnormal event detection model.

[0090] In a possible implementation, the training unit includes:

[0091] Repeat the following steps until the second preset condition is met:

[0092] A third processing module, used for inputting the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame;

[0093] A fourth processing module, configured to perform aggregation processing on the initial second key frame and the initial third key frame to obtain first feature information;

[0094] a fifth processing module, configured to perform aggregation processing on the predicted second key frame and the predicted third key frame to obtain second feature information;

[0095] A calculation module, used for calculating the similarity between the first feature information and the second feature information, and obtaining similarity information corresponding to the initial third key frame;

[0096] The sixth processing module is used to update the parameters in the initial model based on the gradient descent algorithm if it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than the second preset threshold.

[0097] In a possible implementation, the third processing module includes:

[0098] A fourth processing submodule, used for inputting the initial first key frame and the initial second key frame into a preset abnormal event detection model for superposition processing to obtain a plurality of processing features;

[0099] A fifth processing submodule, configured to perform feature fusion on the plurality of processing features to obtain processing feature information;

[0100] The sixth processing submodule is used to perform a regression operation on the processing feature information based on the preset abnormal event detection model to obtain the predicted second key frame and the predicted third key frame.

[0101] In a possible implementation manner, the fourth processing submodule is specifically configured to:

[0102] Repeat the following steps until the third preset condition is reached:

[0103] Input the initial first key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial first key frame; input the initial second key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1;

[0104] Performing feature superposition processing on the j-th feature map corresponding to the initial first key frame and the j-th feature map corresponding to the initial second key frame to obtain a j-th processed feature;

[0105] The initial first key frame is updated to the j-th feature map corresponding to the initial first key frame, and the initial second key frame is updated to the j-th feature map corresponding to the initial second key frame; and the value of j is determined to be j+1.

[0106] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0107] The memory stores computer-executable instructions;

[0108] The processor executes the computer-executable instructions stored in the memory to implement the above first aspect and / or various possible implementations of the first aspect.

[0109] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0110] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0111] The present application provides a method for detecting abnormal events based on surveillance videos, which includes obtaining an initial current image frame in a surveillance video and a continuous initial first image frame and an initial second image frame before the current image frame; inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame; performing aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature; and performing aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregation feature; calculating the similarity between the first aggregation feature and the second aggregation feature to obtain similarity information corresponding to the initial current image frame; determining a detection score corresponding to the initial current image frame based on the similarity information corresponding to the initial current image frame; if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event occurs in the initial current image frame, and an abnormal prompt message is generated and issued. It is possible to infer the next video frame that will occur under normal conditions based on the current video frame that occurs in real time, so as to compare it with the actual video frame and detect abnormal situations in real time, thereby improving the timeliness of safety prevention. At the same time, frame-by-frame similarity comparison also greatly improves the accuracy of prediction and avoids omissions caused by manual detection. Moreover, since this embodiment compares the similarity of image frames based on time series, it is possible to discover the differences in the changes in the timing characteristics between abnormal events and normal events, thereby avoiding missed detection and false detection of single abnormal events and improving the monitoring efficiency of surveillance videos. BRIEF DESCRIPTION OF THE DRAWINGS

[0112] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0113] Figure 1 A flowchart of a method for detecting abnormal events based on surveillance video provided in an embodiment of the present application;

[0114] Figure 2 A flowchart of another abnormal event detection method based on surveillance video provided in an embodiment of the present application;

[0115] Figure 3 A flowchart of another abnormal event detection method based on surveillance video provided in an embodiment of the present application;

[0116] Figure 4 A flowchart of another abnormal event detection method based on surveillance video provided in an embodiment of the present application;

[0117] Figure 5 A schematic diagram of the structure of an abnormal event detection device based on surveillance video provided in an embodiment of the present application;

[0118] Figure 6 A schematic diagram of the structure of another abnormal event detection device based on surveillance video provided in an embodiment of the present application;

[0119] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0120] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0121] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0123] In addition, this application involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and the use of artificial intelligence technology for automated decision-making, and a technical solution for making decisions that have a significant impact on personal rights and interests based on the results of automated decision-making. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decision-making; if the user chooses to reject, the expert decision-making process will be entered.

[0124] It should be noted that the method and device for detecting abnormal events based on surveillance videos of the present application can be used in the field of image processing, and can also be used in any field other than the field of image processing. The application field of the method and device for detecting abnormal events based on surveillance videos of the present application is not limited.

[0125] With the development of globalization, many banks have opened branches in other countries with different cultural backgrounds. When conducting business in different countries, bank branches will also adjust their business according to local conditions. This makes the compliance risks from the external environment and internal operations increasingly prominent. Effective management and early warning of these risks have become issues that bank branches cannot ignore.

[0126] As an important part of bank security, surveillance video needs to deal with more complex security issues. However, the current security prevention methods based on surveillance video are mostly manual monitoring or post-event review. This is not only inefficient, but also overly dependent on manual labor and cannot meet the real-time requirements of security incident detection.

[0127] The data transmission method provided in this application is intended to solve the above technical problems in the prior art.

[0128] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0129] Figure 1 The following is a flow chart of a method for detecting abnormal events based on surveillance video provided in this application. Figure 1 As shown, the method includes:

[0130] S101, obtaining an initial current image frame in a surveillance video, and obtaining consecutive initial first image frames and initial second image frames located before the current image frame; wherein the initial second image frame is located after the initial first image frame.

[0131] Exemplarily, the execution subject of the embodiment of the present application is a server, or an electronic device, or a terminal device, or other devices or equipment that can implement the embodiment of the present application. The embodiment of the present application is introduced with the execution subject being a server.

[0132] The server can obtain the real-time video stream in the surveillance video. The video stream is stored in a corresponding frame image sequence in chronological order. The frame image sequence contains a collection of frames stored in time. According to the current moment, the current image frame and the first two frames of the current image frame, i.e., the initial first image frame and the initial second image frame, are obtained from the frame image sequence. The first image frame, the second image frame, and the current time frame are arranged in chronological order.

[0133] S102: Input the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame.

[0134] Exemplarily, the abnormal event detection model monitors abnormal events in surveillance videos. For example, the association between the business process actions and time series of bank staff under normal circumstances can be obtained, and the actions that will occur in the next normal operation can be predicted based on the staff's previous actions. If the bank staff's business actions do not conform to the predicted normal actions, there may be compliance risks. Alternatively, the association between the actions and time series of customers who come to the bank to handle business can be obtained, and the actions that will occur in the next normal operation can be predicted based on the customer's previous actions. If the customer's actions do not conform to the predicted actions, there may be security risks, which can be identified before dangerous events occur.

[0135] The initial first image frame and the initial second image frame are sequentially input into the abnormal event detection model in chronological order, and the abnormal event detection model makes predictions based on the initial first image frame and the initial second image frame, and then outputs the second image frame predicted by the abnormal event detection model based on the initial first image frame and the initial second image frame and the predicted current image frame. The server obtains the predicted second image frame and the predicted current image frame.

[0136] S103, performing aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature; and performing aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregation feature.

[0137] Exemplarily, the aggregation processing of the initial second image frame and the initial current image frame is to calculate the mean square error (MSE) of the two, and the first aggregation feature is the mean square error of the initial second image frame and the initial current image frame. Similarly, the mean square error of the predicted second image frame and the predicted current image frame is calculated to obtain the second aggregation feature of the two, that is, the mean square error (MSE) of the predicted second image frame and the predicted current image frame.

[0138] S104: Calculate the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame.

[0139] Exemplarily, the abnormal event detection model is trained based on the video stream of normal events, so the predicted image frames output by the successfully trained abnormal event detection model represent the image frames of normal events. Therefore, the detection of abnormal events is determined based on the similarity between the image frames of normal events and the image frames of real events. The higher the similarity, the more normal the current image frame is, and the current business scene is in a normal state. The lower the similarity, the more abnormal the current image frame is, and there are problems with the current business scene.

[0140] The similarity error in the embodiment of the present application adopts the peak signal-to-noise ratio (PSNR) measurement. The higher the peak signal-to-noise ratio value calculated between the first aggregated feature and the second aggregated feature, the higher the similarity between the two.

[0141] S105 . Determine a detection score corresponding to the initial current image frame based on similarity information corresponding to the initial current image frame; wherein the detection score represents a probability of an abnormal event occurring in the initial current image frame.

[0142] Exemplarily, the detection score corresponding to the current image frame is calculated by the similarity information corresponding to the current image frame, the preset maximum peak signal-to-noise ratio value, and the preset minimum peak signal-to-noise ratio value. The maximum peak signal-to-noise ratio value and the minimum peak signal-to-noise ratio value are set by the user according to actual needs. After the similarity information corresponding to the current image frame is obtained in step S104, the corresponding detection score is calculated.

[0143] After the detection score is generated, the detection score within the monitoring video time interval is sent to the server in real time, so that the server generates a real-time risk trend change curve chart with the collected detection score values ​​and sends it to the display. The display receives the real-time risk trend change curve chart and displays it.

[0144] S106. If it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt information is generated and issued; wherein the abnormal prompt information indicates that an abnormal event has occurred in the initial current image frame.

[0145] Exemplarily, the server obtains the detection score corresponding to the current image frame. If the detection score is greater than or equal to a first preset threshold, it indicates that an abnormal event has occurred in the initial current image frame, and an abnormal prompt message is generated and sent to the user to alert the user of the abnormal event.

[0146] In this embodiment, an initial current image frame in a surveillance video and a continuous initial first image frame and an initial second image frame before the current image frame are obtained; the initial first image frame and the initial second image frame are input into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame; the initial second image frame and the initial current image frame are aggregated to obtain a first aggregate feature; and the predicted second image frame and the predicted current image frame are aggregated to obtain a second aggregate feature; the similarity between the first aggregate feature and the second aggregate feature is calculated to obtain similarity information corresponding to the initial current image frame; based on the similarity information corresponding to the initial current image frame, a detection score corresponding to the initial current image frame is determined; if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt message is generated and issued. This enables the present embodiment to infer the video frame that will occur next under normal conditions based on the current video frame that occurs in real time, thereby comparing it with the actual video frame and detecting abnormal situations in real time, thereby improving the timeliness of safety prevention. At the same time, frame-by-frame similarity comparison also greatly improves the accuracy of prediction and avoids omissions caused by manual detection. Moreover, since the present embodiment compares the similarity of image frames based on time series, it is able to discover the differences in the changes in the timing characteristics between abnormal events and normal events, thereby avoiding missed detection and false detection of a single abnormal event and improving the monitoring efficiency of surveillance videos.

[0147] Figure 2 A flowchart of another abnormal event detection method based on surveillance video provided in this application is as follows: Figure 2 As shown, the method includes:

[0148] S201, obtaining an initial current image frame in a surveillance video, and obtaining consecutive initial first image frames and initial second image frames located before the current image frame; wherein the initial second image frame is located after the initial first image frame.

[0149] Exemplarily, the execution subject of the embodiment of the present application is a server, or an electronic device, or a terminal device, or other devices or equipment that can implement the embodiment of the present application. The embodiment of the present application is introduced with the execution subject being a server.

[0150] This step can refer to the introduction of the above step S101 and will not be repeated here.

[0151] S202: Input the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features.

[0152] In one example, step S202 includes the following process:

[0153] Repeat the following steps until the first preset condition is reached:

[0154] The initial first image frame is input into the preset abnormal event detection model for feature map processing to obtain the i-th feature map corresponding to the initial first image frame; the initial second image frame is input into the preset abnormal event detection model for feature map processing to obtain the i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1.

[0155] A feature superposition process is performed on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain an i-th superimposed feature.

[0156] The initial first image frame is updated to the i-th feature map corresponding to the initial first image frame, and the initial second image frame is updated to the i-th feature map corresponding to the initial second image frame; and the value of i is determined to be i+1.

[0157] Exemplarily, the anomaly detection model includes an encoder, a temporal feature fusion module, a decoder and a tanh hyperbolic tangent function (Hyperbolic Tangent Function) network layer, the encoder and the decoder have the same and corresponding layers, and the initial first image frame is input into the preset abnormal event detection model, that is, the initial first image frame is input into the encoder, the encoder performs a convolution process on the initial first image frame and the initial second image frame to obtain a first feature map corresponding to the initial first image frame and a first feature map corresponding to the initial second image frame, and the first feature map corresponding to the initial first image frame and the first feature map corresponding to the initial second image frame are superimposed to obtain a first superimposed feature, and then, the first feature map corresponding to the initial first image frame and the first feature map corresponding to the initial second image frame are continued to be convolved for a second time to obtain the first feature map corresponding to the initial first image frame and the second feature map corresponding to the initial second image frame, and the second feature map corresponding to the initial first image frame and the second feature map corresponding to the initial second image frame are superimposed to obtain a second superimposed feature, and so on, until the preset condition is met.

[0158] In one example, the first preset condition is that four convolution processes have been performed. If it is determined that the initial first image frame and the initial second image frame have not been processed four times, the process included in step S202 continues to be executed; if it is determined that the initial first image frame and the initial second image frame have been processed four times, the process included in step S202 is no longer executed.

[0159] When the preset conditions are met, for each convolution and feature map superposition process, four superimposed features corresponding to the initial first image frame and the initial second image frame are obtained. The four superimposed features are the first superimposed feature, the second superimposed feature, the third superimposed feature, and the fourth superimposed feature according to the convolution order.

[0160] S203: Fusing multiple superimposed features to obtain image feature information.

[0161] Exemplarily, four superimposed features are obtained by four convolution processes and feature superposition processes of the encoder in the downward pooling process through step S202, the fourth superimposed feature is input into the decoder, and other superimposed features are fused in sequence in the upward pooling deconvolution process of the decoder.

[0162] In one example, because the decoder and encoder have the same number of network layers and the corresponding order is opposite, the execution steps are opposite. Therefore, during the first deconvolution process, the fourth superimposed feature and the third superimposed feature are fused to obtain the first fused feature, and during the second deconvolution process, the first fused feature and the second superimposed feature are fused to obtain the second fused feature, and so on, until all superimposed features are fused to obtain the image feature information output by the decoder.

[0163] S204: Perform regression processing on the image feature information based on a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame.

[0164] Exemplarily, the image feature information output by the decoder is input into the tanh hyperbolic tangent function (HyperbolicTangent Function) network layer, and the abnormal event detection model performs regression operation processing on the image feature information through the tanh network layer. The regression operation processing includes the tanh network layer performing data normalization processing on the image feature information, and then mapping the predicted second image frame and the predicted current image frame in the output layer.

[0165] S205 , performing aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature; and performing aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregation feature.

[0166] Exemplarily, the aggregation process of the initial second image frame and the initial current image frame is to calculate the mean square error f between the two. ts(MSE, Mean Square Error), the first aggregate feature is the mean square error between the initial second image frame and the initial current image frame. Similarly, the mean square error between the predicted second image frame and the predicted current image frame is calculated to obtain the second aggregate feature of the two, that is, the mean square error f between the predicted second image frame and the predicted current image frame. ′ ts (MSE, Mean Square Error).

[0167] S206 : Calculate the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame.

[0168] In one example, the similarity information corresponding to the initial current image frame is

[0169] Among them, f ts is the first aggregate feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

[0170] Exemplarily, the abnormal event detection model is trained based on the video stream of normal events, so the predicted image frames output by the successfully trained abnormal event detection model represent the image frames of normal events. Therefore, the detection of abnormal events is determined based on the similarity between the image frames of normal events and the image frames of real events. The higher the similarity, the more normal the current image frame is, and the current business scene is in a normal state. The lower the similarity, the more abnormal the current image frame is, and there are problems with the current business scene.

[0171] The similarity error in the embodiment of the present application is measured by the peak signal-to-noise ratio (PSNR). The higher the peak signal-to-noise ratio value calculated between the first aggregate feature and the second aggregate feature, the higher the similarity between the two features. ts and f ′ ts The corresponding peak signal-to-noise ratio, i.e., similarity information, is calculated.

[0172] S207: Obtain a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio.

[0173] In one example, step S207 includes the following process:

[0174] The similarity information corresponding to each image frame in a plurality of image frames before the initial current image frame is determined.

[0175] The maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames is determined as a preset maximum peak signal-to-noise ratio; and the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames is determined as a preset minimum peak signal-to-noise ratio.

[0176] Exemplarily, the server obtains a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio.

[0177] In one example, a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio are preset, and the preset maximum peak signal-to-noise ratio and the preset minimum peak signal-to-noise ratio can be manually set to reasonable values ​​according to the needs of technicians.

[0178] In another example, for the first image frame, since there is no image frame similarity information value before the first image frame, the initial maximum peak signal-to-noise ratio value and the minimum peak signal-to-noise ratio value can be preset, and for other image frames other than the first image frame, since each of the multiple image frames before it has similarity information after step S206, it can be determined that the maximum similarity information and the minimum similarity information in the multiple image frames before it are respectively the preset maximum peak signal-to-noise ratio and the preset minimum peak signal-to-noise ratio value, and the preset maximum peak signal-to-noise ratio value and the preset minimum peak signal-to-noise ratio value change dynamically with the change of the time series.

[0179] S208 . Determine a detection score corresponding to the initial current image frame according to a preset maximum peak signal-to-noise ratio, a preset minimum peak signal-to-noise ratio, and similarity information corresponding to the initial current image frame.

[0180] In one example, the detection score corresponding to the initial current image frame is

[0181] Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

[0182] Exemplarily, the detection score represents the score of a normal event. The closer to a normal event, the lower the detection score value, and the closer to an abnormal event, the higher the detection score value. In step S206 and step S207, the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and the similarity information corresponding to the initial current image frame are known, and the formula Calculate the detection score corresponding to the current image frame.

[0183] After the detection score is generated, the detection score within the monitoring video time interval is sent to the server in real time, so that the server generates a real-time risk trend change curve chart with the collected detection score values ​​and sends it to the display. The display receives the real-time risk trend change curve chart and displays it.

[0184] S209. If it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt information is generated and issued; wherein the abnormal prompt information indicates that an abnormal event has occurred in the initial current image frame.

[0185] Exemplarily, the server obtains the detection score corresponding to the current image frame. If the detection score is greater than or equal to a first preset threshold, it indicates that an abnormal event has occurred in the initial current image frame, and an abnormal prompt message is generated and sent to the user to alert the user of the abnormal event.

[0186] In this embodiment, an initial current image frame in a surveillance video is obtained, and a continuous initial first image frame and an initial second image frame located before the current image frame are obtained; wherein the initial second image frame is located after the initial first image frame; the initial first image frame and the initial second image frame are input into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features; feature fusion is performed on the plurality of superposition features to obtain image feature information; a regression operation is performed on the image feature information based on the preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame; the initial second image frame and the initial current image frame are aggregated to obtain a first aggregated feature; and the predicted second image frame and the initial current image frame are aggregated to obtain a first aggregated feature. The first and second image frames and the predicted current image frame are aggregated to obtain a second aggregate feature; the similarity between the first and second aggregate features is calculated to obtain similarity information corresponding to the initial current image frame; a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio are obtained; according to the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and the similarity information corresponding to the initial current image frame, a detection score corresponding to the initial current image frame is determined; if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt information is generated and issued; wherein the abnormal prompt information indicates that an abnormal event has occurred in the initial current image frame. This enables the present embodiment to infer the video frame that will occur next under normal conditions based on the current video frame that occurs in real time, thereby comparing it with the actual video frame and detecting abnormal situations in real time, thereby improving the timeliness of safety prevention. At the same time, frame-by-frame similarity comparison also greatly improves the accuracy of prediction and avoids omissions caused by manual detection. Moreover, since the present embodiment compares the similarity of image frames based on time series, it is able to discover the differences in the changes in the timing characteristics between abnormal events and normal events, thereby avoiding missed detection and false detection of a single abnormal event and improving the monitoring efficiency of surveillance videos.

[0187] Figure 3 A flowchart of another abnormal event detection method based on surveillance video provided by this application is as follows: Figure 3 As shown, the method includes:

[0188] S301, acquiring multiple image frames, and extracting key frames from the multiple image frames to obtain multiple image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames.

[0189] Exemplarily, video stream files of normal events are collected and stored in chronological order as corresponding multi-frame image frames, the multi-frame image frames include a collection of frames stored in time, a clustering algorithm is used to extract key frames from the multi-frame image frames, and the key frames are stored in chronological order as a key frame image sequence, the key frame image sequence is divided into multiple image units in chronological order with three frames as a unit, such as the first frame, the second frame, and the third frame are one image unit, the second frame, the third frame, and the fourth frame are one image unit, and so on.

[0190] S302: Based on the image unit to be trained, the initial model is trained to obtain a preset abnormal event detection model.

[0191] Exemplarily, the first two frames of each image unit are input into the abnormal event detection model in chronological order, and the two key frame images predicted for the first two frames of each unit are obtained by the model output. The aggregation results of the predicted two key frame images and the aggregation results of the last two frames of each image unit are calculated, and then the similarity between the predicted two key frame images and the last two frames of each unit is calculated based on the two aggregation results. If the similarity between the two is less than the preset similarity threshold, the model is not trained successfully and the prediction result is poor. The gradient descent algorithm is used to update the parameter weights of the model, and the above steps are repeated until the similarity value is greater than the preset similarity threshold, and the preset abnormal event detection model training is completed.

[0192] After obtaining the preset abnormal event detection model, the abnormal event detection model can be used to perform Figure 1 or Figure 2 method to detect abnormal events in real time.

[0193] In this embodiment, multiple image units to be trained are obtained by acquiring multiple image frames and extracting key frames from the multiple image frames, wherein the image units to be trained include an initial first key frame, an initial second key frame and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames; based on the image units to be trained, the initial model is trained to obtain a preset abnormal event detection model. By acquiring the video stream file of normal events and training the model during the non-customer transaction time period, the accuracy and sensitivity of the model can be effectively guaranteed, and the model can be updated in a timely manner. At the same time, extracting key frames from the normal video stream for model training also improves the efficiency of model training. Then execute Figure 1 or Figure 2 When using the method, the similarity comparison of image frames is performed based on the time series, so that the differences in the changes in the temporal characteristics between abnormal events and normal events can be discovered, avoiding the missed detection and false detection of a single abnormal event and improving the monitoring efficiency of surveillance videos.

[0194] Figure 4 A flowchart of another abnormal event detection method based on surveillance video provided in this application is shown as follows: Figure 4 As shown, the method includes:

[0195] S401, acquiring multiple image frames, and extracting key frames from the multiple image frames to obtain multiple image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames.

[0196] This step can refer to the introduction of the above step S301 and will not be repeated here.

[0197] Repeat the following steps S402-S405 until the second preset condition is reached:

[0198] S402: Input the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame.

[0199] In one example, step S402 includes the following steps:

[0200] In the first step of step S402, the initial first key frame and the initial second key frame are input into a preset abnormal event detection model for superposition processing to obtain a plurality of processing features.

[0201] The second step of step S402 is to perform feature fusion on multiple processing features to obtain processing feature information.

[0202] In the third step of step S402, a regression operation is performed on the processed feature information based on a preset abnormal event detection model to obtain a predicted second key frame and a predicted third key frame.

[0203] In one example, the first step of step S402 is implemented by the following process: repeatedly perform the following steps until the third preset condition is met: input the initial first key frame into the preset abnormal event detection model for feature map processing to obtain the jth feature map corresponding to the initial first key frame; input the initial second key frame into the preset abnormal event detection model for feature map processing to obtain the jth feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1; perform feature superposition processing on the jth feature map corresponding to the initial first key frame and the jth feature map corresponding to the initial second key frame to obtain the jth processed feature; update the initial first key frame to the jth feature map corresponding to the initial first key frame, and update the initial second key frame to the jth feature map corresponding to the initial second key frame; and determine the value of j to be j+1.

[0204] Exemplarily, for the first step of step S402, the anomaly detection model includes an encoder, a temporal feature fusion module, a decoder and a tanh hyperbolic tangent function (Hyperbolic Tangent Function) network layer, the encoder and the decoder have the same and corresponding layers, and the initial first key frame and the initial second key frame are input into the preset abnormal event detection model, that is, the initial first key frame and the initial second key frame are input into the encoder, and the encoder performs a convolution process on the initial first key frame and the initial second key frame to obtain a first feature map corresponding to the initial first key frame and a first feature map corresponding to the initial second key frame, and the first feature map corresponding to the initial first key frame and the first feature map corresponding to the initial second key frame are superimposed to obtain a first processing feature, and then, the first feature map corresponding to the initial first key frame and the first feature map corresponding to the initial second key frame are continued to be convolved for a second time to obtain the first feature map corresponding to the initial first key frame and the second feature map corresponding to the initial second key frame, and the second feature map corresponding to the initial first key frame and the second feature map corresponding to the initial second key frame are superimposed to obtain a second processing feature, and so on, until the preset condition is met.

[0205] In one example, the first preset condition is that after four convolution processes, if it is determined that the four convolution processes have not been completed on the initial first key frame and the initial second key frame, the process included in step S202 continues to be executed; if it is determined that the four convolution processes have been completed on the initial first key frame and the initial second key frame, the process included in step S202 is no longer executed.

[0206] When the preset conditions are met, for each convolution and feature map superposition process, four processing features corresponding to the initial first key frame and the initial second key frame are obtained. The four processing features are the first processing feature, the second processing feature, the third processing feature, and the fourth processing feature according to the convolution order.

[0207] For the second step of step S402, the four processing features obtained by the encoder through four convolution processes and feature superposition processes in the downward pooling process have been obtained through the previous step. The fourth processing feature is input into the decoder, and the other processing features are fused in sequence during the upward pooling deconvolution process of the decoder.

[0208] In one example, because the decoder and encoder have the same number of network layers and the corresponding order is opposite, the execution steps are opposite. Therefore, during the first deconvolution process, the fourth processing feature and the third processing feature are fused to obtain the first fused feature, and during the second deconvolution process, the first fused feature and the second processing feature are fused to obtain the second fused feature, and so on, until all processing features are fused to obtain the image feature information output by the decoder.

[0209] For the third step of step S402, exemplarily, the image feature information output by the decoder is input into the tanh hyperbolic tangent function (Hyperbolic Tangent Function) network layer, and the abnormal event detection model performs regression operation processing on the image feature information through the tanh network layer. The regression operation processing includes the tanh network layer performing data normalization processing on the image feature information, and then mapping in the output layer to obtain the predicted first key frame and the predicted second key frame.

[0210] S403, aggregate the initial second key frame and the initial third key frame to obtain first feature information; and aggregate the predicted second key frame and the predicted third key frame to obtain second feature information.

[0211] Exemplarily, the aggregation process of the initial second key frame and the initial third frame is to calculate the mean square error g of the two. ts (MSE, Mean Square Error), the first feature information is the mean square error between the initial second key frame and the initial third key frame. Similarly, the mean square error between the predicted second key frame and the predicted third key frame is calculated to obtain the second feature information of the two, that is, the mean square error g between the predicted second key frame and the predicted second key frame ′ ts (MSE, Mean Square Error).

[0212] S404: Calculate the similarity between the first feature information and the second feature information to obtain similarity information corresponding to the initial third key frame.

[0213] In one example, the similarity information corresponding to the initial first key frame is

[0214] Among them, g ts is the first characteristic information; g ′ ts is the second feature information; M is the total number of channels of the initial current image frame, N is the height of the initial current image frame, and I is the width of the initial current image frame.

[0215] Exemplarily, the abnormal event detection model is trained based on the video stream of normal events, so the predicted image frames output by the successfully trained abnormal event detection model represent the image frames of normal events. Therefore, the detection of abnormal events is determined based on the similarity between the image frames of normal events and the image frames of real events. The higher the similarity, the more normal the current image frame is, and the current business scene is in a normal state. The lower the similarity, the more abnormal the current image frame is, and there are problems with the current business scene.

[0216] The similarity error in the embodiment of the present application adopts the peak signal-to-noise ratio (PSNR) measurement. The higher the peak signal-to-noise ratio value calculated between the first feature information and the second feature information, the higher the similarity between the two. ts and g ′ ts The corresponding peak signal-to-noise ratio, i.e., similarity information, is calculated.

[0217] S405: If it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than a second preset threshold, update the parameters in the initial model based on a gradient descent algorithm.

[0218] Exemplarily, if the peak signal-to-noise ratio value calculated between the first feature information and the second feature information is less than the preset similarity threshold, the model is not trained successfully and the prediction result is poor. The gradient descent algorithm is used to update the parameter weights of the model, and the above steps are repeated until the similarity value is greater than the preset similarity threshold. The training of the preset abnormal event detection model is completed.

[0219] After obtaining the preset abnormal event detection model, the abnormal event detection model can be used to perform Figure 1 or Figure 2 method to detect abnormal events in real time.

[0220] In this embodiment, multiple image units to be trained are obtained by acquiring multiple image frames and extracting key frames from the multiple image frames, wherein the image units to be trained include an initial first key frame, an initial second key frame and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames; the initial first key frame and the initial second key frame are input into the initial model to obtain a predicted second key frame and a predicted third key frame; the initial second key frame and the initial third key frame are aggregated to obtain first feature information; and the predicted second key frame and the predicted third key frame are aggregated to obtain second feature information; the similarity between the first feature information and the second feature information is calculated to obtain similarity information corresponding to the initial third key frame; if it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than a second preset threshold, the parameters in the initial model are updated based on the gradient descent algorithm. By obtaining the video stream files of normal events and training the model during the non-customer transaction period, the accuracy and sensitivity of the model can be effectively guaranteed, and the model can be updated in a timely manner. At the same time, extracting key frames from normal video streams for model training also improves the efficiency of model training. Figure 1 or Figure 2 When using the method, the similarity comparison of image frames is performed based on the time series, so that the differences in the changes in the temporal characteristics between abnormal events and normal events can be discovered, avoiding the missed detection and false detection of a single abnormal event and improving the monitoring efficiency of surveillance videos.

[0221] Figure 5 A schematic diagram of the structure of an abnormal event detection device based on surveillance video provided in this application, such as Figure 5 As shown, in this embodiment Figure 2 Based on the embodiment, a method for detecting abnormal events based on surveillance video is described in detail. The device includes:

[0222] The first acquisition unit 501 is used to acquire the initial current image frame in the surveillance video, and acquire the continuous initial first image frame and initial second image frame located before the current image frame; wherein the initial second image frame is located after the initial first image frame.

[0223] The first processing unit 502 is used to input the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame.

[0224] The second processing unit 503 is used to perform aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature.

[0225] The third processing unit 504 is used to perform aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregation feature.

[0226] The calculation unit 505 is used to calculate the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame.

[0227] The first determination unit 506 is used to determine the detection score corresponding to the initial current image frame according to the similarity information corresponding to the initial current image frame; wherein the detection score represents the probability of an abnormal event occurring in the initial current image frame.

[0228] The second determining unit 507 is configured to determine that an abnormal event occurs in the initial current image frame if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold.

[0229] The fourth processing unit 508 is used to generate and issue abnormal prompt information; wherein the abnormal prompt information indicates that an abnormal event occurs in the initial current image frame.

[0230] The device of this embodiment can execute the method provided by any of the above embodiments, and its implementation principle and technical effects are similar, which will not be repeated here.

[0231] Figure 6 A schematic diagram of the structure of an abnormal event detection device based on surveillance video provided in this application, such as Figure 6 As shown, the device comprises:

[0232] The first acquisition unit 601 is used to acquire the initial current image frame in the surveillance video, and acquire the continuous initial first image frame and initial second image frame located before the current image frame; wherein the initial second image frame is located after the initial first image frame.

[0233] The first processing unit 602 is used to input the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame.

[0234] The second processing unit 603 is used to perform aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature.

[0235] The third processing unit 604 is used to perform aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregation feature.

[0236] The calculation unit 605 is used to calculate the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame.

[0237] A first determination unit 606 is used to determine a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame; wherein the detection score represents the probability of an abnormal event occurring in the initial current image frame;

[0238] The second determining unit 607 is configured to determine that an abnormal event occurs in the initial current image frame if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold.

[0239] The fourth processing unit 608 is used to generate and issue abnormal prompt information; wherein the abnormal prompt information indicates that an abnormal event occurs in the initial current image frame.

[0240] In one example, the first processing unit 602 includes:

[0241] The first processing module 6021 is used to input the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain multiple superposition features.

[0242] The fusion module 6022 is used to perform feature fusion on multiple superimposed features to obtain image feature information.

[0243] The second processing module 6023 is used to perform regression operation processing on the image feature information based on a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame.

[0244] In one example, the first processing module 6021 includes:

[0245] Repeat the following submodules until the first preset condition is met:

[0246] The first processing submodule 60211 is used to input the initial first image frame into a preset abnormal event detection model for feature map processing to obtain the i-th feature map corresponding to the initial first image frame.

[0247] The second processing submodule 60212 is used to input the initial second image frame into a preset abnormal event detection model for feature map processing to obtain the i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1.

[0248] The third processing submodule 60213 is used to perform feature superposition processing on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain the i-th superimposed feature.

[0249] The first updating submodule 60214 is used to update the initial first image frame to the i-th feature map corresponding to the initial first image frame.

[0250] The second updating submodule 60215 is used to update the initial second image frame to the i-th feature map corresponding to the initial second image frame.

[0251] The first determination submodule 60216 is used to determine that the value of i is i+1.

[0252] In one example, the similarity information corresponding to the initial current image frame is

[0253]

[0254] Among them, f ts is the first aggregate feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

[0255] In one example, the first determining unit 606 includes:

[0256] A first acquisition module 6061 is used to acquire a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio;

[0257] The first determination module 6062 is used to determine the detection score corresponding to the initial current image frame according to a preset maximum peak signal-to-noise ratio, a preset minimum peak signal-to-noise ratio, and similarity information corresponding to the initial current image frame.

[0258] In one example, the first acquisition module 6061 includes:

[0259] The second determining submodule 60611 is used to determine the similarity information corresponding to each image frame in a plurality of image frames before the initial current image frame.

[0260] The third determination submodule 60612 is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is a preset maximum peak signal-to-noise ratio.

[0261] The fourth determination submodule 60613 is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is a preset minimum peak signal-to-noise ratio.

[0262] In one example, the detection score corresponding to the initial current image frame is

[0263]

[0264] Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

[0265] In one example, the device further includes:

[0266] The second acquisition unit 609 is used to acquire multiple image frames.

[0267] The fifth processing unit 610 is used to extract key frames from multiple image frames to obtain multiple image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames.

[0268] The training unit 611 is used to train the initial model based on the image unit to be trained to obtain a preset abnormal event detection model.

[0269] In one example, the training unit 611 includes:

[0270] Repeat the following steps until the second preset condition is met:

[0271] The third processing module 6111 is used to input the initial first key frame and the initial second key frame into the initial model to obtain the predicted second key frame and the predicted third key frame.

[0272] The fourth processing module 6112 is used to perform aggregation processing on the initial second key frame and the initial third key frame to obtain first feature information.

[0273] The fifth processing module 6113 is used to perform aggregation processing on the predicted second key frame and the predicted third key frame to obtain second feature information.

[0274] The calculation module 6114 is used to calculate the similarity between the first feature information and the second feature information to obtain the similarity information corresponding to the initial third key frame.

[0275] The sixth processing module 6115 is used to update the parameters in the initial model based on the gradient descent algorithm if it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than the second preset threshold.

[0276] In one example, the third processing module 6111 includes:

[0277] The fourth processing submodule 61111 is used to input the initial first key frame and the initial second key frame into a preset abnormal event detection model for superposition processing to obtain multiple processing features.

[0278] The fifth processing submodule 61112 is used to perform feature fusion on multiple processing features to obtain processing feature information.

[0279] The sixth processing submodule 61113 is used to perform a regression operation on the processing feature information based on a preset abnormal event detection model to obtain a predicted second key frame and a predicted third key frame.

[0280] In one example, the fourth processing submodule 61111 is specifically configured to:

[0281] The following steps are repeated until the third preset condition is reached.

[0282] The initial first key frame is input into the preset abnormal event detection model for feature map processing to obtain the jth feature map corresponding to the initial first key frame; the initial second key frame is input into the preset abnormal event detection model for feature map processing to obtain the jth feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1.

[0283] A feature superposition process is performed on the j-th feature map corresponding to the initial first key frame and the j-th feature map corresponding to the initial second key frame to obtain a j-th processed feature.

[0284] The initial first key frame is updated to the j-th feature map corresponding to the initial first key frame, and the initial second key frame is updated to the j-th feature map corresponding to the initial second key frame; and the value of j is determined to be j+1.

[0285] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.

[0286] In a specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that at least one processor 701 executes the above method.

[0287] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0288] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0289] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0290] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0291] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0292] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0293] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0294] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0295] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0296] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0297] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0298] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or 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, etc. Various media that can store program codes.

[0299] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0300] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for detecting abnormal events based on surveillance video. It is characterized in that The method comprises: Acquire an initial current image frame in the surveillance video, and acquire consecutive initial first image frames and initial second image frames located before the current image frame; wherein the initial second image frame is located after the initial first image frame; Inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame; Aggregating the initial second image frame and the initial current image frame to obtain a first aggregate feature; and aggregating the predicted second image frame and the predicted current image frame to obtain a second aggregate feature; Calculating the similarity between the first aggregated feature and the second aggregated feature to obtain similarity information corresponding to the initial current image frame; Determine a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame; wherein the detection score represents the probability of an abnormal event occurring in the initial current image frame; If it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold, it is determined that an abnormal event has occurred in the initial current image frame, and an abnormal prompt information is generated and issued; wherein the abnormal prompt information indicates that an abnormal event has occurred in the initial current image frame.

2. The method according to claim 1, It is characterized in that Inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame, including: Inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features; Performing feature fusion on the multiple superimposed features to obtain image feature information; Based on the preset abnormal event detection model, a regression operation is performed on the image feature information to obtain the predicted second image frame and the predicted current image frame.

3. The method according to claim 2, It is characterized in that The initial first image frame and the initial second image frame are input into a preset abnormal event detection model for superposition processing to obtain multiple superposition features, including: Repeat the following steps until the first preset condition is reached: Input the initial first image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial first image frame; input the initial second image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1; Performing feature superposition processing on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain an i-th superimposed feature; The initial first image frame is updated to the i-th feature map corresponding to the initial first image frame, and the initial second image frame is updated to the i-th feature map corresponding to the initial second image frame; and the value of i is determined to be i+1.

4. The method according to claim 1, It is characterized in that The similarity information corresponding to the initial current image frame is Among them, f ts is the first aggregation feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

5. The method according to claim 1, It is characterized in that Determining a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame includes: Obtaining a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio; A detection score corresponding to the initial current image frame is determined according to the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and similarity information corresponding to the initial current image frame.

6. The method according to claim 5, It is characterized in that Get the preset maximum peak signal-to-noise ratio and the preset minimum peak signal-to-noise ratio, including: Determine similarity information corresponding to each image frame in a plurality of image frames located before the initial current image frame; Determine the maximum similarity information among the numerical values ​​represented by the similarity information corresponding to each image frame in the multiple image frames as the preset maximum peak signal-to-noise ratio; and determine the maximum similarity information among the numerical values ​​represented by the similarity information corresponding to each image frame in the multiple image frames as the preset minimum peak signal-to-noise ratio.

7. The method according to claim 5, It is characterized in that The detection score corresponding to the initial current image frame is Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: Acquire multiple image frames, and extract key frames from the multiple image frames to obtain multiple image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames; Based on the image units to be trained, the initial model is trained to obtain the preset abnormal event detection model.

9. The method according to claim 8, It is characterized in that Based on the image unit to be trained, the initial model is trained to obtain the preset abnormal event detection model, including: Repeat the following steps until the second preset condition is reached: Inputting the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame; Aggregating the initial second key frame and the initial third key frame to obtain first feature information; and aggregating the predicted second key frame and the predicted third key frame to obtain second feature information; Calculating the similarity between the first feature information and the second feature information to obtain similarity information corresponding to the initial third key frame; If it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than a second preset threshold, the parameters in the initial model are updated based on a gradient descent algorithm.

10. The method according to claim 9, It is characterized in that Inputting the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame, including: Inputting the initial first key frame and the initial second key frame into a preset abnormal event detection model for superposition processing to obtain a plurality of processing features; Performing feature fusion on the multiple processing features to obtain processing feature information; A regression operation is performed on the processed feature information based on the preset abnormal event detection model to obtain the predicted second key frame and the predicted third key frame.

11. The method according to claim 10, It is characterized in that The initial first key frame and the initial second key frame are input into a preset abnormal event detection model for superposition processing to obtain multiple processing features, including: Repeat the following steps until the third preset condition is reached: Input the initial first key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial first key frame; input the initial second key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1; Performing feature superposition processing on the j-th feature map corresponding to the initial first key frame and the j-th feature map corresponding to the initial second key frame to obtain a j-th processed feature; The initial first key frame is updated to the j-th feature map corresponding to the initial first key frame, and the initial second key frame is updated to the j-th feature map corresponding to the initial second key frame; and the value of j is determined to be j+1.

12. An abnormal event detection device based on surveillance video, It is characterized in that The device comprises: A first acquisition unit is used to acquire an initial current image frame in the surveillance video, and acquire a continuous initial first image frame and an initial second image frame located before the current image frame; wherein the initial second image frame is located after the initial first image frame; A first processing unit, configured to input the initial first image frame and the initial second image frame into a preset abnormal event detection model to obtain a predicted second image frame and a predicted current image frame; A second processing unit, configured to perform aggregation processing on the initial second image frame and the initial current image frame to obtain a first aggregation feature; A third processing unit, configured to perform aggregation processing on the predicted second image frame and the predicted current image frame to obtain a second aggregated feature; a calculating unit, configured to calculate a similarity between the first aggregate feature and the second aggregate feature, and obtain similarity information corresponding to the initial current image frame; A first determination unit, configured to determine a detection score corresponding to the initial current image frame according to similarity information corresponding to the initial current image frame; wherein the detection score represents a probability of an abnormal event occurring in the initial current image frame; a second determining unit, configured to determine that an abnormal event occurs in the initial current image frame if it is determined that the detection score corresponding to the initial current image frame is greater than or equal to a first preset threshold; The fourth processing unit is used to generate and issue abnormal prompt information; wherein the abnormal prompt information represents that an abnormal event occurs in the initial current image frame.

13. The device according to claim 12, It is characterized in that The first processing unit comprises: A first processing module, used for inputting the initial first image frame and the initial second image frame into a preset abnormal event detection model for superposition processing to obtain a plurality of superposition features; A fusion module, used for fusing the multiple superimposed features to obtain image feature information; The second processing module is used to perform regression operation processing on the image feature information based on the preset abnormal event detection model to obtain the predicted second image frame and the predicted current image frame.

14. The device according to claim 13, It is characterized in that The first processing module comprises: Repeat the following submodules until the first preset condition is met: A first processing submodule, used for inputting the initial first image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial first image frame; A second processing submodule, used for inputting the initial second image frame into a preset abnormal event detection model for feature map processing to obtain an i-th feature map corresponding to the initial second image frame; wherein i is a positive integer greater than or equal to 1; A third processing submodule is used to perform feature superposition processing on the i-th feature map corresponding to the initial first image frame and the i-th feature map corresponding to the initial second image frame to obtain an i-th superimposed feature; A first updating submodule, used for updating the initial first image frame to an i-th feature map corresponding to the initial first image frame; A second updating submodule, used for updating the initial second image frame to an i-th feature map corresponding to the initial second image frame; The first determining submodule is used to determine that the value of i is i+1.

15. The device according to claim 12, It is characterized in that The similarity information corresponding to the initial current image frame is Among them, f ts is the first aggregation feature, f ′ ts is the second aggregate feature; C is the total number of channels of the initial current image frame, H is the height of the initial current image frame, and W is the width of the initial current image frame.

16. The device according to claim 12, It is characterized in that The first determining unit includes: A first acquisition module, used to acquire a preset maximum peak signal-to-noise ratio and a preset minimum peak signal-to-noise ratio; The first determination module is used to determine the detection score corresponding to the initial current image frame according to the preset maximum peak signal-to-noise ratio, the preset minimum peak signal-to-noise ratio, and the similarity information corresponding to the initial current image frame.

17. The device according to claim 16, It is characterized in that The first acquisition module includes: A second determination submodule, used to determine similarity information corresponding to each image frame in a plurality of image frames before the initial current image frame; A third determination submodule is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is the preset maximum peak signal-to-noise ratio; The fourth determination submodule is used to determine the maximum similarity information among the values ​​represented by the similarity information corresponding to each image frame in the multiple image frames, which is the preset minimum peak signal-to-noise ratio.

18. The device according to claim 16, It is characterized in that The detection score corresponding to the initial current image frame is Among them, PSNR t is the similarity information corresponding to the initial current image frame, maxPSNR is the preset maximum peak signal-to-noise ratio, and minPSNR is the preset minimum peak signal-to-noise ratio.

19. The device according to any one of claims 12 to 18, It is characterized in that The device also includes: A second acquisition unit, used for acquiring multiple image frames; a fifth processing unit, configured to extract key frames from the plurality of image frames to obtain a plurality of image units to be trained, wherein the image units to be trained include an initial first key frame, an initial second key frame, and an initial third key frame; wherein the key frames in the image units to be trained are continuous image frames; A training unit is used to train the initial model based on the image unit to be trained to obtain the preset abnormal event detection model.

20. The device according to claim 19, It is characterized in that The training unit comprises: Repeat the following steps until the second preset condition is met: A third processing module, used for inputting the initial first key frame and the initial second key frame into the initial model to obtain a predicted second key frame and a predicted third key frame; A fourth processing module, configured to perform aggregation processing on the initial second key frame and the initial third key frame to obtain first feature information; a fifth processing module, configured to perform aggregation processing on the predicted second key frame and the predicted third key frame to obtain second feature information; A calculation module, used for calculating the similarity between the first feature information and the second feature information, and obtaining similarity information corresponding to the initial third key frame; The sixth processing module is used to update the parameters in the initial model based on the gradient descent algorithm if it is determined that the value represented by the similarity information corresponding to the initial third key frame is less than the second preset threshold.

21. The device according to claim 20, It is characterized in that The third processing module comprises: A fourth processing submodule, used for inputting the initial first key frame and the initial second key frame into a preset abnormal event detection model for superposition processing to obtain a plurality of processing features; A fifth processing submodule, configured to perform feature fusion on the plurality of processing features to obtain processing feature information; The sixth processing submodule is used to perform a regression operation on the processing feature information based on the preset abnormal event detection model to obtain the predicted second key frame and the predicted third key frame.

22. The device according to claim 21, It is characterized in that The fourth processing submodule is specifically used for: Repeat the following steps until the third preset condition is reached: Input the initial first key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial first key frame; input the initial second key frame into a preset abnormal event detection model for feature map processing to obtain a j-th feature map corresponding to the initial second key frame; wherein j is a positive integer greater than or equal to 1; Performing feature superposition processing on the j-th feature map corresponding to the initial first key frame and the j-th feature map corresponding to the initial second key frame to obtain a j-th processed feature; The initial first key frame is updated to the j-th feature map corresponding to the initial first key frame, and the initial second key frame is updated to the j-th feature map corresponding to the initial second key frame; and the value of j is determined to be j+1.

23. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-11.

24. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 11 when executed by a processor.

25. A computer program product, It is characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 11 when being executed by a processor.