A multi-agent collaborative perception method, system, electronic device and storage medium

By generating a matching score matrix and a weighted fusion feature map, the communication between agents is optimized, solving the problem of low communication efficiency in the existing technology, and achieving the effect of improving communication efficiency while ensuring perceptual performance.

CN116760536BActive Publication Date: 2024-09-27TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310717887.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2024-09-27
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

Existing collaborative sensing solutions are difficult to improve communication efficiency while ensuring the sensing performance of agents, especially when edge computing devices are deployed and put online.

Method used

By generating local query vectors and local key vectors, exchanging and generating matching score matrices to determine communication groups, performing weighted fusion of intermediate features, and combining teacher model feature maps for model training and knowledge distillation, the communication between agents is optimized.

Benefits of technology

On the premise of ensuring the perception performance of the agent, it improves communication efficiency and reduces communication bandwidth occupation. It is suitable for scenarios such as drone groups and industrial robots, and enhances the overall accuracy of perception tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116760536B
    Figure CN116760536B
Patent Text Reader

Abstract

The present application discloses a multi-agent collaborative perception method, system, electronic device and storage medium, and the technical field to which it belongs is collaborative perception technology. The multi-agent collaborative perception method includes: generating a local query vector and a local key vector according to the target data obtained by the target agent, sending the local query vector to other agents and receiving external query vectors generated by other agents; generating a matching score matrix and determining the communication group of the target agent; weighted fusion of the intermediate features of the target agent and other agents to obtain a student model feature map; model training and knowledge distillation of the target agent according to the student model feature map and the teacher model feature map; if a downstream task execution instruction is received, the target agent is controlled to perform collaborative perception with other agents in the communication group to complete the downstream task. The present application can improve communication efficiency while ensuring the agent perception performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of collaborative perception technology, and in particular to a multi-agent collaborative perception method, system, electronic device and storage medium. Background Art

[0002] Communication is an effective mechanism for coordinating multiple agents. In the fields of unmanned systems, robots, and multi-agent reinforcement learning, agents can improve the overall learning performance and achieve their goals through communication. Collaborative perception technology can enable multiple agents to complement each other's perceived information through communication, promote more comprehensive perception, fundamentally overcome the inevitable problems of single-agent perception such as occlusion and long distance, and improve the overall accuracy of perception tasks. It has certain application value in the fields of autonomous driving and drone swarms.

[0003] Most of the existing collaborative perception solutions collaborate at the level of raw data or perception results. Early communication collaboration at the raw data level requires a large amount of communication bandwidth. Although late communication collaboration at the perception result level solves the problem of communication bandwidth occupation, it will inevitably generate noise that affects the output of the fusion results. Moreover, the trained communication-based intelligent downstream task model has a large number of parameters, which puts great pressure on the deployment and launch of edge computing devices.

[0004] Therefore, how to improve communication efficiency while ensuring the perception performance of the intelligent agent is a technical problem that technical personnel in this field currently need to solve. Summary of the invention

[0005] The purpose of this application is to provide a multi-agent collaborative perception method, system, electronic device and storage medium, which can improve communication efficiency while ensuring the perception performance of the intelligent agents.

[0006] In order to solve the above technical problems, the present application provides a multi-agent collaborative perception method, which includes:

[0007] Generate a local query vector and a local key vector according to the target data acquired by the target agent, send the local query vector to other agents and receive external query vectors generated by the other agents;

[0008] Generate a matching score matrix according to the local query vector, the local key vector and the external query vector, and determine the communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents;

[0009] Performing weighted fusion on the intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph;

[0010] Model training and knowledge distillation are performed on the target agent according to the student model feature graph and the teacher model feature graph; wherein the teacher model feature graph includes intermediate features obtained by the teacher model after collaborative perception from the original data level through an encoder, and the original data is a concatenation result of data obtained by the target agent and all the other agents at the same time;

[0011] If a downstream task execution instruction is received, the target agent is controlled to perform collaborative perception with other agents in the communication group in order to complete the downstream task.

[0012] Optionally, generating a matching score matrix according to the local query vector, the local key vector, and the external query vector includes:

[0013] Calculating a similarity matching function on the local query vector and the local key vector to obtain a self-matching score of the target intelligent agent;

[0014] Calculating a similarity matching function on the external query vector and the local key vector to obtain a connection weight between the target agent and the other agents;

[0015] The matching score matrix is ​​generated according to the self-matching score and the connection weight based on the self-attention mechanism.

[0016] Optionally, determining the communication group of the target agent according to the matching score matrix includes:

[0017] The matching score matrix is ​​pruned using an activation function, and a communication group is constructed according to the pruned matching score matrix.

[0018] Optionally, before sending the local query vector to other agents, the method further includes:

[0019] The local query vector is compressed into a vector of a preset dimension.

