PANDUAN AI Visual

Model Generatif Berbasis Skor

Score-based generative models learn the score of a data distribution, the direction in which data becomes more likely at every point, and then generate new samples by starting from random noise and repeatedly stepping along that direction.

Dengarkan panduan iniDiceritakan oleh AI · ~8 min

Di halaman ini9 menit baca
  1. Ikhtisar
  2. Poin-poin utama
  3. Menyelam Lebih Dalam
  4. Sampling a 2D toy distribution with annealed Langevin dynamics
  5. Implementasi Dunia Nyata
  6. Masa Depan Model Generatif Berbasis Skor
  7. Mempraktikkannya
  8. Sumber dan bacaan lebih lanjut
  9. Terus Menjelajah
  10. Pertanyaan yang sering diajukan

Ikhtisar

Introduced by Yang Song and Stefano Ermon in 2019 and unified with diffusion models in 2021, they are the mathematical foundation of modern image, audio and video diffusion systems.

Poin-poin utama

  1. A score-based model learns the gradient of the log data density, which avoids computing the intractable normalizing constant that density models need.
  2. Song and Ermon's 2019 method perturbed data with many noise levels and sampled with annealed Langevin dynamics, reaching an Inception Score of 8.87 on CIFAR-10.
  3. The 2021 SDE framework showed that score-based models and DDPM-style diffusion models are two discretizations of the same continuous process.
  4. The probability flow ODE derived from the SDE allows exact likelihood computation, giving 2.99 bits per dimension on CIFAR-10 in the 2021 paper.
  5. The main cost of score-based generation is sampling, which typically needs hundreds to thousands of network evaluations per image.

Menyelam Lebih Dalam

A generative model learns to produce new examples that look like its training data, such as faces or photographs. Most approaches try to learn the probability density of the data, a function that says how likely any given image is. That is hard because a valid density must integrate to one, which requires a normalizing constant that is intractable for complex neural networks. Score-based generative models sidestep the problem. Instead of the density itself, they learn its score: the gradient of the log density with respect to the data, written as the gradient of log p(x). At any point in image space, the score is an arrow pointing toward regions where realistic images are more likely, and the normalizing constant disappears when the gradient is taken.

The method has two halves. Training uses score matching, a technique introduced by Aapo Hyvarinen in the Journal of Machine Learning Research in 2005, which fits a model's log-density gradient to the data without ever computing the normalizing constant. In practice, the common variant is denoising score matching: add Gaussian noise to a training image, and train a neural network to predict the direction back toward the clean image, which equals the score of the noisy distribution. Sampling then uses Langevin dynamics, a procedure from physics. Start from random noise, take a small step in the direction of the predicted score, add a little fresh noise, and repeat many times. Under the right conditions the samples converge to the data distribution.

The naive version fails, and the fix defines the field. Real images occupy a tiny region of the space of all possible pixel arrays, so most of the space has almost no data. A score model trained only on clean data learns accurate arrows near real images but gets almost no training signal elsewhere, and Langevin sampling starting from random noise begins exactly in those poorly learned regions. Song and Ermon's 2019 NeurIPS paper, "Generative Modeling by Estimating Gradients of the Data Distribution", solved this by perturbing data with many noise levels at once. Large noise spreads data over the whole space so the arrows are informative everywhere; small noise keeps them precise near real images. A single Noise Conditional Score Network learns the score for every level, and annealed Langevin dynamics samples from the noisiest level down to the cleanest. On CIFAR-10 they used 10 noise levels in a geometric sequence from 1 down to 0.01, with 100 Langevin steps per level, and reported an Inception Score of 8.87 and an FID of 25.32.

The key milestone came in late 2020. In "Score-Based Generative Modeling through Stochastic Differential Equations", posted in November 2020 and given an Outstanding Paper Award at ICLR 2021, Song, Jascha Sohl-Dickstein, Diederik Kingma, Abhishek Kumar, Ermon and Ben Poole replaced the finite list of noise levels with a continuous process. A stochastic differential equation (SDE), an equation describing a random process evolving over time, gradually turns data into noise. A known mathematical result says this process can be run backward in time if the score at every time is known, so learning the score is enough to turn noise back into data. The paper showed that both Song and Ermon's method and the Denoising Diffusion Probabilistic Models of Ho, Jain and Abbeel (2020) are special discretizations of this framework.

The unified view brought new tools. A predictor-corrector sampler alternates a numerical SDE solver step (the predictor) with a Langevin step (the corrector) to fix discretization errors. A deterministic "probability flow" ordinary differential equation shares the same intermediate distributions as the SDE, which allows exact likelihood computation and faster solvers. The paper reported an Inception Score of 9.89, an FID of 2.20 and a likelihood of 2.99 bits per dimension on CIFAR-10, and generated 1,024 by 1,024 face images.

