The invention provides a self-supervised group
behavior recognition method and
system based on global and local comparative learning, and the method comprises the steps: extracting individual features through local branches, generating a soft
mask by employing a multi-head self-attention
mask module, separating significant / non-significant individual features through
mask pooling, constructing a comparison sample, and carrying out the recognition of a group behavior through the comparison sample; feature alignment is optimized in combination with
cosine similarity and local contrast loss; meanwhile, the
spatial interaction relation of the behaviorists is captured by utilizing the spatial global Transform of global branches, short-term action and long-term behavior
modes are fused through multi-scale
time sequence coding, the consistency is optimized by adopting global comparison loss after spatial and temporal characteristics are aggregated, and finally, the two
branch characteristics are integrated through global-local comparison loss for comparison, so that the accuracy of the behavior behavior is improved. And the
loss weight is automatically adjusted to simplify parameter adjustment. After training is completed, a group
behavior recognition result is output through the classifier according to the extracted spatial-temporal features, and the discrimination ability and robustness of the model to complex group behaviors are effectively improved.