[0020] Optionally, performing model training and knowledge distillation on the target agent according to the student model feature graph and the teacher model feature graph includes:

[0021] Calculate the knowledge distillation loss according to the student model feature map and the teacher model feature map;

[0022] Calculating downstream task losses for the target agent and the teacher model;

[0023] A total loss function is determined according to the knowledge distillation loss and the downstream task loss, and the total loss function is used to perform model training and knowledge distillation on the target intelligent agent.

[0024] Optionally, before weighted fusion of the intermediate features of the target agent and other agents in the communication group, the method further includes:

[0025] The target data is encoded using an image encoder in the target agent to obtain intermediate features.

[0026] Optionally, controlling the target agent to perform collaborative perception with other agents in the communication group includes:

[0027] Extracting intermediate features of current data using the target agent;

[0028] The intermediate features of the current data are sent to other agents in the communication group, and data sent by other agents in the communication group are received.

[0029] The present application also provides a multi-agent collaborative perception system, the system comprising:

[0030] A vector interaction module, configured to generate a local query vector and a local key vector according to target data acquired by a target agent, send the local query vector to other agents, and receive external query vectors generated by the other agents;

[0031] A group determination module, configured to generate a matching score matrix according to the local query vector, the local key vector and the external query vector, and determine a communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents;

[0032] A feature graph generation module, used for weighted fusion of intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph;

[0033] A training module, used for performing model training and knowledge distillation on the target agent according to the student model feature map and the teacher model feature map; wherein the teacher model feature map includes intermediate features obtained by the teacher model after collaborative perception from the original data level through the encoder, and the original data is the splicing result of the data obtained by the target agent and all the other agents at the same time;

[0034] The collaborative perception module is used to control the target intelligent agent to perform collaborative perception with other intelligent agents in the communication group if a downstream task execution instruction is received, so as to complete the downstream task.

[0035] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps of the multi-agent collaborative perception method described above are implemented.

[0036] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the multi-agent collaborative perception method are implemented.

[0037] The present application provides a multi-agent collaborative perception method, which includes: generating a local query vector and a local key vector according to target data obtained by a target agent, sending the local query vector to other agents and receiving external query vectors generated by the other agents; generating a matching score matrix according to the local query vector, the local key vector and the external query vector, and determining the communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents; weighted fusion of the intermediate features of the target agent and other agents in the communication group to obtain a student model feature map; model training and knowledge distillation of the target agent according to the student model feature map and the teacher model feature map; wherein the teacher model feature map includes the intermediate features obtained by the teacher model after collaborative perception from the original data level through the encoder, and the original data is the splicing result of the data obtained by the target agent and all the other agents at the same time; if a downstream task execution instruction is received, the target agent is controlled to perform collaborative perception with other agents in the communication group to complete the downstream task.

[0038] In the present application, the target agent exchanges external query vectors with other agents, generates a matching score matrix based on the local query vector, the local key vector and the external query vector, and determines the communication group of the target agent according to the connection weights between the agents recorded in the matching score matrix. The target agent can obtain a student model feature graph by performing a weighted fusion operation of intermediate features with other intelligent models in the communication group, and perform model training and knowledge distillation based on the student model feature graph and the teacher model feature graph, so that the target agent can efficiently select other important agents for collaborative perception during communication, and then complete downstream tasks. The present application can improve communication efficiency while ensuring the perception performance of the agent. The present application also provides a multi-agent collaborative perception system, a storage medium and an electronic device, which have the above-mentioned beneficial effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 A flowchart of a multi-agent collaborative perception method provided in an embodiment of the present application;

[0041] Figure 2 A model framework diagram of knowledge distillation provided in an embodiment of the present application;

[0042] Figure 3 A flowchart of a training phase algorithm provided in an embodiment of the present application;

[0043] Figure 4 A flowchart of a test phase algorithm provided in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of the structure of a multi-agent collaborative perception system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] With the development of the artificial intelligence industry, the field of multi-agent collaborative perception has also been continuously promoted, and the communication details between agents have been widely studied in the new technical context. In terms of multi-agent communication, the existing optimization methods can be mainly divided into the study of communication specifications and communication content. On the one hand, the full cooperation task is completed through continuous communication, and the communication protocol between agents is learned in a deep learning way; on the other hand, the attention unit is used to determine the content of the information to be sent by the sender and the object to be prepared to receive the information, thereby improving the perception performance and communication efficiency of the multi-agent itself.

[0047] See below Figure 1 , Figure 1 A flowchart of a multi-agent collaborative perception method provided in an embodiment of the present application.

[0048] Specific steps may include:

[0049] S101: Generate a local query vector and a local key vector according to target data acquired by a target agent, send the local query vector to other agents, and receive external query vectors generated by the other agents;

