The invention relates to the field of
computer vision, in particular to a
transformer-based domain adaptive target detection method and
electronic equipment, and the method comprises the following steps: S1, obtaining a source domain and a target domain; s2, establishing a model; s3, establishing
a domain confrontation feature alignment module; s4, an adaptive domain
discriminator; according to the method,
a domain confrontation feature alignment module is designed in an
encoder part, a learnable domain confrontation token is used as a query, features generated by an
encoder layer are used as key value pairs, and the features generated by the
encoder are aligned through adversarial learning; a self-adaptive domain
discriminator is designed, so that the model can better process hard cases, and the domain self-adaptive capability of the model is further enhanced; the method provided by the invention shows good detection effect improvement on a plurality of domain adaptive public data sets, and compared with the prior art, the method provided by the invention is effectively improved in the aspect of feature alignment of the features output by the encoder, has obvious advantages in domain adaptive target detection, and has excellent domain generalization ability.