Shadow detection is an important branch of computer vision. Recently, convolutional neural network (CNN)‐based methods for shadow detection have achieved better performance than methods based on manually designed features. However, CNNs are extremely hungry for data and the training of CNN‐based shadow detector requires time‐consuming and expensive pixel‐level annotations. To alleviate this problem in shadow detection, a method of data augmentation based on generative adversarial network (GAN), named ShadowGAN, has been proposed. Given a shadow mask and a shadow‐free image, our ShadowGAN can generate shadow images with labels. To guide the training of ShadowGAN and get more realistic shadow images, scriptL1${{\cal L}_1}$ loss is further implemented to impose a restriction between real shadow images and generated shadow images. The effectiveness of ShadowGAN is demonstrated by training existing shadow detectors on enlarged dataset. In addition, to better make use of shadow‐free images in shadow detection, shadow image classification task is added for the shadow detectors. Experiments show that this task can guide the feature extraction network to learn more robust shadow features. At last, these two methods are combined and a better performance of shadow detection is achieved.