[0050] Among them, this embodiment can be applied to electronic devices such as drones, industrial robots, and environmental monitoring equipment that include target intelligent agents. There are multiple electronic devices in the target area, and the agents in each electronic device can complete downstream tasks through collaborative perception. If the device where the target intelligent agent is located is a drone, the target data obtained by the target intelligent agent can be an environmental image taken by a camera; if the device where the target intelligent agent is located is an industrial robot, the target data obtained by the target intelligent agent can be a material transportation image taken by a camera; if the device where the target intelligent agent is located is an environmental monitoring device, the target data obtained by the target intelligent agent can be the temperature and humidity collected by the temperature and humidity sensor.

[0051] The target agent may include a query generator and a key generator. After the target agent obtains the target data, the target data may be input into the query generator to obtain a local query vector, and the target data may be input into the key generator to obtain a local key vector. This embodiment also sends the local query vector to other agents and receives external query vectors sent by other agents. This embodiment refers to the query vector generated by other agents based on the data collected by themselves as an external query vector.

[0052] S102: generating a matching score matrix according to the local query vector, the local key vector and the external query vector, and determining a communication group of the target intelligent agent according to the matching score matrix;

[0053] After obtaining the external query vector sent by other agents, the local key vector can be respectively calculated with the local query vector and each external query vector to calculate the connection weight, thereby obtaining a matching score matrix, which is used to describe the connection weight between any two agents. In this embodiment, the matching score matrix can also be pruned according to the connection weight, and the items in the pruned matching score matrix are used to construct a communication group. The communication group is used to describe other agents that can communicate with the target agent for collaborative perception.

[0054] S103: performing weighted fusion on the intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph;

[0055] Among them, after obtaining the communication group, the target intelligent agent can obtain the intermediate features of other intelligent agents in the communication group, and weightedly fuse the intermediate features of the target intelligent agent and the intermediate features of other intelligent agents to obtain the student model feature map. The weight coefficient of the above-mentioned weighted fusion operation is determined according to the connection weight, and the above-mentioned intermediate features can be obtained by encoding the input data by the encoder in the intelligent agent. In this embodiment, the target intelligent agent is regarded as the student model in the knowledge distillation process, so the intermediate features after weighted fusion become the student model feature map.

[0056] S104: Performing model training and knowledge distillation on the target agent according to the student model feature graph and the teacher model feature graph;

[0057] Before this step, there may be an operation of training the teacher model. The data obtained by the target intelligent agent and all other intelligent agents at the same time may be spliced ​​to obtain the original data. The teacher model performs collaborative perception from the above-mentioned original data level and processes the encoder to obtain intermediate features, and then generates a teacher model feature map based on all the obtained intermediate features.

[0058] The teacher model performs fully connected communication at the original data level. The intermediate features extracted by the teacher model contain the feature information from the perspective of each agent. The intermediate features are used to supervise the communication feature splicing results of the student model based on the self-attention mechanism. It is hoped that some individual and common features reflected by the teacher model can be extracted during the feature generation process of the student model, and the communication model between multi-agent systems can be better trained by constraining the student model by the teacher model.

[0059] Based on the obtained student model feature graph and teacher model feature graph, the target agent can be trained and knowledge distilled using the student model feature graph and teacher model feature graph to adjust the model parameters of the target agent. After the training of the target agent, it can be deployed on drones, industrial robots and other equipment for application.

[0060] S105: If a downstream task execution instruction is received, the target agent is controlled to perform collaborative perception with other agents in the communication group so as to complete the downstream task.

[0061] Among them, after the target intelligent agent is trained, if it receives a downstream task execution instruction, it can control the target intelligent agent and other intelligent agents in the communication group to perform collaborative perception, so that data can be transmitted between the target intelligent agent and other intelligent agents, thereby completing downstream tasks (such as flight missions, material transportation tasks, temperature and humidity calculation tasks, etc.).

[0062] In this embodiment, the target agent exchanges external query vectors with other agents, generates a matching score matrix based on the local query vector, the local key vector and the external query vector, and determines the communication group of the target agent according to the connection weights between the agents recorded in the matching score matrix. The target agent can obtain a student model feature graph by performing a weighted fusion operation of intermediate features with other intelligent models in the communication group, and perform model training and knowledge distillation based on the student model feature graph and the teacher model feature graph, so that the target agent can efficiently select other important agents for collaborative perception during communication, thereby completing downstream tasks. This embodiment can improve communication efficiency while ensuring the perception performance of the agent.

[0063] As for Figure 1 Further introduction to the corresponding embodiment can generate a matching score matrix for the target intelligent agent in the following manner: calculate the similarity matching function of the local query vector and the local key vector to obtain the self-matching score of the target intelligent agent; calculate the similarity matching function of the external query vector and the local key vector to obtain the connection weights between the target intelligent agent and the other intelligent agents; generate the matching score matrix according to the self-matching score and the connection weights based on the self-attention mechanism.

