Background: As medical technology advances and becomes more complex, it is important to understand how to use it to make accurate diagnoses. Misjudgment may delay treatment, leading to worsening condition or even death. A pneumothorax occurs when there is rupture of bullae or blebs in the lungs, which causes air to accumulate in the pleural cavity, increasing pressure within the pleural space and resulting in collapse of the lungs. If not diagnosed in time, pneumothorax can result in death due to dyspnea. Most hospitals use chest X-ray images for diagnosis. In this paper, Generative Adversarial Network (GAN) was applied to improve the quality of X-ray images of the thoracic cavity, determine the position of characteristic labels of the chest, and generate labeled images of pneumothoraces. Methods: GAN uses combined multiple loss functions to improve the authenticity of labeled images. With Boundary Equilibrium Generative Adversarial Network (BEGAN), image data increased. We evaluated whether this enhances the quality of the labeled images. Results and conclusion: GAN training improves the accuracy of labeling and increased image data improves the quality of labeled images.