The invention discloses a two-stage hyperspectral image
band selection and target detection method, which comprises the following steps of: based on a two-stage
band selection and
background reconstruction network of a
transformer, realizing
band selection through a first-stage training
transformer and realizing
background reconstruction through a second-stage training
transformer; a transform position coding module and a multi-head self-attention mechanism are used for learning similar features and difference features among wave bands, a full connection layer network is used as a clustering device, a
structural similarity index and an
Euclidean distance are added to serve as a
loss function training model,
wave band clustering is achieved, and finally a
local variance is used for estimating the
noise level of an image of each
wave band. Obtaining a band training subset; the band subset is subjected to constraint
energy minimization detection and then sent to a background
feature extraction network composed of a transformer and a
discriminator, background pixels are arranged through position coding, network learning background features are enhanced through a multi-head self-attention mechanism, an improved
loss function is used for training, and therefore reconstruction of a
background image is achieved. The invention provides a two-stage
wave band selection and
background reconstruction network based on transformer so as to realize hyperspectral target detection. The network comprises a first-stage wave band selection work and a second-stage
background spectrum learning work. And difference detection is carried out on the final background reconstruction image and the original image, so that a final task is realized, and the detection precision is improved.