Abstract As a emerging photocatalyst, polymeric carbon nitride has attracted much attention. However, the activity of bulk carbon nitride is low. In this study, the porous carbon nitride (P-UCN) was synthesized by thermal calcination of urea and 2,5-dibromopyrazine. The optical absorption range and the separation efficiency of photogenerated electrons-holes of P-UCN were improved. The photocatalytic activity of P-UCN was studied by sulfadiazine (SD) degradation under 12-channel visible light reaction system. The effect of catalyst amount, initial concentration of SD were studied. In addition, the artificial neural network model was utilized to predict SD removal rate of porous carbon nitride (P-UCN).