HƯỚNG DẪN AI trực quan

Mô hình sáng tạo dựa trên điểm số

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.

Nghe hướng dẫn nàyAI thuật lại · ~8 min

Trên trang nàyđọc 9 phút
  1. Tổng quan
  2. Những điểm chính rút ra
  3. Lặn sâu
  4. Sampling a 2D toy distribution with annealed Langevin dynamics
  5. Triển khai trong thế giới thực
  6. Tương lai của các mô hình sáng tạo dựa trên điểm số
  7. Đưa nó vào thực tế
  8. Nguồn tham khảo và đọc thêm
  9. Tiếp tục khám phá
  10. Câu hỏi thường gặp

Tổng quan

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.

Những điểm chính rút ra

  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.

Lặn sâu

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.

04Ví dụ hoạt động

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.

Những gì nó cho thấy

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.

Triển khai trong thế giới thực

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.

Tương lai của các mô hình sáng tạo dựa trên điểm số

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.

Đưa nó vào thực tế

Tại sao nó quan trọng

  • Tốc độ và tỷ lệ. Visual AI có thể tự động hóa các nhiệm vụ kiểm tra, phát hiện và gắn thẻ trên quy mô lớn.
  • Xây dựng lựa chọn. Các nhóm sáng tạo có thể tạo nguyên mẫu nhanh hơn với ít sửa đổi thủ công hơn.
  • Nhóm và quy trình làm việc. Các hoạt động có thể sử dụng tín hiệu hình ảnh và video mà trước đây khó xử lý.

coi chừng

  • Quyền và sự đồng ý về hình ảnh có thể trở thành rủi ro pháp lý nếu nguồn gốc xuất xứ không rõ ràng.
  • Hiệu suất của mô hình có thể khác nhau tùy theo ánh sáng, nhân khẩu học và môi trường.
  • Kết quả dương tính giả có thể không được chú ý trừ khi ngưỡng tin cậy được theo dõi.

Các bước tiếp theo

  1. Xác định tiêu chí chấp nhận về độ chính xác, thu hồi và chi phí lỗi.
  2. Kiểm tra với dữ liệu phù hợp với điều kiện sản xuất thực tế.
  3. Thêm đánh giá của con người đối với những dự đoán có độ tin cậy thấp hoặc tác động cao.
  4. Theo dõi sự trôi dạt của mô hình và xác nhận lại sau khi thay đổi máy ảnh hoặc tập dữ liệu.

Nguồn tham khảo và đọc thêm

  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)Các mô hình xác suất khử nhiễu khuếch tán
  6. arXiv (ICML 2023)Mô hình nhất quán

Tiếp tục khám phá

Bản tin miễn phí

Nhận bản tóm tắt AI hàng ngày

Ba câu chuyện AI đã được xác minh vào mỗi buổi sáng các ngày trong tuần, được viết bằng tiếng Anh đơn giản. Miễn phí mãi mãi, không có quảng cáo.

Một email mỗi ngày trong tuần. Hủy đăng ký trong một cú nhấp chuột. Chúng tôi không bao giờ bán hoặc chia sẻ địa chỉ của bạn.

Tự kiểm tra

Take the Score-Based Generative Models quiz

Phản hồi tức thì về mọi câu trả lời và chứng chỉ có thể chia sẻ với ID có thể xác minh sau khi bạn vượt qua khóa học.

Bắt đầu bài kiểm tra

Hỗ trợ giáo dục AI miễn phí. AI Understanding là tổ chức phi lợi nhuận 501(c)(3) — không bao giờ có quảng cáo, không có tường phí. Hãy quyên góp

Câu hỏi thường gặp

Mô hình sáng tạo dựa trên điểm số là gì?

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.

Chính xác thì 'điểm' mà những mô hình này học được là gì?

Điểm là độ dốc của mật độ dữ liệu nhật ký so với đầu vào — nó chỉ theo hướng làm tăng khả năng xảy ra của mẫu.

Tại sao các mô hình dựa trên điểm số được đào tạo về dữ liệu bị sai lệch với nhiễu ở nhiều thang đo?

Ở những vùng có mật độ thấp, điểm thực sự được xác định kém; dữ liệu nhiễu loạn với nhiều mức độ nhiễu làm cho việc so khớp điểm có thể thực hiện được ở mọi nơi.

Những mô hình dựa trên điểm số ban đầu đã sử dụng quy trình lấy mẫu nào để tạo dữ liệu?

Động lực học Langevin liên tục di chuyển mẫu theo hướng của điểm số và đưa vào nhiễu nhỏ, dần dần chuyển nhiễu ngẫu nhiên thành dữ liệu thực tế.

Bài báo về điểm số-SDE năm 2021 đã thiết lập mối liên hệ chính nào?

Bài hát và cộng sự. các mô hình khuếch tán thống nhất và dựa trên điểm số trong khung phương trình vi phân ngẫu nhiên, với ODE luồng xác suất xác định phù hợp.

Việc dự đoán tiếng ồn liên quan như thế nào đến việc dự đoán điểm số trong việc giảm nhiễu đối sánh điểm số?

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.