To meet the current aging trend of society and meet the development needs of the field of old-age care,an improved YOLOv7 face recognition algorithm for smart pension is proposed.Firstly,a multi-scale information input module is proposed to extract the global information of the image and improve the information utilization rate.Secondly,the face features of the elderly are summarized,and a global adaptive feature extraction module is proposed,which combines attention mechanism to improve the backbone network and detection head.Finally,the network is trained by transfer learn-ing method,the feature weights are assigned by polynomial loss strategy,and the parameters are continuously debugged to improve the network identification ability.The experimental results show that the accuracy and recall of the proposed network on the old face data set reach 95.26%and 91.57%respectively,and the network parameters are reduced by 5.4%compared with the original YOLOv7.