To investigate the accuracy of automatic segmentation of organs at risk (OARs) in radiotherapy for nasopharyngeal carcinoma (NPC). The CT image data of 147 NPC patients with manual segmentation of the OARs were randomized into the training set (115 cases), validation set (12 cases), and the test set (20 cases). An improved network based on three-dimensional (3D) Unet was established (named as AUnet) and its efficiency was improved through end-to-end training. Organ size was introduced as a priori knowledge to improve the performance of the model in convolution kernel size design, which enabled the network to better extract the features of different organs of different sizes. The adaptive histogram equalization algorithm was used to preprocess the input CT images to facilitate contour recognition. The similarity evaluation indexes, including Dice Similarity Coefficient (DSC) and Hausdorff Distance (HD), were calculated to verify the validity of segmentation. DSC and HD of the test dataset were 0.86±0.02 and 4.0±2.0 mm, respectively. No significant difference was found between the results of AUnet and manual segmentation of the OARs (P > 0.05) except for the optic nerves and the optic chiasm. AUnet, an improved deep learning neural network, is capable of automatic segmentation of the OARs in radiotherapy for NPC based on CT images, and for most organs, the results are comparable to those of manual segmentation.