TL;DR
Integrated positional encoding (IPE) is a way to feed a 3D position into a neural network so that the network sees only the detail that the viewing footprint can resolve. Instead of encoding a single point with sine and cosine features at many frequencies, it encodes the region the pixel covers, modelled as a Gaussian, and returns the average of those features over the region. Each frequency is scaled down by a factor that falls as the frequency and the region size grow, so distant or zoomed-out views stop flickering.
Builds on: Positional Encoding, Multivariate Gaussian, Anti-Aliasing · Leads to: Mip-NeRF, the paper that introduced it, and multi-scale neural scene representations that render the same model at any distance.
Where it's used
Zooming through one scene. A neural radiance field of a city can be viewed from a street and from a plane. A standard NeRF samples single points along each ray, so a distant building covers many pixels with one thin sample per pixel. The result is shimmering, because the high-frequency features the network learned for close-up detail change from one frame to the next. Mip-NeRF, the paper that introduced IPE, uses it to make the same model stable across scales.
Anti-aliased novel views. When a camera moves, the pixel footprint on a surface changes size. IPE gives the network a feature that changes smoothly with that size, so the image does not jump between sharp and blurred detail as the camera passes a surface at a shallow angle.
Multi-scale training for 3D content. A single model trained on images at several resolutions can use one encoding for every scale, with the footprint setting how much fine detail reaches the network. This is useful for large scenes where detail is seen at very different distances.
How it works
Think of a pixel as looking through a small cone. The cone passes through a region of space, and the question is what the network should see for that region. A point encoding answers with the features of one point. IPE answers with the average of the features over the region, which is the same as a low-pass filter applied to the encoding.
flowchart LR C["Pixel cone for one interval"] --> G["Gaussian with mean and covariance"] G --> E["Expected sine and cosine per coordinate"] E --> D["Damping by footprint size and frequency"] D --> N["Encoding fed to the network"]
- Start with the region, not the point. For one interval along a ray, the cone's footprint is summarised by a Gaussian with a mean and a covariance . Check: the mean is where the interval sits, and the covariance is how far it spreads across the cone.
- Recall the point encoding. NeRF's positional encoding gives a point the features and (the sine and cosine) for frequencies . Check: at the features vary slowly, and at they vary fastest.
- Average each feature over the Gaussian. For a coordinate that is Gaussian with mean and variance , the average of is times a damping factor. The same holds for . Check: with no spread, , the damping factor is 1 and the point encoding is recovered.
- Apply the damping at each frequency. At frequency the damping factor is , where is the exponential and is the spread. A tiny instance: with and at , the frequency is . The phase is , and the damping is . Check: the point encoding of is , and the averaged one is about , which is times the point value.
- Let fine frequencies disappear. Because the damping grows with the square of the frequency, a wide footprint removes the highest frequencies and keeps the coarse ones, so the encoding acts as a low-pass filter on position. Check: the damping factor is between 0 and 1, and it falls as rises.
- Feed the result to the network. The encoding of the interval, one entry per coordinate and frequency, replaces the point encoding. The network then renders the interval from its averaged features. Check: a far interval with a wide footprint gets few high-frequency entries, so it cannot depend on detail smaller than its footprint.
The plot shows the damping factor for two footprint sizes. A wider footprint, here , drops below about 0.14 by frequency 4, while a narrow footprint, , still keeps about 0.92 at frequency 8.
- sigma = 0.05
- sigma = 0.5
The math
Setting
The point encoding that NeRF uses for a coordinate is a list of sine and cosine pairs,
NeRF multiplies the input by before the sines. That scaling only changes the units of the coordinate, so the derivation below drops it. Let be the frequency of level . The paper models the region of an interval with a multivariate Gaussian , matched to the cone's mean and covariance. The approximation is the paper's choice, and the rest of this section takes it as given.
Step 1 in symbols: the expected value of one coordinate
Let be one coordinate of the region, a random variable with . The average of a complex exponential is called the characteristic function of . Here is the imaginary unit (), and by Euler's formula , so the real part of the average is the average of the cosine and the imaginary part is the average of the sine. For a normal variable the characteristic function has a closed form,
Taking the real part gives , and the imaginary part gives . The factor is the damping. It is the same for sine and cosine, and it depends only on the spread of the coordinate.
Step 2 in symbols: the integrated encoding
The encoding is applied to each coordinate separately, so each coordinate's expectation needs only its own marginal variance , which is the -th diagonal entry of . The integrated encoding of a Gaussian region is therefore
Here is the number of coordinates, is the -th entry of the mean, and is the damping at level for coordinate . Because is the variance of coordinate alone, the only approximation in this formula is the Gaussian itself.
Step 3 in symbols: the damping
Since , the damping is
For a fixed footprint , falls as grows, and it falls faster for wider footprints. Two facts follow directly. Frequencies with pass almost unchanged, because the exponent is near zero. Frequencies with are wiped out, because the exponent is large and negative. The transition happens around , which is where the spread is about of the coordinate, roughly a sixth of the wavelength of that frequency.
Worked examples
- Take a coordinate with mean and frequency , so .
- For a point, . The damping is , so the encoding is .
- Now let the coordinate spread with . The damping is .
- The integrated cosine is , and the integrated sine is .
- Interpretation: the point encoding says the cosine is 1, but the average over the spread region is 0.607. Averaging pulls the feature toward zero, because the cosine is not linear in the coordinate.
- Take a coordinate with mean , spread , and level , so .
- The phase is . The point features are and .
- The damping exponent is , so the damping is .
- The integrated sine is .
- The integrated cosine is .
- Interpretation: the spread is small, 0.05 in scene units, so the features change little, and the damping removes about 8 percent of each feature. The network sees a slightly weaker signal, not a different one.
Suppose a NeRF uses levels, so , and a distant surface gives a footprint with in normalised scene units. These numbers are illustrative.
- At level , and . The exponent is , so the damping is .
- At level , . The exponent is , so the damping is .
- At level , . The exponent is , so the damping is about .
- Interpretation: the coarse levels still carry the surface's shape, while the finest two are close to zero. The network receives no usable signal from the finest detail, so it cannot learn to rely on it at that distance, and the flicker from that detail does not appear.
Try it: at level with , what fraction of the point's feature survives? Answer: , so the exponent is , and the surviving fraction is .
Common mistakes and tradeoffs
It is tempting to think the encoding of a region is the encoding of its centre. In fact the sine and cosine are not linear, so averaging them is not the same as encoding the average. A cosine at the centre of a region can be 1 while the average over the region is 0.607, as in the first example. The centre encoding overstates the detail the region can show.
It is tempting to think integrated encoding removes aliasing completely. In fact it only attenuates frequencies that a footprint cannot resolve, and the result is only as good as the Gaussian approximation of the footprint. A cone is not exactly a Gaussian, and the paper's claims rest on that approximation.
It is tempting to think integrated encoding is a blur applied to the output image. In fact the damping acts on the network's input, so the network learns from the features each footprint can resolve. The output stays sharp where the footprint is narrow, which is the point of making the encoding depend on scale.
| Situation | Point encoding | Integrated encoding |
|---|---|---|
| One scale, close-up views only | Simple and fast | Unnecessary cost, little gain |
| Views from near and far in one model | Flicker from fine detail at a distance | Stable, because far footprints lose fine detail |
| Training on images at several resolutions | Needs a separate model or manual filtering | One encoding covers every scale |
| Need the cheapest possible forward pass | Only sines and cosines | Adds an exponential and a covariance per sample |
Use integrated encoding when the same model must render at many scales, or when the camera moves through a scene so that footprints change size. Skip it when every view is at one scale, since the point encoding is simpler.
History
Neural scene models of the early 2020s used sine and cosine features to let a multilayer perceptron represent high-frequency detail. NeRF in 2020 used such features at fixed frequencies for each point along a ray, which gave sharp images at a single scale but no control over the scale of the detail. Mip-NeRF, by Barron and colleagues in 2021, observed that rendering a pixel should integrate over its footprint, not sample a point, and derived the integrated encoding in closed form for Gaussian regions. The signal-processing idea behind it is older: a sampled signal can only represent frequencies below half the sampling rate, and a low-pass filter that averages over a region removes the rest before sampling. The paper ties the two ideas together for neural fields.
Recap
- A point encoding of position uses sines and cosines at frequencies , which lets a network represent fine detail but also makes distant views alias.
- The integrated encoding averages those features over a Gaussian region, and for each coordinate the average is the point feature times a damping factor .
- The damping is a low-pass filter. Wide footprints remove the fine frequencies, so the network sees only what the footprint can resolve.
- The result is a single model that renders stably at many scales, at the cost of an exponential and a covariance for each sample.
- Read next: NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis for the point encoding it replaces, and Mip-NeRF for the full method and its results.
Check yourself
QuestionRecall: what does integrated positional encoding average over, and what factor multiplies each sine and cosine feature?Show answer
QuestionComputation: a coordinate has mean 0, spread sigma = 0.5, and frequency omega = 4 (level l = 2). What is the integrated cosine, and what is the integrated sine?Show answer
QuestionWhy: why does a wider footprint remove fine frequencies more than coarse ones, and why is that useful for a distant view?Show answer
QuestionApplied: a NeRF with 12 levels renders a building well from close up, but its distant walls flicker as the camera moves. What would you change, and what would you check?Show answer
Sources
- Barron, J. T., Mildenhall, B., Tancik, M., Hedman, P., Martin-Brualla, R. and Srinivasan, P. P. (2021). Mip-NeRF: A Multiscale Representation for Anti-Aliasing Neural Radiance Fields. arXiv:2103.13415. https://arxiv.org/abs/2103.13415
- Mildenhall, B., Srinivasan, P. P., Tancik, M., Barron, J. T., Ramamoorthi, R. and Ng, R. (2020). NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. arXiv:2003.08934. https://arxiv.org/abs/2003.08934
- Wikipedia, "Aliasing". https://en.wikipedia.org/wiki/Aliasing