The prediction of protein-protein interaction (PPI) can be insightful for exploring the molecular mechanisms of cellular functions. Constructing the negative datasets of PPI is related to the assessment of the prediction accuracy and evaluation of the prediction performance. Aiming at the problem of unstable prediction accuracy in the current method of building negative sets using random sampling, we proposed a method of constructing negative sets based on a conditional generative adversarial network (CGAN), named PPIGAN. This method generates negative samples through a generative network, and the PPI prediction model uses these generated negative samples along with positive samples to learn interaction features. Simultaneously, the generator and the prediction model continuously compete against each other during the learning process, which enhances the model's generalization ability and prediction accuracy. Experimental results show that the accuracy of our proposed method reaches 94.68% and 98.22% in 5-fold cross-validation on yeast and human datasets, respectively. These results either surpass or closely approach the performance of advanced PPI prediction models such as PIPR, convolutional neural network, DeepTrio, and DeepFE, indicating that the method proposed in this article provides an effective solution for the work related to PPI prediction.