Abstract: The electrocardiogram (ECG) is a biological signal that is frequently employed and plays a significant role in cardiac analysis. In analysis of important indicators of the distribution of ECG record of patient. The R wave is crucial for both analyzing abnormalities in cardiac rhythm and determining heart rate variability (HRV). In this article, a brand-new method for classifying and detecting QRS peaks in ECG data based on artificial intelligence is provided. The integration of the ECG signal data is proposed using a reduced order IIR filter design. To construct the reduced order filter, the filter coefficient is optimized using the min-max method. The main focus of this study is on removing baseline uncertainty and power line interferences from the ECG signal. According to the results, the accuracy has increased by about 13.5% in comparison to the fundamental Pan-Tompkins approach and by about 8.1% in comparison to the current IIR-filter-based categorization rules.