[0064] Furthermore, Figure 1 The corresponding embodiment may also utilize an activation function to prune the matching score matrix, and construct a communication group according to the pruned matching score matrix.

[0065] As for Figure 1 Further introduction to the corresponding embodiment, in order to reduce the bandwidth occupied by data transmission between agents, the local query vector can also be compressed into a vector of preset dimension before sending the local query vector to other agents. The size of the local key vector can be transformed from 256*4*4 to 1*1024 through a matrix through a neural network, thereby saving space.

[0066] As for Figure 1 Further introduction to the corresponding embodiment can be performed on the target intelligent agent through model training and knowledge distillation in the following manner: calculating the knowledge distillation loss based on the student model feature map and the teacher model feature map; calculating the downstream task loss of the target intelligent agent and the teacher model; determining the total loss function based on the knowledge distillation loss and the downstream task loss, and using the total loss function to perform model training and knowledge distillation on the target intelligent agent.

[0067] As for Figure 1As a further introduction to the corresponding embodiment, before weighted fusion of the intermediate features of the target agent and other agents in the communication group, the target data may be encoded using an image encoder in the target agent to obtain intermediate features.

[0068] As for Figure 1 Further introduction to the corresponding embodiment can control the target intelligent agent and other intelligent agents to perform collaborative perception in the following manner: use the target intelligent agent to extract intermediate features of current data; send the intermediate features of the current data to other intelligent agents in the communication group, and receive data sent by other intelligent agents in the communication group.

[0069] The process described in the above embodiment is explained below through an embodiment in actual application.

[0070] In the search and rescue missions of maritime drones and unmanned boats, they are usually limited by size and energy storage and cannot carry large sensing equipment. At this time, the collaborative perception of the multi-agent system can greatly improve the overall perception capability of the rescue and maintain the effectiveness of the search and rescue system when some machines cannot work properly. Communication issues, as the key to multi-agent collaborative perception, inevitably lead to a trade-off between perception performance and communication bandwidth.

[0071] Existing research on communication issues in multi-agent collaborative perception can be divided into two categories: 1) The choice of communication specifications or protocols, that is, the problem of communication methods. Most rules in multi-agent collaborative perception problems are implemented through predefined communication protocols, which rely more on researchers' empirical assumptions about actual application scenarios. Fully connected communication methods will cause high usage of network bandwidth and overload hardware devices. 2) The choice of communication content. After determining the communication protocol, if all information can be shared, the effect of complete information game can be achieved, but this often leads to network congestion and delays.

[0072] This embodiment provides a multi-agent collaborative perception solution based on communication optimization. This embodiment optimizes the training process of multi-agent collaborative perception, adopts a knowledge distillation model framework, and applies a teacher model for collaborative training at the early data level to guide the collaboration of different agents at the intermediate data level. On the one hand, it can compress the size of the model so that the small models deployed online by different agents can obtain the generalization ability of the teacher model; on the other hand, it retains the uniqueness of each student model for data input from different perspectives, better trains the attention connection weight matrix between different agents, promotes data fusion at the feature level, and improves communication efficiency.

[0073] See also Figure 2 , Figure 2A model framework diagram of knowledge distillation provided for an embodiment of the present application, showing a teacher model and a student model, the teacher model can use an encoder to extract intermediate features from the spliced ​​raw data, the student model can use an encoder to extract intermediate features from the respective collected data, the student model can be implemented based on a self-attention mechanism (including requesters and providers), and the student model also includes an encoder, a generator (i.e., a query generator, a key generator) and a decoder; in the above model, the student model can be trained by knowledge distillation, and the loss function used in the training process includes the loss function of the distillation process and the loss function of each agent. The multi-agent communication model established in this embodiment optimizes the parameter training process, proposes a teacher-student framework, and trains the model through knowledge distillation. The teacher model uses early data collaboration and overall view input, and the student model uses intermediate input based on a single view. In the reasoning process, only the student model needs to be used. Due to the teacher-student framework, the student model trained by each agent can assume the performance of the teacher model from a holistic perspective by communicating complementary information.

[0074] Figure 2 formula The A in ξ represents the aggregation operation, i.e., dimension connection; i and x i represents the perspective encoding and input image of agent i, Aggregation represents the aggregation formula, and X represents the aggregation result. Represents the intermediate features obtained by the encoder and convolutional neural network in the teacher model; Θ t represents the neural network parameters of the intermediate features extracted from the teacher model after passing through the encoder; Ψ t L represents the decoder of the teacher model. kd represents the loss function of the distillation process (knowledge distillation loss), L det represents the loss function of each agent (downstream task loss), key represents the key vector, query represents the query vector, and Attention score represents the attention score. The encoder, generator, and decoder are also shown in the figure. It represents the intermediate features obtained in the student model after passing through the encoder and then the convolutional neural network. The superscript s represents the student model (student).

[0075] The description of the agent's communication optimization based on the self-attention mechanism is as follows:

