Two numbers describe the same measurement, and the gap between them is the whole article: 24.1× if I window the transform with a Hann taper, 4.3× if I use a rectangular one. I had written the first number down as the headline. My own control said the second number was just as true.
Here is the claim I started with. A real photograph is band-limited by its optics, so it has a hard spectral wall somewhere below Nyquist. An upscaled photograph has a wall too — but the upscaler put it there deliberately, with a low-pass filter, and it sits at exactly 0.5 / factor cycles per pixel. Above that cutoff an upscale is nearly empty. Below it, it is a smooth interpolation of the source. So the ratio of energy above the cutoff to total energy should separate the two by a wide margin.
That reasoning is correct. The separation is real. And it is still not enough to answer the question "was this image upscaled?" — because a photo that is merely out of focus does the same thing to the metric, and out-of-focus is dramatically more common than a 4× upscale you didn't ask for.
Everything below is read out of one file, nhip117_detect.json. Seven photographs, 512-pixel crops, 2-D FFT, one metric: AC energy above fc divided by total AC energy, where fc = 0.5 / factor. The native arm in every comparison is measured at the same cutoff as the upscaled arm it is compared against — not at full band versus reduced band, which would make the gap look larger than it is for free.
The wall is there, and it is 11.4× to 37× wide
Five upscale factors, three kernels each, native measured at the matching cutoff:
| factor | cutoff fc | native | bilinear | bicubic | Lanczos | native ÷ bilinear |
|---|---|---|---|---|---|---|
| 2× | 0.250 | 0.0111 | 0.00040 | 0.00083 | 0.00062 | 27.7× |
| 3× | 0.1667 | 0.0207 | 0.00182 | 0.00181 | 0.00136 | 11.4× |
| 4× | 0.125 | 0.0370 | 0.00153 | 0.00230 | 0.00206 | 24.2× |
| 6× | 0.0833 | 0.0596 | 0.00161 | 0.00189 | 0.00156 | 37.0× |
| 8× | 0.0625 | 0.0701 | 0.00191 | 0.00216 | 0.00160 | 36.7× |
Three things in that table surprised me.
First, the separation is not monotonic in the factor. It would be tidy if 2× were the hardest case to detect — least upscaling, least evidence. It isn't. 2× separates by 27.7× and 3× separates by 11.4×. The reason is arithmetic, not physics: the cutoff 0.5/factor has to land between two FFT bins, and at 3× it lands badly relative to the bin grid of a 512-pixel crop. The upscaled arm's residual is a floor set by the window's own leakage, and that floor does not move smoothly with the cutoff. So the weakest point of the whole detector is a bin alignment artefact, not a property of upscaling.
Second, the kernel choice barely matters. Within any row, bilinear, bicubic and Lanczos are within a factor of 2.08 of each other at worst (at 2×: 0.00040 bilinear against 0.00083 bicubic), and at 3× they are nearly indistinguishable — 0.00182, 0.00181, 0.00136. The gap to the native arm in the same row is 11× to 37×. What the metric is responding to is the existence of the low-pass filter, not its shape. That is a useful thing to know and a bad thing for attribution: the metric can tell you a filter exists, but it cannot tell you which one.
Third — and this is the correction I have to make to my own earlier draft — the separation number changes with the window. The native ÷ up column above is computed under a Hann window. I ran the same pairing under a rectangular window and got 4.3× where Hann gave 24.1×.
My control refuted my headline, and that is the useful part
I wrote the control before I wrote the article, which is the only reason I caught this. It said: the ratio must stay above 5× under both windows, because a window changes the leakage floor but not the underlying fact that one signal is band-limited and the other is not.
C4b: Hann native ÷ up4 = 24.1×. Rectangular = 4.3×. Prediction: >5× under both. Failed.
The absolute value of this metric is a property of the window, not of the image. A Hann taper concentrates energy into a narrow main lobe and suppresses sidelobes; a rectangular window does the opposite, smearing energy across the spectrum and filling the region above the cutoff with leakage. That is textbook spectral leakage, and the choice of taper is a real engineering decision, not a formality — which is exactly why window functions get their own chapter in every DSP text.
The practical rule that comes out of the failure: quote the ratio with the window named, or don't quote it. A bare "24× separation" is not a measurement, it is a measurement plus an unstated taper. Every number below therefore says Hann.
The same control run showed the window is not close to neutral even on the input side. Control C4 measured the same image's in-band energy at 0.037 under Hann and 0.0139 under rectangular — a factor of 2.66 with no upscaling involved at all. When the taper alone can move a reading by 2.66×, a 2.08× spread between kernels cannot be read as "this kernel removes more detail."
Two more controls, for completeness, both pass: the measurement is deterministic (0.037037 on two consecutive runs of the same image), and a synthetic perfectly band-limited signal returns 0.005535 above its cutoff rather than zero — the floor of the estimator, which is why 0.0004 is the smallest number that means anything here.
The test that ends the argument: blur
Up to this point the detector looks good. Here is the experiment that took it apart.
Take a native photograph — never upscaled, straight out of the camera pipeline — and apply a Gaussian blur of σ pixels. Measure the same metric at the 4× cutoff, 0.125.
| σ (px, on a native photo) | energy above 0.125 | says "upscaled"? |
|---|---|---|
| 0.0 | 0.03704 | no |
| 0.5 | 0.02302 | no |
| 0.7 | 0.01696 | no |
| 1.0 | 0.00993 | yes |
| 1.5 | 0.00320 | yes |
| 2.0 | 0.00076 | yes |
| 3.0 | 0.00002 | yes |
A Gaussian of σ = 1.0 px on a native file produces a reading below the 4× upscale's own reading of 0.00153. The detector cannot tell them apart, because at this cutoff they are not different: both are band-limited, both have had their finest detail removed, and the metric asks only whether the detail is gone.
σ = 1.0 px is not an exotic amount of blur. It is what you get from a cheap lens at full aperture, a plastic window on a phone case, a scanner with the lid slightly open, or one pass of noise reduction on a high-ISO file. It is ordinary softness, and this test flags it as an upscale.
Run the confusion count honestly. Five arms came back flagged — four blurs (σ = 1.0, 1.5, 2.0, 3.0) and one 4× upscale — and only one of those five really was an upscale. Precision: 20%. On the native side, four of seven arms were wrongly flagged, so specificity is 42.9%. A method with 24× separation on its headline metric and 20% precision on the question people actually ask is not a detector. It is a softness meter wearing a costume.
The log-log slope above the cutoff — a second, independent statistic — does not save it either:
| arm | slope above 0.125 (dB/oct) | flagged |
|---|---|---|
| native | −6.0 | no |
| blur 0.5 px | −7.05 | no |
| blur 0.7 px | −8.06 | no |
| blur 1.0 px | −10.2 | yes |
| blur 1.5 px | −15.45 | yes |
| blur 2.0 px | −22.79 | yes |
| upscale 4× | −19.17 | yes |
The 4× upscale's slope sits between blur 1.5 and blur 2.0. There is no threshold on this statistic that admits the upscale and rejects the blurs, because the upscale is a blur with a particular transfer function. That is not a coincidence to be worked around. It is the mechanism: resampling is low-pass filtering, and the metric measures low-pass filtering. Any statistic that measures "how much high-frequency energy is missing" will be confused by anything else that removes high-frequency energy. Which is most of the things that happen to photographs.
Two more statistics that cannot do the job
Level occupancy. An upscale interpolates, so it should produce fewer distinct 8-bit values and a lower histogram entropy than the original. It doesn't, meaningfully. Across seven images, distinct values moved 252→252, 250→246, 251→250, 256→250, 256→254, 254→239, 250→227; Shannon entropy moved by at most 0.051 bits — rising on five images and falling on two (the largest fall, 7.251 → 7.231, is 0.020 bits). An image with 227 distinct levels instead of 250 is not evidence of anything a viewer would see. Histogram-based "is this upscaled" checks are not measuring what they claim.
JPEG. I re-encoded both arms at quality 70, 85 and 95 to see whether compression noise flattens the separation. It doesn't — separation stayed at 1.0 (flagged) for all three images at all three qualities. But that is not the detector succeeding. JPEG quantisation removes high-frequency detail from both arms, so the native arm's residual falls toward the upscale's floor at the same time. The gap survives, but its meaning degrades: at q70 the 4× residual on one image rose from 0.00153 to 0.00176 while separation was still "1.0," which is the metric becoming more confident after the evidence got worse.
So what is the ratio good for?
It is a good screening test and a bad verdict. Used that way, it earns its keep:
- If the ratio (Hann, named cutoff, same-cutoff native baseline) is above ~20×, the image has a great deal of genuine fine detail and is very unlikely to be a straightforward 4× upscale of a smaller file. That is a useful negative.
- If the ratio is below ~5×, the image has been low-pass filtered by something — an upscale, a lens, a denoiser, a JPEG chain, or a resize — and you now know to ask which.
- Anything in between is not information. Do not report it as one.
The reason the negative is trustworthy and the positive is not is asymmetry of evidence. Fine detail that survives at 0.125 and above cannot be manufactured by an interpolator. Its absence can be manufactured by a dozen unrelated things. A test whose positive result has many causes and whose negative result has one cause is only valid in one direction.
When you should not run this at all
- Single image, unknown provenance. The metric has no absolute scale. Without a same-cutoff native baseline from a comparable file, the number means nothing.
- Anything that has been resized, ever. A file that was downscaled for the web and then upscaled back has two low-pass filters in it. You will measure the sum and attribute it to one.
- Screenshots, renders, and anything with synthetic edges. The bandlimit assumption is about optics. A render has no optics and no wall, and a screenshot has pixel-aligned edges that will read as maximum detail.
- Heavily denoised files. Modern denoisers are trained to preserve edges and remove texture, which produces exactly the signature this metric calls "upscaled." You will get a confident wrong answer.
- Any question where the answer changes a decision about a person. 25% specificity is a fun fact in a notebook and a serious problem in a moderation queue.
A procedure that follows from the numbers
- Fix the window before you look at anything. Hann, and write it down. If you use rectangular windows for speed, re-run one image under Hann and see how far the ratio moves — on my data it moved 24.1 to 4.3, which is enough to change any conclusion.
- Compare like with like. Native energy must be measured at the same cutoff as the upscaled arm. An earlier version of my own control divided the minimum native residual by the maximum upscale floor across different factors and printed 3.1× — a cross-factor mismatch that looked like a weak detector and was actually a broken comparison. Pairing each factor with its own cutoff gives 11.4× to 42×.
- Run the blur null before you trust a positive. Take a known-native image, blur it at σ = 1.0 px, and measure. If the blurred native and the suspect land within a factor of ~2, you have learned nothing about the suspect's history.
- Report the weakest factor, not the average. The 3× case gave 11.4× where 6× gave 37×. The 3× number is the one that governs whether the method works on an arbitrary file, because you do not get to choose the upscale factor of a file someone else made.
- Convert a positive into a question, not an accusation. "This file's high-frequency content is consistent with a resize" is supportable. "This file was upscaled" is not, and the difference costs one sentence.
Where this feeds into an actual pipeline
The reason I care about the measurement at all is that upscaling decisions upstream decide whether this test is even meaningful later. If a resize is going to happen, it should happen once, at an integer factor, from the best source available, with the kernel chosen for the output rather than inherited from a default — and then the result should be the file of record, not a file that gets resized again somewhere downstream. Every extra low-pass filter in the chain makes provenance unrecoverable, and this experiment is a demonstration of exactly how quickly that happens.
If the resize half is what you need handled, the upscaler at upgolab.com runs the resize and selects a preset for the content type; the checklist above is what to run afterwards if you care whether anyone can later tell what happened to the file.
That 28-second video is a pass through five presets on real product frames — watch it here if the embed does not load. Watch it with this article in mind: what changes between presets is mostly edge contrast, which is precisely the quantity the blur test above showed is not diagnostic of provenance.
What the numbers actually said
I set out to build a native-versus-upscaled detector and expected to report a wide margin and a clean threshold. The margin is real — 11.4× to 37× depending on the factor, under a Hann window — and the threshold does not exist. A Gaussian blur of σ = 1.0 px on a native photograph reads below the 4× upscale on the identical metric, which means the statistic measures softness and not history. Precision on the arms I tested was 20%; specificity, 42.9%.
The refutation that stings more is the one about my own headline. I had a ratio of 24.1× that I was going to print without qualification. The control I wrote to protect it — "this ratio should hold under both windows" — failed, and the honest version of the number is "24.1× under Hann, 4.3× under rectangular." Both are in nhip117_detect.json. The difference between those two sentences is the difference between a measurement and a claim.
Checklist
- [ ] Window named and fixed (Hann) before any comparison
- [ ] Native baseline measured at the same cutoff as the upscaled arm
- [ ] Ratio reported per factor, with the weakest factor quoted
- [ ] Blur null run at σ = 1.0 px on a known-native image
- [ ] Kernel spread (2.08× here) checked — it bounds any "this kernel" claim
- [ ] Level-occupancy and histogram statistics kept out of the verdict
- [ ] Positive result phrased as consistency with a resize, not proof of one
- [ ] Decided explicitly whether 20% precision is acceptable for the decision at hand


Top comments (0)