Ice crystals in clouds have various shapes, which play a crucial role in understanding the development of precipitation, climate change and remote sensing retrievals. The copious ice crystal images collected by the airborne cloud particle imager probe (CPI) following each research flight impede efficient human identification, prompting the necessity for an automated, high-precision algorithm to classify ice crystal habits. Traditional automatic classification methods require manual feature extraction for a good performance, which affects their generalization ability. Instead, the recently perfected machine learning method -- convolutional neural network (CNN) holds promise in addressing this issue. In this paper, the ice crystal images observed by CPI are used to set up an ice crystal dataset, which consists of eleven shapes containing 5,342 images. Additionally, a method to identify ice particle shape based on CNN is presented. The small 3×3 convolutional kernels are used to construct a 30-layer CNN model to achieve automatic habit classification of ice crystal particle shapes. The CNN model is compared with traditional machine learning models (SVM, BP) using the created dataset. The CNN model achieved the highest F1 score for each category and an accuracy of 95.45%. Experimental results show that ice crystal classification using CNN is an effective and feasible method, surpassing traditional classification methods that require manual feature extraction. This research provides a reference value for cloud microphysics research.