  Deep learning can provide rapid brain age estimation based on brain magnetic
resonance imaging (MRI). However, most studies use one neural network to
extract the global information from the whole input image, ignoring the local
fine-grained details. In this paper, we propose a global-local transformer,
which consists of a global-pathway to extract the global-context information
from the whole input image and a local-pathway to extract the local
fine-grained details from local patches. The fine-grained information from the
local patches are fused with the global-context information by the attention
mechanism, inspired by the transformer, to estimate the brain age. We evaluate
the proposed method on 8 public datasets with 8,379 healthy brain MRIs with the
age range of 0-97 years. 6 datasets are used for cross-validation and 2
datasets are used for evaluating the generality. Comparing with other
state-of-the-art methods, the proposed global-local transformer reduces the
mean absolute error of the estimated ages to 2.70 years and increases the
correlation coefficient of the estimated age and the chronological age to
0.9853. In addition, our proposed method provides regional information of which
local patches are most informative for brain age estimation. Our source code is
available on: \url{https://github.com/shengfly/global-local-transformer}.
