A method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning
By adopting intelligent collaborative reasoning and multi-agent deep reinforcement learning in the intelligent monitoring system, segmenting the deep neural network model and dynamically allocating resources in the edge cloud system, the reasoning delay on resource-limited terminal devices and the high cost of cloud computing model are solved. Cost and high latency issues are eliminated to achieve efficient intelligent monitoring system performance and resource utilization.
Patent Information
- Application Number
- CN202210576950.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-05-25
AI Technical Summary
When existing intelligent monitoring systems deploy deep learning models on resource-constrained terminal devices, there are problems with inference delays and insufficient computing power, and the traditional cloud computing model faces problems of transmission pressure, delay, high cost, and low security.
Using a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning, the deep neural network model is divided into a horizontal execution network and a vertical execution network through horizontal segmentation and vertical segmentation algorithms, and a multi-agent deep reinforcement learning algorithm is used to dynamically allocate resources to minimize Minimize task processing time difference and realize adaptive computing offloading and resource allocation for collaborative multi-camera tracking tasks in edge cloud systems.
It reduces the calculation time cost of complex DNN models, improves the utilization of system computing power, reduces cloud service costs, and achieves faster edge-cloud system collaborative reasoning and higher system performance.
Smart Images

Figure CN114815755B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, and in particular relates to a method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning. Background Art
[0002] Intelligent Surveillance System (ISS) is an important application that combines deep learning (DL) and Internet of Things (IoT) technologies, and Multiple Targets Multiple Camera Tracking (MTMCT) has been widely recognized as a promising solution for intelligent surveillance systems. However, current terminal devices have low memory, low power consumption, and limited computing power, so the artificial intelligence (AI) models deployed on these resource-constrained devices need to ensure inference latency and accuracy. In order to fully utilize the computing power of the system and minimize the system computing latency, real-time video analysis systems based on edge computing have become a new research hotspot in recent years. However, the existing system architecture lacks a fine-grained discussion of deep learning models, and ignores the coordination problem between camera clusters in model splitting.
[0003] The key reason for the success of MTMCT is the booming development of deep learning technology and the Internet of Things, such as image recognition, target detection, and target tracking. With dynamic computation offloading and resource allocation, real-time video analysis based on the Internet of Things can be achieved. The real-time video stream analysis architecture based on edge computing verifies the possibility of edge computing in the field of vision. However, the wide range of application scenarios has led to different architectures in edge cloud clusters, and there is a lack of discussion on fine-grained deep neural network (DNN) models. In the field of DNN model partitioning, considering the cooperation between multi-layer clusters is still an unresolved problem. Therefore, there are still three challenges for edge real-time video analysis systems: 1. Offloading complex DNN models to limited edge devices; 2. Heterogeneous clusters on the edge cloud at the offloading end between layers or nodes; 3. Relieve the computing pressure of the cloud, make full use of the computing power of the system, and minimize computing delays in scenarios with multiple video streams. Specifically:
[0004] First, the data in MTMCT requires a huge computing power to fully release its potential, and cloud computing is one of the solutions. However, with the surge in the number of surveillance cameras, it is challenging to process such a large amount of data only through cloud computing, which faces huge transmission pressure, high latency, high cost and low security.
[0005] 2. Real-time video analysis systems based on edge computing have become a research hotspot. Common system designs focus on using collaborative learning strategies to solve multi-target multi-camera tracking tasks. However, deep neural networks still run in the cloud, resulting in system performance limitations. Existing systems have adaptively balanced the workload between smart cameras and divided the workload between cameras and edge clusters to achieve optimized system performance. However, the properties of DNNs have not been considered, and the AI models deployed on these resource-constrained devices need to maintain a low number of parameters while tolerating high inference latency and low accuracy. Therefore, it makes sense to combine DNN partitioning with cross-camera video processing.
[0006] 3. Driven by the above trends, many types of research have attached great importance to the splitting of DNNs to reduce latency and save resources. There are two basic categories of splitting strategies: horizontal splitting and vertical splitting. For the former, the horizontal splitting of DNNs uses the characteristics of DNNs to design a coarse-grained hierarchical computation splitting strategy. By considering DNN as a directed acyclic graph (DAG), the problem of minimizing latency is transferred to an equivalent minimum splitting problem. However, the horizontally split DNN cannot achieve parallel execution of the model network and increases the communication cost of intermediate parameters between devices. For vertical splitting, the feature projection is divided into convolutional layers based on the computing power of a single node, and then the outputs of all nodes in the host are merged. Vertical splitting applies a scalable fused tile partitioning (FTP) strategy for convolutional layers to minimize memory usage and reduce transmission between nodes. Although vertical splitting can achieve parallel execution between convolutional layers, models with residual structures and attention mechanisms require more detailed discussions.
[0007] Traditional cloud computing models cannot handle huge amounts of data and suffer from heavy transmission pressure, high latency, high costs and low security. Figure 1 As shown in the figure, the process of MTMCT calculation based on deep learning is shown. The common MTMCT system process is divided into the following three parts: multiple cameras generate video stream data in real time, and upload the video stream to the cloud center for algorithm execution; the MTMCT algorithm deployed in the cloud center performs target detection (Target Detection), that is, using common deep neural networks such as YOLOv4 to detect targets such as people, cyclists, and bicycles in the video. The network structure of YOLOv4 is as follows Figure 3As shown in the figure, the MTMCT algorithm uses the DeepSort algorithm to perform track association (TrackerAssociation), that is, firstly, the corresponding track features are generated for the targets in each video, and the algorithm compares the tracks of the same camera before and after, matches the currently generated target track with the target track that has been detected in the past, and then performs track matching across cameras, and finally obtains the tracking results of the target in a single camera and across camera videos. Summary of the invention
[0008] Aiming at the technical problem of lightweight model reasoning of ISS resource-constrained computing nodes, the present invention proposes a method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning, and realizes a distributed real-time intelligent monitoring system based on edge intelligent collaborative reasoning (Edge Intelligent Collaborative Inference for Distributed Real-Time Intelligent Surveillance System, EI-ISS), which is suitable for adaptive computing offloading and resource allocation of collaborative multi-camera tracking tasks on edge cloud systems. To solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0009] A method for establishing an intelligent collaborative lightweight model of a distributed intelligent monitoring system comprises the following steps:
[0010] S1, build a video surveillance system including monitoring terminals, base stations and cloud;
[0011] S2, using horizontal segmentation and vertical segmentation algorithms to establish a horizontal segmentation model based on a deep neural network, wherein the output of the horizontal segmentation model includes a horizontal execution network and a vertical execution network;
[0012] S3, constructing the horizontal segmentation point decision, horizontal execution node decision, and vertical execution node decision of the horizontal segmentation model into a Markov decision process;
[0013] S4, the cloud uses DDQN's multi-agent deep reinforcement learning algorithm and builds a split point execution device decision model with minimizing the task processing time difference as the objective function;
[0014] S5, each monitoring terminal inputs the generated video stream into the split point execution device decision model respectively, and uploads the video stream to the corresponding horizontal execution node according to the horizontal execution node decision generated by the split point execution device decision model. The horizontal execution node uses the horizontal segmentation model to complete the horizontal segmentation and execution of the model, and sends the network parameters after the horizontal execution to the corresponding vertical execution node;
[0015] S6, the vertical execution nodes respectively use the vertical segmentation algorithm to vertically segment and execute their respective vertical execution networks according to the vertical execution node decisions generated by the segmentation point execution device decision model;
[0016] S7, the cloud receives the execution results from each vertical execution node and uses the trajectory matching algorithm to complete the cross-camera trajectory matching.
[0017] The step S2 comprises the following steps:
[0018] S2.1, construct the deep neural network model as a directed acyclic graph;
[0019] S2.2, using the depth-first algorithm to obtain the longest path from the input layer to the output layer in the deep neural network model;
[0020] S2.3, using the horizontal segmentation algorithm to split the longest path obtained in step S2.2 into a horizontal execution network and vertical execution network
[0021] The Horizontal Execution Network and vertical execution network The expression of the network parameters is:
[0022]
[0023] In the formula, the value of n is 0 or 1. When n=0, Indicates the horizontal segmentation point p h The split horizontal execution network The network parameters, when n = 1, Indicates the horizontal segmentation point p h The split vertical execution network The network parameters, Resunit network structure at the horizontal split point p h The divided The proportion of the number of network layers in the network, ω Resunit Parameters representing the Resunit network structure, Indicates CBL conv+bn+leakyRelu The network structure is at the horizontal split point p h The divided The proportion of the number in the network, ω CBL Indicates CBL conv+bn+leakyRelu The parameters of the network structure, Indicates CBM conv+bn+mish The network structure is at the horizontal split point p h The divided The proportion of the number in the network, ω CBM Indicates CBMconv+bn+mish Parameters of the network structure.
[0024] The step S3 comprises the following steps:
[0025] S3.1, construct the state space, which is expressed as:
[0026]
[0027] In the formula, Indicates execution of camera d m The execution time of the video stream detection task is Indicates camera d m The video stream detection task is executed on the node and execution nodes The transmission delay between Indicates camera d m The video stream detection task is executed on the node The execution time on Indicates camera d m The video stream detection task is executed on the node The waiting time on Indicates that the base station and the cloud are in addition to the camera d m The state affected by other intelligent agents other than the daemon includes the number of tasks waiting to be executed in the base station and the cloud, the task volume, and the estimated completion time of the current task. m Indicates camera d m The horizontal segmentation point of the network corresponding to the video stream, Indicates camera d m The state at time t, ε represents the set of base stations, Represents cloud, A collection of monitoring terminals;
[0028] S3.2, construct the action space, which is expressed as:
[0029]
[0030] In the formula, Indicates camera d m Action at time t;
[0031] S3.3, construct the reward function, which is expressed as:
[0032]
[0033] In the formula, μ represents the penalty weight, ρ represents the tolerance of the maximum time difference for all cameras to complete the detection task at time t, and Z represents the maximum time tolerance for completing the detection task of a single camera. represents the action space of camera d0 at time t, Indicates camera d M-1 In the action space at time t, represents the state space of camera d0 at time t, Indicates camera d M-1 In the state space at time t, Indicates camera d m The reward function at time t is Indicates execution of camera d m The longest execution time of the video stream detection task, Indicates execution of camera d m The shortest execution time of the detection task of the video stream.
[0034] In step S3.1, the camera d m The execution time of the video stream detection task The calculation formula is:
[0035]
[0036] In the formula, Indicates camera d m The video stream detection task is executed vertically at the node The execution time on Indicates camera d m The video stream is transmitted to the horizontal execution node transmission delay.
[0037] The camera d m The video stream detection task is executed on the horizontal node Waiting time on The calculation formula is:
[0038]
[0039] In the formula, Indicates camera d m′ The video stream detection task is transmitted to the horizontal execution node The transmission delay of is the indicator function.
[0040] The camera d m The video stream is transmitted to the horizontal execution node Transmission delay The calculation formula is:
[0041]
[0042] In the formula, Indicates camera d m Horizontal execution node The bandwidth speed between m Indicates camera d m The actual amount of data transmitted per second for the video stream.
[0043] The camera d m The video stream detection task is executed on the horizontal node Execution time on The calculation formula is:
[0044]
[0045] In the formula, Indicates camera d m The video stream corresponds to the regression parameters of the execution time, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution. express The regression parameters corresponding to the execution time, Represents the lateral execution network The parameters of correspond to the regression parameters of the execution time, Represents the lateral execution network Execute nodes in the horizontal The regression parameters on represents the constant term for the execution time regression fit, K m Indicates camera d m The actual amount of data transmitted per second in the video stream. Represents a horizontal execution node The computing power of For calculation The required computing power regression fitting function, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network network parameters.
[0046] The camera d m The video stream detection task is executed horizontally on the nodes and vertical execution nodes The transmission delay between The calculation formula is:
[0047]
[0048] In the formula, Represents a horizontal execution node and vertical execution nodes The bandwidth speed between Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution.
[0049] In step S4, the expression of the objective function is:
[0050]
[0051] Where, T Total represents the maximum processing time difference of the video detection task periodically generated by the camera cluster, P represents the horizontal segmentation point set of the deep neural network model, Y0 represents the horizontal execution node set of the horizontal execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P, Y1 represents the vertical execution node set of the vertical execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P, ρ represents the tolerance of the maximum time difference for all cameras to complete the detection task at time t, Indicates execution of camera d m The longest execution time of the video stream detection task, Indicates execution of camera d m The shortest execution time of the video stream detection task, A collection of monitoring terminals.
[0052] The step S6 comprises the following steps:
[0053] S6.1, divide the vertical execution network into l*l fusion regions according to the l*l grid method;
[0054] S6.2, using the regression function to construct the relationship between the network parameters, input and output of the longitudinal execution network, the corresponding expression is:
[0055]
[0056] In the formula, Represents the lateral execution network Execute nodes in the horizontal The intermediate parameters output after the execution is completed and the regression fitting parameters of the longitudinal execution network execution time, Represents the vertical execution network Execute nodes vertically The regression fitting parameters of the output parameters after the execution is completed, Represents the vertical execution network The regression fitting parameters of the parameters, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network Execute nodes vertically Output parameters after execution. Represents the vertical execution network Execute nodes vertically The constant term parameter of the regression fit on Indicates vertical execution node The computing power of Representation calculation The required computing power regression fitting function, express The regression fitting parameters are Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network The network parameters, Indicates camera d m The video stream detection task is executed vertically at the node The execution time on Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution;
[0057] S6.3, each vertical execution node The received vertical execution networks are calculated in parallel and the calculated results are merged and output.
[0058] Beneficial effects of the present invention:
[0059] This application uses regression equations to model and characterize the computing power requirements, time costs, and network parameters of complex DNN target recognition algorithms, combines horizontal segmentation and vertical segmentation methods, fully utilizes the computing power of base stations, and reduces the computing time cost of complex DNN models. In addition, this application adopts a solution based on deep reinforcement learning to obtain an approximate optimal solution for dynamic resource allocation, accelerates the collaborative reasoning speed of the edge cloud system, and improves the effective utilization of the system computing power. Experiments have shown that this application has achieved better results than the baseline. The horizontal segmentation algorithm divides the model into two parts according to the DNNs hierarchical granularity, improves the system's computing power utilization, and reduces higher cloud service costs. The vertical segmentation algorithm is based on the FTP strategy, which can minimize memory usage and reduce transmission between nodes, and realize model parallel computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 This is the MTMCT system process based on deep learning.
[0062] Figure 2 Workflow flow of the MTMCT system based on base station and cloud.
[0063] Figure 3 This is a network structure diagram of YOLOv4 in the prior art.
[0064] Figure 4 Schematic diagram of segmentation based on horizontal segmentation method and vertical segmentation method.
[0065] Figure 5 Schematic diagram of multi-agent reinforcement learning training.
[0066] Figure 6 Create a flow chart for the model of this application.
[0067] Figure 7 This is a comparison diagram of the application and other algorithms. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] A method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning, such as Figure 1 and 2 As shown, the following steps are included:
[0070] S1, build a video surveillance system including monitoring terminals, base stations and cloud;
[0071] The video surveillance system adopts express, Represents the monitoring terminal, that is, the collection of cameras, each camera is an intelligent agent, M represents the monitoring terminal set The number of monitoring terminals in , ε represents the set of base stations, ε = {e0, e1, ..., e N-1}, N represents the number of base stations in the base station set ε, Represents cloud, Each monitoring terminal is wirelessly connected to all base stations, and any two base stations are wired connected, and all base stations are wired connected to the cloud to achieve video stream transmission. Each base station and cloud is an execution node, responsible for detecting and calculating the video stream captured by the camera to achieve target tracking. The computing power of execution node i is represented as C i ,and Represents the CPU or GPU disk speed per bit; i,m Indicates camera d m The bandwidth speed between the execution node i is in kb / s. m Generate x per second m The larger the batch size, the more memory and computing power will be consumed when performing image detection. Therefore, in order to ease the overall pressure on the system, it is assumed that the camera will drop some frames per second, and the frame loss rate is set to F. m The number of valid data frames per second is f m =(1-F)·x m , the actual data volume of the transmitted video stream is K m = k·f m , where k is the average unit quantity for each video frame. If the execution node i will perform the detection of camera d mThe detection and tracking task of the video stream is referred to as the camera detection task. m The transmission delay of the video stream to the execution node i is expressed as
[0072] S2, using the horizontal segmentation algorithm to design a horizontal segmentation model based on a deep neural network, the output of the horizontal segmentation model includes a horizontal execution network and a vertical execution network, such as Figure 4 As shown, the following steps are included:
[0073] S2.1, construct the deep neural network (DNN) model as a directed acyclic graph;
[0074] The directed acyclic graph adopts express, Represents the vertex, which is the collection of DNN model network structure layers. represents the set of edges, Represents vertex v j The input of the DNN model network structure is vertex v j′ The output of
[0075] This application uses YOLOv4 as the DNN model for cross-camera tracking tasks, such as Figure 3 As shown, YOLOv4 has a large number of residual structures, and the YOLOv4 network mainly includes the following three network structures: CBL, CBM, and ResUnit as network units. The network structure of the YOLOv4 network is prior art and will not be described in detail in this application.
[0076] S2.2, use the depth-first algorithm to obtain the longest path from the input layer to the output layer in the DNN model;
[0077] S2.3, using the horizontal segmentation algorithm to split the longest path obtained in step S2.2 into a horizontal execution network and vertical execution network
[0078] The Horizontal Execution Network and vertical execution network The expression of the network parameters is:
[0079]
[0080] In the formula, the value of n is 0 or 1. When n=0, Indicates the horizontal segmentation point p h The split horizontal execution network The network parameters, when n = 1, Indicates the horizontal segmentation point p h The split vertical execution network The network parameters, represents the set of horizontal segmentation points, and P represents the set of horizontal segmentation points The number of elements in Indicates the horizontal segmentation point p h The divided The proportion of Resunit network structures in the network layer, ω Resunit Parameters representing the Resunit network structure, Indicates the horizontal segmentation point p h The divided CBL in the network conv+bn+leakyRelu The proportion of network structures in this network layer, ω CBL Indicates CBL conv+bn+leakyRelu The parameters of the network structure, Indicates the horizontal segmentation point p h The divided CBM in the network conv+bn+mish The proportion of network structures in this network layer, ω CBM Indicates CBM conv+bn+mish Parameters of the network structure.
[0081] S3, constructing the horizontal segmentation point decision, horizontal execution node decision, and vertical execution node decision of the horizontal segmentation model into a Markov decision process, including the following steps:
[0082] S3.1, construct the state space, which is expressed as:
[0083]
[0084] In the formula, Indicates execution of camera d m The execution time of the video stream detection task is Indicates camera d m The video stream detection task is executed horizontally on the nodes and vertical execution nodes The transmission delay between Indicates camera d m The video stream detection task is executed on the horizontal node The execution time on Indicates camera d m The video stream detection task is executed on the horizontal node The waiting time on Indicates that the base station and the cloud are in addition to the camera d m The state affected by other intelligent agents besides the datum node includes the number of tasks waiting to be executed in the base station and the cloud, the task size, i.e., the task volume, and the estimated completion time of the currently executed task. m Indicates camera d m The horizontal segmentation point of the network corresponding to the video stream, Indicates camera d m The state at time t, and
[0085] The execution camera d m The execution time of the video stream detection task The calculation formula is:
[0086]
[0087] In the formula, Indicates camera d m The video stream detection task is executed vertically at the node The execution time on Indicates camera d m The video stream is transmitted to the horizontal execution node transmission delay.
[0088] When multiple cameras select the same execution node for calculation, there will be a waiting delay. All these transmitted tasks are stored in a task queue of the execution node and are executed sequentially on the execution node according to the First In First Out (FIFO) principle. m The video stream detection task is executed on the horizontal node Waiting time on The calculation formula is:
[0089]
[0090] In the formula, Indicates camera d m The video stream detection task is transmitted to the horizontal execution node The transmission delay of is the indicator function. When the parameter of the indicator function is true, the value of the indicator function is 1, otherwise it is 0.
[0091] The camera d m The video stream is transmitted to the horizontal execution node Transmission delay The calculation formula is:
[0092]
[0093] In the formula, Indicates camera d m Horizontal execution nodes The bandwidth speed between.
[0094] Use regression function to construct camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network The relationship between the network parameters and the input and output, the camera d m The video stream detection task is executed on the horizontal node Execution time on The calculation formula is:
[0095]
[0096] In the formula, Indicates camera d m The video stream corresponds to the regression parameters of the execution time, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution. express The regression parameters corresponding to the execution time, Represents the lateral execution network The parameters of correspond to the regression parameters of the execution time, Represents the lateral execution network Execute nodes in the horizontal The regression parameters on Represents the constant term for the execution time regression fit. Indicates a horizontal execution node The computing power of For calculation The required computing power regression fitting function, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network network parameters.
[0097] The camera d m The video stream detection task is executed horizontally on the nodes and vertical execution nodes The transmission delay between The calculation formula is:
[0098]
[0099] In the formula, Indicates a horizontal execution node and vertical execution nodes The bandwidth speed between.
[0100] S3.2, construct the action space, which is expressed as:
[0101]
[0102] In the formula, Indicates camera d m The action corresponding to the video stream at time t is also the decision.
[0103] S3.3, construct the reward function, which is expressed as:
[0104]
[0105] In the formula, μ represents the penalty weight, ρ represents the tolerance of the maximum time difference for all cameras to complete the detection task at time t, and Z represents the maximum time tolerance for completing the detection task of a single camera. represents the action space of camera d0 at time t, Indicates camera d M-1 In the action space at time t, represents the state space of camera d0 at time t, Indicates camera d M-1 In the state space at time t, Indicates camera d m The reward function at time t is Indicates execution of camera d m The longest execution time of the video stream detection task, Indicates execution of camera d m The shortest execution time of the detection task of the video stream. It reflects the task completion time difference generated by all cameras at time t.
[0106] S4, the cloud uses the DDQN (Double Deep Q Network) multi-agent deep reinforcement learning (DRL) algorithm, and builds a split point execution device decision model with minimizing the task processing time difference as the objective function to solve the Markov decision process;
[0107] The expression of the objective function is:
[0108]
[0109] Where, T Total It represents the maximum processing time difference of the video analysis tasks periodically generated by the camera cluster, P represents the horizontal segmentation point set of the DNN model, Y0 represents the horizontal execution node set of the horizontal execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P, and Y1 represents the vertical execution node set of the vertical execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P.
[0110] The construction of the split point execution device decision model includes the following steps:
[0111] a. Set the number of training rounds Initialize training period τ = 1;
[0112] b, each camera continuously generates video streams at time t, and the action of each camera is obtained according to the current DDQN network;
[0113] c. Deploy the video stream to different horizontal execution nodes in a distributed manner according to the action;
[0114] d. After completing the horizontal segmentation task, each horizontal execution node transmits the intermediate parameters to the vertical execution node and finally completes the execution of the detection task;
[0115] For cross-camera tracking tasks, all cameras should work together, i.e., detection tasks generated simultaneously should be “as synchronized as possible” within a certain threshold.
[0116] e. All vertical execution nodes transmit their respective target recognition results to the cloud, which completes cross-camera multi-target tracking and obtains the final detection results;
[0117] f, the cloud simultaneously obtains the reward of each agent for the current action and the new state and will Deposit into experience pool;
[0118] g, the cloud obtains continuous Train and update the multi-agent DDQN model and make a decision for the next time t+1;
[0119] like Figure 5 and Figure 6 As shown in Figure 1, DDQN has an evaluation network and a target network. By decoupling the strategy evaluation from the action selection and the Q value of the next action, the overestimation problem of DQN is eliminated. The target network periodically updates the weights from the evaluation network. That is, DDQN is based on the parameter θ t The evaluation network selects the best action and takes The target network obtains the Q value. In the distributed execution, the centrally trained DDQN weights are shared with all agents. Each agent has a homogeneous state, action, and reward space, which reduces the problem of having to train a large number of weights.
[0120] This application models each camera as an intelligent agent. The corresponding agent is based on the strategy π and the current state Select an action Among them, S represents the set of all states, A represents the set of all actions, and action After interacting with the environment, the camera d m The corresponding agent gets rewarded and transition to a new state And through the duration reward R, learn the strategy π so that the cumulative reward G t Maximization. The goal of the agent is to maximize Where γ is the discount factor, R t+1 is the reward obtained at time t+1, Q(S t+1 ) represents the Q value obtained at time t+1, argmax a Q(S t+1 , a; θ t ) represents the action that maximizes the state-action value function, Represents the parameters of the target network. Each agent observes the state at time t The base station and the cloud follow the FIFO (first in, first out) principle and need to cooperate to complete the resource allocation decision of multiple agents, that is, the horizontal segmentation point decision and the computation offloading decision, that is, the horizontal execution node decision and the vertical execution node decision. In a distributed scenario, find the best strategy for real-time load balancing of multiple continuous video analysis tasksπ * The goal of EI-ISS is to minimize the processing time difference of video analysis tasks periodically generated by camera clusters. EI-ISS not only considers minimizing the processing time of each camera's video task, but also ensures that the time difference between cameras completing tasks at the same time is minimized.
[0121] S5, each monitoring terminal inputs the generated video stream into the split point execution device decision model respectively, and uploads the video stream to the horizontal execution node according to the horizontal execution node decision generated by the split point execution device decision model. The horizontal execution node uses the horizontal segmentation model to complete the horizontal segmentation and execution of the model, and sends the network parameters after the horizontal execution to the vertical execution node, including the following steps:
[0122] S5.1, each monitoring terminal inputs the generated video stream into the segmentation point execution device decision model, and the segmentation point execution device decision model generates a horizontal segmentation point decision, a horizontal execution node decision, and a vertical execution node decision;
[0123] S5.2, the monitoring terminals transmit their respective video streams to the corresponding horizontal execution nodes according to the decision of the horizontal execution nodes;
[0124] S5.3, the horizontal execution node uses the horizontal segmentation model to segment the network model corresponding to the video stream according to the horizontal segmentation point decision, and completes the horizontal execution of the horizontal execution network;
[0125] S5.4, the horizontal execution node transmits the network parameters after the horizontal execution to the vertical execution node corresponding to the decision of the vertical execution node.
[0126] S6, the vertical execution nodes use the vertical segmentation algorithm to vertically segment the vertical execution network, that is, the target recognition of MTMCT is completed, including the following steps:
[0127] S6.1, dividing the neural network of the longitudinal execution network into l*l fusion regions according to the l*l grid method;
[0128] S6.2, using regression function to build a longitudinal execution network The relationship between the input and output of the network parameters is the corresponding expression of the camera d m The video stream detection task is executed vertically at the node Execution time on The calculation formula is:
[0129]
[0130] In the formula, Represents the lateral execution network Execute nodes in the horizontal The intermediate parameters output after execution are the regression pseudo parameters of the longitudinal network execution time. Represents the vertical segmentation network Execute nodes vertically The regression fitting parameters of the output parameters after the execution is completed, Represents the vertical execution network The regression fitting parameters of the parameters, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network Execute nodes vertically Output parameters after execution. Represents the vertical execution network Execute nodes vertically The constant term parameter of the regression fit on Indicates vertical execution node The computing power of Representation calculation The required computing power regression fitting function, express The regression fitting parameters are Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network network parameters.
[0131] S6.3, each vertical execution node The parameters received from the horizontal execution nodes are calculated in parallel, and the calculated results are merged and output using a fully connected layer.
[0132] In S7, the cloud receives the target recognition results from each vertical execution node, uses the DeepSort trajectory matching algorithm to complete cross-camera trajectory matching, and finally obtains the cross-camera multi-target tracking results.
[0133] This application regresses and fits the computing resources of the camera, edge device, and cloud respectively to obtain the corresponding dynamic environment representation. Then, in the online decision-making stage, the segmentation point decision will be made through multiple agents based on the real dynamic network environment and user needs, and the segmentation result will be finally obtained. The following explains the necessity of performing device decision model reasoning using segmentation points across cameras:
[0134] like Figure 1 As shown, multiple cameras start working and continue to generate video streams. The camera requests to offload the video tracking task to the base station or cloud node. According to the decision result of MADRL, the camera offloads the first part of the task to the horizontal execution node. The node saves the pre-configuration file of the model, performs horizontal segmentation of the model and performs horizontal processing tasks. After that, the horizontal execution node needs to transmit the intermediate parameters to the node that performs the vertical segmentation. The vertical execution node accepts the intermediate parameters of the network and performs vertical model segmentation and network parallel calculation according to the pre-configuration file. The final target recognition result is uploaded and stored in the cloud center. The cloud center uses the DeepSort trajectory matching algorithm to first track and identify a single camera inside the camera. After multiple cameras complete the target recognition task, the cloud center completes the trajectory analysis and recognition between multiple cameras, and finally obtains the tracking result. It can be seen that in this process, the communication, computing, and cache resources of the base station, that is, the edge and cloud systems are all called. Therefore, in this process, this application is needed to realize the joint allocation of these three-dimensional resources.
[0135] In order to demonstrate the superiority of this application in the collaborative multi-task flow scenario, Figure 7 As shown, the greedy algorithm and the random algorithm are compared with the present application. The Epsilon-Greedy algorithm makes the best decision based on the current task, resource availability, and delay constraints. The discount factor and minimum greedy rate of its greedy rate are 0.0001 and 0.3, respectively. The random algorithm makes random decisions without considering the collaborative relationship between edge devices. The MTMCT system requires collaborative cross-camera tracking, and the long time difference in task processing between cameras will lead to the loss and duplication of tracking targets. Therefore, based on the user-defined time threshold ρ, we designed a metric to determine the success rate of collaboration between tasks. As can be seen from the figure, the collaboration rate of DDQN gradually increases and converges, and finally meets the collaboration time requirements proposed by the user, while the collaboration rate of the greedy algorithm finally fluctuates only around 0.4, thus proving the collaborative superiority of the present application for cross-camera tracking collaborative systems.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning, characterized in that: The steps include: S1, build a video surveillance system including monitoring terminals, base stations and cloud; S2, using horizontal segmentation and vertical segmentation algorithms to establish a horizontal segmentation model based on a deep neural network, wherein the output of the horizontal segmentation model includes a horizontal execution network and a vertical execution network; S3, constructing the horizontal segmentation point decision, horizontal execution node decision, and vertical execution node decision of the horizontal segmentation model into a Markov decision process; S4, the cloud uses DDQN's multi-agent deep reinforcement learning algorithm and builds a split point execution device decision model with minimizing the task processing time difference as the objective function; S5, each monitoring terminal inputs the generated video stream into the split point execution device decision model respectively, and uploads the video stream to the corresponding horizontal execution node according to the horizontal execution node decision generated by the split point execution device decision model. The horizontal execution node uses the horizontal segmentation model to complete the horizontal segmentation and execution of the model, and sends the network parameters after the horizontal execution to the corresponding vertical execution node; S6, the vertical execution nodes respectively use the vertical segmentation algorithm to vertically segment and execute their respective vertical execution networks according to the vertical execution node decisions generated by the segmentation point execution device decision model; S7, the cloud receives the execution results from each vertical execution node and uses the trajectory matching algorithm to complete the cross-camera trajectory matching.
2. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 1 is characterized in that: The step S2 comprises the following steps: S2.1, construct the deep neural network model as a directed acyclic graph; S2.2, using the depth-first algorithm to obtain the longest path from the input layer to the output layer in the deep neural network model; S2.3, using the horizontal segmentation algorithm to split the longest path obtained in step S2.2 into a horizontal execution network and vertical execution network The Horizontal Execution Network and vertical execution network The expression of the network parameters is: In the formula, the value of n is 0 or 1. When n=0, Indicates the horizontal segmentation point p h The split horizontal execution network The network parameters, when n = 1, Indicates the horizontal segmentation point p h The split vertical execution network The network parameters, Resunit network structure at the horizontal split point p h The divided The proportion of the number of network layers in the network, ω Resunit Parameters representing the Resunit network structure, Indicates CBL conv+bn+leakyRelu The network structure is at the horizontal split point p h The divided The proportion of the number in the network, ω CBL Indicates CBL conv+bn+leakyRelu The parameters of the network structure, Indicates CBM conv+bn+mish The network structure is at the horizontal split point p h The divided The proportion of the number in the network, ω CBM Indicates CBM conv+bn+mish Parameters of the network structure.
3. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 1 is characterized in that: The step S3 comprises the following steps: S3.1, construct the state space, which is expressed as: In the formula, Indicates execution of camera d m The execution time of the video stream detection task is Indicates camera d m The video stream detection task is executed on the node and execution nodes The transmission delay between Indicates camera d m The video stream detection task is executed on the node The execution time on Indicates camera d m The video stream detection task is executed on the node The waiting time on Indicates that the base station and the cloud are in addition to the camera d m The state affected by other intelligent agents other than the daemon includes the number of tasks waiting to be executed in the base station and the cloud, the task volume, and the estimated completion time of the current task. m Indicates camera d m The horizontal segmentation point of the network corresponding to the video stream, Indicates camera d m The state at time t, ε represents the set of base stations, Represents cloud, A collection of monitoring terminals; S3.2, construct the action space, which is expressed as: In the formula, Indicates camera d m Action at time t; S3.3, construct the reward function, which is expressed as: In the formula, μ represents the penalty weight, ρ represents the tolerance of the maximum time difference for all cameras to complete the detection task at time t, and Z represents the maximum time tolerance for completing the detection task of a single camera. represents the action space of camera d0 at time t, Indicates camera d M-1 In the action space at time t, represents the state space of camera d0 at time t, Indicates camera d M-1 In the state space at time t, Indicates camera d m The reward function at time t is Indicates execution of camera d m The longest execution time of the video stream detection task, Indicates execution of camera d m The shortest execution time of the detection task of the video stream.
4. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 3 is characterized in that: In step S3.1, the camera d m The execution time of the video stream detection task The calculation formula is: In the formula, Indicates camera d m The video stream detection task is executed vertically at the node The execution time on Indicates camera d m The video stream is transmitted to the horizontal execution node transmission delay.
5. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 4 is characterized in that: The camera d m The video stream detection task is executed on the horizontal node Waiting time on The calculation formula is: In the formula, Indicates camera d m′ The video stream detection task is transmitted to the horizontal execution node The transmission delay of is the indicator function.
6. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 4 is characterized in that: The camera d m The video stream is transmitted to the horizontal execution node Transmission delay The calculation formula is: In the formula, Indicates camera d m Horizontal execution nodes The bandwidth speed between m Indicates camera d m The actual amount of data transmitted per second for the video stream.
7. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 3 is characterized in that: The camera d m The video stream detection task is executed on the horizontal node Execution time on The calculation formula is: In the formula, Indicates camera d m The video stream corresponds to the regression parameters of the execution time, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution. express The regression parameters corresponding to the execution time, Represents the lateral execution network The parameters of correspond to the regression parameters of the execution time, Represents the lateral execution network Execute nodes in the horizontal The regression parameters on represents the constant term for the execution time regression fit, K m Indicates camera d m The actual amount of data transmitted per second in the video stream. Indicates a horizontal execution node The computing power of For calculation The required computing power regression fitting function, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network network parameters.
8. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 3 is characterized in that: The camera d m The video stream detection task is executed horizontally on the nodes and vertical execution nodes The transmission delay between The calculation formula is: In the formula, Indicates a horizontal execution node and vertical execution nodes The bandwidth speed between Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution.
9. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 1 is characterized in that: In step S4, the expression of the objective function is: Where, T Total represents the maximum processing time difference of the video detection task periodically generated by the camera cluster, P represents the horizontal segmentation point set of the deep neural network model, Y0 represents the horizontal execution node set of the horizontal execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P, Y1 represents the vertical execution node set of the vertical execution network segmented by each horizontal segmentation point in the horizontal segmentation point set P, ρ represents the tolerance of the maximum time difference for all cameras to complete the detection task at time t, Indicates execution of camera d m The longest execution time of the video stream detection task, Indicates the shortest execution time of the detection task of the video stream of camera dm. A collection of monitoring terminals.
10. The method for establishing a distributed real-time intelligent monitoring system based on intelligent collaborative reasoning according to claim 1, characterized in that: The step S6 comprises the following steps: S6.1, divide the vertical execution network into l*l fusion regions according to the l*l grid method; S6.2, using the regression function to construct the relationship between the network parameters, input and output of the longitudinal execution network, the corresponding expression is: In the formula, Represents the lateral execution network Execute nodes in the horizontal The intermediate parameters output after the execution is completed and the regression fitting parameters of the longitudinal execution network execution time, Represents the vertical execution network Execute nodes vertically The regression fitting parameters of the output parameters after the execution is completed, Represents the vertical execution network The regression fitting parameters of the parameters, Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network Execute nodes vertically Output parameters after execution. Represents the vertical execution network Execute nodes vertically The constant term parameter of the regression fit on Indicates vertical execution node The computing power of Representation calculation The required computing power regression fitting function, express The regression fitting parameters are Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split vertical execution network The network parameters, Indicates camera d m The video stream detection task is executed vertically at the node The execution time on Indicates camera d m The horizontal segmentation point p of the network corresponding to the video stream detection task m The split horizontal execution network Execute nodes in the horizontal Output parameters after execution; S6.3, each vertical execution node The received vertical execution networks are calculated in parallel and the calculated results are merged and output.
