Objective To investigate the risk factors for perforation after endoscopic submucosal dissection (ESD) in patients with upper gastrointestinal lesions and to construct a risk prediction model. Methods A retrospective analysis was conducted on the clinical data of 246 patients with upper gastrointestinal lesions who underwent ESD. Patients were divided into a perforation group (n=28) and a non-perforation group (n=218) according to the occurrence of postoperative perforation. Clinical data were compared between the two groups. Multivariate Logistic regression analysis was applied to identify the risk factors for perforation after ESD in patients with upper gastrointestinal lesions, and a risk prediction model was constructed based on these risk factors. The discrimination of the model was assessed using receiver operating characteristic (ROC) curves. Results Of 246 patients with upper gastrointestinal lesions who underwent ESD, 28 developed perforation, with an incidence rate of 11.38%. The perforation group had significantly higher proportions of female patients, lesion diameter ≥3 cm, postoperative malignant pathology, and operation duration ≥60 min than the non‑perforation group (P<0.05). The results of multivariate Logistic regression analysis showed that female, lesion diameter ≥3 cm, malignant postoperative pathology, and operation duration ≥60 min were independent risk factors for perforation after ESD in patients with upper gastrointestinal lesions (P<0.05). A risk prediction model for post-ESD perforation was established based on the results of multivariate Logistic regression analysis. The area under the curve was 0.826 (95%CI: 0.780, 0.872), with a sensitivity of 0.679 and a specificity of 0.633, indicating that the model had favorable discrimination. Conclusion Female, lesion diameter ≥3 cm, postoperative malignant pathology, and operation duration ≥60 min are risk factors for perforation after ESD in patients with upper gastrointestinal lesions. The risk prediction model established based on the above risk factors has certain clinical application value.