What does Visual Saliency and Interface Cognition conclude, in numbers, about “What Pops Out First: Visual Search and Saliency Maps”?
Answer: The speed of visual search depends on the relative difference between target and distractors on features that can be computed in parallel: a large enough difference makes the target pop out, no difference reduces search to inspecting items one by one, and guided search lies in between; the simulated slopes agree with the prediction \(50\,\Phi(-d'/\sqrt2)\). The structure of the Itti–Koch–Niebur model (nine-level pyramids, \(c\in\{2,3,4\}\), \(\delta\in\{3,4\}\), 42 feature maps, \(\mathcal N(\cdot)\), winner-take-all with inhibition of return) checks out; a standard-library implementation shows that, in this model, a button's colour uniqueness can move it from the 18th shift of attention to the first. But the model describes only low-level saliency, and the paper itself says its trajectories are not necessarily similar to human fixations; on web pages, centre and top-left biases, the task, text and faces are often more important.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's models and hypotheses; all pages, brands and data in the book are fictional or simulated.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 18, 42
| layout A, red CTA | 42 feature maps; saliency map 16 x 12 (level 4) |
| |=*+=============| | |
| |-=--=====-------| | |
| |++====-++-------| | |
| |++==+--++-------| | |
| |=*++++++====----| | |
| |=*++++++*@@@*---| | |
| |-=======--==--::| | |
| |-:------::::::::| | |
| |:::: | ...:.......| |
| |:::: | ...:.......| |
| |:: | .:...:...:...| |
| | | .:::.:::.......| |
| shift 1: cell (11, 5) S | 0.245 CTA button |
| shift 2: cell ( 1, 0) S | 0.165 logo |
| shift 3: cell ( 8, 5) S | 0.162 CTA button |
| shift 4: cell ( 1, 5) S | 0.149 hero photo |
| shift 5: cell ( 3, 4) S | 0.139 hero photo |
| shift 6: cell ( 8, 2) S | 0.135 white space |
| the CTA button is first attended at shift 1 | |
| peak S: CTA button 0.245, logo 0.165, hero photo 0.149, body text 0.134, card 1 0.082 | |
| layout B, grey CTA | 42 feature maps; saliency map 16 x 12 (level 4) |
| shift 1: cell ( 1, 0) S | 0.274 logo |
| shift 2: cell ( 2, 5) S | 0.183 hero photo |
| shift 3: cell ( 6, 5) S | 0.176 hero photo |
| shift 4: cell ( 4, 4) S | 0.172 hero photo |
| shift 5: cell ( 7, 3) S | 0.159 hero photo |
| shift 6: cell ( 1, 3) S | 0.158 hero photo |
Show the full program
# Itti-Koch-Niebur (1998) saliency, synthetic 256 x 192 landing page, standard
# library only. Nine dyadic Gaussian levels (0-8); centre c in {2,3,4}, surround
# s = c + d, d in {3,4}; 6 intensity, 12 colour, 24 orientation maps (42 in all);
# N(.) = scale to [0,1], multiply by (1 - mean of the other local maxima)^2; conspicuity
# maps summed at level 4; S = (N(I) + N(C) + N(O))/3. Simplifications: orientation =
# |oriented second difference| instead of Gabor filters, nearest-neighbour expansion,
# and an argmax WTA with disk-shaped inhibition of return (radius 1/6 of the smaller
# image side) instead of integrate-and-fire neurons. Layout A: red call-to-action
# (CTA) button; layout B: the same button in grey of equal intensity I = (r+g+b)/3.
import math # math.fsum: same float sums on Python 3.8-3.13
W, H = 256, 192
BOXES = [("nav bar", 0, 0, 256, 16, (.15, .15, .17)),
("logo", 8, 3, 40, 13, (.95, .55, .1)),
("hero photo", 8, 24, 124, 100, (.35, .55, .6)),
("sun in photo", 84, 34, 100, 50, (.98, .85, .2)),
("headline", 136, 28, 248, 36, None), ("body text", 136, 44, 248, 64, None),
("CTA button", 136, 76, 196, 92, (.85, .1, .1)),
("2nd button", 204, 76, 248, 92, (.9, .9, .9))]
BOXES += [(f"card {k + 1}", 8 + 62 * k, 116, 62 * k + 64, 180, (.93, .93, .93))
for k in range(4)]
THUMB = ((.75, .8, .85), (.85, .8, .75), (.8, .85, .78), (.82, .8, .86))
def page(cta):
img = [[(.97, .97, .97)] * W for _ in range(H)]
for name, x0, y0, x1, y1, col in BOXES:
col = cta if name == "CTA button" else col
for y in range(y0, y1):
for x in range(x0, x1):
if col:
img[y][x] = col
elif x % 7 < 4 and (name == "headline" or y % 7 < 4): # text strokes
img[y][x] = (.1, .1, .1) if name == "headline" else (.35, .35, .35)
for k in range(4): # card thumbnails and labels
for y in range(122, 160):
for x in range(14 + 62 * k, 58 + 62 * k):
img[y][x] = THUMB[k]
for y in range(166, 174):
for x in range(14 + 62 * k, 50 + 62 * k):
if x % 5 < 3:
img[y][x] = (.4, .4, .4)
return img
def down(m): # blur with [1 4 6 4 1]/16, then keep every 2nd pixel
h, w = len(m), len(m[0]); k = (1, 4, 6, 4, 1)
fs = math.fsum
rows = [[fs(k[j] * r[min(max(x + j - 2, 0), w - 1)] for j in range(5)) / 16
for x in range(0, w, 2)] for r in m]
return [[fs(k[j] * rows[min(max(y + j - 2, 0), h - 1)][x] for j in range(5)) / 16
for x in range(len(rows[0]))] for y in range(0, h, 2)]
def pyramid(m):
p = [m]
while len(p) < 9:
p.append(down(p[-1]))
return p
def diff(c, s, sign=1): # |c (-) s|: expand s to the size of c, subtract
fy, fx = len(s) / len(c), len(s[0]) / len(c[0])
return [[abs(c[y][x] - sign * s[int(y * fy)][int(x * fx)]) for x in range(len(c[0]))]
for y in range(len(c))]
def N(m):
mx = max(max(r) for r in m) or 1.0
m = [[v / mx for v in r] for r in m]; h, w = len(m), len(m[0]); peaks = []
for y in range(h):
for x in range(w):
v = m[y][x]
if 0 < v < 1 and all(v >= m[j][i] for j in range(max(y - 1, 0), min(y + 2, h))
for i in range(max(x - 1, 0), min(x + 2, w))):
peaks.append(v)
f = (1 - math.fsum(peaks) / len(peaks)) ** 2 if peaks else 1.0
return [[v * f for v in r] for r in m]
def to4(m): # average-pool any level to 16 x 12
f = len(m) // 12
return [[math.fsum(m[y * f + j][x * f + i] for j in range(f) for i in range(f)) / f**2
for x in range(16)] for y in range(12)]
def add(a, b):
return [[u + v for u, v in zip(r, q)] for r, q in zip(a, b)]
def orient(m, t): # oriented second difference, theta = 0/45/90/135
dy, dx = ((0, 1), (1, 1), (1, 0), (1, -1))[t]; h, w = len(m), len(m[0])
g = lambda y, x: m[min(max(y, 0), h - 1)][min(max(x, 0), w - 1)]
return [[abs(2 * g(y, x) - g(y - dy, x - dx) - g(y + dy, x + dx)) for x in range(w)]
for y in range(h)]
def saliency(img):
I = [[math.fsum(p) / 3 for p in r] for r in img]; imax = max(max(r) for r in I)
def opp(p, i):
if i < imax / 10:
return 0.0, 0.0
r, g, b = (v / i for v in p)
R, G, B = r - (g + b) / 2, g - (r + b) / 2, b - (r + g) / 2
Y = (r + g) / 2 - abs(r - g) / 2 - b
return max(R, 0) - max(G, 0), max(B, 0) - max(Y, 0)
op = [[opp(p, i) for p, i in zip(r, ri)] for r, ri in zip(img, I)]
PI = pyramid(I); PRG = pyramid([[o[0] for o in r] for r in op])
PBY = pyramid([[o[1] for o in r] for r in op])
PO = [[orient(PI[l], t) if l >= 2 else None for l in range(9)] for t in range(4)]
zero = [[0.0] * 16 for _ in range(12)]; Ib, Cb, Ob = zero, zero, [zero] * 4; n = 0
for c in (2, 3, 4):
for s in (c + 3, c + 4):
Ib = add(Ib, to4(N(diff(PI[c], PI[s]))))
rg, by = to4(N(diff(PRG[c], PRG[s], -1))), to4(N(diff(PBY[c], PBY[s], -1)))
Cb = add(Cb, add(rg, by))
Ob = [add(Ob[t], to4(N(diff(PO[t][c], PO[t][s])))) for t in range(4)]
n += 7 # 1 intensity + 2 colour + 4 orientation maps
Ob = [N(o) for o in Ob]; O = add(add(Ob[0], Ob[1]), add(Ob[2], Ob[3]))
S = add(add(N(Ib), N(Cb)), N(O))
return [[v / 3 for v in r] for r in S], n
def label(x, y): # level-4 cell -> page element under its centre
px, py = 16 * x + 8, 16 * y + 8
for name, x0, y0, x1, y1, _ in reversed(BOXES):
if x0 <= px < x1 and y0 <= py < y1:
return name
return "white space"
def scanpath(S, k=6, r=2):
S = [row[:] for row in S]; out = []
for _ in range(k):
v, y, x = max((S[y][x], y, x) for y in range(12) for x in range(16))
out.append((x, y, v))
for j in range(12):
for i in range(16):
if (i - x) ** 2 + (j - y) ** 2 <= r * r:
S[j][i] = 0.0
return out
if __name__ == "__main__":
for tag, cta in (("A, red CTA", (.85, .1, .1)), ("B, grey CTA", (.35, .35, .35))):
S, n = saliency(page(cta))
print(f"layout {tag}: {n} feature maps; saliency map 16 x 12 (level 4)")
if tag[0] == "A":
mx = max(max(r) for r in S)
for r in S:
print(" |" + "".join(" .:-=+*#%@"[min(int(v / mx * 10), 9)] for v in r)
+ "|")
path = scanpath(S, k=40)
for i, (x, y, v) in enumerate(path[:6], 1):
print(f" shift {i}: cell ({x:2d},{y:2d}) S = {v:.3f} {label(x, y)}")
first = next(i for i, (x, y, v) in enumerate(path, 1)
if label(x, y) == "CTA button")
print(f" the CTA button is first attended at shift {first}")
peak = {}
for y in range(12):
for x in range(16):
peak[label(x, y)] = max(peak.get(label(x, y), 0.0), S[y][x])
print(" peak S: " + ", ".join(f"{k} {peak[k]:.3f}" for k in
("CTA button", "logo", "hero photo", "body text", "card 1")))Single source and citation
Fan, Y. (2026). Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design (Version 1.0.0), Chapter 3: What Pops Out First: Visual Search and Saliency Maps. 5D Library. https://doi.org/10.5281/zenodo.23836258
DOI: 10.5281/zenodo.23836258 · Read the monograph · 5DL-B-046 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026046,
author = {Fan, Yafu},
title = {Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23836258},
url = {https://doi.org/10.5281/zenodo.23836258}
}Other chapter answers in this book
- Chapter 1 · Two Popular Rules: the Golden Ratio and Three Clicks
- Chapter 2 · Deciding and Pointing: the Hick–Hyman Law and Fitts's Law
- Chapter 4 · How Gaze Moves: Centre Bias, Saccades and Inhibition of Return
- Chapter 5 · Seeing Clearly: Spatial-Frequency Channels, Contrast Sensitivity and WCAG
- Chapter 6 · Can "Looking Good" Be Measured? Type Scales, Aesthetic Measure and Complexity
- Chapter 7 · Reading the Classics: Examining Curves and Aspects, and Timber as the Root
- Chapter 8 · Practice and a Pre-Registered Test