# Adaptive-Modeling Multi-Agent Learning System for Video Behavioral Clustering Recognition
## 3 Method
### Multi-Agent Clustering System  
The computational process of discrete temporal sequence matching and the fusion update and maintenance of the model is performed in each agent, employing a multilayer hierarchical structure to combine multiple agents. It is worth noting that this system is designed using traditional methods rather than a fully connected neural network. A pyramidal structure is used between layers in the multilayer system, where correlated regions correspond between different layers. Agents only communicate with two types of data transfer: clustering results, passed from bottom-up, and prediction feedback, passed in the opposite direction. The communication between agents is performed with only two kinds of data transfer. The LCS similarity comparison algorithm calculates the matching degree between any-length DTS and EM in terms of sequence similarity, applied in the matching computation process, model feature fusion, and prediction. The model-matching degree is evaluated using the model weights and the LCS which is obtained by dynamic programming. For the model upgrading operation, according to the model matching degree, it was decided to update the selected EM in which the LCS is used to modify the weights of EM units to set an effect of strong and weak memory, or create a new one. Each agent implements the computational process of matching discrete temporal sequences while also performing model operations such as merging and modeling. Agents employ uniform functional modules within a homogeneous design, and the multi-agent system is combined using a multilayer, hierarchical structure. Figure 3 shows the structure of three agents, wherein agent 1 and agent 3 only represent the interface part. Interfaces S_in and D_out serve for data input and clustering results, respectively. Moreover, interfaces Fb_in and P_out receive feedback information and output prediction results in the opposite direction of data transfer. The History Encoder module encodes input data over time into DTSs, the Model Library module saves local EMs, and the Compare Core module computes matching scores between DTS data and EMs using feedback information and history selections from the History State. The Model_op module performs model feature merging or generates a new model based on the matching performance to achieve self-supervised learning effects. Assuming the existence of empirical model \(M=\{m_{1},\ldots,m_{n}\}\) and the DTS \(\boldsymbol{\Delta}=\{\delta_{1},\ldots,\delta_{n}\}\), the specific algorithm formula of the dynamic planning table using dynamic programming to find the longest subsequence of the EM with DTS is as follows:  
\[T_{ij} = \begin{cases}T_{i(j-1)}+1,&\delta_{i}=m_{j}\\ T_{(i-1)j},&\delta_{i}\
eq m_{j}\end{cases}  \tag{1}\]  
where \(T\) is the planning table generated by dynamic programming, \(\delta_{i}\) is a certain sequence member, \(m_{j}\): a certain model member, and \(i\) and \(j\) denote pointers to \(\boldsymbol{\Delta}\) and \(M\), respectively. Figure 2: Application of DTS and EMs. Moreover, in a multi-agent system, if each agent is designed only to prioritize its own performance, it is similar to implementing an independent learning approach for a single agent, ignoring any underlying systemic relationship among the agents. To address this challenge, the system uses the DTS and bottom-up multilayer approach, in which higher-layer agents can learn the model-matching pattern from the lower-layer agents' behavior. The improved performance is transmitted as feedback to the lower-layer agent, thereby enhancing its capability to provide priority suggestions during subsequent model-matching operations. During the model-matching process, if the entity maintains models that exhibit significant differences, the entity must select the most accurate model at the outset of the DTS step. However, in cases where similar fragments of several models overlap, targeted instructions through DTSs are needed to make informed selections before prediction.