We present a deep learning method based on Convolutional Neural Networks (CNN) to reconstruct the shower axis of isotropic electrons in a three-dimensional (3D) imaging calorimeter, which is one of the core instruments of the High Energy cosmic-Radiation Detection (HERD) payload. The CNN method is evaluated against the Principal Component Analysis (PCA) method, utilizing isotropic Monte Carlo (MC) simulation data covering an energy spectrum from 10 GeV to 1000 GeV, as well as beam test data ranging from 50 GeV to 250 GeV. The comparative analysis results indicate that the CNN outperforms the PCA by about 40% at 100 GeV in terms of angular resolution under isotropic conditions. Both methods are further validated using beam test data. The results demonstrate the effectiveness of the CNN method in reconstructing the shower axis, and they underscore the potential of incorporating advanced deep learning techniques into the comprehensive task of calorimeter reconstruction.