[0076] In order to reduce the complexity of the network and bandwidth usage, a three-phase handshake communication method is first applied to determine the weights of the connections between agents, and then an activation function is used to further prune less important connections. The three-phase handshake communication mechanism includes three stages: request, matching, and selection. First, agent i selects the agent based on its own observed data x.i Generate query vector query and key vector key.

[0077]

[0078] Among them, μ i represents the query vector generated by agent i, κ i represents the key vector generated by agent i, G q is a q Parameterized query builder, θ q represents the neural network parameters of the query generator, Q represents the dimension of the query vector, G k is given by θ k Parameterized key generator, θ k represents the neural network parameters of the key generator, and K represents the dimension of the key vector. In this embodiment, i and j represent agent numbers. This embodiment can further broadcast the query to all other agents and calculate the connection weight m between agent i and agent j according to the similarity matching function Φ i,j , κ j Represents the key vector generated by agent j:

[0079]

[0080] At the same time, calculate its own matching score m according to this function i,i :

[0081] m i,i =Φ(μ i , κ i ); (3)

[0082] To reduce bandwidth usage during information transmission, an asymmetric messaging method is used in the calculation step of the matching function, which compresses the query vector query into a very low-dimensional vector (transmitted) while keeping the key vector key (not transmitted) large. After the communication, the relevance score is calculated:

[0083]

[0084] Where T represents vector transpose, is a learnable parameter used to match the query and key sizes, Q and K are the query and key dimensions, respectively. The matching score matrix M is generated based on the above self-attention mechanism, where σ(·) is a row-by-row softmax function and N represents the total number of agents.

[0085]

[0086] In order to prune unnecessary communication relationships to build a communication group, this embodiment can use an activation function to prune the M matrix. After the communication group is established, each agent can perform its own downstream tasks based on its own observed data and the data obtained through communication. The above-mentioned data obtained through communication refers to the intermediate features f obtained by each agent after feature extraction by the encoder. j , the content of the communication is the intermediate feature f of each agent j , for the part of the matching score matrix M based on the attention score that is pruned away, no communication is required, and the retained part of M is weighted fused to obtain f i , that is, the intermediate-level feature fusion result. The matching score matrix M matrix is ​​a matrix that represents the attention scores of the agents between each other. After passing through the softmax function, each row of the matrix represents the normalized probability of the attention score. Pruning the M matrix can select individuals with high probability for feature dimension communication, thereby reducing the communication bandwidth. In this embodiment, 1 / N can be selected as the hyperparameter δ, where N is the number of agents in the system, and the items less than δ in the M matrix are set to 0, and then the softmax function is re-performed row by row to obtain the normalized probability. The pruned M can be regarded as the adjacency matrix of a directed graph, where the diagonal elements of the matrix indicate when to communicate (a probability of 1 indicates that no communication is required), the non-diagonal elements indicate who to communicate with, each row of the matrix indicates how the requester receives information from different agents, and each column of the matrix indicates how a supporter sends his information to different request agents. After obtaining the final M matrix, the intermediate features of the agents that constitute the communication group are dimensionally spliced ​​to obtain the label information of the student model task.

[0087]

[0088] Where D is given by θ d Parameterized perceptual task decoder, is located in the matrix The elements of the i-th and j-th rows of is the M matrix after pruning, f i =E(x i θ e ) is the feature map of agent i encoded by the image encoder E, f j is the feature map of agent j encoded by the image encoder E, x i The original image with finger input, θ e is the neural network parameter of the encoder for feature extraction of the original image, [·;·] is the cascade operation along the channel dimension, Refers to the result output of each agent after passing through the decoder, f iinf It refers to the result of weighted processing of the intermediate feature graphs of other agents obtained through communication according to the trimmed M matrix, θ d Represents the neural network parameters that make up the decoder. To train the model, the labels of downstream tasks (such as segmentation masks) are used during training. i As supervision, the loss function L during training is calculated as:

[0089]

[0090] where H(·,·) can be the objective function of any downstream vision task (e.g., pixel-wise cross entropy for segmentation tasks or cross entropy for recognition tasks), y j is the final output of the student model. is the label information of the student model task (used to update the parameters of the neural network through training). After that, the weight of the model is updated in an end-to-end manner using the above loss θ = (θ k ,θ q ,θ e ,θ d ), θ k represents the neural network parameters of the generator that generates the key vector, θ q Represents the neural network parameters of the generator that generates the query vector.

[0091] The knowledge distillation optimization method in this embodiment is designed as follows:

[0092] The teacher model uses the cooperation of early data to encode and integrate the images obtained by multiple agents at the same time to ensure the integrity of spatial information, and guide the student model to perform collaborative perception at the feature level. The teacher model and the student model are shared by all agents. After the teacher model completes feature extraction through multi-view input, the intermediate feature can be used to calculate the KL divergence of the communication feature splicing result obtained by the student model as the second loss function of the model for fitting.

