An Optimized Convolutional Neural Network for Detection of Heart Attack in Cardiac Magnetic Resonance Images