Dense Connections vs. Residual Shortcuts: How DenseNet-121 Outperforms ResNet-50 in Brain Cancer Recognition ✛

Original: "Evaluation and optimization of deep learning models for enhanced detection of brain cancer using transmission optical microscopy of thin brain tissue samples"
arXiv:2505.11735 · 2025-05-16 · CC BY 4.0 · 4 min
Comparing two neural networks on thin brain slice images showed that dense connections between layers yield 88.35% accuracy versus 82.12% for a network with residual shortcuts.

Context

Manual interpretation of brain biopsy images is labor-intensive and suffers from inter-observer variability: different doctors may assess the same section differently. A substantial body of work has grown around this problem; neighboring studies in our archive use neural networks for tumor segmentation, image synthesis, and model confidence estimation. This article follows the same line of automating medical image analysis but focuses on a direct comparison of two popular convolutional architectures for classifying brain tissue images. The task is not new, but a systematic comparison on a single dataset with careful overfitting control fills a gap in the evidence base for architecture selection.

Methods

We used a commercial tissue microarray (TMA) with 24 circular brain tissue samples, each 5 microns thick, scanned on an Olympus BX61 microscope with a 40x objective in automatic scanning mode (about 100 points in 6 minutes). From 2931 images, we allocated 1996 for training, 437 for validation, and 498 for testing, splitting by patient to prevent data leakage. Each image was resized to 256×256 pixels and normalized using the training set mean and variance. We took two ImageNet-pretrained networks, ResNet-50 and DenseNet-121, and replaced the final layer with a two-output classifier. Fine-tuning proceeded in two stages: first 10 epochs training only the new classifier with frozen convolutional layers, then 20 more epochs with the last two blocks unfrozen and a lower learning rate. We applied random rotations, reflections, shifts, and brightness changes, as well as early stopping if validation loss did not improve for 5 epochs.

Results

On the held-out test set of 498 sections, DenseNet-121 achieved 88.35% accuracy (95% confidence interval ±1.28%), a cancer class precision of 0.9614, recall of 0.8667, and an F1-score of 0.9116. ResNet-50 reached 82.12% (±1.75%), with precision 0.9035, recall 0.8142, and F1-score 0.8563. The 6.23 percentage point difference in accuracy is statistically significant (p=0.004 by McNemar's test). DenseNet-121's confusion matrix shows 299 true positives, 141 true negatives, 46 false negatives, and only 12 false positives; the low false alarm rate (7.9%) is critical for clinical use. The network slightly overpredicts the 'no cancer' class (187 vs. 153) and underpredicts 'cancer' (311 vs. 345), which could be corrected by class weighting.

Implications

This work demonstrates that dense connections between layers (as in DenseNet) are more effective than residual shortcuts (as in ResNet) for transferring knowledge to small medical datasets. Compared to neighboring studies that often use a single architecture or tackle segmentation, here we directly compare two networks under an identical training protocol with statistical significance testing. This yields a practical recommendation: for tissue image classification with limited examples, DenseNet-like architectures are preferable. The two-stage fine-tuning with aggressive augmentation is reproducible and can serve as a template for other binary classification tasks in pathology.

Future development

A natural extension is moving from binary classification to multiclass tumor grading (low, intermediate, high grade) using ordinal loss functions. Another direction is combining multiple imaging modalities (e.g., different stains or phase-contrast microscopy) for a more complete tissue characterization. To increase clinician trust, explainability methods such as Grad-CAM saliency maps, which show which image regions the network relies on, are needed. Finally, federated learning would allow training models on data from different hospitals without centralizing it, improving generalizability.

Impact

The results could accelerate the adoption of automated brain biopsy screening in clinical practice, reducing pathologists' workload and improving diagnostic reproducibility. The methodology applies to other tissue types and classification tasks in digital pathology.

Next steps

Validate the proposed protocol on independent datasets from different hospitals to confirm generalizability. Implement multiclass classification and integrate explainability maps into the pathologist's workflow.

Key open problems

For medical imaging, the shortage of labeled data remains an unresolved problem: annotating images requires expensive expert labor. This work shows that careful transfer learning with aggressive augmentation partially compensates for this deficit, but it does not address systematic biases in training sets. The connection to the fundamental problem of model interpretability also remains open: high accuracy does not guarantee that the network relies on clinically meaningful features rather than staining or acquisition artifacts.

The knowledge machine's view

This section is addressed to the author of the paper and their colleagues. Neighbouring works were found by meaning-based search across our archive, not by word overlap. We do not review: we show the field around the work.

What the work does

This study directly compares ResNet-50 and DenseNet-121 for binary classification of brain tissue slices on a dataset of 2931 images. We used two-stage fine-tuning with freezing and unfreezing of blocks, aggressive augmentation, and early stopping. DenseNet-121 achieved an accuracy of 88.35% and an F1 score of 0.9116, significantly outperforming ResNet-50.

Where its strength is

A systematic comparison of two popular architectures on the same dataset with careful control of overfitting provides concrete numbers for architecture selection. The low false positive rate (7.9%) of DenseNet-121 highlights its practical suitability.

Where it could go next

Worth trying

  • Try probability calibration (e.g., temperature scaling) on DenseNet-121's output and assess how the rate of confident errors changes.
  • Apply pruning to the trained DenseNet-121 and compare accuracy and inference speed with the original network.
  • Run images through a physics-based water enhancement model and check whether accuracy on the test set improves.

Why this may matter

If we can combine DenseNet-121's accuracy with calibrated confidence and reduced computational requirements, it would bring automatic classification of brain slices closer to real clinical practice, where both reliability and speed matter.

The brain tissue sections in this study are only 5 microns thick, roughly 20 times thinner than a human hair. Meanwhile, DenseNet-121 contains about 8 million trainable parameters, which works out to one parameter for every 0.37 images in the dataset.

Key numbers

  • DenseNet-121 accuracy: 88.35%
  • ResNet-50 accuracy: 82.12%
  • DenseNet-121 F1-score: 0.9116
  • number of images: 2931
  • false positive cases: 12 out of 498
Concepts
brain cancer detection deep learning in medical imaging deep neural network Convolutional Neural Networks transfer learning medical image analysis tumor segmentation pattern recognition speech recognition brain scan transformers retina tumor imaging characterization cancer drug discovery training data Large Language Models training protein language model predictive model computed tomography