A method and device for aggregating alarm events based on multi-target detection of surveillance videos
By using a combination of multi-target detection and deep cosine metric learning models in surveillance videos, the problem of difficult and time-consuming aggregation of alarm events is solved, the efficient removal of duplicate alarm events is achieved, and the management efficiency of safety production is improved.
Patent Information
- Application Number
- CN202011497409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-17
AI Technical Summary
There is little research on alarm event aggregation in the existing technology, which leads to the generation of repeated alarms, increases the time cost of managers to troubleshoot hidden dangers, and is not conducive to automation and efficient management in safe production.
Using a multi-target detection method based on surveillance videos, through the target detection model and deep cosine metric learning network model, the apparent feature vector of the target object in the video frame is extracted, and the alarm events are aggregated according to the label, system time and coordinate position. Remove duplicate alarm events through cosine similarity matching rules.
It effectively reduces the time cost of managers to troubleshoot hidden dangers, improves the real-time and reliability of alarm management, and improves safety production and operation levels.
Smart Images

Figure CN112528898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent surveillance, specifically to a method and apparatus for aggregating alarm events based on multi-target detection in surveillance video. Background Technology
[0002] With the implementation of new infrastructure projects, the industrial internet sector faces new development opportunities and challenges. The industrial intelligent alarm management platform was born out of this need. It analyzes real-time monitoring videos of workers and scenarios, such as detecting the correct wearing of safety helmets and work clothes, identifying and detecting hazards like smoke, oil leaks, and boundary intrusions. It captures and saves images of targets meeting preset conditions and issues alarms, providing voice prompts. In daily enterprise safety production, the industrial intelligent alarm platform provides standardized safety production application functions and information service support, enabling dynamic perception of safety risks, immediate alarms for accident hazards, and precise and efficient safety supervision, effectively promoting the implementation of enterprises' main responsibility for safety production.
[0003] Compared to traditional alarm management platforms, industrial intelligent alarm management platforms can reduce the number of invalid alarms, quickly provide operational guidance to managers, and significantly shorten the alarm management cycle. They analyze and aggregate alarms such as invalid and duplicate alarms to maximize the discovery of important alarms and facilitate efficient hazard identification, thereby improving the real-time performance and reliability of alarm management and effectively enhancing the level of safe production and safe operation in industrial processes.
[0004] Currently, there is relatively little research on alarm event aggregation. It mainly focuses on target detection and real-time alarm generation for target objects. This process generates a large number of identical or invalid alarms. Excessive duplicate alarms will greatly increase the time cost for managers to investigate potential hazards, which is not conducive to automation and efficient management in safe production.
[0005] Therefore, it is of great significance to establish a method and device for aggregating alarm events based on multi-target detection in surveillance videos. Summary of the Invention
[0006] To address the aforementioned problems of difficulty, high time cost, and hindering automation and efficient management in safe production caused by clustering and investigating duplicate alarm events, this application proposes a method and apparatus for alarm event aggregation based on multi-target detection in surveillance video to solve the technical problems mentioned in the background section.
[0007] In a first aspect, embodiments of this application provide a method for aggregating alarm events based on multi-target detection in surveillance video, comprising the following steps:
[0008] The target detection step involves inputting the acquired video frames into the target detection model to determine whether a target object exists in the detection results. It also determines whether the target object exists based on whether the confidence score exceeds a set threshold, and then proceeds to the metric learning step.
[0009] The metric learning step extracts the appearance feature vectors of target objects in video frames using a deep cosine metric learning network model, and combines this with the target detection step to obtain the target object's label, appearance feature vector, and coordinate position; and
[0010] The aggregation and classification step determines whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event based on the target object's label, system time, apparent feature vector, and coordinate position, using alarm event aggregation rules.
[0011] In some embodiments, the method further includes the following steps prior to the target detection step:
[0012] By using OpenCV to acquire real-time video streams from surveillance footage and capturing video frames at regular time intervals, multiple real-time video streams can be simultaneously accessed for real-time intelligent analysis in practical applications.
[0013] In some embodiments, a deep cosine metric learning network model extracts the apparent feature vectors of the target object to construct an event-aggregated feature vector queue. This event-aggregated feature vector queue can be used for feature vector similarity calculation.
[0014] In some embodiments, alarm event aggregation rules specifically include:
[0015] The system queries the built event aggregation feature vector queue by tag to see if the target object exists. If it does, it enters the time matching stage; otherwise, it directly generates an alarm event and adds the target object's tag, appearance feature vector, and system time to the event aggregation feature vector queue.
[0016] The system determines whether the difference between the system time and the target object's time in the event aggregation feature vector queue is within a valid time period. If so, it proceeds to the cosine similarity matching stage; otherwise, it directly generates an alarm event and adds the target object's label, appearance feature vector, and system time to the event aggregation feature vector queue.
[0017] The apparent feature vector of the target object is compared with the apparent feature vector of the target object within the valid time period in the event aggregation feature vector queue using cosine similarity calculation. The cosine similarity value is compared with a pre-set cosine similarity threshold to determine whether the target object meets the matching rules. If the cosine similarity value is less than the cosine similarity threshold, it means that the apparent feature vector matching is unsuccessful, and an alarm event is generated directly. The target object's tag, apparent feature vector, and system time are added to the event aggregation feature vector queue. If the cosine similarity value is greater than or equal to the cosine similarity threshold, it means that the apparent feature vector matching is successful, and the alarm event corresponding to the target object is a duplicate alarm event.
[0018] In some embodiments, the Django framework is used to encapsulate the object detection model and the deep cosine metric learning network model. After encapsulation, an HTTP interface is provided for clients to make requests, facilitating model management and external requests.
[0019] In some embodiments, the object detection model uses YOLOv3 as the model framework, and improves the original classification model into a lightweight classification model based on the YOLOv3 model. Currently, the detection model has high detection accuracy and high computational efficiency.
[0020] In some embodiments, the activation function of each layer in the network structure of the object detection model is the Rectified Linear Unit (ReLU), and the activation function of each layer in the network structure of the deep cosine metric learning network model is the Exponential Linear Unit (ELU). In this case, the model computation accuracy is high.
[0021] Secondly, embodiments of this application also propose an alarm event aggregation device based on multi-target detection in surveillance video, comprising:
[0022] The target detection module is configured to input the acquired video frames into the target detection model, determine whether there is a target object in the detection results, and determine whether it is a target object based on whether the confidence score exceeds a set threshold, and then proceed to the metric learning step.
[0023] The metric learning module is configured to extract appearance feature vectors of target objects in video frames using a deep cosine metric learning network model, and combine this with the target detection module to obtain the target object's label, appearance feature vector, and coordinate position; and
[0024] The aggregation and classification module is configured to determine whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event based on the target object's label, system time, apparent feature vector, and coordinate position, using alarm event aggregation rules.
[0025] Thirdly, embodiments of this application provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect.
[0026] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
[0027] This invention discloses an alarm event aggregation method and apparatus based on multi-target detection in surveillance video. The method involves inputting acquired video frames into a target detection model to determine if a target object exists in the detection results. The model then determines whether the object is a target based on whether the confidence level exceeds a set threshold, proceeding to the next step. A deep cosine similarity learning network model is used to extract the apparent feature vectors of the target objects in the video frames. Combining this with the previous steps, the label, apparent feature vector, and coordinate position of the target object are obtained. Based on the target object's label, system time, apparent feature vector, and coordinate position, alarm event aggregation rules are used to determine whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event. This invention is based on a high-precision target detection model and deep cosine similarity learning. It performs target detection on real-time video frames of a video surveillance system, then uses the deep cosine similarity learning model to extract the apparent feature vectors of the target objects to construct a multi-target apparent feature vector feature library. Combined with cosine similarity matching rules, it effectively removes duplicate and invalid alarm events, greatly saving the time and cost for managers to investigate potential hazards. This is beneficial for efficient management in safe production and is applicable to various industrial scenarios, demonstrating strong practicality. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is an exemplary device architecture diagram in which an embodiment of this application can be applied;
[0030] Figure 2 This is a flowchart illustrating an alarm event aggregation method based on multi-target detection in surveillance video, according to an embodiment of the present invention.
[0031] Figure 3 This is a schematic diagram of the network structure of the target detection model in the alarm event aggregation method based on multi-target detection in surveillance video, according to an embodiment of the present invention.
[0032] Figure 4 This is a schematic diagram of the network structure of a deep metric learning network model for an alarm event aggregation method based on multi-target detection in surveillance video, according to an embodiment of the present invention.
[0033] Figure 5 This is a flowchart illustrating step S3 of the alarm event aggregation method based on multi-target detection in surveillance video according to an embodiment of the present invention.
[0034] Figure 6 This is a schematic diagram of an alarm event aggregation device based on multi-target detection in surveillance video, according to an embodiment of the present invention.
[0035] Figure 7 This is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the present application. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0037] Figure 1 An exemplary device architecture 100 is shown, which can be applied to the alarm event aggregation method or the alarm event aggregation device based on multi-target detection of surveillance video according to the embodiments of this application.
[0038] like Figure 1 As shown, the device architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0039] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various applications, such as data processing applications and file processing applications, can be installed on terminal devices 101, 102, and 103.
[0040] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are imposed here.
[0041] Server 105 can be a server that provides various services, such as a background data processing server that processes files or data uploaded by terminal devices 101, 102, and 103. The background data processing server can process the acquired files or data and generate processing results.
[0042] It should be noted that the alarm event aggregation method based on multi-target detection of surveillance video provided in this application embodiment can be executed by server 105 or by terminal devices 101, 102, and 103. Correspondingly, the alarm event aggregation device based on multi-target detection of surveillance video can be set in server 105 or in terminal devices 101, 102, and 103.
[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Any number of terminal devices, networks, and servers can be included depending on implementation needs. If the data being processed does not need to be retrieved remotely, the above architecture may not include a network, requiring only servers or terminal devices.
[0044] Figure 2 An embodiment of this application illustrates an alarm event aggregation method based on multi-target detection in surveillance video, comprising the following steps:
[0045] S1. Input the acquired video frames into the target detection model to determine whether there is a target object in the detection results, and determine whether it is a target object based on whether the confidence score exceeds the set threshold, and then proceed to the next step.
[0046] In a specific embodiment, the method further includes the following step before step S1:
[0047] The system uses OpenCV to acquire real-time video streams from surveillance footage and captures video frames at regular time intervals. Therefore, in practical applications, multiple real-time video streams can be accessed simultaneously for real-time intelligent analysis. In a specific embodiment, the RTSP real-time video stream of the current surveillance video is acquired using OpenCV, and one image is captured every 2 seconds as input for subsequent model prediction. In practical applications, a single device needs to access multiple real-time video streams for real-time intelligent analysis simultaneously. Considering equipment performance and workload, and the long operating time in industrial production environments where the target remains largely unchanged within 2 seconds, video frames are captured at 2-second intervals.
[0048] The system framework is designed based on the Python language. The Django framework is used to encapsulate multi-target detection algorithm and appearance feature extraction algorithm model service. OpenCV is used to acquire monitoring video stream in real time, and video frames are captured at custom time intervals. Then, the model service encapsulated by Django is requested to perform multi-target detection and appearance feature vector extraction. Alarm event aggregation rules are used to determine whether it is a duplicate alarm event. Finally, non-duplicate alarm events are sent to the industrial intelligent alarm management platform for display in real time.
[0049] In a specific implementation, the target detection model uses YOLOv3 as its framework, and the original classification model is improved into a lightweight classification model based on the YOLOv3 model. Currently, the detection model boasts high detection accuracy and computational efficiency.
[0050] A high-precision target detection model is fundamental; once the detected target is correct, subsequent feature vector extraction becomes meaningful. This invention uses the most common example of compliant work safety attire in industrial production environments for illustration. Compliant work safety attire refers to the requirement for workers to correctly wear safety helmets and work clothes in designated work environments to ensure worker safety. However, the same method can be used for multi-target detection in other scenarios. In specific embodiments, this application uses the efficient convolutional neural network YOLOV3 (You Only Look Once) as the model framework for multi-target detection. Combining the color characteristics of safety helmets and work clothes in work safety attire, and the real-time requirements in practical applications, the YOLOV3 model proposed by Joseph Redmon is improved, and the original classification model is replaced with a lightweight classification model. The network structure of the lightweight classification model is as follows: Figure 3As shown, the input size of the object detection model is 416×416, and the activation function for each layer is the ReLU linear rectified function. Samples are labeled according to the color of the safety helmet and work clothes, focusing on the head and upper body. Then, k-means clustering is used to select nine anchors suitable for safety helmets and work clothes to replace the original anchors for model training. The final trained work safety clothing model achieves an accuracy of over 95%.
[0051] When the label, confidence score, and coordinate position of the target object predicted by the object detection model are obtained, it is determined whether the confidence score is greater than a set threshold. If it is less than the set threshold, it is discarded; if it is greater than the set threshold, the appearance feature vector is extracted.
[0052] S2, the appearance feature vector of the target object in the video frame is extracted by the deep cosine metric learning network model, and the label, appearance feature vector and coordinate position of the target object are obtained by combining with step S1.
[0053] In a specific implementation, a deep cosine metric learning network model extracts the apparent feature vectors of the target object to construct an event-aggregated feature vector queue. This event-aggregated feature vector queue can then be used for feature vector similarity calculation.
[0054] Generally, two appearance features extracted from the same target are more similar than appearance features extracted from different targets. This invention aims to achieve this by selecting a deep metric learning network model as a method for extracting this similarity feature space. Metric learning can be understood as a clustering problem; through learning, it aims to minimize the metric distance between similar target objects, thus achieving a clustering effect—that is, minimizing the distance between samples of the same class and increasing the distance between samples of different classes. The deep cosine metric learning network model proposed by Nicolai Wojke et al. is used as the model framework for extracting appearance feature vectors for target detection, constructing an event aggregation feature vector queue from the extracted appearance feature vectors of the target objects. Figure 4 This describes the network structure of a deep cosine metric learning network model. The model's input size is 128×64, the activation function for each layer is an exponential linear unit (ELU), and the final output apparent feature vector length is 128. The training dataset for the deep cosine metric learning network model consists of three parts: the Market1501 dataset, a portion of the DukeMTMC-reID dataset, and a self-collected dataset. All training datasets were created according to the Market1501 dataset standards, and the final pedestrian ID is 5257.
[0055] In a specific implementation, the Django framework is used to encapsulate the object detection model and the deep cosine metric learning network model. After encapsulation, an HTTP interface is provided for clients to make requests, facilitating model management and external requests.
[0056] The alarm event generation and aggregation methods are encapsulated in a single business logic using Python. The acquired video frames are used as input images, and the model service encapsulated by the Django framework is requested. First, the YOLOv3 object detection model is requested to determine whether there is a target object in the detection results. If there is, the confidence score is checked to see if it is greater than a set threshold. If it is less than the set threshold, it is discarded. If it is greater than the set threshold, the deep cosine metric learning network model is further requested to extract the feature vector of the current target object.
[0057] S3 determines whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event based on the target object's label, system time, apparent feature vector, and coordinate position through alarm event aggregation rules.
[0058] In specific embodiments, such as Figure 5 As shown, step S3 specifically includes:
[0059] S31, query the constructed event aggregation feature vector queue by tag to see if the target object exists. If it does, proceed to the time matching stage. Otherwise, generate an alarm event directly and add the target object's tag, appearance feature vector and system time to the event aggregation feature vector queue.
[0060] S32, determine whether the difference between the system time and the time of the target object in the event aggregation feature vector queue is within a valid time period. If so, proceed to the cosine similarity matching stage; otherwise, directly generate an alarm event and add the target object's label, appearance feature vector, and system time to the event aggregation feature vector queue; and
[0061] S33: Calculate the cosine similarity between the apparent feature vector of the target object and the apparent feature vector of the target object within the valid time period in the event aggregation feature vector queue. Determine whether the target object meets the matching rules by comparing the cosine similarity value with a pre-set cosine similarity threshold. If the cosine similarity value is less than the cosine similarity threshold, it means that the apparent feature vector matching is unsuccessful, and an alarm event is directly generated. Add the target object's label, apparent feature vector, and system time to the event aggregation feature vector queue. If the cosine similarity value is greater than or equal to the cosine similarity threshold, it means that the apparent feature vector matching is successful, and the alarm event corresponding to the target object is a duplicate alarm event.
[0062] After obtaining the target object's label, apparent feature vector, and coordinates, the target object's label and current system time are used as query objects. First, the system checks if the target object exists in the event aggregation feature vector queue. If not, it means the target object is appearing for the first time, so an alarm event is generated directly, and the target object's label, feature vector, and current system time are added to the event aggregation feature vector queue. If the target object exists, the system further determines whether the difference between the current system time and the target time in the event aggregation feature vector queue is within a valid time period. In a specific embodiment, the valid time period is set to 10 minutes. If it is not within a valid time period, it means the event aggregation feature vector queue has expired, so an alarm event is generated directly, and the event aggregation feature vector queue is updated. If it is within a valid time period, the system proceeds to the cosine similarity matching stage.
[0063] The cosine similarity threshold is set based on the target object's label, and the threshold varies for different target objects. The cosine similarity is calculated by comparing the current target object's apparent feature vector with the target object's apparent feature vectors within the valid time period in the event aggregation feature vector queue. The comparison of the cosine similarity value with the pre-set cosine similarity threshold determines whether the current target object meets the matching rules. If the cosine similarity value is less than the threshold, the apparent feature vector match is unsuccessful and does not meet the matching rules, resulting in an alarm event and updating the target's apparent feature vector in the event aggregation feature vector queue. If the cosine similarity value is greater than or equal to the threshold, the apparent feature vector match is successful, and the alarm event corresponding to the current target object is a duplicate alarm event, which is filtered out and not displayed. Therefore, this achieves the effect of aggregating alarm events corresponding to the same target object.
[0064] In a specific embodiment, the formula for calculating cosine similarity is as follows:
[0065]
[0066] Where A and B are the apparent feature vectors of the target object, A i B i Let A and B be the components of vectors A and B, respectively, and let cos(θ) be the cosine value. If the cosine similarity value is less than the cosine similarity threshold, it means that the target feature vector does not match the apparent feature vector of the same target in the feature queue, and it is not a duplicate alarm event. It is pushed to the industrial intelligent alarm management platform for display as a new alarm event. If the cosine similarity value is greater than or equal to the cosine similarity threshold, it means that the cosine similarity feature match is successful, and the current event is a duplicate alarm event, which can be discarded.
[0067] The application scenarios of this invention can realize the deduplication of multi-target alarm events in frame skipping detection, analyze and aggregate the filtering of invalid alarms, duplicate alarms and other alarm problems, discover important alarms to the greatest extent, and carry out efficient hidden danger investigation, thereby improving the real-time performance and reliability of alarm management, and effectively improving the level of safe production and safe operation in industrial processes.
[0068] This invention uses the example of wearing protective equipment in compliance with regulations to illustrate the method of aggregating alarm events, but it is not limited to this and can also be applied to the aggregation of events such as smoke, flames, crude oil spills, masks, and pedestrians.
[0069] Further reference Figure 6 As an implementation of the methods shown in the above figures, this application provides an embodiment of a chat text feature classification device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0070] An embodiment of this application proposes an alarm event aggregation device based on multi-target detection in surveillance video, comprising:
[0071] The target detection module 1 is configured to input the acquired video frames into the target detection model, determine whether there is a target object in the detection results, and determine whether it is a target object based on whether the confidence score exceeds a set threshold, and then enter the metric learning step.
[0072] Metric learning module 2 is configured to extract the appearance feature vector of target objects in video frames using a deep cosine metric learning network model, and combine it with target detection module 1 to obtain the target object's label, appearance feature vector, and coordinate position; and
[0073] The aggregation classification module 3 is configured to determine whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event based on the target object's label, system time, apparent feature vector, and coordinate position through alarm event aggregation rules.
[0074] This invention discloses an alarm event aggregation method and apparatus based on multi-target detection in surveillance video. The method involves inputting acquired video frames into a target detection model to determine the presence of target objects in the detection results. The model then determines whether an object is a target based on whether its confidence level exceeds a set threshold, proceeding to the next step. A deep cosine similarity learning network model is used to extract the apparent feature vectors of target objects in the video frames. Combining this with the previous steps, the label, apparent feature vector, and coordinate position of the target object are obtained. Based on the target object's label, system time, apparent feature vector, and coordinate position, alarm event aggregation rules are used to determine whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event. This invention, based on a high-precision target detection model and deep cosine similarity learning, performs target detection on real-time video frames of a video surveillance system. It then uses the deep cosine similarity learning model to extract the apparent feature vectors of target objects, constructing a multi-target apparent feature vector feature library. Combined with cosine similarity matching rules, it effectively removes duplicate and invalid alarm events, significantly saving management time in identifying potential hazards. This is beneficial for efficient management in safe production and is applicable to various industrial scenarios, demonstrating strong practicality.
[0075] The following is for reference. Figure 7 It illustrates an electronic device suitable for implementing embodiments of this application (e.g., Figure 1 The diagram shows the structure of a computer device 700 (a server or terminal device). Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0076] like Figure 7 As shown, the computer device 700 includes a central processing unit (CPU) 701 and a graphics processing unit (GPU) 702, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 703 or programs loaded from storage section 709 into random access memory (RAM) 704. The RAM 704 also stores various programs and data required for the operation of the device 700. The CPU 701, GPU 702, ROM 703, and RAM 704 are interconnected via a bus 705. An input / output (I / O) interface 706 is also connected to the bus 705.
[0077] The following components are connected to I / O interface 706: an input section 707 including a keyboard, mouse, etc.; an output section 708 including an LCD, speakers, etc.; a storage section 709 including a hard disk, etc.; and a communication section 710 including a network interface card, such as a LAN card or modem. The communication section 710 performs communication processing via a network such as the Internet. A drive 711 may also be connected to I / O interface 706 as needed. A removable medium 712, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 711 as needed so that computer programs read from it can be installed into storage section 709 as needed.
[0078] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 710, and / or installed from removable medium 712. When the computer program is executed by central processing unit (CPU) 701 and graphics processing unit (GPU) 702, the functions defined in the methods of this application are performed.
[0079] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium, a computer-readable medium, or any combination of the two. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, or any combination thereof. More specific examples of a computer-readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than a computer-readable medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0080] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using dedicated hardware-based apparatus to perform the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0082] The modules described in the embodiments of this application can be implemented in software or hardware. These modules can also be located within a processor.
[0083] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: input acquired video frames into a target detection model, determine whether a target object exists in the detection results, and determine whether it is a target object based on whether the confidence level exceeds a set threshold, and then proceed to a metric learning step; extract apparent feature vectors from the video frames using a deep cosine metric learning network model, and obtain the target object's label, apparent feature vector, and coordinate position by combining the above steps; and determine whether the alarm event corresponding to the target object in the video frame is a duplicate alarm event based on the target object's label, system time, apparent feature vector, and coordinate position using alarm event aggregation rules.
[0084] It should be understood that the scope of the invention involved in this application is not limited to the technical solutions formed by specific combinations of the above-mentioned technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, technical solutions formed by substituting the above-mentioned features with technical features that have similar functions disclosed in this application (but not limited to those disclosed in this application).
Claims
1. A method for aggregating alarm events based on multi-target detection in surveillance video, characterized in that: The following steps are involved: The target detection step inputs the acquired video frame into the target detection model to determine whether there is a target object in the detection result, and determines whether it is the target object according to whether the confidence exceeds the set threshold, and enters the metric learning step, wherein Open CV is used to acquire the video frame, and the Django framework is used to encapsulate the multi-target detection algorithm in the target detection model; A metric learning step, extracting the apparent feature vector of the target object in the video frame through a deep cosine metric learning network model, and obtaining the label, apparent feature vector and coordinate position of the target object in combination with the target detection step; wherein the deep cosine metric learning network model extracts the apparent feature vector of the target object to construct an event aggregation feature vector queue; and The aggregation classification step is to determine whether the alarm event of the target object in the video frame is a repeated alarm event based on the label, system time, apparent feature vector and coordinate position of the target object through the alarm event aggregation rule; wherein the alarm event aggregation rule specifically includes: Querying whether the target object exists in the constructed event aggregation feature vector queue through the label, and if so, entering the time matching phase, otherwise directly generating an alarm event, and adding the label, the apparent feature vector and the system time of the target object to the event aggregation feature vector queue; Determine whether the difference between the system time and the time of the target object in the event aggregation feature vector queue is within the valid time period, if so, enter the cosine similarity matching stage, otherwise directly generate an alarm event, and add the label, the apparent feature vector and the system time of the target object to the event aggregation feature vector queue: and The cosine similarity of the apparent feature vector of the target object and the apparent feature vector of the target object within the valid time period in the event aggregation feature vector queue is calculated, and whether the target object meets the matching rule is determined by comparing the cosine similarity value with a preset cosine similarity threshold. If the cosine similarity value is less than the cosine similarity threshold, it means that the apparent feature vector is not matched successfully, and an alarm event is directly generated. The label of the target object, the apparent feature vector and the system time are added to the event aggregation feature vector queue. If the cosine similarity value is greater than or equal to the cosine similarity threshold, it means that the apparent feature vector is matched successfully, and the alarm event corresponding to the target object is a repeated alarm event.
2. The alarm event aggregation method based on multi-target detection of surveillance video according to claim 1 is characterized in that: Before the target detection step, the method further includes: The real-time video stream of the surveillance video is obtained through OpenCV, and the video frames are intercepted at certain time intervals.
3. The alarm event aggregation method based on multi-target detection of surveillance video according to claim 1 is characterized in that: The target detection model and the deep cosine metric learning network model are encapsulated using the Django framework.
4. The alarm event aggregation method based on multi-target detection of surveillance video according to claim 1 is characterized in that: The target detection model adopts YoloV3 as the model framework, and improves the original classification model into a lightweight classification model based on the YoloV3 model.
5. The alarm event aggregation method based on multi-target detection of surveillance video according to claim 1 is characterized in that: The activation function of each layer in the network structure of the target detection model is the linear rectification function ReLU, and the activation function of each layer in the network structure of the deep cosine metric learning network model is the exponential linear unit ELU.
6. An alarm event aggregation device based on multi-target detection of surveillance video, characterized in that: The following steps are involved: The target detection module is configured to input the acquired video frame into the target detection model, determine whether there is a target object in the detection result, and determine whether it is a target object according to whether the confidence exceeds a set threshold, and enter the metric learning step, wherein Open CV is used to acquire the video frame, and the Django framework is used to encapsulate the multi-target detection algorithm in the target detection model; A metric learning module is configured to extract an apparent feature vector of the target object in the video frame through a deep cosine metric learning network model, and obtain a label, an apparent feature vector and a coordinate position of the target object in combination with the target detection module; wherein the deep cosine metric learning network model extracts the apparent feature vector of the target object to construct an event aggregation feature vector queue; and The aggregation classification module is configured to determine whether the alarm event of the target object in the video frame is a repeated alarm event based on the label, system time, apparent feature vector and coordinate position of the target object through an alarm event aggregation rule; wherein the alarm event aggregation rule specifically includes: Querying whether the target object exists in the constructed event aggregation feature vector queue through the label, and if so, entering the time matching phase, otherwise directly generating an alarm event, and adding the label, the apparent feature vector and the system time of the target object to the event aggregation feature vector queue; Determine whether the difference between the system time and the time of the target object in the event aggregation feature vector queue is within the valid time period, if so, enter the cosine similarity matching stage, otherwise directly generate an alarm event, and add the label, the apparent feature vector and the system time of the target object to the event aggregation feature vector queue: and The cosine similarity of the apparent feature vector of the target object and the apparent feature vector of the target object within the valid time period in the event aggregation feature vector queue is calculated, and whether the target object meets the matching rule is determined by comparing the cosine similarity value with a preset cosine similarity threshold. If the cosine similarity value is less than the cosine similarity threshold, it means that the apparent feature vector is not matched successfully, and an alarm event is directly generated. The label of the target object, the apparent feature vector and the system time are added to the event aggregation feature vector queue. If the cosine similarity value is greater than or equal to the cosine similarity threshold, it means that the apparent feature vector is matched successfully, and the alarm event corresponding to the target object is a repeated alarm event.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
An automatic tracking and track modeling method for short-track speed skating athletes in videos
CN109448025A
