SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
Generative Adversarial Nets
Lucas Borsatto Simão, Iniciação Científica em Machine Learning
Meetup Machine Learning Rio de Janeiro
Background
GANs
Tipos de aprendizado
Supervisionado
• Um conjunto x de dados
possuem rótulos y;
• Objetivo do algoritmo é prever a
saída y dada uma entrada x;
Não supervisionado
• O conjunto x de dados não é
rotulado;
• O algoritmo tenta entender a
estrutura presente nos dados x;
Modelos de aprendizado
Discriminativo
• Representa a função que mapeia
os dados x aos rótulos y;
• Aprende a probabilidade
condicional P(y|x);
Generativo
• Representa a função que mapeia
x e y dado somente o x;
• Aprende a probabilidade
conjunta P(x, y);
Discriminativos vs Generativos
Redes Neurais Generative Adversarial Nets (GANs)
Uso de modelos generativos
Para que servem
Utilização de modelos Generativos
Denoising
Utilização de modelos Generativos
Inpainting
Utilização de modelos Generativos
Transferência de estilos
Fonte: https://arxiv.org/abs/1603.03417.pdf
GANs
Generative Adversarial Networks
Conceitos básicos
• Modelo revolucionou a área de Generative Models;
• Criado por Ian Goodfellow, em 2014;
"GANs and it's variations are the most
interesting idea in 10 years in ML", Yan
Lecunn, diretor do departamento de
pesquisa do Facebook.
Conceitos básicos
• Usa um vetor latente z;
• São dois modelos que competem entre si;
• Modelo gerador tenta criar imagens próximas das reais para
confundir o discriminador;
• O discriminador tenta adivinhar qual imagem é falsa e qual é real;
Estrutura de uma GAN
Estrutura de uma GAN
Estrutura de uma GAN
Aprendizagem
• Processo inicialmente possui
tanto G(z) quanto D(x,G(z))
imprecisos;
Fonte: https://arxiv.org/pdf/1406.2661.pdf
Aprendizagem
• A medida que o D(x,G(z))
melhora a precisão, G(z) gera
dados de maior qualidade;
Fonte: https://arxiv.org/pdf/1406.2661.pdf
Fonte: https://arxiv.org/pdf/1406.2661.pdf
Aprendizagem
• Com o tempo G(z) aproxima sua
distribuição de X;
Fonte: https://arxiv.org/pdf/1406.2661.pdf
Aprendizagem
• Processo acontece até que G(z) ~
X e D(x,G(z)) ~ 0.5;
Fonte: https://arxiv.org/pdf/1406.2661.pdf
Aprendizagem – Nash Equilibrium
• O aprendizado se trata de um
jogo chamado minimax:
• O Discriminador tenta aumentar
as chances de classificação
correta;
• O Gerador tenta diminuir as
chances de o Discriminador
acertar a classificação;
Fonte: https://arxiv.org/pdf/1701.00160.pdf
Problemas ...
Adversidades encontradas no treinamento
Instabilidade no treinamento
• Dificuldade de se achar
hiperparâmetros que se
encaixem no problema;
Fonte: https://arxiv.org/pdf/1701.07875.pdf
Colapso de modelo
• Um grande número de valores
de z são mapeados para uma
mesma resposta, sem variação;
Fonte: https://arxiv.org/pdf/1701.07875.pdf
Erros de conceito
• Por vezes, quando convergem,
tem dificuldade em interpretar
figuras 3D e discernir as
propriedades da imagem;
–
Fonte: https://arxiv.org/pdf/1701.00160.pdf
Avanços
Melhorias propostas ao algoritmo
Unrolled GAN
• Objetivo é tratar do colapso de modelo;
• Função de custo é modificada para que o Discriminador antecipe os
passos que serão dados pelo Gerador;
• O custo é mais alto para o gerador para passos que tendem ao
colapso;
Unrolled GAN
Fonte: https://arxiv.org/abs/1611.02163.pdf
DCGAN
• Objetivo é mapear padrões e métodos para que o algoritmo
apresente convergência;
• Implementação de CNNs junto com GANs;
• Utilização da capacidade do modelo para tarefas discriminativas;
• Operações conceituais entre imagens;
DCGAN – Conceitos utilizados
• Utilização de redes inteiramente convolucionais;
• Batch Normalization;
• Definição dos hiperparâmetros para apresentar resultados;
DCGAN - Estrutura
Fonte: https://arxiv.org/pdf/1511.06434.pdf
DCGAN
Fonte: https://arxiv.org/pdf/1511.06434.pdf
DCGAN
Fonte: https://arxiv.org/abs/1611.02163.pdf
Improved Techniques for Training GANs
• Melhoras sugeridas pelo mesmo autor das GANs:
• Discriminador possui conhecimento prévio dos minibatches com o objetivo de
evitar o colapso de modelo;
• Limita o discriminador a ter respostas entre 0.1 e 0.9 ao invés de 0 e 1;
• Virtual Batch – Gradiente baseado em batchs de referência;
• Tenta-se resolver o problema com métodos empíricos;
Fonte: https://arxiv.org/abs/1606.03498.pdf
Principled Methods for Training GANS
• Problemas das GANs explicados matematicamente;
• Proposta de se usar função de custo baseada em distância entre os
dados e não em sua semelhança;
• Torna-se base para criação das Wasserstein GANs;
Fonte: https://openreview.net/pdf?id=Hk4_qw5xe
Principled Methods for Training GANS
• Distância da dados dispostos entre duas retas;
Fonte: https://openreview.net/pdf?id=Hk4_qw5xe
WGAN
Fonte: https://arxiv.org/pdf/1701.07875.pdf
WGAN
Fonte: https://arxiv.org/pdf/1701.07875.pdf
Aplicações das GANs
Algoritmos para diversas funcionalidades
InfoGAN
Fonte: https://arxiv.org/pdf/1606.03657.pdf
Neural Photo Editing
Fonte: https://arxiv.org/pdf/1609.07093.pdf
SRGAN – Super Resolução
Fonte: https://arxiv.org/pdf/1609.04802.pdf
SGAN
Fonte: https://arxiv.org/pdf/1611.08207.pdf
Conditional GANs
Fonte: https://arxiv.org/pdf/1701.00160.pdf
Imitation Learning
Fonte: https://blog.openai.com/generative-models/
Conclusão
• GANs são modelos generativos que aprendem a partir de um espaço
latente;
• É necessário encontrar o equilíbrio entre o modelo gerador e o
discriminativo;
• As muitas variações possuem alplicações em diversas áreas;
Obrigado!
Lucas Borsatto
Pesquisador em Machine Learning
Engenheiro Mecatrônico
Twitter
@lucasbsimao

Mais conteúdo relacionado

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Intrudução as Generative adversarial nets (GANs)