Cardiac disease is one of the most complex diseases globally. It affects the lives of humans critically. It is essential for accurate and timely diagnosis to treat heart failure and prevent the disease. In most aspects, it was not so successful with the traditional method, which uses past medical history. Many existing models had several types of the loss function in traditional CNN can lead to misidentification of the model. To solve this problem, so many scholars have used the swarm intelligence algorithm, but most of these techniques are stuck in the local minima and suffer from premature convergence. In the proposed method, we build up the Levy Flight – Convolutional Neural Network (LV-CNN) depending on the diagnostic system using heart disease image data set for heart disease assessment. Initially, the input Big Data images are resized to reduce the computational complexity of the system. Then, those resized images are subject to the proposed LV-CNN model. Therefore, the LV approach is integrated with the Sunflower Optimization Algorithm (SFO) to reduce loss function occurring in the CNN architecture. Such a combination helps the SFO algorithm avoid trapping in local minima due to the random walk of the levy flight. The proposed algorithm will be simulated using the MATLAB tool and tested experimentally in terms of accuracy is 95.74%, specificity is 0.96%, the error rate is 0.35, and time consumption is 9.71 s. This comparative analysis revealed that the excellence of the proposed model.