[0093] The student model consists of the following parts:

[0094] Feature encoding, whose function is to extract informative features from the raw metrics of each agent. The feature of the i-th agent is f i s ←Θ s (x i ), where Θ s (·) is the feature encoder, which is trained separately for each agent, and the superscript s reflects the student model. To save communication bandwidth, each agent can compress its feature map before transmission.

[0095] Communication Collaboration,In the communication stage, the self-attention method mentioned in the previous section is used to,construct a communication group.

[0096] Decode the output, use the fused features as the decoding object, and output the downstream task results.

[0097] The teacher model is similar to the student model, with feature encoders and decoders, but the original image data of different agents from different perspectives need to be integrated before training. In subsequent training, all agents share a teacher model to guide their downstream task training, but each agent is input with its own observed data.

[0098] In the system training and knowledge distillation part, the loss function L is designed S as follows:

[0099]

[0100] Downstream task loss L det Similar to the loss of the teacher model, it is mainly the cross entropy loss function, and the second term is mainly used as the loss of knowledge distillation to regularize the student model to generate results similar to the teacher model. i The final output result of the student model; Label information for student model tasks; The intermediate features obtained by concatenating the dimensions after the student model communication; It is the intermediate feature obtained by the teacher model after coordination from the original data level and passing through the encoder. kd To control the knowledge distillation loss L kd The hyperparameter, L kd The definition is as follows:

[0101]

[0102] Where D KL (p(x)||q(x)) represents the KL divergence (i.e., relative entropy) of the distributions p(x) and q(x), where p(x) and q(x) represent probability distributions. represents the resolution of the feature map, and σ(·) represents the softmax operation on the feature map output by the decoder.

[0103] See also Figure 3 , Figure 3A flowchart of a training phase algorithm provided for an embodiment of the present application, the training process includes: selecting a group of images taken by a group of drones at the same time, and determining whether it is a teacher network (ie, a teacher model). If it is a teacher network, it enters the multi-channel image input and UNet processing to determine whether it is a training process. If it is a training process, the loss loss is calculated to update the network parameters. If it is not a training process, the intermediate-level feature maps and segmentation result soft labels of different channels are obtained. If it is not a teacher network, it means that it is a student network (ie, an intelligent agent). Each encoder of each drone perspective can be used to obtain its own feature map, and the feature vectors after each communication are obtained based on the mutual attention mechanism. Feature-level knowledge distillation and each drone perspective decoder processing are performed to obtain the segmentation result, and the segmentation result is subjected to result-level knowledge distillation. The results of the feature-level knowledge distillation and the result-level knowledge distillation are added to calculate the loss loss respectively, and the network parameters are updated for different intelligent agents.

[0104] See also Figure 4 , Figure 4 A flowchart of a testing phase algorithm provided in an embodiment of the present application, the testing process includes: using each agent's respective encoder to generate its own feature map, communicating based on the mutual attention mechanism to obtain the feature vectors after each communication, and using each agent's respective decoder to obtain the segmentation result.

[0105] In the training phase: This embodiment first trains a teacher model, which is a model with multiple image channel input and multi-channel output. During the training process, the images input by multiple agents can be spliced ​​according to the RGB channel dimensions, and passed through the convolutional neural network to obtain an intermediate feature containing global information. Then, for the intermediate feature, UNet is used to extract features for each agent at the same time, and the intermediate features are weighted to obtain Decode them separately to get multiple output results.

[0106] In the process of training the student model, each agent trains a feature extractor to extract its own intermediate features f i , and train an extractor of query vector and key vector at the same time, which is used to perform small bandwidth communication first, obtain cross attention scores, and obtain M matrix. After performing softmax, pruning and other operations on M matrix, the communication group, that is, the communication object, can be determined. Through the self-attention mechanism, the intermediate features f of the intelligent agents that need to communicate are selected according to the attention scores. i Weighted, get the fused feature map of each agent Feature map obtained from the teacher model The loss function result of the distillation is calculated as the regularization term of the downstream task loss result, so that the feature extractor of each agent in the student model and the extractor of the query vector and key vector can better learn the global feature information of the teacher model, and obtain better results in the process of establishing the communication group (attention score M matrix) and feature fusion.

[0107] During the testing phase: the teacher model does not need to be involved. Each agent in the student model establishes a communication group (attention score M matrix) based on its own feature extractor and the extractor of the query vector and key vector to communicate and output its own downstream task results.

[0108] This embodiment proposes distributed communication optimization based on the knowledge distillation teacher-student framework, which communicates at the feature level of the intermediate data level with the idea of ​​centralized training and distributed execution. The communication model between the multi-agent system is better trained by constraining the student model by the teacher model. While compressing the downstream task models of different agents, the generalization performance of the teacher model is obtained and the characteristics of the input data from each perspective are retained, so that the student model can improve the task accuracy when performing downstream task reasoning under the same bandwidth usage.

