A common fix for rare diseases in medical imaging datasets is to train an image generator and use it to add synthetic examples of the rare classes. The deepfake-detection literature shows that generators leave invisible statistical traces in every image they produce: periodic frequency patterns from upsampling, and pixel-noise statistics that differ from a real scanner's. Put these two facts together and a problem appears. If synthetic images are added mostly to the rare classes, then "carries a generator trace" becomes a strong predictor of "rare disease" in the training set. A classifier can learn to detect forgeries instead of pathology. That shortcut would fail silently in the clinic, because real rare cases carry no generator trace. It would also invite attack: a tampered scan that carries such a trace could be steered toward a rare, high-stakes diagnosis.
This note proposes to measure that leak, show whether diagnostic classifiers exploit it, and remove it with a sampling rule that makes synthetic-ness carry no information about the label. If the leak is real, the rule is cheap to apply. If it is not, that is a useful negative result for anyone augmenting long-tailed medical data. The deepfake direction supplies the mechanism and the measurement tools. The class-imbalance direction supplies the setting where the failure matters.
Core Claim
The standard recipe fills each class up to a target count $M$ with $s_k$ synthetic images, where class $k$ has $n_k$ real images. The synthetic fraction of class $k$ is then
$$r_k = \frac{s_k}{n_k + s_k} = 1 - \frac{n_k}{M},$$
which is near 0 for head classes and near 1 for tail classes. The NIH-CXR-LT benchmark has a rarest class of 7 images against a head class above 45,000, so the synthetic flag nearly determines tail membership. The mutual information between the synthetic flag and the label is zero exactly when $r_k$ is the same for every class.
The claim has two parts. First, classifiers trained with the standard recipe measurably rely on generator traces. Second, a sampler that separates the two roles of augmentation can remove that reliance without giving up the tail gains. Its label-balancing step first picks the class (class-balanced). Its trace-neutral step then draws a synthetic rather than real image with the same probability $r$ for every class. This requires synthesizing only enough head-class images to fill batches, not matching head counts.
Relation to Prior Work
Three papers motivate this question. Red-GAN conditions a SPADE generator on masks and class metadata to add samples for sparse classes. It reports about 4–5% Dice gains on ISIC keratosis and the BraTS TCIA05 center, but it never examines the forensic properties of its samples. We reuse its recipe as the augmentation under study and ask what else the downstream model learns from it.
The detection literature supplies the tools and the evidence that generator traces exist. SFMFNet shows that upsampling leaves periodic frequency artifacts that survive compression. NoiseDF shows that sensor-noise residuals expose synthesis. DSKI and the MedForensics benchmark show that such traces are detectable at about 91.6% mean accuracy across six medical modalities, using constrained convolutions that strip anatomy. That work treats forgery detection as a balanced real-versus-fake task with no disease labels. We instead use a forensic detector as a probe of a diagnostic model and as an adversary in training.
CT-GAN constrains the threat model. It shows that injected lung nodules fool radiologists (99% in blind trials) and a screening AI (100%), and it proposes only cryptographic defenses. We ask the complementary question: does training on synthetic tail data make diagnostic models easier to steer with generated content?
On the imbalance side, Holste et al. show that the failure on long-tailed chest X-rays sits mostly in the classifier layer, and that decoupled retraining (cRT) lifts tail accuracy from 1.7% to 30.0% on NIH-CXR-LT. They also show that MixUp hurts on radiographs. Balanced-MixUp is the strongest non-generative regularizer on fundus images. These two papers set the bar any synthetic augmentation must clear. Holste et al. also warn that a clean decoupled baseline may leave little room for synthesis to help.
Research Program
The first component is a leak measurement. We train class-conditional generators on each benchmark's full training set, so tail synthesis borrows anatomy from head classes and softens the "synthesis dilemma" that Red-GAN identifies. We use two generator families, a SPADE GAN following Red-GAN and a latent diffusion model, because their traces differ. We then train diagnostic classifiers under the standard fill-to-$M$ recipe and read their behavior with three instruments.
The first instrument is the swap test. We generate synthetic head-class images (for example "No Finding" radiographs) and measure how often the classifier assigns them to a tail class. A trace-free model should not. The second instrument is a linear probe on the penultimate features that predicts whether an image is real or synthetic. High probe accuracy shows the representation encodes the trace. The third instrument is the real–synthetic tail gap: accuracy on held-out synthetic tail images minus accuracy on real tail test images.
The second component is the fix. The trace-neutral sampler holds $r$ constant across classes. We add an optional invariance term: a gradient-reversal head, initialized from a DSKI-style constrained-convolution detector, that penalizes features predictive of synthetic-ness. We sweep $r$ over 0.25, 0.5, and 0.75. We also test compression and low-pass filtering of synthetic images as a cheaper "wash the trace out" defense.
The third component is a security consequence. Following CT-GAN's injection protocol, we insert generated lesions into real test scans. We then compare how often each classifier flips to the target tail class when the injecting generator matches the augmentation generator's family versus when it does not.
Baselines
The naive reference point is plain softmax training on the natural distribution. Holste et al. report 1.7% tail accuracy and 0.164 group-wise average on NIH-CXR-LT. This anchors how bad the tail is without any intervention.
The strongest existing non-generative method on the chest benchmarks is decoupled classifier retraining (cRT) from Holste et al.. It retrains only the linear head with class-balanced sampling on a frozen backbone, and is reported at 30.0% tail accuracy and 0.369 group-wise average on NIH-CXR-LT, and 36.7% tail accuracy on MIMIC-CXR-LT. It is the strongest competitor because it fixes the dominant failure without any synthetic data. We rerun it with the same backbone, input resolution, epochs, and a matched hyperparameter search budget. Beating it means higher real-test tail accuracy and group-wise average across three seeds.
On Eyepacs, the strongest competitor is Balanced-MixUp, reported at a quadratic weighted kappa of 80.78, with 85.14 on external Messidor-2. We run it with the same ResNeXt-50 backbone.
The standard synthetic-augmentation baseline is Red-GAN-style fill-to-$M$, using the same generators as our method. Because only the sampling rule differs, this comparison isolates the sampler.
Two ablations separate the key ingredients: the trace-neutral sampler without the invariance term, and the invariance term under fill-to-$M$ sampling. We found no reported result on Lacuna for generator-based augmentation on NIH-CXR-LT or MIMIC-CXR-LT classification, so that baseline will be established here.
Why not just…?
Why not just use cRT and skip synthetic data entirely? This is the most serious threat. The cRT result suggests the tail problem is largely in the classifier layer, not a shortage of data. Our design settles it directly. If trace-neutral synthetic augmentation plus cRT does not beat cRT alone on real tail accuracy, the practical conclusion is not to synthesize. The leak measurement still stands as a warning about why earlier synthetic gains may have been inflated.
Why not just compress or blur the synthetic images to remove the trace? SFMFNet reports that upsampling artifacts survive standard compression, and blurring risks erasing the thin structures that Holste et al. show matter on radiographs. We test this defense anyway. If filtered images drive swap-test and probe scores to chance without hurting tail accuracy, it is the simpler winner and we will say so.
Why not just generate synthetic images for every class up to equal counts? Matching synthetic counts to the 45,000-image head classes is expensive. Equal synthetic counts also still leave $r_k$ unequal, because real counts differ, so the leak remains. Holding the rate constant at sampling time achieves zero leakage at a fraction of the generation cost. The fill-to-$M$ and equal-count variants are both run, so any difference will show up in the swap test.
Why not rely on scanner signatures instead? CT-GAN's cryptographic proposal protects scans in transit. It cannot stop a model from learning a shortcut that its own training pipeline created, so it does not address this failure.
Proposed Experiments and Decisive Checks
We use NIH-CXR-LT and MIMIC-CXR-LT, reporting head, medium, and tail accuracy plus group-wise average. We use Eyepacs with Messidor-2 as an external set, reporting kappa, and ISIC diagnosis for continuity with Red-GAN. MedForensics pretrains the probe and adversary detector.
The decisive check for the leak is the swap test under fill-to-$M$. If synthetic head images are assigned to tail classes far above the rate for real head images, and the real–synthetic tail gap is large, the shortcut exists. The decisive check for the fix is that the trace-neutral sampler brings the swap rate and probe accuracy near chance while matching or improving real-test tail accuracy. The decisive check for the security claim is a higher injection success rate on fill-to-$M$ models than on trace-neutral or cRT models, especially when the injecting generator shares the augmentation generator's family.
A null result on the first check, meaning no measurable reliance on generator traces, would retire the hypothesis. That would itself be worth reporting, since it would support synthetic tail augmentation as currently practiced.
References
- Red-GAN: Attacking class imbalance via conditioned generation. Yet another medical imaging perspective
- A Spatial-Frequency Aware Multi-scale Fusion Network for Real-Time Deepfake Detection
- Noise Based Deepfake Detection via Multi-Head Relative-Interaction
- Toward Medical Deepfake Detection: A Comprehensive Dataset and Novel Method
- CT-GAN: Malicious Tampering of 3D Medical Imagery using Deep Learning
- Long-Tailed Classification of Thorax Diseases on Chest X-Ray: A New Benchmark Study
- Balanced-MixUp for Highly Imbalanced Medical Image Classification