Given their widespread use, knitting machines must be maintained regularly. When the spare parts that make up these machines break down or become unusable, they must be replaced with new ones. However, the code/name information of the spare parts is not available to the end user, and can only be accessed with high-cost catalog procurement. Manufacturing companies keep the code/name information of such machine parts confidential. When the literature is examined, there are no studies in which spare parts are classified with machine learning-based algorithms. In line with this, this study focuses on the classification of spare parts using machine learning-based algorithms. The deep learning-based Convolutional Neural Network (CNN) architecture developed in this study can classify highly similar spare parts. In addition, since the code/name information received from the manufacturer and the spare part sample images require confidentiality, the CNN architecture has been developed in combination with the Differential Privacy (DP) method to present the DP-CNN method. As a result of the application of the Differential Privacy method, there has been no great loss of accuracy. This is an important development for our study. In the article, many optimizer algorithms are tested on the proposed method and comparative results are given. A 99.41% accuracy ratio has been obtained with the DP-RMSProp optimization method, which produces the best results. Experimental results of our study are presented in detail.