A gen­er­at­ive ad­versari­al network (GAN) is a modern machine learning model that employs two neural networks to produce realistic synthetic data. GANs can generate images, text, and even music. This concept is used in various fields, including image and video gen­er­a­tion, art, design, and data aug­ment­a­tion.

What does gen­er­at­ive ad­versari­al network mean?

A gen­er­at­ive ad­versari­al network, GAN for short, is a framework for gen­er­at­ing synthetic data from the field of machine learning, primarily used for training networks in un­su­per­vised learning. The model consists of two ar­ti­fi­cial neural networks—the generator and the dis­crim­in­at­or—that work against each other.

  • Generator: The generator’s job is to create new data instances that look con­vin­cingly real, closely re­sem­bling the original dataset. The gen­er­at­ive neural network starts with a random noise and achieves con­tinu­ous im­prove­ments through training. The generator learns to map a vector of latent variables to the specific result space, gen­er­at­ing outputs that fit a par­tic­u­lar dis­tri­bu­tion. Its ultimate goal is to produce ar­ti­fi­cial data that can fool the dis­crim­in­at­or.
  • Dis­crim­in­at­or: This network is trained on a known dataset to dif­fer­en­ti­ate between real and synthetic data until it achieves ac­cept­able accuracy. The dis­crim­in­at­or evaluates the au­then­ti­city of the data it receives, de­term­in­ing whether the instances come from the original dataset or if they are fab­ric­ated.

The competing networks are trained sim­ul­tan­eously, with the generator competing against the dis­crim­in­at­or until it produces data that the dis­crim­in­at­or can no longer identify as fake. Back­propaga­tion is employed to optimise the weights of both networks during each training step. This process allows the two neural networks to con­tinu­ously improve each other, gradually refining the generated dis­tri­bu­tion to closely match the real one given enough training time. Once training is complete, the generator can be used to produce realistic-looking synthetic data.

Note

Gen­er­at­ive ad­versari­al networks were initially used ex­clus­ively as a model for un­su­per­vised learning, but have now also proven them­selves when it comes to semi-su­per­vised learning, su­per­vised learning and re­in­force­ment learning.

GANs compared to other machine learning models

Gen­er­at­ive ad­versari­al networks differ from other machine learning methods in several ways. GANs function as implicit gen­er­at­ive models, meaning they do not model a direct like­li­hood function or provide a method to identify latent variables. Instead, GANs generate new data instances through the com­pet­i­tion between the two networks, the generator and the dis­crim­in­at­or.

In contrast to other ap­proaches, which generate data step by step, GANs are able to generate a complete sample in just one run. In addition, there are no re­stric­tions on the type of function used by the network.

AI Tools at IONOS
Empower your digital journey with AI
  • Get online faster with AI tools
  • Fast-track growth with AI marketing
  • Save time, maximise results

How do Gen­er­at­ive ad­versari­al networks work? The training process

The training process for gen­er­at­ive ad­versari­al networks consists of several steps. The following overview il­lus­trates how the training of GANs works in detail:

  1. Ini­tial­isa­tion: The two neural networks—the generator and the dis­crim­in­at­or—are created and ini­tial­ised with random para­met­ers.
  2. Gen­er­a­tion of fake data: The generator takes a random vector as input to produce synthetic data. Since it hasn’t yet been trained, the initial output resembles random noise.
  3. Eval­u­ation by dis­crim­in­at­or: The dis­crim­in­at­or receives both real data samples and the generator’s synthetic outputs. Its role is to dif­fer­en­ti­ate real from fake data, though it also starts without training, so its initial eval­u­ations are imprecise.
  4. Feedback and updating of weights: Using back­propaga­tion, both networks adjust their para­met­ers. The generator learns to create in­creas­ingly realistic data, while the dis­crim­in­at­or improves its accuracy in dis­tin­guish­ing real from ar­ti­fi­cial samples.
  5. Iteration: The gen­er­at­ive ad­versari­al network cycles through steps 2 to 4, gradually refining both networks until the generator produces data so con­vin­cing that the dis­crim­in­at­or can no longer reliably identify it as synthetic—or until the desired quality level is reached.

In which areas are GANs used?

Gen­er­at­ive ad­versari­al networks, which are part of ar­ti­fi­cial in­tel­li­gence, are already being used suc­cess­fully in various in­dus­tries. The main areas of ap­plic­a­tion are:

  • Image and video gen­er­a­tion: GANs are widely used in film pro­duc­tion and game de­vel­op­ment to create highly realistic images and video sequences. This tech­no­logy also helps companies visualise products, such as shoes or clothing, more ef­fect­ively and supports the creation of virtual en­vir­on­ments.
  • Medicine: In medical imaging, GANs are valuable for both training doctors and enhancing dia­gnost­ic pro­ced­ures. They also address privacy concerns by gen­er­at­ing synthetic medical images, providing re­search­ers with data while main­tain­ing patient con­fid­en­ti­al­ity.
  • Data aug­ment­a­tion: GANs can create ad­di­tion­al training data for machine learning models, es­pe­cially helpful in scenarios with limited real examples, to improve model accuracy and per­form­ance.
  • Speech re­cog­ni­tion and synthesis: GANs enhance natural language gen­er­a­tion and optimise speech synthesis systems, producing new, realistic audio samples beyond tra­di­tion­al methods.
  • Science: In sci­entif­ic research, GANs support diverse ap­plic­a­tions, such as re­con­struct­ing velocity and scalar fields in turbulent flows. They’ve also been used to generate new molecules targeting in­flam­ma­tion, cancer, and fibrosis.
  • Art and design: Artists and designers draw on GAN ar­chi­tec­ture to create in­nov­at­ive artworks and designs.

Ad­vant­ages and dis­ad­vant­ages of gen­er­at­ive ad­versari­al networks

Gen­er­at­ive ad­versari­al networks open new pos­sib­il­it­ies for creating realistic ar­ti­fi­cial data, es­pe­cially in image and video gen­er­a­tion. One key advantage is their ability to produce high-quality data without using explicit prob­ab­il­ity models, setting them apart from other gen­er­at­ive models. This flex­ib­il­ity allows for many cus­tom­is­able features, sup­port­ing a variety of ap­plic­a­tions.

However, GANs also face chal­lenges, par­tic­u­larly with training stability. A common issue, mode collapse, can occur if the generator produces only limited data vari­ations – often a result of the generator training too fre­quently without cor­res­pond­ing updates to the dis­crim­in­at­or. Ad­di­tion­ally, GANs carry risks of misuse, such as gen­er­at­ing realistic deepfakes, spreading dis­in­form­a­tion, or enabling identity theft.

Ad­vant­ages Dis­ad­vant­ages
High-quality data Unstable training process
Flexible model Can be misused e.g. for deepfakes
Suitable for many ap­plic­a­tion scenarios
Go to Main Menu