[0109] In this embodiment, the teacher model adopts early collaboration based on the overall view input, and the student model adopts intermediate collaboration based on the single view input. The knowledge distillation-based framework optimizes the training of the multi-agent communication model by constraining the post-collaboration feature graph in the student model to match the corresponding relationship in the teacher model. Under the guidance of the output-level supervision of perception and the feature-level supervision of knowledge distillation, the distilled collaboration graph promotes better feature abstraction and aggregation, and improves the performance-bandwidth trade-off. In terms of modeling collaborative communication, this embodiment gives a connection weight matrix between different agents based on the self-attention mechanism to reflect the collaboration intensity between the multi-agent system. In the matrix, each element represents the mutual attention score between specific agents. This design allows agents to communicate adaptively and select appropriate partners to request supplementary information.

[0110] In the field of group control, multi-agent collaborative perception technology can be used for group control, such as drone formation flight. In this case, each drone can perceive the surrounding environment through sensors and plan and execute flight missions together with other drones. In the field of intelligent transportation, multi-agent collaborative perception technology can also be applied to intelligent transportation systems, such as urban traffic congestion monitoring and traffic flow optimization. By sensing the traffic and road conditions in the city through multiple agents, traffic congestion can be monitored in real time, and traffic flow can be optimized to improve road utilization and traffic efficiency.

[0111] In the process of industrial automation, multi-agent collaborative perception technology can also be applied to material transportation and collaborative work on the production line. Through equipment such as smart sensors and robots, multiple agents can perceive and collaborate to complete various tasks on the production line in real time.

[0112] For applications in environmental monitoring, multi-agent collaborative perception technology can also be applied to the field of environmental monitoring. For example, in weather forecasting, multiple sensors can be used to perceive weather changes, and collaborative computing can be used to improve forecast accuracy. Multi-agent collaborative perception technology can also be applied to intelligent target tracking systems. Through multiple agents sensing environmental changes, they can collaboratively complete tasks such as reconnaissance and target tracking, improving operational efficiency and accuracy.

[0113] See also Figure 5 , Figure 5 A schematic diagram of the structure of a multi-agent collaborative perception system provided in an embodiment of the present application; the system may include:

[0114] A vector interaction module 501 is used to generate a local query vector and a local key vector according to the target data acquired by the target agent, send the local query vector to other agents and receive external query vectors generated by the other agents;

[0115] A group determination module 502 is used to generate a matching score matrix according to the local query vector, the local key vector and the external query vector, and determine the communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents;

[0116] A feature graph generation module 503 is used to perform weighted fusion on the intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph;

[0117] A training module 504 is used to perform model training and knowledge distillation on the target agent according to the student model feature map and the teacher model feature map; wherein the teacher model feature map includes intermediate features obtained by the teacher model after collaborative perception from the original data level through the encoder, and the original data is the splicing result of the data obtained by the target agent and all the other agents at the same time;

[0118] The collaborative perception module 505 is used to control the target agent to perform collaborative perception with other agents in the communication group to complete the downstream task if a downstream task execution instruction is received.

[0119] In this embodiment, the target agent exchanges external query vectors with other agents, generates a matching score matrix based on the local query vector, the local key vector and the external query vector, and determines the communication group of the target agent according to the connection weights between the agents recorded in the matching score matrix. The target agent can obtain a student model feature graph by performing a weighted fusion operation of intermediate features with other intelligent models in the communication group, and perform model training and knowledge distillation based on the student model feature graph and the teacher model feature graph, so that the target agent can efficiently select other important agents for collaborative perception during communication, thereby completing downstream tasks. This embodiment can improve communication efficiency while ensuring the perception performance of the agent.

[0120] Furthermore, the process of the group determination module 502 generating a matching score matrix based on the local query vector, the local key vector and the external query vector includes: calculating the similarity matching function of the local query vector and the local key vector to obtain the self-matching score of the target intelligent agent; calculating the similarity matching function of the external query vector and the local key vector to obtain the connection weight between the target intelligent agent and the other intelligent agents; generating the matching score matrix based on the self-matching score and the connection weight based on the self-attention mechanism.

[0121] Furthermore, the process of the group determination module 502 determining the communication group of the target agent according to the matching score matrix includes: pruning the matching score matrix using an activation function, and constructing a communication group according to the pruned matching score matrix.

[0122] Furthermore, it also includes:

[0123] A compression module is used to compress the local query vector into a vector of a preset dimension before sending the local query vector to other agents.

[0124] Furthermore, the process of the training module 504 performing model training and knowledge distillation on the target intelligent agent according to the student model feature graph and the teacher model feature graph includes: calculating the knowledge distillation loss according to the student model feature graph and the teacher model feature graph; calculating the downstream task loss of the target intelligent agent and the teacher model; determining the total loss function according to the knowledge distillation loss and the downstream task loss, and using the total loss function to perform model training and knowledge distillation on the target intelligent agent.

