In order to solve the problem of weak single domain generalization ability in existing crowd counting methods, this study proposes a new crowd counting framework called Multi-scale Attention and Hierarchy level Enhancement (MAHE). Firstly, the model can focus on both the detailed features and the macro information of structural position changes through the fusion of channel attention and spatial attention. Secondly, the addition of multi-head attention feature module facilitates the model's capacity to effectively capture complex dependency relationships between sequence elements. In addition,...