The objective of this study was to explore the predictive value of electrocardiogram (ECG) based on intelligent analysis algorithm for atrial fibrillation (AF) in elderly patients undergoing coronary artery bypass grafting (CABG). Specifically, 106 elderly patients with coronary heart disease who underwent CABG in the hospital were selected, including 52 patients with postoperative AF (AF group) and 54 patients without arrhythmia (control group). Within 1-3 weeks after operation, the dynamic ECG monitoring system based on Gentle AdaBoost algorithm constructed in this study was adopted. After the measurement of the 12-lead P wave duration, the maximum P wave duration (Pmax) and minimum P wave duration (Pmin) were recorded. As for simulation experiments, the same data was used as the back-propagation algorithm. The results showed that for the detection accuracy of the test samples, the Gentle AdaBoost algorithm showed 93.7% accuracy after the first iteration, and the Gentle AdaBoost algorithm was 16.1% higher than the back-propagation algorithm. Compared with the control group, the detection rate of arrhythmia in patients after CABG was significantly lower (
P
<
0.05
). Bivariate logistic regression analysis on Pmax and Pmin showed as follows: Pmax: 95% confidential interval (CI): 1.024-1.081,
P
<
0.05
; Pmin: 95% CI: 1.036-1.117,
P
<
0.05
. The sensitivity of Pmax and Pmin in predicting paroxysmal AF was 78.2% and 73.4%, respectively; the specificity of them was 80.1% and 85.6%, respectively; the positive predictive value was 81.2% and 83.4%, respectively; and the negative predictive value was 79.5% and 75.3%, respectively. In conclusion, the generalization ability of Gentle AdaBoost algorithm was better than that of back-propagation algorithm, and it can identify arrhythmia better. Pmax and Pmin were important indicators of AF after CABG.