Compared with alternatives, score-based models trade speed for stability and quality. Generative adversarial networks (GANs) produce an image in one forward pass but train a generator against a discriminator, a game that can be unstable and can drop parts of the data distribution. Variational autoencoders and normalizing flows give likelihoods but historically produced blurrier or less detailed images, or required restricted architectures. Score-based training is a simple regression problem with no adversary, and the 2019 paper noted it needs no special architecture constraints. The cost is sampling: generating one image requires hundreds to thousands of network evaluations. The SDE paper's samplers commonly used 1,000 or 2,000 steps.

The main limitations follow from that. Slow sampling makes deployment expensive, which is why much later research targets fewer steps. Score estimates are least accurate where data is sparse, so errors accumulate along the sampling path, and too few steps produce artifacts. Results depend on the noise schedule, the weighting of noise levels in the loss and the sampler, choices that interact in ways that are still tuned empirically. Like other generative models trained on large datasets, they can memorize and reproduce training examples, and the 2019 paper itself checked nearest neighbors in the training set to show it was not simply copying images.

In practice, score networks are usually U-Net-style convolutional networks conditioned on the noise level or time. The 2019 NCSN used a RefineNet variant and trained for 200,000 iterations with batch size 128 using the Adam optimizer. Training cost resembles that of other image models of the same size; the extra expense is at inference, where the network must run once per sampling step.

04Contoh yang berhasil

Sampling a 2D toy distribution with annealed Langevin dynamics

  1. Create training data from two Gaussian blobs in the plane, centered at (-4, 0) and (4, 0), with standard deviation 0.5, putting 80% of points in the left blob and 20% in the right.

  2. Choose 10 noise levels in a geometric sequence from 5 down to 0.05.

  3. Train a small neural network that takes a point and a noise level and outputs a 2D vector, using the loss that it should predict minus the added noise divided by sigma squared.

  4. Start 1,000 points uniformly at random in the square from -8 to 8 on both axes.

  5. For each noise level from largest to smallest, run 100 Langevin steps: move each point by half the step size times the predicted score, plus Gaussian noise scaled by the square root of the step size.

  6. Plot the final points and count how many end near each blob center.

Apa yang ditunjukkannya

The points should form two tight clusters at the blob centers with close to an 80 to 20 split. Running plain Langevin dynamics at only the smallest noise level instead tends to leave points in whichever blob they started near, giving roughly a 50 to 50 split; the 2019 NCSN paper shows this failure to recover the relative weights of separated modes.

Implementasi Dunia Nyata

Song and Ermon's 2019 Noise Conditional Score Network generated CIFAR-10 images with an Inception Score of 8.87, the best reported for unconditional models at the time, without adversarial training.

The 2021 stochastic differential equation framework by Song and colleagues produced the first high-fidelity 1,024 by 1,024 images from a score-based model and reached an FID of 2.20 on CIFAR-10.

Because a trained score model can be combined with a measurement model through Bayes' rule, the same network has been used for image inpainting, colorization, and reconstructing accelerated MRI and sparse-view CT scans.

Denoising Diffusion Probabilistic Models (2020), the approach behind many text-to-image systems, train a network whose objective is a weighted form of score matching, so they belong to the same family.

Consistency Models (Song and colleagues, ICML 2023) distill the score-based sampling path into a network that generates CIFAR-10 images in one step with an FID of 3.55.

Masa Depan Model Generatif Berbasis Skor

Most current research builds on the 2021 unification and focuses on speed, control and theory. Faster sampling is the biggest thread: Consistency Models (Song, Dhariwal, Chen and Sutskever, ICML 2023) learn to map any point on the probability flow path straight to its endpoint, reporting one-step FIDs of 3.55 on CIFAR-10 and 6.20 on 64 by 64 ImageNet. Other work studies better ODE solvers and distillation of many-step samplers into few-step students. A second thread is scientific and medical inverse problems. Song's 2021 overview describes using unconditional score models as learned priors for accelerated MRI and sparse-view CT reconstruction, with an ICLR 2022 paper on medical imaging; how reliably such priors behave on patients unlike the training data is still an open question for clinical use. Open theoretical questions include why score-based models generalize rather than memorize, how errors in the learned score propagate through long sampling chains, and how to choose noise schedules and loss weightings in a principled way. Extending the framework to discrete data such as text, and to very high-dimensional outputs such as long videos, remains an active area without a settled best approach.

