Adolescents with scoliosis, a sideways curvature of the spine, may receive up to 22 X-rays over three years of monitoring. Photographs of the bare back are a radiation-free substitute, and recent networks already grade curve severity from them. These networks share two weaknesses. They are trained on cohorts of a few hundred to a few thousand patients, and they degrade when the camera or room lighting changes. The diagnostic signal in a back photo is faint: a rib hump or a deviated spinal furrow shows up only as small local shading gradients across a surface whose relief spans about 10 cm. Central difference convolutions, filters that weight differences between each neighboring pixel and the center pixel rather than raw intensities, are built to pick up exactly this kind of faint local contrast. They have also let networks with fewer than a million parameters train from scratch.
Moving these filters directly from face anti-spoofing to back photographs has two flaws. First, the invariance usually claimed for them only cancels an additive brightness offset, while real changes in lighting and camera exposure are roughly multiplicative. Second, when a network is told to ignore everything outside the back, the usual method is to zero those pixels. That creates an artificial edge at the mask border, and a difference filter responds most strongly to edges. We propose a single operator that fixes both problems. It takes differences of log-intensity, which cancels multiplicative gain, and it only compares pairs of pixels that both lie inside a learned, soft back mask, so mask borders and background never produce responses. We then test whether this operator lets compact networks trained from scratch on 50 to 200 patients match or beat ImageNet-pretrained backbones, and whether they hold up under lighting shift.
Core Claim
A difference convolution computed on log-intensity and gated by a jointly learned region-of-interest mask should do three things. It should keep its output unchanged under changes in camera gain or exposure that are smooth over the filter's neighborhood. It should produce no response at the mask border. It should give a compact network enough built-in bias toward local relief cues to train from scratch on small radiation-free cohorts. Concretely, at pixel $p_c$ with neighbors $p_i$, the operator computes
$$y(p_c) = \sum_{i} w_i \, m(p_i)\, m(p_c)\,\big(\ell(p_i) - \ell(p_c)\big) \;+\; \theta \sum_i w_i \, m(p_i)\, x(p_i),$$
where $x$ is pixel intensity and $\ell = \log(x+\epsilon)$ is log-intensity. The $w_i$ are learned weights. $m \in [0,1]$ is a soft back mask predicted by a segmentation head trained jointly with the severity task. $\theta$ is a learned scalar that mixes in an ordinary masked convolution, so absolute intensity is not discarded entirely.
If the image is scaled by a gain $g$ that is roughly constant over the 3×3 neighborhood, then $\log g$ cancels in the first term. If either pixel of a pair lies outside the mask, that pair contributes nothing. The first term can be rewritten as two ordinary convolutions, one applied to $m\ell$ and one to $m$, so it stays cheap. It does give up the exact conversion to a single vanilla convolution at test time that PiDiNet exploits.
Where This Sits
Prior work that supplies the method. The difference operator comes from face anti-spoofing. Searching Central Difference Convolutional Networks for Face Anti-Spoofing introduced central difference convolution as a learnable high-pass filter. Multi-Modal Face Anti-Spoofing Based on Central Difference Networks argued for its robustness across sensors. S-Adapter inserted these filters into frozen vision transformers and reduced cross-domain error (HTER) on MICO from 4.75% to 3.43% at 0.38% extra parameters. All three operate on linear intensity, which is why they can only claim invariance to additive offsets, and none uses a spatial mask. PiDiNet supplies the evidence for training from scratch: 0.807 ODS on BSDS500 with under 1M parameters and no ImageNet pretraining. That result is on natural-image edges, not on clinical small-sample tasks.
Prior work that motivates the proposal. Radiation-free spine assessment is established, and it is fragile in the ways we target. ScolioNet classifies severity from smartphone photographs and reports a follow-up AUC of 0.839 on its prospective cohort, where it notes degradation from camera and lighting shift. Yang et al. crop the back with Faster R-CNN and then classify with a ResNet-101, reaching an external AUC of 0.929 for curves of 20° or more. Their pipeline has no way to recover from a bad crop. EUFormer reconstructs 3D curves from two orthogonal photos (curve IoU 56.3, Dice 0.71, versus 52.3/0.68 for a U-Net) and struggles most on moderate cases with subtle surface cues. GAMA-Net predicts back depth before segmenting the curve (IoU 0.8102), at the cost of depth supervision from a Kinect sensor. None of these methods uses difference operators, and none is studied below a few hundred patients.
Prior work that constrains the design. The Role of Pleura and Adipose in Lung Ultrasound AI shows that masking out non-diagnostic tissue raises AUC from 0.6553 to 0.7742 because unmasked models learn shortcuts. Masking is therefore needed, but its hard masks are exactly the kind that would create spurious edges for a difference filter. Seg4Reg+ shows on spine X-rays that training segmentation jointly with angle regression beats a cascade (Jaccard 75.47% to 77.86%, SMAPE 7.32%). We adopt its joint training but use a single loss rather than its five-step schedule. Tartaglione et al. find that ResNet-50 overfits relative to ResNet-18 on 447 chest radiographs and that pretraining on other cohorts imports shortcuts. That finding is the reason our main pretrained baseline is a small network rather than a large one.
Research Program
We build a compact encoder of about 1–2M parameters whose early stages use the mask-aware log-difference operator. A light segmentation head predicts the soft back mask $m$, supervised by coarse back-outline annotations. A severity head predicts curve-severity grade and, where labels exist, Cobb angle. All parts are trained together, so the severity loss can reshape the mask.
The analysis targets the two failure modes the operator is designed to remove. We measure feature-map change under controlled photometric perturbations: a global gain, a gamma change, and a smooth spatially varying illumination field. We also measure how strongly filters respond within a few pixels of the mask border compared with inside the back. Two further checks address the noise risk the file raises for high-pass filters. The first applies the same operator to the public AASCE spine X-ray set, which has quantum mottle. The second compares log-domain and linear-domain differences in dark regions, where $\log$ amplifies sensor noise; we tune $\epsilon$ for this case.
Baselines
The naive reference point is a ResNet-18 pretrained on ImageNet and fine-tuned on the full uncropped photograph with standard color-jitter augmentation. Following Tartaglione et al., this is the strongest generic choice at small sample sizes.
The strongest existing-method baseline is a reimplementation of the Yang et al. two-stage design, a detector crop followed by a classifier, with the classifier reduced to ResNet-18 to match the sample regime. We also run a ScolioNet-style residual-attention ResNet-50. Their published AUCs, 0.929 external for Yang and 0.839 prospective for ScolioNet, come from their private cohorts and cannot be compared directly. We therefore rerun both on our splits.
On the public AASCE X-ray check, the reference is Seg4Reg+ at SMAPE 7.32% and Jaccard 77.86% from Seg4Reg+. We report results at reduced training sizes as well as the full 609 images.
The ablations isolate the key ingredient. We compare the following variants, each against the full operator:
- linear-intensity central difference convolution, unmasked, as in the face anti-spoofing papers;
- linear-intensity difference with the mask applied after the filter;
- log-difference with a hard mask;
- log-difference with a soft mask that is fixed rather than learned;
- the full operator with $\theta$ forced to zero, which tests whether absolute intensity matters.
Fairness rules apply to every model. All models see the same patients, splits and augmentation policy. Each gets the same number of hyperparameter trials, 20 random-search runs. Each is trained to the same wall-clock budget on one GPU. Results are averaged over five seeds per training size.
The proposal counts as beating a baseline under two conditions. It must improve AUC for detecting curves of 20° or more by a margin larger than the across-seed standard deviation at training sizes of 200 or fewer. It must also lose at least half as much AUC as the baseline under the held-out lighting shift.
Why not just…?
Why not just use heavy photometric augmentation with instance normalization? This is the most serious alternative. Mean subtraction already removes additive offsets, and gain and gamma jitter teach approximate multiplicative invariance. Our claim survives only if built-in invariance generalizes to perturbations outside the augmentation range: spatially varying illumination fields, and gains beyond those seen in training. These are exactly the conditions in our held-out shift tests. If augmentation matches the operator there, we will report that the invariance argument adds nothing. The contribution then reduces to whatever sample-efficiency gain remains.
Why not just fine-tune a pretrained ResNet-18? Pretrained early layers already contain edge-like filters. PiDiNet showed that difference filters trained from scratch can compete with pretrained models on edges, but not on clinical photographs. Our learning curves at 50, 100, 200 and the full cohort settle the question. We expect any advantage to appear at the smallest sizes and shrink as data grows. If no advantage appears at 50–100 patients, the from-scratch argument fails.
Why not just add a fixed Sobel channel or crop first, then classify? A fixed Sobel filter is neither learnable nor gain-invariant, and the hand-tuned Sobel pipeline in Gare et al. needed manual curve fitting. Crop-then-classify inherits localization errors, which is the cascade problem documented by Seg4Reg+. Both appear as baselines. We also test robustness to deliberately jittered crops to measure how much each design depends on accurate localization.
Proposed Experiments
The primary experiment requires an institutional optical cohort of posteroanterior back photographs with paired radiographic Cobb angles, of the kind used by EUFormer and ScolioNet. We will obtain one through collaboration or collect it ourselves; no public optical dataset appears in the file. Splits are by patient. One acquisition device or room is held out as the shift test set. Metrics are AUC for curves of 10° or more and 20° or more, macro-F1 over severity grades, and mean absolute error in Cobb angle where labels exist.
The decisive checks are three. The first is a learning curve where the proposal's advantage over pretrained ResNet-18 is largest at 50–100 patients. The second is a shift test, both device hold-out and synthetic illumination fields, where log-domain masked differences beat both linear central difference convolution and the augmentation baseline. The third is a boundary-response measurement showing that the mask gating, rather than the difference operator alone, removes the edge artifacts that hard masking creates.
The secondary public check repeats the comparison on AASCE against the Seg4Reg+ numbers above. It tests whether the operator helps or hurts on a noisy ionizing modality. If performance drops there, the result supports limiting the claim to optical surface imaging.
References
- Pixel Difference Networks for Efficient Edge Detection
- Searching Central Difference Convolutional Networks for Face Anti-Spoofing
- Multi-Modal Face Anti-Spoofing Based on Central Difference Networks
- S-Adapter: Generalizing Vision Transformer for Face Anti-Spoofing With Statistical Tokens
- A clinical classification for radiation-less monitoring of scoliosis based on deep learning of back photographs
- Development and validation of deep learning algorithms for scoliosis screening using back images
- EUFormer: Learning Driven 3D Spine Deformity Assessment with Orthogonal Optical Images
- A Dual-Feature Extractor Framework for Accurate Back Depth and Spine Morphology Estimation from Monocular RGB Images
- The Role of Pleura and Adipose in Lung Ultrasound AI
- Seg4Reg+: Consistency Learning Between Spine Segmentation and Cobb Angle Regression
- Unveiling COVID-19 from CHEST X-Ray with Deep Learning: A Hurdles Race with Small Data