Medical data classification is used to find the hidden patterns of data by training a large amount of patient data collected from the providers. As the medical data is very sensitive, it must be a safeguard from all the noncollaborative means. Thus, it is important to take steps to preserve the confidential medical data. Accordingly, this paper proposes a classification method termed as crow optimization-based deep belief neural network (CS-DBN) to preserve the privacy of confidential medical data automatically. This classifier works based on three phases, including generation of the privacy-preserved data, construction of ontology, and classification. The Deep convolutional kernel approach is used to provide data confidentiality using the optimal coefficients. The construction of ontology is done with the cardiac heart disease terms used in the medical field for classification. Finally, the classification is performed using the deep belief network (DBN), which is trained using the crow search algorithm (CSA). The performance is analyzed in terms of the metrics, namely, accuracy, fitness, sensitivity, and specificity. The proposed CS-DBN method produces higher fitness, accuracy, sensitivity, and specificity of 0.9007, 0.8842, 1, and 0.8408, respectively.