The invention provides a target tracking method based on a causal relationship and an attention mechanism, and the method comprises the steps: obtaining a target feature through a
feature extraction sub-network, calculating a trajectory feature according to a target tracking result at a previous moment, and constructing an AND-OR logic diagram of a driving task; inputting the trajectory features and an adjacent matrix containing AND-OR logic weights into a
spatial graph coding layer, the output of the layer serving as the input of a time coding layer, the output of the time coding layer serving as the output of a space-time decoder, and the output serving as one of the inputs of the decoder; initializing an adjacent matrix according to the distance between the target detected in the current frame and the track, and inputting the target
feature vector and the adjacent matrix into an image
convolution layer; the
feature vector of the current frame and the adjacent matrix are input into a decoder, the decoder outputs a tracking result of a current frame target through a prediction layer, and finally track information is updated and fed back to the input end of the
encoder for prediction at the next moment. According to the method, the causal
logical relationship from the driving task to the target state is introduced as a high-level semantic meaning, and the causal
logical relationship and the target trajectory information are aggregated through the graph convolutional network, so that the capability of extracting the space-time and causal dependency relationship of the target motion at different moments is enhanced, and missing detection and
false detection when the target is shielded for a long time are avoided.