Do CNNs Internally Represent Real and Fake Images Differently? A Hidden-Layer Analysis
Organizations: Department of Computer Science, Kansas State University, Manhattan, Kansas, USA
Abstract
Fake/synthetic images are increasingly prevalent, but it remains unclear whether Convolutional Neural Networks (CNNs) process real and fake images in the same internal manner. This work examines the hypothesis that CNNs represent real and fake images differently, such that fake images induce different hidden-layer activation patterns even when semantic content is preserved. The hypothesis is evaluated in scene recognition settings using trained CNN models. Dense-layer activations are extracted, and neurosymbolic methods assign semantic labels to selected neurons. For each real test image, corresponding fake images are generated with similar semantic content using object-label-guided text-to-image and image-to-image generation based on Stable Diffusion variants. Paired real-fake activation patterns are then compared statistically. Additional experiments with another dataset, CNN architecture, generative model, and JPEG/blur degradation analysis assess robustness. Results suggest that fake images evoke different hidden-neuron activations, and these differences are not explained only by simple image degradation. Overall, the findings indicate that real and fake images differ in CNN hidden-layer activation behavior at least in some settings, which opens the door for follow-up work on making use of this different behavior to improve fake image detection.
Figures & tables
| Hypothesis | Neuron Subset | Selection Criteria | Metric Compared | Interpretation |
| H1 | All | Activated ( ), zero-filtered | Count | Real images trigger broader neural activity than fake |
| H2 | Relevant confirmed | i) Semantically aligned or ii) activated | Value | Real images activate relevant neurons more strongly |
| H3 | Activated for real | Activation threshold | Shared Count | Fake images fail to preserve real activation patterns |
| H4 | Activated & confirmed | Confirmed with activation threshold | Count | Real images better activate semantically meaningful neurons |
| Neuron ID | ECII Concepts | TLA % | Non-TLA % | Target Median | Non-Target Median | Target Mean | Non-Target Mean | -score | -value |
|---|---|---|---|---|---|---|---|---|---|
| 0 | snowy_mountain | 95 | 54.44 | 7.05 | 0.25 | 6.12 | 1.04 | -6.57 | |
| 7 | sky_and_snowy_mountain | 95 | 38.81 | 2.81 | 0.00 | 2.72 | 0.56 | -5.92 | |
| 9 | fence_and_central | 100 | 62.30 | 4.03 | 0.76 | 3.97 | 1.46 | -5.54 | |
| … | … | … | … | … | … | … | … | … | |
| 41 | skyscraper | 80 | 69.92 | 1.21 | 1.03 | 2.05 | 1.46 | -1.40 | |
| … | … | … | … | … | … | … | … | … |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 402 | 348 |
| Median(diff) | 1.000 | 1.000 |
| Mean(diff) | 0.542 | 0.787 |
| Prop(real fake) | 0.600 | 0.681 |
| -value |
| Statistic | Text-Guided Fake Generation (Concept Alignment) | Structure-Guided Fake Generation (Concept Alignment) | Text-Guided Fake Generation (Activation-Based Relevancy) | Structure-Guided Fake Generation (Activation-Based Relevancy) |
| Images paired | 890 | 885 | 244 | 249 |
| Nonzero diffs used | 890 | 885 | 244 | 249 |
| Median (real - fake) | 0.7047 | 1.0429 | 2.5363 | 2.2209 |
| Mean (real - fake) | 0.7421 | 1.2023 | 2.6552 | 2.5786 |
| Prop(real - fake) | 0.657 | 0.740 | 0.959 | 0.924 |
| -value |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 299 | 264 |
| Mean(real_count) | 0.803 | 0.803 |
| Mean(fake_count) | 0.057 | 0.158 |
| Median (real_count - fake_count) | 1.000 | 1.000 |
| Prop(real_count fake_count) | 1.000 | 1.000 |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 212 | 189 |
| Median (real-fake) counts | 1.000 | 1.000 |
| Prop(real fake) | 0.646 | 0.709 |
| -value | ||
| Effect size ( | 0.292 | 0.418 |
Appendix figures & tables25 assets
Supplementary material from the paper’s appendix.
Appendix
| Neuron ID | ECII Concepts | TLA % | Non-TLA % | Target Median | Non-Target Median | Target Mean | Non-Target Mean | -score | -value |
|---|---|---|---|---|---|---|---|---|---|
| 0 | snowy_mountain | 95 | 54.44 | 7.05 | 0.25 | 6.12 | 1.04 | -6.57 | |
| 7 | sky_and_snowy_mountain | 95 | 38.81 | 2.81 | 0.00 | 2.72 | 0.56 | -5.92 | |
| 9 | fence_and_central | 100 | 62.30 | 4.03 | 0.76 | 3.97 | 1.46 | -5.54 | |
| 11 | bathtub | 100 | 51.98 | 4.79 | 0.05 | 4.69 | 0.75 | -7.23 | |
| 12 | coffee_and_bouquet | 95 | 55.16 | 1.37 | 0.20 | 1.60 | 0.78 | -3.82 | |
| 16 | skyscraper_and_building | 95 | 45.95 | 2.68 | 0.00 | 2.45 | 0.59 | -5.57 |
| Statistic | Real Images with JPEG Compression |
|---|---|
| Images paired | 793 |
| Nonzero diffs used | 304 |
| Median(real - compressed_real) | -1.000 |
| Mean(real - compressed_real) | -0.280 |
| Prop(real compressed_real) | 0.418 |
| -value | 0.9972669 |
| Statistic | Concept Alignment | Activation-Based Relevancy |
|---|---|---|
| Images paired | 966 | 260 |
| Nonzero diffs used | 966 | 260 |
| Median(real - compressed_real) | -0.0383 | 0.3315 |
| Mean(real - compressed_real) | -0.0656 | 0.4086 |
| Prop(real - compressed_real 0) | 0.478 | 0.677 |
| -value | 0.9676 |
| Statistic | Real Images with JPEG Compression |
|---|---|
| Images paired | 793 |
| Nonzero diffs used | 168 |
| Mean(real_count) | 0.803 |
| Mean(compressed_real_count) | 0.480 |
| Median(real_count - compressed_real_count) | 1.000 |
| Prop(real_count compressed_real_count) | 1.000 |
| Statistic | Real Images with JPEG Compression |
|---|---|
| Images paired | 793 |
| Nonzero diffs used | 151 |
| Median(real - compressed_real) counts | -1.000 |
| Prop(real compressed_real) | 0.457 |
| -value | 0.8666343 |
| Effect size ( ) | -0.086 |
| Statistic | Mild Blur | Medium Blur |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 295 | 302 |
| Median(real - blurred_real) | 1.000 | 1.000 |
| Mean(real - blurred_real) | -0.044 | 0.331 |
| Prop(real blurred_real) | 0.515 | 0.606 |
| -value | 0.6090308 |
| Statistic | Mild Blur | Medium Blur | ||
|---|---|---|---|---|
| Concept Alignment | Activation-Based Relevancy | Concept Alignment | Activation-Based Relevancy | |
| N total | 967 | 260 | 960 | 260 |
| Nonzero diffs used | 967 | 260 | 960 | 260 |
| Median(real - blurred_real) | 0.0226 | 0.4866 | 0.1731 | 0.7375 |
| Mean(real - blurred_real) | 0.0261 | 0.5052 | 0.1861 | 0.7686 |
| Prop(real blurred_real) | 0.508 | 0.754 | 0.571 | 0.762 |
| Statistic | Mild Blur | Medium Blur |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 189 | 229 |
| Median(real_count - blurred_real_count) | 1.000 | 1.000 |
| Prop(real_count blurred_real_count) | 1.000 | 1.000 |
| -value | ||
| Effect size ( ) | 1.000 | 1.000 |
| Statistic | Mild Blur | Medium Blur |
|---|---|---|
| Images paired | 793 | 793 |
| Nonzero diffs used | 155 | 162 |
| Median(real - blurred_real) | 1.000 | 1.000 |
| Prop(real blurred_real) | 0.523 | 0.605 |
| -value | 0.3883456 | |
| Effect size ( ) | 0.045 | 0.210 |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 399 | 339 |
| Median(real-fake) | 1.000 | 1.000 |
| Mean(real-fake) | 0.574 | 0.209 |
| Prop(real fake) | 0.667 | 0.558 |
| -value |
| Statistic | Text-Guided Fake Generation (Concept Alignment) | Structure-Guided Fake Generation (Concept Alignment) | Text-Guided Fake Generation (Activation-Based Relevancy) | Structure-Guided Fake Generation (Activation-Based Relevancy) |
| Images paired | 888 | 880 | 269 | 285 |
| Nonzero diffs used | 888 | 880 | 269 | 285 |
| Median(real - fake) | 1.4678 | 0.1044 | 4.2830 | 0.8398 |
| Mean(real - fake) | 1.3775 | 0.4081 | 4.3264 | 1.4776 |
| Prop(real fake) | 0.718 | 0.536 | 0.970 | 0.775 |
| -value |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 329 | 215 |
| Mean (real_count) | 0.431 | 0.431 |
| Mean (fake_count) | 0.014 | 0.196 |
| Median(real_count - fake_count) | 1.000 | 1.000 |
| Prop(real_count fake_count) | 1.000 | 1.000 |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 232 | 205 |
| Median (real-fake) counts | 1.000 | 1.000 |
| Prop(real fake) | 0.828 | 0.546 |
| -value | ||
| Effect size ( ) | 0.655 | 0.093 |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 400 | 329 |
| Median(real - fake) | 1.000 | 1.000 |
| Mean(real - fake) | 0.818 | 0.356 |
| Prop(real fake) | 0.718 | 0.626 |
| -value |
| Statistic | Text-Guided Fake Image Generation (Concept Alignment) | Structure-Guided Fake Image Generation (Concept Alignment) | Text-Guided Fake Image Generation (Activation-Based Relevancy) | Structure-Guided Fake Image Generation (Activation-Based Relevancy) |
| Images paired | 925 | 905 | 316 | 292 |
| Nonzero diffs used | 925 | 905 | 316 | 292 |
| Median(real - fake) | 1.1181 | 0.1640 | 3.3038 | 0.8045 |
| Mean(real - fake) | 1.0456 | 0.1993 | 3.4708 | 0.8583 |
| Prop(real fake) | 0.692 | 0.572 | 0.984 | 0.757 |
| -value |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 321 | 229 |
| Mean (real_count) | 0.431 | 0.431 |
| Mean (fake_count) | 0.021 | 0.191 |
| Median(real_count - fake_count) | 1.000 | 1.000 |
| Prop(real_count fake_count) | 1.000 | 1.000 |
| Statistic | Text-Guided Fake Image Generation | Structure-Guided Fake Image Generation |
|---|---|---|
| Images paired | 1370 | 1370 |
| Nonzero diffs used | 256 | 212 |
| Median(real - fake) | 1.000 | 1.000 |
| Prop(real fake) | 0.758 | 0.580 |
| -value | ||
| Effect size ( ) | 0.516 | 0.160 |