[0125] Furthermore, it also includes:

[0126] The encoding module is used to encode the target data using the image encoder in the target intelligent agent to obtain the intermediate features before weighted fusion of the intermediate features of the target intelligent agent and other intelligent agents in the communication group.

[0127] Furthermore, the collaborative perception module 505 controls the target intelligent agent to perform collaborative perception with other intelligent agents in the communication group, including: using the target intelligent agent to extract intermediate features of current data; sending the intermediate features of the current data to other intelligent agents in the communication group, and receiving data sent by other intelligent agents in the communication group.

[0128] Since the embodiments of the system part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the system part, which will not be repeated here.

[0129] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0130] The present application also provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components.

[0131] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0132] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A multi-agent collaborative perception method, characterized in that: include: Generate a local query vector and a local key vector according to the target data acquired by the target agent, send the local query vector to other agents and receive external query vectors generated by the other agents; Generate a matching score matrix according to the local query vector, the local key vector and the external query vector, and determine the communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents; Performing weighted fusion on the intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph; Model training and knowledge distillation are performed on the target agent according to the student model feature graph and the teacher model feature graph; wherein the teacher model feature graph includes intermediate features obtained by the teacher model after collaborative perception from the original data level through an encoder, and the original data is a concatenation result of data obtained by the target agent and all the other agents at the same time; If a downstream task execution instruction is received, the target agent is controlled to perform collaborative perception with other agents in the communication group in order to complete the downstream task.

2. The multi-agent collaborative perception method according to claim 1, characterized in that: Generating a matching score matrix according to the local query vector, the local key vector and the external query vector includes: Calculating a similarity matching function on the local query vector and the local key vector to obtain a self-matching score of the target intelligent agent; Calculating a similarity matching function on the external query vector and the local key vector to obtain a connection weight between the target agent and the other agents; The matching score matrix is ​​generated according to the self-matching score and the connection weight based on the self-attention mechanism.

3. The multi-agent collaborative perception method according to claim 1, characterized in that: Determining a communication group of the target agent according to the matching score matrix includes: The matching score matrix is ​​pruned using an activation function, and a communication group is constructed according to the pruned matching score matrix.

4. The multi-agent collaborative perception method according to claim 1, characterized in that: Before sending the local query vector to other agents, the method further includes: The local query vector is compressed into a vector of a preset dimension.

5. The multi-agent collaborative perception method according to claim 1, characterized in that: The target agent is subjected to model training and knowledge distillation according to the student model feature graph and the teacher model feature graph, including: Calculate the knowledge distillation loss according to the student model feature map and the teacher model feature map; Calculating downstream task losses for the target agent and the teacher model; A total loss function is determined according to the knowledge distillation loss and the downstream task loss, and the total loss function is used to perform model training and knowledge distillation on the target intelligent agent.

6. The multi-agent collaborative perception method according to claim 1, characterized in that: Before weighted fusion of the intermediate features of the target agent and other agents in the communication group, the method further includes: The target data is encoded using an image encoder in the target agent to obtain intermediate features.

7. The multi-agent collaborative perception method according to claim 1, characterized in that: Controlling the target intelligent agent to perform collaborative perception with other intelligent agents in the communication group includes: Extracting intermediate features of current data using the target agent; The intermediate features of the current data are sent to other agents in the communication group, and data sent by other agents in the communication group are received.

8. A multi-agent collaborative perception system, characterized in that: include: A vector interaction module, configured to generate a local query vector and a local key vector according to target data acquired by a target agent, send the local query vector to other agents, and receive external query vectors generated by the other agents; A group determination module, configured to generate a matching score matrix according to the local query vector, the local key vector and the external query vector, and determine a communication group of the target agent according to the matching score matrix; wherein the matching score matrix is ​​used to describe the connection weights between agents; A feature graph generation module, used for weighted fusion of intermediate features of the target agent and other agents in the communication group to obtain a student model feature graph; A training module, used for performing model training and knowledge distillation on the target agent according to the student model feature map and the teacher model feature map; wherein the teacher model feature map includes intermediate features obtained by the teacher model after collaborative perception from the original data level through the encoder, and the original data is the splicing result of the data obtained by the target agent and all the other agents at the same time; The collaborative perception module is used to control the target intelligent agent to perform collaborative perception with other intelligent agents in the communication group if a downstream task execution instruction is received, so as to complete the downstream task.

9. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, it implements the steps of the multi-agent collaborative perception method as claimed in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores computer executable instructions, which, when loaded and executed by a processor, implement the steps of the multi-agent collaborative perception method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for training model

    CN115564059A

  • Neural network distillation method and device

    WO2022001805A1