Every year, many newborns lose their sight to retinopathy of prematurity (ROP) worldwide. Despite its high prevalence and adverse consequences, periodic examinations can effectively prevent it. The use of an intelligent system enables physicians to avoid medical mistakes while examining newborns. The optic disk (OD) is an integral part of the retina for grading the severity and progression of ROP. Due to the uneven brightness and lack of a defined OD border, the use of retinal images of infants is very challenging for OD diagnosis. This paper provides an innovative model of OD segmentation based on attention gate. Initially, the images were collected and preprocessed and inputted into a novel deep convolutional neural network consisting of attention in skip connections. The architecture is comprised of a two-stage convolutional network. Different outputs are obtained from two individual branches of the original image and image features in the first stage. The outputs were concatenated to transfer into the post-processing stage to identify the area related to the OD. The final results based on the Dice coefficient (Dice) and the Intersection-Over-Union (IoU) were 94.22% and 86.1%, respectively.