Currently, the use of deep neural networks in the field of processing medical images is increasing. Particularly, these networks are widely used in medical applications such as medical diagnosis. Recently, the use of generative adversarial networks has been increasing in various applications. In this paper, we propose a new method for improving and classifying a CT scan dataset of a lung image based on generative adversarial networks. Images are selected from LUNA16 dataset. After pre-processing the dataset of images and selecting the candidate areas, we divided nodule images into 3 groups of small, medium and large, and configured a generative adversarial network. Then we applied a dataset of nodule image in 3 categories, along with a random normal vector as inputs of the network. By using this method, equally we increased our dataset of images in both class of nodule and non-nodule images. Finally, we use 6 types of the CNN neural network as feature extraction and classifier on a dataset of new generated images. Compared to the use of data augmentation and use of pre-trained networks and fine-tuning, the high accuracy of the proposed method demonstrates its optimal efficiency.