Cardiac arrhythmia is a deadly disease that threatens the lives of millions of people, which shows the need for earlier detection and classification. An abnormal signal in the heart causing arrhythmia can be detected at an earlier stage when the health data from the patient are monitored using IoT technology. Arrhythmias may suddenly lead to death and the classification of arrhythmias is considered a complicated process. In this research, an effective classification model for the classification of heart disease is developed using flamingo optimization. Initially, the ECG signal from the heart is collected and then it is subjected to the preprocessing stage; to detect and control the electrical activity of the heart, the electrocardiogram (ECG) is used. The input signals collected using IoT nodes are collectively presented in the base station for the classification using flamingo-optimization-based deep convolutional networks, which effectively predict the disease. With the aid of communication technologies and the contribution of IoT, medical professionals can easily monitor the health condition of patients. The performance is analyzed in terms of accuracy, sensitivity, and specificity.