A neural network that distinguishes real data from generator-produced fakes in GANs.
The discriminator is one of two competing neural networks at the heart of a generative adversarial network (GAN). Its core function is binary classification: given an input sample, it must determine whether that sample comes from the real training distribution or was synthesized by the GAN's companion network, the generator. The discriminator outputs a probability score — values near 1 indicate a confident judgment of "real," while values near 0 signal "fake." It is typically implemented as a convolutional neural network for image tasks or a feedforward network for lower-dimensional data, trained using standard supervised learning objectives such as binary cross-entropy.
The discriminator and generator are trained simultaneously in an adversarial loop. The generator attempts to produce samples realistic enough to fool the discriminator into assigning them high probability scores, while the discriminator is updated to correctly reject those fakes. This dynamic creates a minimax game: the generator minimizes the discriminator's ability to distinguish real from fake, and the discriminator maximizes it. Gradients from the discriminator's classification errors flow back to the generator, providing the training signal that pushes generated samples toward greater realism — even though the generator never directly observes real data.
The quality of the discriminator is critical to the overall quality of the GAN. A discriminator that is too weak fails to provide useful gradients, causing the generator to stagnate. One that is too strong can saturate the loss function, producing vanishing gradients that also stall training. Much GAN research — including Wasserstein GANs, spectral normalization, and progressive growing architectures — has focused on stabilizing this balance. The discriminator can also be conditioned on class labels or other auxiliary information, enabling conditional generation of specific categories of output.
Beyond image synthesis, discriminators appear in video generation, text-to-image models, audio synthesis, and data augmentation pipelines. In some frameworks, a trained discriminator is repurposed as a feature extractor or anomaly detector, since its internal representations capture rich information about what makes data look "real." The adversarial training paradigm pioneered by GANs has also influenced reinforcement learning from human feedback and other areas where a learned reward signal replaces a hand-crafted one.