Neural Network
📖 How does this work?
What is Diffusion?
Diffusion models work by learning to reverse a noise-adding process. We gradually corrupt an image with Gaussian noise until it's pure static, then train a neural network to predict and remove that noise step by step.
The Neural Network
This app runs a real multi-layer perceptron (MLP) entirely in your browser. It has ~50,000 parameters across 4 layers. It trains on patches of your image, learning the relationship between noisy pixels and clean pixels at each noise level.
Forward Diffusion
Progressively adds Gaussian noise according to your chosen schedule (linear, cosine, or sigmoid). At t=0 the image is clean; at t=50 it's nearly pure noise.
Reverse Diffusion
The trained network predicts what the clean image should look like at each timestep. Starting from noisy input, it iteratively denoises — each step removes a bit more noise, gradually reconstructing the image.
Note: This is a simplified single-image denoiser, not a full generative diffusion model like Stable Diffusion. But the math is real!