Critical nodes play a pivotal role in ensuring the security and reliability of power grids, given that attacking them can lead to widespread power outages. Consequently, identifying critical nodes within the power grid holds immense significance. However, prior research either focuses on a single node metric or subjectively assigns weights to multiply metrics, resulting in inaccurate ranking lists. To overcome these limitations, this paper introduces the CGA algorithm to identify critical nodes in the power grid using deep learning methods. Specifically, CGA employs the contraction algorithm to establish feature matrices and utilizes the Susceptible-Infectious-Recovered (SIR) model to generate labels for nodes. Subsequently, CGA leverages the Convolutional Neural Network (CNN) to encode node information, effectively reducing computational complexity, then applies the Graph Neural Network (GNN) with an attention mechanism to learn node hidden representation. In addition, this paper employs two evaluation metrics to assess the effectiveness and distinguishability of CGA, including Kendall's tau correlation coefficient and monotonicity index. Through conducting extensive experiments on the three datasets, simulation results demonstrate that CGA performs better than the six baseline algorithms, in which the effectiveness of identifying critical nodes is improved and the distinguishability of the ranking list is enhanced.