Mempraktikkannya

Mengapa itu penting

  • Kecepatan dan skala. Visual AI dapat mengotomatiskan tugas inspeksi, deteksi, dan penandaan dalam skala besar.
  • Pilihan Build. Tim kreatif dapat membuat prototipe konsep lebih cepat dengan lebih sedikit revisi manual.
  • Tim dan alur kerja. Pengoperasiannya dapat menggunakan sinyal gambar dan video yang sebelumnya sulit diproses.

Hati-hati

  • Hak citra dan persetujuan dapat menjadi risiko hukum jika asal usulnya tidak jelas.
  • Performa model dapat bervariasi berdasarkan pencahayaan, demografi, dan lingkungan.
  • Positif palsu mungkin tidak diketahui kecuali ambang batas keyakinan dipantau.

Langkah selanjutnya

  1. Tentukan kriteria penerimaan untuk biaya presisi, penarikan kembali, dan kesalahan.
  2. Uji dengan data yang sesuai dengan kondisi produksi sebenarnya.
  3. Tambahkan tinjauan manusia untuk prediksi dengan tingkat keyakinan rendah atau dampak tinggi.
  4. Lacak penyimpangan model dan validasi ulang setelah kamera atau kumpulan data berubah.

Sumber dan bacaan lebih lanjut

  1. Journal of Machine Learning ResearchEstimation of Non-Normalized Statistical Models by Score Matching
  2. arXiv (NeurIPS 2019)Generative Modeling by Estimating Gradients of the Data Distribution
  3. arXiv (ICLR 2021)Score-Based Generative Modeling through Stochastic Differential Equations
  4. Yang SongGenerative Modeling by Estimating Gradients of the Data Distribution (blog overview)
  5. arXiv (NeurIPS 2020)Menyangkal Model Probabilistik Difusi
  6. arXiv (ICML 2023)Model Konsistensi

Terus Menjelajah

Buletin gratis

Dapatkan pengarahan AI harian

Tiga cerita AI terverifikasi setiap pagi hari kerja, ditulis dalam bahasa Inggris sederhana. Gratis selamanya, tanpa iklan.

Satu email setiap hari kerja. Berhenti berlangganan dalam satu klik. Kami tidak pernah menjual atau membagikan alamat Anda.

Uji diri Anda sendiri

Take the Score-Based Generative Models quiz

Umpan balik instan untuk setiap jawaban, dan sertifikat yang dapat dibagikan dengan ID yang dapat diverifikasi setelah Anda lulus kursus.

Mulai kuis

Mendukung pendidikan AI gratis. AI Understanding adalah organisasi nirlaba 501(c)(3) — tanpa iklan, tanpa paywall, selamanya. Berikan sumbangan

Pertanyaan yang sering diajukan

What is Score-Based Generative Models?

Score-based generative models learn the score of a data distribution, the direction in which data becomes more likely at every point, and then generate new samples by starting from random noise and repeatedly stepping along that direction. Introduced by Yang Song and Stefano Ermon in 2019 and unified with diffusion models in 2021, they are the mathematical foundation of modern image, audio and video diffusion systems.

Berapa sebenarnya 'skor' yang dipelajari model-model ini?

Skornya adalah gradien kepadatan data log sehubungan dengan masukan — skor tersebut menunjuk ke arah yang meningkatkan kemungkinan sampel.

Mengapa model berbasis skor dilatih pada data yang dirusak oleh gangguan pada berbagai skala?

Di wilayah dengan kepadatan rendah, skor sebenarnya tidak didefinisikan dengan baik; data yang mengganggu dengan beberapa tingkat kebisingan membuat pencocokan skor dapat dilakukan di mana saja.

Prosedur pengambilan sampel manakah yang digunakan model berbasis skor awal untuk menghasilkan data?

Dinamika Langevin berulang kali menggerakkan sampel ke arah skor dan memasukkan derau kecil, secara bertahap mengubah derau acak menjadi data realistis.

Apa hubungan utama yang dibangun oleh makalah skor-SDE tahun 2021?

Lagu dkk. difusi terpadu dan model berbasis skor di bawah kerangka persamaan diferensial stokastik, dengan ODE aliran probabilitas deterministik yang cocok.

Bagaimana hubungan prediksi kebisingan dengan prediksi skor dalam pencocokan skor denoising?

For additive Gaussian corruption x_t=x_0+σ ε with standardized ε, the conditional score target is −ε/σ. A denoising score network estimates the score of the noisy-data distribution from such training targets; it does not output the individual noise sample or variance.