Grin logo
de en es fr
Shop
GRIN Website
Publish your texts - enjoy our full service for authors
Go to shop › Computer Sciences - Artificial Intelligence

Machine Learning for Wound Image Analysis

From Mathematical Foundations to Research Practice

Summary Excerpt Details

This textbook connects the mathematical foundations of machine learning with the design and evaluation of methods for wound image analysis. It addresses three central tasks: wound classification, wound segmentation, and multimodal analysis combining images with metadata or text.

The chapters progress from wound terminology and evaluation principles to classical classifiers and clustering, convolutional and capsule networks, U-Net and modern segmentation architectures, vision Transformers, and multimodal models. Mathematical derivations, worked numerical examples, explanatory diagrams, practice questions and worked solutions help readers understand how model components operate and how their outputs should be interpreted.

Annotated Python examples and practical research recipes explain data preparation, patient-level data separation, training, model selection, calibration, uncertainty and failure analysis. Particular attention is given to distinguishing improvements in model scores from evidence of clinical usefulness.

Written for advanced students, researchers and engineers in computer vision, biomedical imaging and applied artificial intelligence, the book supports both structured study and selective reference. Familiarity with linear algebra, calculus, probability and basic Python is helpful.

The emphasis is on understanding computations, examining assumptions and developing transparent, reproducible research workflows. The book provides educational and research guidance; its teaching examples and proposed pipelines do not establish clinical effectiveness.

Excerpt


Contents

Copyright

Preface

1 Wounds and the Need for Automated Assessment
1.1 Wounds and public health
1.2 Defining wounds
1.3 Wound classification
1.3.1 Procedural and traumatic wounds
1.3.2 Open and closed wounds
1.3.3 Penetrating and nonpenetrating mechanisms
1.3.4 Other injury mechanisms
1.3.5 Acute and chronic wounds
1.3.6 Surgical wound contamination classes
1.3.7 External injury and underlying disease
1.3.8 Common clinical wound categories
1.4 Limits of conventional assessment
1.5 Machine learning in wound care
1.6 Evaluating automated assessment
1.7 Principal applications
1.8 Benefits, challenges, and prospects
1.9 Objectives and organization
1.10 Notation and reading conventions
1.11 Chapter review
1.11.1 Assessment tasks compared
1.11.2 Practice questions
1.11.3 Worked answers
1.11.4 Chapter summary

2 Foundations of Machine Learning and Deep Learning
2.1 Introduction
2.2 Artificial intelligence and agents
2.3 Learning in intelligent systems
2.3.1 Deep learning
2.4 Learning paradigms
2.4.1 Supervised learning
2.4.2 Unsupervised learning
2.4.3 Semi-supervised and related learning
2.4.4 Reinforcement learning
2.5 Evaluating wound predictions
2.5.1 Targets, references, and evaluation units
2.5.2 Training, selection, and testing
2.5.3 Confusion matrices
2.5.4 Confusion-matrix measures
2.5.5 Class imbalance and prevalence
2.5.6 Multiclass evaluation
2.5.7 Thresholds and ranking performance
2.5.8 Probability evaluation
2.5.9 Evaluating masks and boxes
2.5.10 Uncertainty and paired comparisons
2.5.11 Metrics and training objectives
2.5.12 Connections to later chapters
2.6 Artificial neural networks
2.6.1 Neurons and fully connected layers
2.6.2 One hidden layer
2.6.3 Matrix representation
2.6.4 Two hidden layers
2.6.5 Multilayer perceptrons
2.6.6 Multimodal learning and reasoning: an introduction
2.7 Optimization and backpropagation
2.7.1 Gradient descent
2.7.2 Stochastic gradient descent with momentum
2.7.3 AdaGrad
2.7.4 Adam
2.7.5 Backpropagation and the chain rule
2.8 Activation functions
2.8.1 Sigmoid
2.8.2 Hyperbolic tangent
2.8.3 Rectified linear unit
2.8.4 Softmax
2.9 Convolutional neural networks
2.9.1 Convolutional layers
2.9.2 Pooling layers
2.9.3 Fully connected output layers
2.9.4 Convolution mechanics
2.9.5 Stride and padding
2.9.6 Receptive fields and parameter sharing
2.10 Regularization and normalization
2.10.1 Dropout
2.10.2 Batch normalization
2.11 Deep metric learning
2.11.1 Medical-image applications
2.11.2 Distances and learned transformations
2.11.3 Pairwise contrastive loss
2.11.4 Triplet loss and example mining
2.11.5 Softmax and angular margins
2.12 Federated learning
2.12.1 Federated averaging and its objective
2.12.2 Client data partitions
2.12.3 Federated reinforcement learning
2.12.4 Information leakage and split learning
2.13 Chapter review
2.13.1 Learning methods compared
2.13.2 Practice questions
2.13.3 Worked answers
2.13.4 Chapter summary

3 Classical Machine Learning for Wound Image Analysis
3.1 Representations and classical models
3.2 Image preparation and feature selection
3.2.1 Preprocessing, extraction, and selection
3.2.2 Filter, wrapper, and embedded selection
3.2.3 Leakage prevention
3.3 Classification tasks and class imbalance
3.3.1 Label definitions
3.3.2 Effects of class imbalance
3.3.3 Resampling and alternatives
3.4 Classical classifiers
3.4.1 Support vector machines
3.4.2 Separating hyperplanes
3.4.3 Hard and soft margins
3.4.4 Nonlinear feature mappings and kernels
3.4.5 fc-nearest-neighbor (k-NN) classification
3.4.6 Decision trees
3.4.7 Random forests
3.4.8 Naive Bayes
3.5 Distances, similarities, and clustering
3.5.1 Metrics and distance functions
3.5.2 Cosine and Jaccard similarity
3.5.3 Kernel-induced distances
3.6 Clustering methods
3.6.1 K-means objective
3.6.2 Gaussian mixtures
3.6.3 Expectation-maximization in one dimension
3.6.4 Multivariate EM and practical checks
3.6.5 Fuzzy memberships and neighbor graphs
3.7 Evidence from wound studies
3.7.1 Supervised image analysis
3.7.2 Prediction from clinical records
3.7.3 Clustering and segmentation evidence
3.8 Limitations and fair comparisons
3.8.1 Acquisition and annotation limits
3.8.2 Comparing complete pipelines
3.8.3 Interpretation and practical limits
3.9 Chapter review
3.9.1 Classifiers and clustering compared
3.9.2 Practice questions
3.9.3 Worked answers
3.9.4 Chapter summary

4 Convolutional and Capsule Networks for Wound Images
4.1 Defining the prediction task
4.1.1 Wound analysis tasks
4.1.2 Labels and independent observations
4.2 Learned image representations
4.2.1 Encoders, aggregation, and prediction heads
4.2.2 Losses and head gradients
4.2.3 Spatial operations and clinical information
4.3 Transfer learning with limited data
4.3.1 Domains and tasks
4.3.2 Transfer mechanisms and suitability
4.3.3 Adaptation workflow
4.3.4 Negative transfer and shortcuts
4.4 CNN architectures
4.4.1 VGG: depth and small kernels
4.4.2 Inception and Xception
4.4.3 ResNet and DenseNet
4.4.4 MobileNet variants
4.4.5 NASNet and EfficientNet
4.4.6 ConvNeXt and ConvNeXt V2
4.5 Encoder extensions
4.5.1 Channel and spatial attention
4.5.2 Self-supervised pretraining
4.5.3 Image and location fusion
4.5.4 CNN-Transformer hybrids
4.6 Capsule representations and routing
4.6.1 Vector feature representations
4.6.2 Invariance and equivariance
4.6.3 Votes, couplings, and the squash function
4.6.4 Dynamic routing by agreement
4.6.5 Worked routing example
4.6.6 Classification and reconstruction losses
4.6.7 Parameters, memory, and routing cost
4.7 Capsule variants and evidence
4.7.1 Matrix capsules and EM routing
4.7.2 Learned routing, attention, and pruning
4.7.3 FixCaps and medical variants
4.8 Comparing wound classifiers
4.8.1 Architectural hypotheses
4.8.2 Controlled comparisons
4.9 Evidence from wound studies
4.9.1 Classification evidence and limits
4.9.2 Related tasks and evidence boundaries
4.9.3 Choosing a baseline
4.10 Evaluating the complete classifier
4.10.1 Patient-level data splits
4.10.2 Confusion-matrix metrics
4.10.3 Uncertainty and model comparison
4.10.4 Calibration, selective prediction, and domain shift
4.10.5 Explanations and failure analysis
4.10.6 Reproducible comparison protocol
4.11 Chapter review
4.11.1 Architecture comparisons
4.11.2 Exercises
4.11.3 Worked answers
4.11.4 Chapter summary

5 U-Net and Modern Wound Segmentation
5.1 Wound segmentation tasks
5.1.1 Mask definitions
5.1.2 Semantic, instance, and panoptic outputs
5.1.3 Pixels, patients, and modalities
5.2 Development of segmentation methods
5.2.1 Shape and atlas assumptions
5.2.2 Engineered and learned features
5.2.3 Fully convolutional prediction and stride
5.2.4 Comparing segmentation grids
5.3 The original U-Net
5.3.1 Contracting and expanding paths
5.3.2 Dimension trace
5.3.3 Upsampling and pooling
5.3.4 Receptive field, parameters, and cost
5.4 Loss functions and deep supervision
5.4.1 Likelihoods and training objectives
5.4.2 Overlap losses
5.4.3 Boundary losses: worked example
5.4.4 Deep supervision and anatomical labels
5.5 Data preparation, training, and inference
5.5.1 Image-mask alignment
5.5.2 Sparse labels and teacher-student consistency
5.5.3 Patch stitching
5.6 Volumetric U-Net
5.6.1 Spatial axes and image channels
5.6.2 Voxel spacing and receptive fields
5.6.3 Reproducible configuration
5.7 Residual, dense, and recurrent extensions
5.7.1 Residual connections
5.7.2 Dense connectivity
5.7.3 Recurrent residual blocks
5.8 Skip connections and multiscale fusion
5.8.1 UNet++: nested skip pathways
5.8.2 UNet 3+: multiscale fusion
5.8.3 MultiResUNet: multiscale blocks
5.9 Attention and staged refinement
5.9.1 Attention U-Net: gated skips
5.9.2 Channel and spatial attention
5.9.3 Cascades and atrous spatial pyramid pooling
5.10 Efficient models and self-configuring pipelines
5.10.1 Efficiency tradeoffs
5.10.2 MedNeXt and its extensions
5.10.3 The nnU-Net pipeline
5.11 U-shaped Transformer segmentation
5.11.1 From grids to tokens
5.11.2 TransUNet and UNETR
5.11.3 Windowed attention: Swin-Unet and Swin UNETR
5.12 State-space extensions
5.12.1 State-space recurrence
5.12.2 Input-dependent selection
5.12.3 U-Mamba and SegMamba
5.13 Promptable segmentation
5.13.1 Region prompts
5.13.2 Medical adaptation and sequence memory
5.13.3 SAM 3 and MedSAM3: concept prompts
5.13.4 Evaluating human input
5.14 Ambiguous boundaries and uncertainty
5.14.1 Pixel confidence and contour uncertainty
5.14.2 Probabilistic U-Net
5.14.3 Diffusion-based mask refinement
5.15 Mask evaluation and wound measurement
5.15.1 Overlap metrics
5.15.2 Boundary distances and coordinates
5.15.3 Aggregation, independence, and uncertainty
5.15.4 Calibrated wound area
5.16 Evidence from wound studies
5.16.1 Tasks and evaluation settings
5.16.2 Tissue, measurement, and preclinical studies
5.16.3 Designing an informative comparison
5.17 Chapter review
5.17.1 Model selection by task
5.17.2 Architectural mechanisms compared
5.17.3 Worked review exercises
5.17.4 Chapter summary

6 Transformer-Based Wound Classification
6.1 Motivation and objectives
6.2 Defining wound classification
6.2.1 Inputs, targets, and decisions
6.2.2 Task-specific labels
6.2.3 Measurable research endpoints
6.3 Categories, datasets, and reference labels
6.3.1 Clinical category boundaries
6.3.2 Dataset identity and provenance
6.3.3 Reference quality and leakage prevention
6.4 From recurrence to attention
6.4.1 Sequence and image tasks
6.4.2 LSTM gates and cell state
6.4.3 Gated recurrent units (GRU)
6.4.4 Independently recurrent neural networks (IndRNN)
6.4.5 Attention over representations
6.5 Transformer mathematics
6.5.1 Queries, keys, values, and scaling
6.5.2 Worked attention calculation
6.5.3 Self-attention, cross-attention, and masks
6.5.4 Multi-head attention and Transformer blocks
6.5.5 Positional information
6.6 Vision Transformer classification
6.6.1 Image tokenization
6.6.2 Resolution, information, and computation
6.7 Learning from limited labels
6.7.1 Feature extraction and fine-tuning
6.7.2 Knowledge distillation
6.7.3 Masked-image pretraining
6.7.4 DINO and later developments
6.8 Hierarchical and multiscale transformers
6.8.1 Swin: local attention windows
6.8.2 Patch merging and relative position
6.8.3 Pyramid attention and spatial reduction
6.9 Compact CNN-Transformer architectures
6.9.1 Convolutional tokenization
6.9.2 MobileViT: local and global processing
6.10 Transformers with feature extractors
6.10.1 Hybrid layouts
6.10.2 Feature correspondence in fusion
6.10.3 Wound-specific model and reproducibility
6.10.4 Interpreting published explanatory maps
6.11 U-Net hybrids for classification
6.11.1 From segmentation to classification
6.11.2 Cropping and available evidence
6.11.3 Joint losses and missing labels
6.11.4 Spatial outputs before classification
6.12 Multimodal wound classification
6.12.1 Information available at inference
6.12.2 Missing metadata and shortcut learning
6.12.3 Queries and retrieval decisions
6.12.4 Multimodal language models: scope
6.13 Training and implementation
6.13.1 Data preparation
6.13.2 Classification losses and gradients
6.13.3 Optimization and checkpoint selection
6.13.4 Reproducible inference
6.14 Temporal models: Informer and FEDformer
6.14.1 When temporal models are appropriate
6.14.2 Informer: query selection
6.14.3 FEDformer: trend and frequency components
6.14.4 Worked temporal example
6.15 Evaluation, uncertainty, and failure analysis
6.15.1 Confusion matrices and aggregation
6.15.2 Ranking, calibration, and uncertainty
6.15.3 Failure review and interpretation
6.16 Evidence from wound studies
6.16.1 Tasks, protocols, and reported scores
6.16.2 Classification and multimodal studies
6.16.3 Segmentation and tissue evidence
6.16.4 WILLIE: a unified model case study
6.16.5 Requirements for stronger evidence
6.17 Reproducible study design
6.17.1 Questions and comparison arms
6.17.2 Ablations and mechanisms
6.17.3 Implementation checks
6.17.4 Reproducibility and reporting
6.18 Chapter review
6.18.1 Choosing a minimal experiment
6.18.2 Review exercises
6.18.3 Worked solutions
6.18.4 Research questions from evidence
6.18.5 Cross-chapter classification guide
6.18.6 Chapter summary

7 Multimodal and Reasoning Models
7.1 Multimodal representations and decisions
7.1.1 Notation and tensor conventions
7.1.2 Running examples
7.2 Targets and available information
7.2.1 Defining the prediction target
7.2.2 Collected text and model-written captions
7.2.3 Inference contract
7.3 Multimodal data preparation
7.3.1 Patient, wound, and visit pairing
7.3.2 Categorical encoding
7.3.3 Missing modalities and augmentation
7.3.4 From records to batches
7.4 Image-metadata classification
7.4.1 Shared experimental protocol
7.4.2 Concatenation and training objective
7.4.3 Worked fusion-head update
7.4.4 Late fusion of predictions
7.4.5 Learned gates and fallback
7.4.6 Worked gate update
7.4.7 Cross-attention and meaningful keys
7.4.8 Worked classification from tokens
7.4.9 Interpreting published multimodal results
7.5 Additional imaging modalities
7.5.1 Measured signals and geometric alignment
7.5.2 Sampling registered sensor data
7.5.3 Evidence from multisensor studies
7.5.4 Multisensor experiment design
7.6 Vision-language wound classifiers
7.6.1 Language model interfaces
7.6.2 Contrastive alignment and class descriptions
7.6.3 Worked alignment and classification
7.6.4 Decoded labels and sequence likelihood
7.6.5 Image input to language decoders
7.6.6 Worked multi-token scoring
7.6.7 Clinical image-text case study
7.7 Retrieval and in-context classification
7.7.1 The retrieval index
7.7.2 Diversity-aware support selection
7.7.3 Caption-assisted retrieval and SCARWID
7.7.4 Neighborhood learning with triplet loss
7.7.5 MMR context selection
7.7.6 In-context learning with small VLMs
7.8 Adapting wound classifiers
7.8.1 Frozen, adapted, and retrieval-only baselines
7.8.2 Low-rank updates and their cost
7.8.3 Worked LoRA updates
7.8.4 Label and rationale provenance
7.8.5 Token alignment and masked losses
7.9 Reasoning models for classification
7.9.1 Reasoning objectives
7.9.2 Supervised reasoning distillation
7.9.3 GRPO updates
7.9.4 Worked regularized policy update
7.9.5 Sequence-level and token-level GRPO
7.9.6 Limits of class rewards
7.9.7 Bounded symbolic reasoning
7.9.8 Consistency checks and unresolved outcomes
7.9.9 Testing reasoning claims
7.10 Evaluating multimodal and reasoning models
7.10.1 Targeted ablations
7.10.2 Calibration and abstention
7.10.3 Prediction ledgers and selection effects
7.10.4 Evaluating explanation quality
7.10.5 Published failure case
7.10.6 Study evidence and its limits
7.10.7 Costs and external testing
7.11 Implementation recipes
7.11.1 Recipe 1: pairing without leakage
7.11.2 Recipe 2: image-metadata classification
7.11.3 Recipe 3: gates and cross-attention
7.11.4 Recipe 4: prototypes and support indexing
7.11.5 Recipe 5: constrained-label VLM inference
7.11.6 Recipe 6: adaptation and post-training
7.11.7 Recipe 7: output and cost evaluation
7.11.8 Three worked pathways
7.11.9 Walkthrough A: PU/IAD classification
7.11.10 Walkthrough B: infection retrieval
7.11.11 Walkthrough C: adaptation and reward learning
7.12 Chapter review
7.12.1 Choosing a classification approach
7.12.2 Review exercises
7.12.3 Worked solutions
7.12.4 Research questions
7.12.5 Chapter summary

8 Hands-on Wound Classification
8.1 From models to experiments
8.1.1 Pipeline walkthrough progression
8.1.2 Notation and evidence status
8.2 Dataset selection
8.2.1 Dataset cards and leaderboards
8.2.2 AZH teaching target
8.3 Manifests and data partitions
8.3.1 Environment and artifacts
8.3.2 Duplicate detection and correction
8.3.3 Training, validation, and test roles
8.4 Image preprocessing and batching
8.4.1 Deterministic inference transforms
8.4.2 Training augmentation and unit tests
8.5 Establishing baselines
8.5.1 Feature-based nearest-neighbor baseline
8.5.2 Learned representations
8.6 Training a wound classifier
8.6.1 Architecture, dimensions, and objective
8.6.2 Optimization and checkpoint contents
8.6.3 Learning sanity checks
8.7 Validation and inference selection
8.7.1 Checkpoint and policy selection
8.7.2 Temperature calibration and rejection
8.7.3 Limits of a single tuning set
8.8 Testing and error analysis
8.8.1 Prediction ledger
8.8.2 Interpreting test outputs
8.8.3 Uncertainty and paired comparisons
8.8.4 Inspecting inputs and outputs
8.9 Segmentation-assisted classification
8.9.1 Mask-prediction walkthrough
8.9.2 From masks to crops
8.9.3 Matched classification experiment
8.10 Multimodal experiment interfaces
8.10.1 Recipe A: image and collected metadata
8.10.2 Recipe B: image-text class matching
8.10.3 Recipe C: retrieval-assisted classification
8.11 Reasoning-model adaptation and evaluation
8.11.1 Classification contract
8.11.2 Recipe D: supervised LoRA adaptation
8.11.3 Recipe E: class-reward post-training
8.11.4 Resources and research scope
8.12 Benchmark selection
8.12.1 Wound benchmarks and general medical context
8.12.2 Reproducible benchmark evaluation
8.13 Self-contained pipeline walkthroughs
8.13.1 Environment, data preparation and classification functions
8.13.2 A complete classification session
8.13.3 Complete optional mask walkthrough
8.13.4 Output, metadata and coordinate contracts
8.13.5 Preflight, visual reports and controlled development
8.14 Debugging, reproduction, and capstone
8.14.1 Failure diagnosis
8.14.2 Reproduction before modification
8.14.3 Capstone brief and grading
8.15 Chapter review
8.15.1 Comparing experimental evidence
8.15.2 Review exercises
8.15.3 Worked solutions
8.15.4 Research questions
8.15.5 Chapter summary

Glossary

Notation

Bibliography

Image Credits

About the Author

Index

Machine Learning for Wound Image Analysis

From Mathematical Foundations to Research Practice

Copyright © 2026 Massoud Pourmandi.

First edition, 2026. Digital release.

Creative Commons Attribution 4.0 International

Except where otherwise indicated, the author’s original material in this book is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

You may copy, redistribute, and adapt the licensed material for any purpose, including commercial use, subject to the license terms. You must acknowledge the author and source, include a link to the license, and identify any modifications. Attribution must not imply endorsement by the author.

Full license: https://creativecommons.Org/licenses/by/4.0/

Third-party material

Third-party figures, photographs, illustrations, and other credited material retain their original copyrights and applicable license or permission terms. This book’s general CC BY 4.0 notice does not replace those separate terms. Consult the individual captions, credit lines, and Image Credits section before reusing such material.

If your intended reuse is not permitted by the applicable terms or by law, obtain permission directly from the relevant rights holder.

Research and clinical use

This book is intended for education and research. Its teaching examples, synthetic calculations and code listings are not validated clinical tools. Photographs are presented in their cited source contexts. The book does not replace professional clinical assessment, diagnosis or treatment.

To my dear nieces,

Sana, Faeze, Selda, Farhan,

Iliya, Ilmaz, Dilay, and Delan,

With all my love.

May you always find joy in learning

and the courage to follow your dreams.

Preface

This book introduces the mathematical and computational methods used in machine learning for wound image analysis. It examines how wound images can be classified, how wound regions can be identified through segmentation, and how images can be combined with metadata and text. The chapters progress from classical feature-based methods to neural networks, Transformers and multimodal models. Mathematical explanations, worked numerical examples and practical guidance help readers understand how these methods work and apply that understanding to the design, implementation and evaluation of wound image research.

The book connects mathematical foundations with research practice. Wound classification, segmentation and multimodal analysis provide concrete problems through which to study how pixels become features, how losses guide learning and how model scores become decisions. The emphasis is on understanding the computation, testing its assumptions and explaining what the results support.

Audience and preparation. The book is written for advanced students, re-searchers and engineers working in computer vision and wound image analysis. Familiarity with linear algebra, multivariable calculus, elementary probability and basic Python is helpful. Chapter 1 introduces the wound terminology needed for the computational discussion; a clinical qualification is not assumed. Clinical interpretation remains a distinct responsibility from the construction and evaluation of a learning system.

What you will learn. The chapters develop the skills needed to define a prediction task, trace a model’s computations, implement its essential steps and compare methods under a common evaluation protocol. Worked numerical examples make dimensions and intermediate values visible. Review exercises and worked answers help readers test their understanding before extending a method. By the end, readers should be able to connect a model’s design to a reproducible experiment and explain its errors and limitations.

A route through the book. Chapters 1 and 2 introduce wound assessment, evaluation and the mathematical foundations of learning. Chapter 3 develops feature-based classification and clustering. Chapter 4 examines convolutional and capsule networks; Chapter 5 develops U-Net and modern segmentation methods, including attention, Transformers and state-space extensions. Chapter 6 returns to classification through Transformer and hybrid models. Chapter 7 connects images with metadata, language, retrieval, adaptation and reasoning. Chapter 8 brings these ideas into pipeline walkthroughs and practical recipes. For a segmentation-focused route, follow the first two chapters with Chapter 5; for classification, continue through Chapters 3, 4 and 6. The glossary, notation appendix and index support selective reading. Local definitions and stated dimensions take precedence when a symbol has different roles in different methods.

From equations to experiments. Chapter 8 supplies the complete core classification program inside the book, with setup instructions, synthetic checks and a session that carries data preparation through training, tuning, testing and individual-image inference. Its outputs include a saved predictor, a prediction ledger and reports for inspecting errors. An optional synthetic mask example explains segmentation and coordinate checks. Advanced multimodal and reasoning pathways require additional data and model-specific implementation. Readers can complete the core route before choosing an extension.

Begin the practical walkthroughs with the synthetic tests. Follow the stated access procedures to obtain external datasets, and check their terms of use. Explain how you prepare the data, divide it into training, validation and test sets, and choose the model. State whether you evaluate results per image, per patient or using another unit. If patient IDs are available, keep all images from each patient in the same set. If IDs are missing, explain that this limits your ability to check whether the same patient appears in different sets. Several photographs of one patient do not count as several independent patients. The worked examples demonstrate specific calculations and procedures. They do not establish how well a model would perform in clinical practice.

Reading the evidence. A published result belongs to its cited task, dataset and evaluation protocol. A worked example demonstrates a calculation; a proposed experiment describes work still to be done. Captions distinguish clinical photographs, reference annotations, reported model outputs and conceptual overlays. A caption or explanation produced by a model requires a separate assessment of its clinical correctness. Keep logits, probabilities, predictions and reference annotations distinct when interpreting a result.

Use the book actively: work through a calculation, answer a review question, run a check and inspect a failure. Each step builds toward the same goal: making informed modeling choices and producing a wound-image experiment whose computations, results and limitations another reader can examine.

Chapter 1

Wounds and the Need for Automated Assessment

1.1 Wounds and public health

Wounds are among the oldest and most complex problems in medicine. From ancient practice to modern health care, their management has remained an essential part of treatment. Population aging, diabetes, obesity, vascular disease, and the growing number of complex surgical procedures all contribute to the burden of wounds, particularly those that fail to heal normally. Wound care therefore concerns both the biological repair of tissue and the organization of long-term care [1-3].

Wounds are often described as acute or chronic. Acute wounds follow injury, surgery, or burns and ordinarily progress through an organized healing response. A chronic wound fails to make the expected progress toward repair. The expected course depends on the wound’s cause, depth, blood supply (perfusion), and clinical context; elapsed time should be interpreted alongside those factors. Healing involves overlapping phases: hemostasis limits bleeding, inflammation responds to injury, proliferation builds new tissue, and remodeling reorganizes that tissue. Disruption of these processes can prolong tissue injury [4].

The size of the burden depends on the population and definition being measured. An analysis of Medicare claims reported an increase from approximately 8.2 million beneficiaries with wounds in 2014 to 10.5 million in 2019. The abstract reports a prevalence increase from 14.5% to 16.4%; the same article's plain-language summary instead gives 16.3% for 2019. We retain the abstract-reported 16.4% while noting this discrepancy. Under the study’s most conservative method of attributing spending to wound care, expenditure fell from $29.7 billion to $22.5 billion. These are estimates for specified Medicare populations and years; they are not estimates for the entire US population or for all worldwide wound-related expenditure [5].

The international burden is also substantial. A 2023 review estimated that diabetic foot ulcers affect approximately 18.6 million people worldwide each year, including 1.6 million in the United States [6]. These annual counts describe a different quantity from lifetime risk or the proportion of patients who have an ulcer at a particular time. Lifetime-risk estimates among people with diabetes also vary with the population and methods used. Pressure injuries likewise remain a major concern as populations age. Analyses of their future burden project continued challenges through 2050, although these are model-based projections rather than observed future outcomes [7].

The consequences extend beyond expenditure. Chronic wounds can restrict mobility, cause pain, and affect psychological well-being and social participation. Diabetic foot disease is associated with substantial mortality. A 2020 synthesis reported five-year mortality of 30.5% following diabetic foot ulceration and 56.6% following major amputation. These pooled figures describe different clinical groups, so comparisons require attention to differences in population, follow-up, and comorbidity [8]. Accurate recognition, classification, measurement, and continuing assessment of wounds are consequently clinical and public health priorities.

1.2 Defining wounds

A wound is damage to the integrity of biological tissue, including the skin and underlying structures. Causes include falls and collisions, cuts and other injuries from sharp objects, human or animal bites, thermal or chemical injury, electrical injury, and underlying disease processes such as diabetes or vascular insufficiency.

Physical and chemical injury can disrupt the protective tissue barrier. In a closed injury, bleeding and tissue damage may occur beneath an intact skin surface.

The resulting findings may include pain and tenderness, bleeding, redness, swelling, discharge, and restricted movement of the affected part. Purulent dis-charge can indicate infection, but no isolated visual sign establishes the complete diagnosis. Assessment brings these findings together with the cause and extent of injury to guide care, which aims to support healing and reduce infection and other complications [4, 9].

1.3 Wound classification

Wounds can be classified along complementary dimensions, including etiology (cause), size, depth, tissue condition, contamination, and duration. Etiology is central to management; the other dimensions describe the wound’s extent, con-dition, and course. These descriptions answer different questions and can apply simultaneously: a surgical wound can be recent, open, and infected. Considering its mechanism and extent helps explain why wounds with similar appearances may require different care.

Wound depth is described by the tissue layers involved. The skin consists of an outer epidermis and an underlying dermis, with subcutaneous tissue beneath them. The epidermis provides a protective barrier. The dermis contains connective tissue, including collagen and elastin, together with vessels, nerves, and skin appendages. The subcutaneous layer, or hypodermis, lies beneath the skin proper. It contains substantial adipose tissue and provides insulation and cushioning [9, 330].

The following subsections examine procedural and traumatic origins, skin continuity, injury mechanisms, healing course, surgical contamination, and underlying disease. These dimensions complement one another.

1.3.1 Procedural and traumatic wounds

Some wounds are deliberately created during clinical procedures, including a surgical incision, insertion of an intravenous device, or puncture for cerebrospinal fluid sampling. Such procedures are planned, aseptic technique is used where applicable, and bleeding is managed. These precautions do not guarantee sterility or prevent every infection.

Traumatic wounds arise from falls, burns, projectiles, or sharp objects. Their edges may be irregular, and tissue damage or contamination may be extensive. This distinction concerns planned clinical procedures versus unplanned trauma. A separate epidemiological distinction concerns intentional violence and unintentional injury; studies of childhood injuries and injury intentionality must be read in relation to the populations and circumstances studied [10, 11]. These circumstances cannot be inferred from wound appearance: a gunshot wound, for example, cannot be classified as accidental from a photograph alone.

1.3.2 Open and closed wounds

Open wounds disrupt the skin barrier and include incisions, lacerations, abrasions, and punctures; they do not all result from penetrating trauma. Interruption of skin or mucosal continuity provides a potential entry point for microorganisms and a route for contamination.

In a closed injury, the skin may remain intact while deeper tissues are damaged. Blunt trauma from a fall or collision can produce bruising, a hematoma, or a crush injury. The absence of a visible opening therefore does not establish that the underlying injury is minor.

Figures 1.1 and 1.2 contrast an open defect with bleeding beneath intact skin. The documented thrombocytopenia case in Figure 1.2 illustrates that such bleeding can also occur without trauma. The photographs show surface findings, which alone cannot establish an injury mechanism.

Illustrations are not included in the reading sample

Figure 1.1. Open right-foot ulcer at presentation. Cropped from Prakash et al. (2016), Figure 1A, case 1, with its A label retained; CC BY 3.0.[12] The photograph illustrates interruption of the skin barrier; assessment of depth and infection requires clinical context.

Illustrations are not included in the reading sample

Figure 1.2. Clinical ecchymosis beneath an intact skin surface. Cropped from Idogun et al. (2021), Figure 2, showing the left upper extremity in a patient with thrombocytopenia; CC BY 4.0.[13] The photograph illustrates subcutaneous bleeding, not a documented traumatic contusion. Skin appearance does not establish the bleeding mechanism or deeper injury.

1.3.3 Penetrating and nonpenetrating mechanisms

A penetrating injury occurs when an object passes through the surface into deeper tissue. Punctures, stab injuries, and some gunshot wounds are examples. An incision or skin cut can have variable depth, whereas an avulsion or skin tear describes a different pattern of tissue disruption. These terms should not be treated as interchangeable.

Nonpenetrating mechanisms include blunt impact and compression. They can produce a contusion, hematoma, or crush injury without an entry tract. Other terms describe the resulting tissue changes: an abrasion disrupts the epidermis, a laceration tears tissue, a blister separates tissue layers, and a seroma is a collection of serous fluid. Distinguishing these tissue changes from the mechanism helps keep the descriptions precise: mechanism and skin continuity are related but distinct classification axes.

1.3.4 Other injury mechanisms

Additional mechanisms include thermal injury, cold injury, chemical exposure, electrical injury, and bites or stings. Heat burns, sunburn, and frostbite have different mechanisms and should be named accordingly. Chemicals may injure tissue by direct contact. Animal bites and stings can involve mechanical damage, inoculation of microorganisms, or venom exposure. A useful assessment records the mechanism rather than grouping all these injuries under a single severity label.

The anatomical site of injury also defines the scope of the classification. In-halation injury concerns the respiratory tract, while concussion is a traumatic brain injury. These conditions should be distinguished from categories of skin wounds even when they occur in the same broader account of an injury.

1.3.5 Acute and chronic wounds

An acute wound develops after a recent injury or procedure and ordinarily pro-gresses toward repair. Uncomplicated superficial wounds may improve over several weeks, but healing time depends on the injury and its clinical context. Traumatic and surgical wounds are common examples; the presence of an abscess or infection requires an additional description.

Chronic wounds remain unhealed or progress inadequately because one or more processes necessary for repair are impaired. Persistent inflammation, inadequate perfusion, nerve damage (neuropathy), infection, and impaired cellular responses can contribute. Diabetic foot ulcers, pressure injuries, and arterial or venous ulcers are important examples. A burn does not become chronic solely because it is classified as second degree or deeper; its subsequent healing course must be considered [4, 6].

Clinical examples and tissue appearance. Healing course is only one dimen-sion of wound description. Figures 1.3-1.6 illustrate a complementary dimension through four clinical categories used in image-analysis research: diabetic, pressure, surgical, and venous wounds [14]. The photographs illustrate these categories rather than a sequence from acute to chronic injury. All four are independent documented clinical cases, not samples from the classification dataset. Clinical history, examination, and vascular assessment remain necessary because wound appearances and causes can overlap.

Interpreting these photographs also requires distinguishing the wound bed, or exposed tissue within the defect, from the surrounding skin. Granulation tissue forms during repair and often has a red appearance; slough and eschar describe forms of devitalized tissue that may obscure the bed. These terms describe tissue appearance and condition, whereas labels such as diabetic or venous refer to the clinical setting or underlying cause [9, 15].

Compare the heel photograph in Figure 1.4 with the sutured incision below the neck in Figure 1.5: the captions distinguish tissue appearance from the pressure- related or operative context. These are separate assessment dimensions, so similar colors across panels do not imply the same cause.

Illustrations are not included in the reading sample

Figure 1.3. A documented diabetes-related heel ulcer, reproduced as a single clinical example. Jonathan Moore (2008), original file Neuropathic heel ulcer diabetic.jpg, CC BY 3.0; exact source and licence in the Image Credits. Neuropathy is documented by the source; it is not diagnosed from this image.

Illustrations are not included in the reading sample

Figure 1.4. A documented right-heel pressure ulcer. Prakash et al. (2016), Figure 2A, case 2: the photograph follows seven days of negative-pressure wound therapy before epidermal grafting. Cropped from the published clinical panel, with its original A label retained; CC BY 3.0.[12] This single treated case is not a pressure-stage sequence, and no stage or treatment benefit is inferred from its appearance.

Illustrations are not included in the reading sample

Figure 1.5. A sutured incision below the neck following fibroma removal, as documented by the photographer. Drummyfish, Sutured wound (2018), Wikimedia Commons, CC0 1.0; source details in the Image Credits. It illustrates surgical closure; it is not a sequence of healing stages or evidence of infection.

Illustrations are not included in the reading sample

Figure 1.6. A chronic venous ulcer on the right leg, as documented in the source case description. Jonathan Moore (2008), original file Venous ulcer dorsal leg.jpg, CC BY 3.0; source and licence details in the Image Credits. The source reports an ulcer size of 2 by 2.6 cm; no physical measurement or etiological diagnosis is derived from the printed photograph.

1.3.6 Surgical wound contamination classes

The preceding categories describe injury and healing. Surgical contamination classes answer a more specific question: what contamination or infection was present in the operative setting? They complement the other descriptions rather than replacing them.

The surgical wound classification distinguishes four categories, rather than assigning every wound a universal infection probability [16]:

• Clean. An operative wound without infection or inflammation, without a major breach of sterile technique, and without entry into the respiratory, alimentary, or genitourinary tract.
• Clean-contaminated. Controlled entry into one of these tracts without unusual contamination.
• Contaminated. A wound involving a major break in sterile technique, gross spillage, or acute nonpurulent inflammation; open traumatic wounds may also belong to this category.
• Dirty or infected. A wound with established infection, perforated viscera, or traumatic injury containing devitalized tissue.

Infection rates depend on the operation, patient population, surveillance definition, and preventive care. Percentages from one setting should not be presented as fixed properties of these classes. Likewise, elapsed time alone does not establish whether a wound is infected.

1.3.7 External injury and underlying disease

Another useful distinction concerns whether the initiating mechanism is external or related to disease. External forces include impact, pressure, sharp objects, bites, and thermal, chemical, or electrical exposure. The resulting injury can be open or closed.

Underlying disorders can also predispose tissue to breakdown. Neuropathy, arterial insufficiency, venous disease, and some inherited conditions affect tissue

protection or repair. Calling such wounds “internal” can be misleading, because their visible manifestation may still be on the skin. It is more precise to identify the underlying cause and its contribution to the wound.

1.3.8 Common clinical wound categories

The following clinical categories bring these dimensions together. Some identify a cause, some a procedural context, and others a complication. In particular, infection can occur within several of the categories below, so they should not be treated as mutually exclusive labels.

Diabetic foot ulcers. These open lesions occur in people with diabetes and often arise through an interaction between neuropathy, repeated mechanical loading, and peripheral arterial disease. Loss of protective sensation, dry or fragile skin, foot deformity, and impaired perfusion can increase risk. Infection and tissue necrosis can complicate an ulcer and may lead to amputation. Timely recognition and appropriate multidisciplinary care can reduce risk, but do not eliminate it. Because risk estimates depend on the population and methods used, a single percentage should not be applied to all people with diabetes [6].

Pressure injuries. Sustained pressure, frequently combined with shear, can damage skin and underlying tissue, particularly over bony prominences. Immobility in bed or in a chair can expose vulnerable regions to prolonged loading. Damage may extend into deeper tissue even when the visible surface changes appear limited. Nutrition, hydration, tissue perfusion, and the individual’s ability to reposition affect vulnerability. Friction may contribute to superficial injury, but pressure and shear are the defining mechanisms of pressure injury [15].

Burn wounds. Heat, electricity, chemicals, and radiation can cause burns of different depths and extents. Depth influences the expected course of healing and the treatment required. Burns may arise in accidents, occupational exposures, or other circumstances. Classification describes the resulting injury; determining 11

whether the event was preventable or involved negligence requires information about those circumstances.

Infected wounds. Infection occurs when microorganisms invade tissue and produce a host response. It can complicate acute or chronic wounds, including a surgical incision, so infection status is recorded separately from healing course and procedural context. For example, infection in a postoperative cesarean incision is a complication that can also occur after other surgical procedures. Its presence alone establishes neither chronicity nor inadequate previous care.

Surgical wounds. A surgical incision provides access to underlying structures. Its length, depth, closure method, and contamination class depend on the proce-dure. Continuing assessment is needed to identify separation of the wound edges, infection, or other complications.

Vascular ulcers. Disorders of circulation can lead to tissue breakdown, partic-ularly in the lower limbs. Arterial ulcers are associated with inadequate oxygen and nutrient delivery. Venous ulcers arise in the setting of venous hypertension and impaired venous return, often with edema. Arterial and venous mechanisms may coexist.[254, 331] Consequently, an image alone is insufficient to establish the vascular status of a limb [9].

1.4 Limits of conventional assessment

Conventional wound assessment combines the wound history and examination with visual inspection, ruler or caliper measurements, descriptions of tissue and surrounding skin, and clinical judgment. The classification vocabulary introduced above helps clinicians document the wound’s current condition and changes over time [9]. These methods are useful, but making observations comparable across clinicians and visits remains difficult [17, 18]. The following paragraphs examine five limitations: observer differences, measurement error, the demands of repeated assessment, limited access to expertise, and fragmented information.

Observer dependence. Even when clinicians examine the same wound, they may disagree about tissue composition, category, or severity. The assessment system determines which features they judge: the red-yellow-black description concerns tissue appearance, while Meggitt-Wagner, SINBAD, and the University of Texas system are used for diabetic foot assessment. Agreement therefore needs to be interpreted for the stated system, observer training, types of wounds assessed, and available information. Results from different assessment conditions should not be treated as interchangeable.

Measurement error. Observer judgment also affects measurement. Multiplying maximum length by maximum width gives the area of a bounding rectangle and can overestimate an irregular wound’s surface area. Digital tracing can follow the boundary more closely, but camera angle, scale calibration, image quality, and the operator’s choices still affect the result. A more accurate outline in image pixels therefore does not, by itself, establish an accurate area in physical units.

Time and repeatability. These measurement difficulties become particularly important when assessments are repeated to monitor healing. Differences between visits may reflect the assessment method as well as biological change. Repeated manual measurements and documentation can also be time-consuming.

Access to expertise. Obtaining and interpreting these observations also depends on having trained staff available. Remote communities and settings with limited resources may have difficulty accessing specialist wound care. Reliable documentation can help clinicians share findings for consultation, but its usefulness depends on whether the relevant expertise and follow-up care are available.

Fragmented information. Access to a clinician does not ensure that all relevant information is available together. Photographs, anatomical location, examination findings, test results, and clinical history may be recorded separately. Assessment requires considering these sources together; an isolated photograph or image label cannot represent the complete clinical picture.

Taken together, these limitations can contribute to delayed recognition, unsuitable management, and additional costs [14, 18]. They motivate tools that support measurement, documentation, and interpretation within clinical assessment. The next section introduces machine learning as one approach to these tasks and explains why an image model’s intended contribution must be defined explicitly.

1.5 Machine learning in wound care

These assessment difficulties suggest concrete computational tasks. An image model can be trained to identify a wound category, outline a boundary, or describe visible tissue. Each task captures only part of the clinical assessment, so the first design decision is to specify what the model is intended to contribute.

Machine learning is a branch of artificial intelligence in which a system learns relationships from data instead of relying exclusively on explicitly programmed rules. Deep learning uses multiple computational layers to learn representations suited to a task. In medical imaging, these methods have been investigated for skin lesions, radiology, pathology, and other applications. Performance on a selected benchmark must be distinguished from effectiveness in routine care.

Early wound-image methods commonly used manually designed descriptors of color, texture, or shape with classifiers such as support vector machines or random forests. Convolutional neural networks subsequently enabled features and predictions to be learned together. Architectures based on residual networks and efficient convolutional models have been used for classification; U-Net and related encoder-decoder networks are widely studied for segmentation. Detection networks, transformers, and multimodal or multitask models extend this range of approaches [17, 19]. Their suitability depends on the available data, task definition, and evaluation design.

1.6 Evaluating automated assessment

Evaluating the methods introduced above means checking how well they perform a defined wound-assessment task. The first step is to identify what the system predicts and what reference information is available for judging that prediction. A wound-type classifier assigns a category to an image; a segmentation system marks pixels; a detector locates an object; a prognostic model estimates a future outcome. Their outputs must be compared with suitable reference annotations. An expert-defined category, a traced wound boundary, and a later clinical outcome are different reference standards. The quality of those standards, including how disagreements are resolved, affects what an evaluation can establish.[20]

Figure 1.7 connects these tasks to the quantities measured. In the first row, accuracy counts correct image labels, while sensitivity and precision describe particular errors. In the second, Dice and intersection over union (IoU) measure overlap between predicted and reference regions. In the third, a predicted box must first be matched to a reference object before detection precision and recall can be counted. Average precision (AP) summarizes a stated precision-recall evaluation; its definition includes the matching and averaging rules. The final two rows separate estimated probabilities from physical measurements. A probability needs assessment of calibration, whereas an area estimate needs a valid spatial scale and an error expressed in meaningful units. Choosing complementary measures according to the task is a central recommendation of Metrics Reloaded.[21]

The denominator is as important as the percentage. An accuracy of 90% may describe photographs, tissue regions, or individual pixels. It does not necessarily describe 90% of patients correctly assessed. Repeated photographs of one patient are related observations. Similarly, a segmentation system can label most pixels correctly by predicting only background when wounds occupy a small part of each photograph. Neither a large image count nor a high overall percentage resolves these problems.[22]

For every result, the reader should be able to identify the target, the reference standard, the evaluation unit, the population, and the role of the evaluated data. Training data fit the model. A tuning set, also called a validation set here, guides model and decision-policy choices. Together these form development data. A held-out test set assesses the fixed system; testing at a separate center or acquisition setting addresses an additional generalization question. Reporting guidance such as CLAIM and STARD-AI helps make those conditions explicit.[20, 23]

Successful agreement with annotations is one step toward a useful clinical system. Whether a model improves decisions, documentation, workload, or patient outcomes requires evaluation appropriate to that use. The next section surveys applications with these distinctions in mind. Section 2.5 then develops the mathematical tools needed to interpret their scores.

Question Output and reference What is assessed?

Illustrations are not included in the reading sample

Figure 1.7. From a wound-assessment question to an evaluation quantity. Original conceptual diagram; each row has its own reference standard and unit of analysis. Equations and numerical examples follow in Section 2.5.

1.7 Principal applications

The task distinctions in Section 1.6 organize the applications below: image labels support categorization, spatial outputs support localization and measurement, and longitudinal predictions require linked observations over time. Each application needs annotations and performance measures that match its output [17].

Wound-type classification. Convolutional networks and ensembles have been investigated for distinguishing diabetic, pressure, surgical, and venous wounds. Anisuzzaman and colleagues combined image features with anatomical location and reported improved classification in their experimental setting [14]. Accuracy varies with the included classes, dataset, and split; a range pooled across unrelated studies should not be interpreted as an expected clinical accuracy.

Wound application. Anisuzzaman and colleagues classified diabetic, pressure, surgical and venous wound photographs using image features and anatomical loca- tion.[14] This provides a published example of assigning clinical categories rather than measuring wound size. Chapters 4 and 7 develop the image and multimodal classification routes.

Segmentation and measurement. Segmentation identifies the pixels belonging to a wound. Networks such as U-Net and DeepLab variants can support boundary tracing and the estimation of area or perimeter. Overlap measures, including the Dice coefficient, assess agreement with reference masks. Physical measurement additionally requires scale information and an acquisition protocol that accounts for perspective and surface geometry [17].

Wound application. Liu and colleagues combined pressure-injury segmentation with LiDAR-based area measurement, using the predicted wound region together with spatial information.[24] The two outputs illustrate why delineation and physical measurement are separate tasks. Section 5.15 develops their evaluation and calibration requirements.

Tissue characterization. Models may attempt to distinguish granulation tissue, slough, and necrotic tissue within the wound bed. These labels can support doc-umentation of healing, but color alone is not a complete clinical definition, and reference annotations may differ between observers.

Detection of complications. Image-based methods have been investigated for findings associated with infection or ischemia. Such systems must be evaluated against an appropriate clinical reference standard. A photograph cannot directly supply all information obtained from examination, perfusion testing, or microbiology.

Wound application. The SCARWID preprint used wound photographs, model- written captions and retrieved labeled examples to classify diabetic-foot-ulcer infection status.[25] Its target is a reference infection label, rather than an etiological wound category. Section 7.7 explains the application and the role of retrieval.

Prediction of healing and amputation risk. Longitudinal images and clinical measurements may be combined to predict future outcomes. A model trained for this purpose needs a defined prediction time, follow-up interval, and outcome. Its usefulness depends on whether it distinguishes patients with different outcomes, whether predicted risks agree with observed frequencies, and whether performance holds on data from another setting. These questions concern discrimination, calibration, and external testing, respectively [18, 19].

Integrated systems. WILLIE illustrates how task-specific evaluation applies to an integrated system: it combines wound classification, segmentation, and localization in a single framework. Its classification evaluation uses held-out AZH images, while segmentation and mask-derived localization use a separate

FUSeg evaluation; these tasks do not share one interchangeable accuracy measure [26]. Comparisons must also distinguish the reported model scales and test-time augmentation settings. In addition, differences between aggregate and per-class classification summaries require reconciliation before a single classification score can be interpreted. Chapter 6 examines these evaluation conditions and reporting limits alongside the architecture. These retrospective benchmarks do not establish diagnostic success in prospective clinical use.

Data resources supporting these applications. Developing and evaluating these applications requires data suited to the intended task. AZH, Medetec, the Diabetic Foot Ulcer Challenges (DFUC), and FUSeg are among the resources used in woundimage research. AZH data originate from a wound-care setting in Wisconsin; other resources differ in their collection protocols, class definitions, tasks, and annotation procedures [14, 27, 28]. Using a dataset also requires checking its terms, because its name alone does not establish that unrestricted redistribution or commercial reuse is permitted. Size, patient diversity, annotation quality, and separation of patients across data splits are important considerations when interpreting results.

The partitioning principles introduced in Section 1.6 apply to these datasets. Report patient grouping, the roles of training, tuning, and test data, and whether testing uses a separate source such as another institution. Section 2.5.2 develops the protocol in detail; CLAIM 2024 provides the reporting framework [20].

1.8 Benefits, challenges, and prospects

Potential benefits include more consistent documentation, reduced measurement effort, support for telemedicine, and repeated assessment using accessible devices such as smartphones. Earlier recognition of concerning changes and better integration of clinical information may support personalized care. These benefits require evaluation in the intended workflow rather than inference from model accuracy alone.

Important challenges remain. Large, representative, well-annotated datasets are scarce. Models can learn biases associated with population, camera, clinic, or acquisition conditions and may generalize poorly to a new setting. Privacy obligations, data governance, and applicable regulations affect how images and records can be collected and used. Prospective validation and integration into clinical practice are necessary before a research model can be regarded as a dependable clinical tool [18, 19].

Several research directions address these limitations in different ways. Self-supervised learning constructs training targets from the data themselves; federated learning coordinates training across data holders; multimodal models combine images with clinical measurements or sensor data. The first two approaches are explained in Chapter 2 [29, 30]. Explainable methods may help investigators examine model behavior, while wearable systems may provide longitudinal information unavailable from a single photograph. Their potential should be evaluated alongside limitations in robustness, privacy, interpretability, and clinical benefit.

1.9 Objectives and organization

These chapters connect wound assessment with the foundations of automated image analysis. This chapter introduces wound categories, assessment difficulties, the meaning of successful evaluation, and machine-learning applications. Chapter 2 develops evaluation metrics through worked wound examples before explaining neural networks, convolution, optimization, metric learning, and distributed learning. Chapter 3 develops feature-based classifiers and clustering, connecting their assumptions to wound studies and fair evaluation. Chapter 4 develops convolutional and capsule networks for wound-image classification. Chapter 5 extends the analysis to pixel-level masks, using U-Net to explain segmentation architectures, supervision, measurement, and modern alternatives. Chapter 6 develops Transformer-based wound-image classification, hybrid representations, multimodal inputs, and reproducible research pipelines. Chapter 7 develops multimodal and reasoning models, with worked fusion, retrieval, adaptation, and evaluation recipes.

Chapter 8 turns these methods into a reproducible pipeline walkthrough, connecting data preparation, baseline training, tuning, frozen inference, testing, and failure analysis. Throughout, experimental performance is distinguished from established clinical effectiveness.

1.10 Notation and reading conventions

The mathematical chapters reuse a small set of ideas: an input, a reference target, a prediction, a model, and an evaluation rule. Table 1.1 introduces the notation for reading them. It is a guide to conventions, not a requirement to memorize every symbol before continuing. Chapters 2-8 provide short local tables and define new quantities beside their equations.

Table 1.1. Common mathematical reading conventions.

Illustrations are not included in the reading sample

Symbol meanings are local when the same letter serves several subjects. For example, K can count classes or clusters, while in attention it can name a matrix of keys. A statement such as K G zNxdk resolves that use immediately. Similarly, the image index and pixel index are kept distinct in segmentation. Read the definition and dimensions before substituting a value from another chapter.

The book uses reference label and reference mask for annotations under a stated protocol. Sensitivity and recall agree for the same selected positive class; precision is positive predictive value. A performance metric measures prediction quality, whereas a distance metric measures separation in a representation space. Section 2.5 develops these distinctions before the models are compared.

1.11 Chapter review

The chapter has distinguished wound descriptions from the questions an assess-ment must answer. This review brings those distinctions together in a comparison of assessment tasks, then uses practice questions and worked answers to check their application. The closing summary connects the clinical foundations to the computational methods developed in later chapters.

1.11.1 Assessment tasks compared

Figure 1.7 connects each assessment question to an output and a reference standard. Table 1.2 uses that distinction to explain what each task can contribute to a classification workflow. Task-specific evaluation and explicit reference annotations are required before these contributions can be judged.[20, 21]

Table 1.2. Comparing assessment tasks before choosing a classifier. The outputs and reference standards determine the evaluation; potential uses are conditional.

Table 1.2 continued

Approach and role Potential wound-task advantage Limitations and requirements Fair comparison must test

Measurement: calibrated quantity Describes area or change alongside categorical assessment. Requires a measurement reference, scale and suitable acquisition geometry. Error in physical units and repeatability; separate evidence for any diagnostic use.

Illustrative research choice. Suppose a clinic wants both wound-type labels and weekly area estimates from photographs. These questions require different references: documented clinical categories for classification, and delineated regions with a valid physical scale for area measurement. A correct category does not establish an accurate area, and a precise outline does not establish the cause of a wound. The team should report the two endpoints separately, then investigate whether their combination supports the intended assessment workflow. Any claim about improved patient care requires additional clinical evidence.

1.11.2 Practice questions

These teaching scenarios use the distinctions developed in this chapter. Attempt the questions before reading the worked answers.

1. A clinical record identifies a pressure-related heel ulcer, while a photograph shows red tissue. Which statement concerns etiology, which concerns appearance, and what further evidence is needed to label infection?
2. A system returns a wound-type label, a bounding box, a binary mask and an illustrative area estimate of 2.4 cm[2]. Name the four tasks and state the additional requirement for interpreting the area in physical units.
3. Two photographs of the same patient are assigned to training and testing. Why can the test result overstate performance on new patients, and when should the grouping decision be made?

1.11.3 Worked answers

1. Pressure-related etiology is supported by the clinical record; red appearance is an image observation. Neither alone establishes infection. A clinician assesses the wound and surrounding skin for findings such as increasing pain, warmth, swelling, purulent discharge, deterioration and systemic symptoms, interpreted in context. Record the findings and diagnostic criteria used for the infection reference label; an image classifier is evaluated against that reference.[15]
2. The outputs correspond to classification, detection, segmentation and measurement. Physical area requires a valid scale and suitable acquisition geometry, together with a delineated region. A pixel count or an accurate category alone is insufficient. The value 2.4 cm[2] is illustrative; its accuracy cannot be checked without the mask, calibration and reference measurement.
3. Shared patient appearance, background and repeated wound views can make the cases dependent. Group all photographs, wounds and visits from a patient into one partition before augmentation or learned preprocessing. Patient grouping must be verified from records rather than inferred from filename resemblance. Fit any data-dependent preprocessing on training data only, then apply the fitted procedure unchanged to tuning and test data.

1.11.4 Chapter summary

Wound-image analysis begins with the assessment question and the information needed to answer it. Wound cause, tissue appearance, infection status, location, and change over time describe different aspects of a case; a photograph may not contain sufficient evidence for every clinical conclusion. A useful study therefore defines its target, prediction unit, reference annotations, and intended population before selecting a model.

Classification assigns categories, detection locates objects, segmentation delineates regions, and measurement estimates quantities. Figure 1.7 and Table 1.2 show how their outputs require different evaluation procedures. These tasks can cooperate within one system, but success on one task does not establish success on another. Claims about new patients require test patients to be separated from development patients, including their repeated photographs. The practical lesson is to connect each proposed benefit to evidence from the intended workflow. Chapter 2 develops the mathematical tools for evaluating predictions and explains how learning methods construct them.

Chapter 2

Foundations of Machine Learning and Deep Learning

2.1 Introduction

This chapter presents technical concepts used in deep-learning approaches to wound recognition. The discussion follows a sequence: define the learning task, establish how predictions will be evaluated, express a prediction as a network of operations, train its parameters, and adapt the representation or training arrangement to the application. Wound-image classification provides a recurring example, while the mathematics also applies to other tasks.

Deep learning is a major area of machine-learning research. Its classifiers have produced promising results in applications such as object recognition and image classification. A central advantage is the ability to learn features from data rather than relying entirely on manual feature design. Handcrafted extraction can be timeconsuming and can emphasize features selected by the designer rather than those most useful for prediction. Learned representations can reduce that dependence, but they do not guarantee higher accuracy or remove bias. Their success depends on data, architecture, training, and evaluation [31].

For recognition tasks, the difficulty of specifying useful features can be as important as the choice of classifier. A deep network maps relatively simple inputs into intermediate representations and then into a prediction. The design problem therefore includes selecting the architecture and learning procedure. Convolutional neural networks are particularly important for images, including wound photographs. We first establish the learning concepts needed to understand them.

Notation for this chapter. Table 2.1 is a reference guide to the notation used as the chapter moves from evaluation to networks, metric learning, and federated learning. The symbols are defined again where they are used; the table need not be memorized before reading. Counts and indices refer to the object being modeled in each section.

Table 2.1. Notation guide for Chapter 2.

Illustrations are not included in the reading sample

2.2 Artificial intelligence and agents

To place wound-image learning in context, we first locate it within the broader field of artificial intelligence (AI). AI studies computational systems that make decisions, solve problems, and improve through experience, including attempts to represent aspects of human reasoning and learning in machines [32]. The brief history below explains how this field developed before we turn to agents and the feedback used in learning.

The development of programmable digital computers in the 1940s made previously abstract ideas about mathematical reasoning computationally actionable. During the following decade, researchers in mathematics, psychology, engineering, economics, and other disciplines investigated the possibility of artificial intelligence. Historical accounts describe the interaction between these intellectual traditions and the capabilities of early computers [33].

In 1950, Alan Turing published Computing Machinery and Intelligence. He approached the question of machine intelligence through an imitation game, now associated with the Turing test. Rather than resolving the meaning of “thinking” by definition alone, the test considers whether a machine’s responses in a specified conversational setting can be distinguished from those of a person. Passing such a test is a behavioral criterion; it does not by itself settle every philosophical question about thought [34].

The period beginning with the Dartmouth meeting in 1956 brought influential demonstrations in theorem proving, game playing, and symbolic problem solving. Early natural-language programs could handle restricted forms of interaction, although their capabilities were narrower than general human language understanding. Natural-language processing remains concerned with enabling machines to interpret and produce human language, answer questions, and participate in communication [32, 33].

AI is an interdisciplinary field drawing on computer science, linguistics, psy-chology, biology, philosophy, and other areas. Its systems need not reproduce every aspect of human cognition: many are designed to perform a particular task well. An agent is a system that perceives aspects of an environment and selects actions. Rational action concerns achieving an objective using the information available, including under uncertainty. Depending on the task, an agent may require:

• natural-language processing to interpret or produce communication;
• knowledge representation to store information about the world;
• machine learning to adapt from data and experience.

These capabilities are related, but they are not all necessary in every AI system [32].

For wound analysis, the immediate goal is usually a defined prediction from an image or clinical record. The broader agent framework helps distinguish that prediction task from systems that must choose actions and observe their consequences. The kind of feedback available determines how either system can learn.

2.3 Learning in intelligent systems

Learning allows an agent to improve its performance on future tasks using observations and experience. Different components can be improved, and the available methods depend on four questions:

1. Which component is to be improved: a representation of states, an action-selection rule, a model of the environment, or another component?
2. What knowledge about the world is already available?
3. How are data and knowledge represented, for example by discrete or continuous numerical vectors, Boolean variables, or structured objects?
4. What feedback is available? It may include explicit target outputs, observations without labels, or rewards and penalties associated with actions.

The answers influence both the learning objective and the algorithm used [32].

If improved performance is desirable, why not program it into the agent from the start? First, a designer cannot anticipate every situation the agent will encounter. Second, an environment can change over time. Third, the designer may be unable to express a successful solution as a practical set of explicit rules. Learning provides a way to estimate useful behavior from examples rather than specifying every detail in advance.

Learning can reduce direct human intervention in specifying individual de-cisions. Training data may contain solved examples of the task or observations collected while an agent interacts with its environment. Nevertheless, human in-volvement also includes defining objectives, selecting and annotating data, choosing models, and assessing errors. Providing data is therefore only one part of the design process.

The next subsection focuses on deep learning as one approach to constructing the representations used by a learning system.

2.3.1 Deep learning

Deep learning is based on representation learning with multiple computational layers. Instead of fixing all features in advance, the learning procedure adjusts transformations that make the input useful for a task. Deep models can be used in supervised, semi-supervised, unsupervised, and reinforcement-learning settings [31]. The word “deep” describes the composition of transformations; it does not specify the kind of supervision.

Wound application. Wang and colleagues trained a convolutional encoder-decoder to delineate foot-ulcer regions in clinical photographs.[35] The application turns learned image representations into a spatial mask rather than a single image label. Chapter 5 develops this segmentation setting, while Chapter 8 connects learning to a wound experiment.

2.4 Learning paradigms

Data characteristics and available feedback distinguish several common learning paradigms. Figure 2.1 summarizes them. These categories describe the learning setting; an application may combine more than one.

2.4.1 Supervised learning

In supervised learning, the training set contains pairs (xi,yi), where x^ is an input and yi is its target. If the targets are discrete categories, the task is classification. Recognizing handwritten digits is a familiar example. If the target is a continuous quantity, the task is regression; predicting a house price from location and the

Illustrations are not included in the reading sample

Figure 2.1. Learning paradigms distinguished by their training information. Original diagram based on standard definitions [31, 36].

number of rooms is one example. The learned mapping should generalize to new examples rather than merely reproduce the training labels [31].

In wound research, x, might be a photograph and p, its annotated category. For segmentation, the target is instead a map assigning a label to each pixel. The input may be similar, but the form of the target changes the output layer and training loss.

Wound application. Anisuzzaman and colleagues used annotated wound cate-gories to supervise networks receiving photographs and anatomical location.[14] Their image-only, location-only and combined classifiers illustrate how the same reference labels can supervise different inputs. Section 7.4 develops the corresponding wound-classification application.

2.4.2 Unsupervised learning

Unsupervised learning uses observations x, without externally supplied target labels for the task. Examples include clustering, density estimation, and learning low-dimensional representations for visualization. The absence of class labels does not mean that the learning procedure has no objective: it still optimizes a criterion defined by the model and task.

Wound application. Veredas and colleagues used k-means to segment wound images before supervised classifiers assigned tissue categories to the resulting regions.[37] The clustering component therefore organizes image content with-out itself supplying clinical tissue labels. Section 3.6 develops the method and Section 3.7 examines this wound pipeline.

2.4.3 Semi-supervised and related learning

Semi-supervised learning combines labeled and unlabeled examples. Let nl count the labeled examples and nu the unlabeled examples. The corresponding datasets are

Illustrations are not included in the reading sample

The aim is to use information in Nu to improve a task for which labels are scarce. One possible approach learns representations from unlabeled examples and then uses labeled examples to train or fine-tune a predictor. Other approaches train with both types of data jointly. Semi-supervised learning is therefore not restricted to a two-stage procedure.

Self-taught learning also uses unlabeled data to learn a useful representation, but those data need not come from the same class distribution as the supervised task. Its original formulation emphasizes learning transferable structure from a broader collection of examples [38]. It should not be confused with self-training, in which a model’s own predictions supply provisional labels, or with the broader modern category of self-supervised learning.

Consider distinguishing cats from dogs. In a conventional semi-supervised setting, the unlabeled examples might also consist of cats and dogs. In a self-taught setting, the unlabeled collection could contain a wider range of natural images, perhaps collected from the Internet. The learned features are useful only insofar as they transfer to the target task. A difference in distributions is permitted; it is not a guarantee of successful transfer.

A related distinction concerns how the training signal is constructed, rather than only which images have supplied labels. In self-supervised learning, a training target is constructed from the observed data. A masked autoencoder, for example, learns to reconstruct hidden image patches from the visible patches [29]. This can provide an initial representation for later supervised training. It supplies a learning signal without requiring a clinical label for each pretraining image; downstream wound assessment still requires task-specific labels and evaluation.

Section 4.5 connects this learning signal to wound images, positive-pair choices, masking, and the need to separate evaluation patients before unlabelled pretraining. Section 4.3 then explains how frozen and adapted representations are compared when target labels are limited.

Wound application. Curti and colleagues combined semi-supervised U-Net training with clinicians accepting or rejecting predicted wound masks for later training rounds.[39] This is a documented response to limited manual wound annotations. Section 5.5 develops learning with incomplete labels and its distinction from fully supervised segmentation.

2.4.4 Reinforcement learning

In reinforcement learning, an agent interacts with an environment and learns how to act to obtain a high cumulative reward. Unlike ordinary supervised learning, the agent is not necessarily shown the best action for each situation. It must learn from the consequences of its behavior, and actions can affect both future rewards and future observations. The objective generally concerns a sequence of decisions, rather than maximizing only the reward from the next action [36].

Wound application. The Infection-Reasoner preprint used reinforcement-learning post-training with GRPO to refine a vision-language model for wound infection classification.[40] Here the reward concerns agreement with infection labels, rather than learning a wound-treatment policy. Section 7.9 develops this application and its evidence limits.

2.5 Evaluating wound predictions

The learning paradigms above describe how data and feedback guide training. Before choosing a model architecture, we also need to specify how its predictions will be evaluated. We begin by defining targets, observation units, and data partitions, then count classification errors and examine class imbalance, thresholds, probabilities, and spatial outputs. All numerical examples and diagrams in this section are original, synthetic teaching examples: they are not patient data, trained- model results, or estimates of clinical effectiveness. The definitions follow standard image-analysis validation principles.[21, 22]

2.5.1 Targets, references, and evaluation units

Let xi denote the input for observation i, yi its reference label, gi its patient identifier, and yi the model’s predicted label. A score si = s(Xi) can be converted to a binary prediction using a threshold r:

Illustrations are not included in the reading sample

Here 1 [•] is one when its condition holds and zero otherwise. A score need not be a probability; when it is explicitly a probability estimate, we write pi. The positive label 1 must be defined before any calculation. In a wound-category experiment it could mean “pressure injury” versus the other eligible categories. Infection, severity, and the need for referral are separate clinical endpoints and require their own definitions and reference standards. A single-label multiclass study also needs a rule for mixed, uncertain, and ineligible cases.[20]

The observation unit defines the claim. One photograph per patient allows image and patient counts to coincide in a teaching example. Several images per wound, several wounds per patient, and repeated visits break that equivalence. Pixel counts answer a spatial question rather than supplying independent patient observations. A reference annotation is the documented comparison target, not a guarantee of error-free clinical truth.[20, 22]

Illustrations are not included in the reading sample

No patient overlap between branches. No feedback from the final test to selection. External testing adds a separate population or acquisition setting.

Figure 2.2. The roles of data in evaluation. Original schematic: split patient groups first, select using tuning data, and evaluate the fixed procedure on held-out observations. Training and tuning together form development. The arrows represent permitted information flow.

2.5.2 Training, selection, and testing

Model parameters are learned from the training partition. In this book, development data comprise the training data and the data used for model selection. Within development, a separate tuning set, also called a validation set in machine learning, supports choices such as model size, stopping time, and the decision threshold. The final test estimates performance after those choices are fixed. Fitting a probability calibration also belongs to development: state which observations fit the calibration and how any reuse of development data is controlled. Patient identities should be separated before creating crops or augmented views.[20]

Illustrations are not included in the reading sample

The sets G contain patient identifiers, not pixel indices. Figure 2.2 shows how Equation (2.3) constrains the data flow. All visits and derived views from one patient stay in one branch. Training-only augmentation supplies examples for fitting, while the validation-to-selection arrow represents information used to choose the model or decision policy. The final test and any external cohort remain outside those choices. If patient identifiers are unavailable, report that limitation rather than asserting that image separation proves patient independence.

Here validation set names a data partition; broader expressions such as clinical validation concern evidence for an intended use. A model-selection result is not an untouched test result. Later chapters use development in this inclusive sense and identify the particular fitting or selection subset when the distinction matters.

2.5.3 Confusion matrices

Once the target and evaluated observations are fixed, prediction errors can be counted. For a binary task, a true positive (TP) is a positive reference case predicted positive. A false negative (FN) is a missed positive; a false positive (FP) is a negative reference case predicted positive; a true negative (TN) is a correctly rejected negative. Throughout this book, matrix rows are reference classes and columns are predicted classes. “Positive” is a designated category, not a statement that a finding is beneficial.[21]

Consider 100 eligible wound photographs, one per hypothetical patient. Twenty have the target category and 80 do not. At one fixed threshold the system produces

Illustrations are not included in the reading sample

The first row and column denote the positive category. Figure 2.3 displays these four counts with their margins. Reading across the positive row answers how many target cases were recovered. Reading down the positive column answers how many positive predictions were correct. Thus the two denominators are 20 and 28, respectively; sensitivity and precision need not agree.

Illustrations are not included in the reading sample

Figure 2.3. A binary wound-category example with 100 synthetic observations. Counts, row totals, and column totals expose the denominators of the measures in Equation (2.5).

2.5.4 Confusion-matrix measures

Let N = TP + TN + FP + FN. Accuracy, sensitivity, specificity, and predictive values are threshold-dependent measures derived from these counts:

Illustrations are not included in the reading sample

Sensitivity is also called recall or the true-positive rate; precision is the positive predictive value (PPV). Negative predictive value (NPV) describes the correctness of negative predictions. Specificity describes the recovery of reference negatives. These synonyms should be recognized when comparing papers. F1 is the harmonic mean of precision and recall when both are defined; its count form is convenient for handling cases in which one of those separate fractions is undefined.[21]

For Equation (2.4), accuracy is 84/100 = 0.84, sensitivity is 16/20 = 0.80, specificity is 68/80 = 0.85, precision is 16/28 & 0.5714, NPV is 68/72 & 0.9444, and F1 = 32/48 « 0.6667. The model recovers four out of five target

cases, but only about 57% of its positive predictions are correct. Which error matters most depends on the defined use; a wound-type classification experiment does not by itself specify the costs of a treatment decision.

The F score excludes TN, so it cannot describe negative-class performance by itself. If no positives are predicted, precision has a zero denominator. If the reference set contains no positives, sensitivity is not estimable. Report the affected counts and a prespecified software convention rather than interpreting an undefined value as a measured zero.[22]

Wound application. Anisuzzaman and colleagues reported precision, recall and F1 for their wound-category classifiers in addition to accuracy.[14] These measures describe errors against the study’s category labels. Section 4.10.2 develops the image-classification application; Section 8.8 connects such measures to recorded predictions.

2.5.5 Class imbalance and prevalence

A different hypothetical test contains five target-category images and 95 other images. A rule that always predicts “other” obtains 95% accuracy while detecting none of the five target cases. Binary balanced accuracy averages sensitivity and specificity:

The always-negative rule has BA = (0 + l)/2 = 0.5. The earlier 100-image classifier has BA = (0.80 + 0.85)/2 = 0.825. Neither comparison establishes clinical utility: balanced accuracy deliberately gives the two reference classes equal weight, while ordinary accuracy weights observations equally. Choose the primary measure in relation to the intended question.[21]

The class proportions also affect how many positive predictions are correct. Predictive values additionally depend on the prevalence R = F(p = l) in the

evaluated population. Under explicitly fixed sensitivity Se and specificity Sp, Bayes’ rule gives

With Se = 0.80, Sp = 0.85, and T = 0.20, this yields 0.16/(0.16 + 0.12) « 0.5714, matching the confusion matrix. If prevalence were 0.05 while both rates remained fixed, PPV would be 0.04/(0.04 + 0.1425) « 0.2192. This is a conditional calculation, not a prediction for a new clinic. Sensitivity and specificity can themselves change with case mix, severity, acquisition, and the reference standard. Artificially balancing a test set therefore changes the interpretation of predictive values.[23]

2.5.6 Multiclass evaluation

The same counting ideas extend from a binary decision to several categories. For K mutually exclusive labels, let M,. count observations with reference class i and predicted class ). For each class F, use a one-versus-rest comparison:

Illustrations are not included in the reading sample

Macro averaging weights classes equally. Support-weighted F instead uses weights R/,./V, where nfc = ^.Mfc. is the reference support. Micro averaging pools the class-specific counts before calculating a metric. In single-label classification with all classes included, micro precision, recall, and F equal accu-racy: every error contributes one FP and one FN across the classes. This identity does not generally hold for multilabel prediction.[21]

Take the synthetic matrix

Illustrations are not included in the reading sample

For teaching, let the prespecified eligible labels be pressure, venous, and dia-betic wounds, in that order, with one reference category per case. There are 50 observations and 38 correct predictions, so accuracy is 0.76. Class recalls are (0.90,0.60,0.80); balanced accuracy is approximately 0.7667. Class precisions are (18/21,12/16, 8/13) and class F scores are (36/41, 24/36,16/23), giving macro F « 0.7468. Compute each class F before averaging: the harmonic mean of macro precision and macro recall is generally a different number. Chapter 4 revisits these same counts to show how class-specific errors can disappear in a headline score.

Report class supports, class definitions, and handling of absent classes. A multilabel study, such as separately predicting several findings for one wound, needs a separate binary evaluation for each endpoint and an explicitly chosen aggregation. It should not inherit the single-label interpretation automatically.

2.5.7 Thresholds and ranking performance

The preceding classification examples used a fixed decision threshold. We now examine what happens when that threshold varies. Changing T in Equation (2.2) changes the confusion counts. The receiver operating characteristic (ROC) plots sensitivity against the false-positive rate, FPR = FF/(FF + 7.77 = 1 — Specificity. A precision-recall (PR) curve plots precision against recall. Both require scores across thresholds, rather than just a final list of predicted labels. PR analysis is especially informative about positive predictions when the target class is uncommon; its interpretation depends on prevalence.[41]

Consider eight independent hypothetical patients ranked by decreasing targetcategory score:

Illustrations are not included in the reading sample

At T = 0.70, the first four cases are positive predictions: TP = 3, FP =1, FN = 1, and TN = 3. Recall and precision are both 0.75, while FPR is 0.25. Figure 2.4 marks this operating point. These eight cases are a separate illustration from the 100-image matrix.

The area under the ROC curve (AUROC) has a useful pairwise interpretation. For positive scores Illustrations are not included in the reading sample and negative scores Illustrations are not included in the reading sample,

Illustrations are not included in the reading sample

Here N+ and N- are positive and negative counts. Eleven of the sixteen positive-negative pairs are correctly ordered, giving AUROC = 11/16 = 0^6875. This measures ranking; it does not identify a clinically appropriate threshold or establish that the scores are calibrated probabilities.[21]

One noninterpolated average-precision convention is

Illustrations are not included in the reading sample

where Fj and Fj are recall and precision after successive score groups are admitted, ordered by increasing recall. Tied scores should be processed together. For the distinct scores above, recall increases at ranks 1, 3, 4, and 7. Thus AP = (1 + 2/3 + 3/4 + 4/7)/4 « 0^7470. Figure 2.4 shows the four rectangles contributing this area. Trapezoidal PR integration and interpolated AP conventions can give different values; “AUPRC” and “AP” should not be exchanged without stating the implementation.[42]

Select the threshold using development data and a stated objective, then retain it for testing. Searching the test set for the best F1 or desired sensitivity makes that set part of model selection. In multiclass work, specify the one-versus-rest or other construction and the averaging rule before reporting an AUC. A larger AUROC does not ensure better precision at the threshold needed for a particular use.

Wound application. The TransUNet-GradCAM study examined ROC and precision-recall behavior for foot-ulcer segmentation alongside thresholded masks.[43] This places ranking and operating-point questions within a wound-region task. Section 5.15 develops spatial evaluation and distinguishes threshold selection from the quality of the predicted boundary.

Illustrations are not included in the reading sample

Figure 2.4. Ranking and operating points for the same eight synthetic cases. Left: empirical ROC. Right: recall-weighted steps for the noninterpolated AP calculation, not linear interpolation between all PR points. The marked point corresponds to threshold 0.70.

2.5.8 Probability evaluation

Ranking assesses the ordering of scores. When scores are presented as probabilities, their numerical values also need evaluation. A calibrated positive-class probability of 0.8 means that, among comparable predictions near that probability, approximately 80% have the positive reference label. Calibration is a group-frequency property; it does not establish that a particular patient is correctly classified. Neuralnetwork normalization alone does not ensure calibration.[44]

For binary probabilities p, = P^y, = 1 | x,), two proper probability scores are the Brier score and logarithmic loss:

Illustrations are not included in the reading sample

Lower values are better under these definitions. The logarithm is natural; a probability of zero assigned to an outcome that occurs gives infinite log loss. Numerical clipping must be documented. For a positive reference, p = 0.8 contributes 0.04 to BS and approximately 0.2231 to log loss; p = 0.2 contributes 0.64 and 1.6094. These scores assess overall probabilistic performance, not calibration alone. A

reliability plot is needed to examine the relationship between predicted probabilities and observed frequencies directly.[21, 45]

For probability bins Bb, a positive-class reliability plot compares

In a separate 20-case example, ten predictions all have p = 0.6 and five positive references; ten have p = 0.9 and eight positive references. Figure 2.5 therefore places points at (0.6,0.5) and (0.9,0.8). Both lie below the identity line, indicating overestimation of positive frequency in these groups. Equation (2.12) gives BS = (5(0.4)[2] + 5(0.6)[2] + 8(0.1)[2] + 2(0.9)[2])/20 = 0.215. This small constructed sample illustrates the calculation, not a reliable population calibration estimate.

In Chapters 4 and 6, multiclass Brier scoring sums squared errors over all classes before averaging over observations. For two classes that convention is twice the binary BS in Equation (2.12), because the positive and negative errors have equal squares. The class-summed definition and binary scaling are documented in scikit- learn.[332] A class-mean rescaling can instead be explicitly defined by dividing the

class-summed score by K. State the definition before comparing values. Classwise reliability and confidence-versus-correctness reliability plots also answer different questions; the Transformer chapter explicitly uses the latter.[44]

Wound application. Jiang and colleagues assessed calibration and Brier scores for a chronic-wound infection model built from routine clinical records.[46] The application concerns predicted infection probabilities from clinical variables, rather than photographs alone. Section 3.7 distinguishes record-based prediction from wound-image analysis.

2.5.9 Evaluating masks and boxes

Spatial predictions require another change of evaluation unit: we now count pixels and objects rather than image-category decisions. For binary wound masks, let A be predicted foreground and B reference foreground on the same pixel grid. Then TP = |A A B|, FP = |A \ B|, and FN = |B \ A|. Two overlap measures are

Illustrations are not included in the reading sample

The algebraic form of binary foreground Dice equals that of Fg, but the counted units here are pixels. It does not follow that a Dice of 0.8 means 80% of wound images or patients were classified correctly. For the same mask pair and counting convention, D = 2J/(1 + J);the nonlinear relation does not generally convert an average IoU into an average Dice.[22]

Figure 2.6 uses an exact 5-by-5 teaching grid. The reference occupies nine cells, the prediction twelve, and their intersection six. TP = 6, FP = 6, FN = 3, and TN = 10, so Dice = 12/21 « 0.5714 and loU = 6/15 = 0'4. Read the shared cells as recovered wound pixels, the prediction-only cells as excess region, and the reference-only cells as missed region. These geometric errors differ from the category errors in Figure 2.3.

Illustrations are not included in the reading sample

Figure 2.6. An exactly counted synthetic mask pair. Color and symbols identify TP, FP, FN, and background cells. The original diagram represents a calculation grid, not a clinical wound boundary.

Specify treatment of empty masks, inclusion of background, and whether counts are pooled before scoring or scores averaged per image. If both masks are empty, the unsmoothed fractions are undefined. A high pixel accuracy can conceal a missed small wound. Boundary distances, their physical units, and calibrated area measurement are developed in Section 5.15; overlap alone cannot establish accurate wound area in square centimeters.[22]

Detection adds an assignment problem. A predicted box is matched to a reference object according to an explicit rule, often requiring IoU above a threshold. A matched prediction contributes one object-level TP; an unmatched prediction contributes FP; an unmatched reference contributes FN. Duplicate boxes for one object are not multiple successful detections. AP@0.5 uses an IoU matching threshold of 0.5, which is distinct from the score threshold swept to form the PR curve. mAP additionally requires a stated average over classes and, in some protocols, IoU thresholds. These rules explain why localization AP, mask Dice, and image-label accuracy in a multitask wound study must be read separately.[21, 26]

Wound application. WILLIE evaluated wound classification, segmentation and mask-derived localization as separate tasks, using category metrics, mask overlap and localization measures.[26] Its example shows why spatial and category results

need their own references. Section 6.16 develops the integrated wound-model case study.

2.5.10 Uncertainty and paired comparisons

Every score above is estimated from a particular collection of observations, so its sampling uncertainty also matters. An estimate of 16/20 and one of 160/200 both equal 0.8, but they carry different sampling precision. Report the numerator, denominator, and an appropriate uncertainty interval. With repeated photographs, resample patients and retain their observations together when using a patient-cluster bootstrap. Compute each model’s score on the same resampled patients when estimating a paired performance difference. For example, a resample containing patients A, A, C, D includes all of A’s retained images twice; it does not independently select arbitrary images from A and B. This preserves the chosen clustering while leaving the metric’s image, wound, or patient weighting explicit.[20, 45]

A95% confidence-interval procedure aims for 95% coverage under its sampling assumptions. It is not a guarantee of the same performance at a new clinic. Variation across training seeds describes another source of uncertainty and should not be substituted for patient-sampling uncertainty. Report class supports and external cohort characteristics; a subgroup with very few observations may support only an imprecise estimate. Training on one site and testing on another can expose acquisition shift, but overlapping patients or reused public images must still be checked.

Compare systems on the same target definitions, eligible observations, partitions, and metric conventions. Report threshold selection, missing predictions, and failures. An improvement in discrimination, a better-calibrated probability, and a beneficial clinical decision are separate findings. Clinical prediction guidance explicitly distinguishes discrimination, calibration, and clinical utility.[45]

Wound application. The foot-ulcer TransUNet study repeated segmentation experiments across seeds and examined changes after removing model compo-nents.[43] Its uncertainty summaries describe that experimental repetition, rather than a new patient sample. Section 5.16 develops the study and Section 8.8 connects uncertainty to comparison design.

2.5.11 Metrics and training objectives

A training loss supplies the objective used to adjust parameters. An evaluation metric summarizes performance under a declared assessment protocol. They can share a mathematical expression: cross-entropy can be optimized on training data and reported as log loss on a test set. Their roles and data differ. Accuracy and hard Fg are not generally convenient differentiable training objectives; a smooth surrogate may be used instead. Class weights or resampling change the objective, so an improvement in weighted training loss need not imply improvement in every unweighted test metric.[31]

Deep metric learning has a separate meaning: it learns distances or similarities between representations. Its contrastive or triplet objectives are not substitutes for reporting classification sensitivity, segmentation overlap, or probability calibration. Section 2.11 develops those representation objectives after the network and optimization foundations.

Wound application. Curti and colleagues trained a wound-segmentation U- Net with a combination of Dice and binary focal losses while monitoring spatial prediction measures.[39] The application separates the optimized training objective from the evaluation of the resulting masks. Section 5.4 develops these segmentationloss choices.

2.5.12 Connections to later chapters

Chapter 3 compares feature-based pipelines under task-specific evaluations. Sec-tion 4.10 applies the present definitions to convolutional and capsule systems, revisits the multiclass matrix, and adds selective prediction and failure analysis. Section 5.15 develops boundary distances, empty masks, aggregation, and physicalarea errors. Section 6.15 applies classification and calibration measures to Transformer systems. Their worked examples retain the same reference-row/prediction- column convention. Model architecture changes how predictions are produced; it does not by itself change what the evaluation quantities mean.

Worked review checks. If two FN in Equation (2.4) become TP while all other cases stay fixed, accuracy becomes 86/100 = 0.86, sensitivity 18/20 = 0.90, precision 18/30 = 0.60, and specificity remains 0.85. If a model instead gains accuracy only by improving TN, sensitivity may remain unchanged. For the mask grid, correcting all three FN while retaining six FP yields Dice 18/24 = 0.75 and IoU 9/15 = 0.60. Each calculation changes a specified kind of error; none can be described adequately by saying only that the model became “more accurate.”

2.6 Artificial neural networks

The learning paradigms describe the feedback available during training, and Section 2.5 establishes how predictions will be assessed. We now turn to the model that receives that feedback. A neural network specifies how input values are transformed into an output; the training objective determines how its parameters are adjusted.

An artificial neural network is a computational system built from connected units. Its adjustable parameters encode relationships learned from examples. In a multilayer network, successive transformations can construct increasingly useful representations of the input. Higher layers often express more abstract features, although the actual representation depends on the architecture, task, and training data.

Two important families are feedforward and recurrent networks. In a feedfor-ward network, information passes through a directed acyclic computation graph from inputs to outputs. A recurrent network reuses a state across steps, allowing past information to affect subsequent computation. Its compact representation contains recurrent connections; when unrolled over a finite sequence, its computation can also be represented as a directed acyclic graph.

Artificial networks were inspired by biological nervous systems, but their units and learning rules are mathematical abstractions. A useful model need not be a detailed simulation of an animal brain [31, 47].

The following subsections build this description from individual units to multilayer representations, then introduce multimodal inputs and reasoning before we turn to optimization.

2.6.1 Neurons and fully connected layers

An artificial neuron maps an input vector to a scalar output. A common definition is

Illustrations are not included in the reading sample

where a : R ^ R is an activation function, w contains weights, and b is a bias. The weights and bias are adjusted during learning.

A weight controls the contribution of one input component; the bias shifts the combined score before activation. Without the activation, the expression is an affine transformation; the nonlinear activation is what permits a composition of layers to express more than a single affine map.

A fully connected layer has a connection from each input component to each output unit. In matrix notation,

Illustrations are not included in the reading sample

with a applied elementwise. The connectivity pattern is part of the network’s topology. Input nodes provide observed data, hidden layers compute intermediate representations, and an output layer produces the prediction. Hidden activations are not directly supplied as target observations, but they can be inspected or reused; “hidden” does not mean inaccessible. Depth counts successive transformations,

although conventions differ on whether the output layer is included. Width describes the number of units in a layer.

For example, with three input features and two output units, W has two rows and three columns, Wx has two components, and b contains two biases. This dimensional check is useful when moving between scalar formulas and matrix notation.

A single-layer perceptron is an elementary feedforward model. Under its con-ventional threshold decision rule, its decision is obtained by thresholding an affine score. The boundary is a hyperplane in the input features, provided the weight vector is nonzero; the thresholded output is not itself a linear function. Additional output units can represent multiple scores. The limitations of such models motivated the study of multilayer networks [47, 48].

A dense layer maps 'vv to R^; structurally, every output can depend on every input. Individual learned weights may of course be zero. Figure 2.7 illustrates the connection pattern.

2.6.2 One hidden layer

We now express a network as a composition of scalar units. This makes the transition to multiple hidden layers explicit [31, 49]. A unit in the first hidden layer The superscript identifies the layer, the index j identifies its unit, and WQ[1]^- is the bias. It is helpful to separate the affine combination from the nonlinear activation.

Algorithm: Evaluating a first-layer unit

1. Supply x, the activation a, and the unit’s parameters.
2. Compute Vj = wQj + E^=1 WnJxn.
3. Apply the activation to obtain a(vj).
4. Return fj[1]-(x) = a(vj).

For a one-dimensional input and a hyperbolic-tangent activation,

Illustrations are not included in the reading sample

Changing the bias shifts the transition, while changing the weight alters its direction and steepness. The examples in Figure 2.8 use different documented parameters to illustrate this variation.

Replacing the activation with a rectified linear unit (ReLU) gives

Illustrations are not included in the reading sample

The same two parameters now determine the location of the hinge and the slope of its active branch. These examples demonstrate the behavior of individual units; they are not fitted experimental results.

A model with Ui first-layer units and a scalar affine output is

Illustrations are not included in the reading sample

The parameter collection 9 includes both the internal weights of the hidden units and the output coefficients c0.^.cUi. For classification, an appropriate output transformation or decision rule can be applied to the resulting score.

An architecture diagram presents these operations from left to right. Input nodes hold observed features, edges carry weighted contributions, hidden units apply nonlinear transformations, and the output combines their activations. Biases can be shown as connections from a constant input or absorbed into an augmented vector. Figure 2.9 shows a network and its more compact computational representation.

Illustrations are not included in the reading sample

Figure 2.8. Four illustrative scalar units u(h + wr) with tanh (top) and ReLU (bottom). Corresponding columns use the same (b,w): (—0.7, 0.8), (0.6,—1.1), (1.0,1.7), and (—1.0, —0.65). Vertical scales differ between panels. Parameters are recorded with the figure source.

The hidden representation is computed from the observed input; it is not supplied independently by the training set.

2.6.3 Matrix representation

The scalar equations show what each unit computes, but become cumbersome when many units are evaluated together. Matrix notation collects those same calculations into one operation. The following augmented representation incorporates the biases into the weight matrix; it changes the bookkeeping, not the network function.

Augment the input with a leading constant to incorporate biases:

Illustrations are not included in the reading sample

Here W/ G ¡Rx+[1])XA. stores the parameters of each hidden unit in a column. This column-wise convention differs from the unaugmented row-wise convention in Equation (2.16); the transpose below makes the dimensions consistent.

Illustrations are not included in the reading sample

Figure 2.9. One hidden layer represented as connected units and as a sequence of operations. Both drawings implement Equation (2.20). Original diagrams.

The vector WT x G R^[1] contains all hidden preactivations. Its ,/th component is

Illustrations are not included in the reading sample

For a vector v G Rd, elementwise activation means

Illustrations are not included in the reading sample

Consequently,

Illustrations are not included in the reading sample

This UT-component vector contains the outputs of all first-layer units.

TTT’JI C ri T 1 r iT A‘ 1 A A 11

With h1 = [1; hj and c = [c0,c1,_,c^1][1], the entire scalar-output model becomes

Illustrations are not included in the reading sample

Keeping the hidden-layer weights and output weights distinct makes the two stages of this computation explicit: first compute the hidden representation, then combine its activations into the scalar output.

2.6.4 Two hidden layers

A second-layer unit applies the same construction to first-layer activations:

Illustrations are not included in the reading sample

The first-layer units become the inputs to a new affine combination and activation.

Figure 2.11 makes this composition explicit.

Algorithm: Evaluating a second-layer unit

1. Specify the activation and the Ui first-layer units.
2. Evaluate Ji([1])(x) for i = 1,..., Ui. a u (2) , v-U1 (2) ,(1)z A
3. Form VJ = w^,' + £i=\ wi,^/i Ax).
4. Return J([2]) (x) = a(u7). ' J

A narrow special case with one unit in each hidden layer is

Illustrations are not included in the reading sample

More generally, a second-layer unit can combine several first-layer outputs as in Equation (2.26). This allows more varied functions than the narrow special case. Increasing depth can increase expressive capacity, but the result also depends on layer width and parameter choices. In particular, a chain of scalar monotone activations cannot produce every nonmonotone shape merely by adding layers.

Figure 2.10 visualizes Equation (2.26): changing the mixture of first-layer responses changes the second-layer function. The three incoming units are essential to the illustrated construction; the curves do not describe the narrower model in Equation (2.28).

A network with ( 2 units in its second hidden layer can produce the scalar output U2

Illustrations are not included in the reading sample

Figure 2.10. Illustrative two-layer units: a scalar input feeds three first-layer units and one activated second-layer unit, following Equation (2.26). Both layers use tanh (top) or ReLU (bottom); corresponding columns share the same weights and biases. Vertical scales differ. The third ReLU example is identically zero on the plotted interval.

Each second-layer unit has its own incoming weights, while all of them can use the same first-layer activations. The parameter set 9 contains the weights and biases of both hidden layers and the output coefficients.

Reading the network from left to right corresponds to evaluating its nested formula from the innermost transformations outward. Intermediate activations are called hidden because they are internally computed representations. The final output is available for comparison with a target or for use in a downstream decision.

2.6.5 Multilayer perceptrons

The same construction extends to L hidden layers. For £ > 2, define

Illustrations are not included in the reading sample

The unit receives Lp_x activations from the preceding layer, forms an affine combination, and applies an activation. Evaluation begins at the input and proceeds through the hidden layers. The recurrence is across depth, not across time as in a recurrent neural network.

Illustrations are not included in the reading sample

Figure 2.11. A two-hidden-layer network. A second-layer unit combines first-layer activations; the output combines the second-layer activations. The lower diagram shows the equivalent sequence of vector operations. Original diagrams.

Illustrations are not included in the reading sample

Figure 2.12. A feedforward network as a composition of hidden layers and an output map, shown for three hidden layers. The recurrence in Equation (2.30) extends the construction to any specified depth. Original diagram.

Algorithm: Evaluating a unit in layer f

1. Supply Uf and the preceding layer’s Illustrations are not included in the reading sample outputs.
2. Evaluate the preceding units if they are not already available.
3. Compute Illustrations are not included in the reading sample
4. Return Illustrations are not included in the reading sample

In Figure 2.12, each hidden layer supplies the activations used by the next application of Equation (2.30). The output map combines the final hidden activations; it is distinct from another hidden layer.

Models with several hidden layers are commonly called deep networks, although the term has no single universal depth threshold. Different layers may use different

Illustrations are not included in the reading sample

Figure 2.13.Illustrative three-layer units with widths 3,3,1 after a scalar input. Every layer uses tanh (top) or ReLU (bottom), with no additional affine readout. Corresponding columns share weights and biases; vertical scales differ. ReLU examples 2 and 4 are identically zero on the plotted interval. Parameters are documented and were not fitted to data.

activations; reusing one activation throughout the hidden layers is a design choice. Figure 2.13 illustrates functions obtained with three hidden transformations and shows why depth should be interpreted together with width and activation type.

For +L units in the final hidden layer, the scalar-output model is

Illustrations are not included in the reading sample

where each /(L) is defined by Equation (2.30). This separates the final output combination from the recursively constructed hidden representations.

Wound application. Anisuzzaman and colleagues used an MLP to encode anatomical wound location and combined its features with an image network for wound-type classification.[14] The dense layers therefore serve a metadata branch within a larger system. Section 7.4 develops this image-location application.

2.6.6 Multimodal learning and reasoning: an introduction

The networks introduced so far transform an input representation into a prediction. In wound analysis, that representation can include both the photograph and information recorded separately, such as anatomical location or clinical observations. Published research has investigated combining wound images with categorical patient information to distinguish pressure ulcers from incontinence-associated dermatitis [50]. Researchers also investigate intermediate explanations and hypothesis checks, including wound-infection classification in the preliminary Infection- Reasoner preprint and symbolic assistance for burn assessment in AURA [40, 51]. These approaches introduce two concepts: multimodal learning combines different forms of input, while reasoning procedures construct or examine intermediate statements and hypotheses. Understanding this distinction helps readers separate the information a system receives from the conclusions it produces.

Combining available inputs. A modality is a form of information, such as an image, structured clinical data, or text. The inputs must be paired with the intended wound assessment, with their source and timing recorded. Independently recorded observations have a different origin from a caption produced by a model from the photograph: the caption is an image-derived representation, not a new patient measurement. A model may draw on pretrained knowledge when writing it, but cannot thereby establish an unrecorded symptom. Section 7.2 develops this distinction.

The input forms can first be converted into feature vectors. Let I be the photograph, m the recorded metadata, and jj and fM their respective encoders, meaning functions that construct the feature vectors. Assuming both inputs are available, a simple fusion rule is

Illustrations are not included in the reading sample

The semicolon means concatenation: append one vector below the other. For synthetic encoder outputs fj(I) = (1,2)T and fM(m) = (3), the combined vector is h = (1,2,3)T. Its width is 2 + 1 = 3. These are chosen feature values, not patient measurements or probabilities. A classifier then maps h to its output scores. Missing inputs require a declared alternative; Section 7.4 extends this calculation with availability indicators.

Connecting images with language. A vision-language model (VLM) relates visual representations to text. One interface compares image and text feature vectors, as in CLIP; another decodes an answer conditioned on an image and a prompt [40, 52]. The prompt can specify a question or permitted labels without providing another patient measurement. These interfaces can return a class directly; using language does not itself establish a useful reasoning process. Section 7.6 explains these interfaces.

Examining intermediate statements. A basic review workflow records the available observations, identifies the proposed class, and checks the accompanying explanation against those observations. Suppose a system receives only a photograph and anatomical location, but its explanation states that the patient reports pain. The supplied record does not support that claim. Flagging it does not establish that pain is absent or determine the correct wound class.

Such an explanation is an output to evaluate, not a guaranteed record of the model’s internal calculation. An explicit consistency check can also expose incompatible assertions while leaving their factual truth unresolved. These distinctions motivate the separate reasoning and evaluation treatments in Sections 7.9 and 7.10.

Multimodality concerns the input forms; reasoning concerns intermediate or explanatory processing. Either choice still requires evidence of usefulness. A correct class does not validate every explanation statement, and a consistent explanation does not establish a correct class.

These examples extend the information a model receives and the checks applied to its outputs. Training its learned components still requires a loss and parameter updates, which the next section develops.

Wound application. Brehmer and colleagues combined wound images with structured clinical information to distinguish pressure ulcers from incontinence- associated dermatitis; Infection-Reasoner studied infection-label reasoning in a preprint.[40, 50] These are distinct wound tasks. Sections 7.4 and 7.9 develop their respective applications.

2.7 Optimization and backpropagation

The preceding sections described how neural networks transform their available inputs into predictions. For their trainable components, we now need a loss that compares predictions with the target. This learning objective is distinct from any separate rule-based review of an explanation. For labeled data F X ,

a common objective is

Illustrations are not included in the reading sample

Here £ is the loss for one example, Q is an optional regularization penalty, and A > 0 controls its strength. Squared error is one choice for a continuous target; cross-entropy is commonly used for class probabilities. A lower training loss means a better fit to this objective, but performance on separate data must still be checked [31].

Training repeats three operations: compute predictions and loss in a forward pass, differentiate the loss in a backward pass, and update the parameters. The next subsections explain the update rules before deriving how the backward pass supplies their gradients.

2.7.1 Gradient descent

Training commonly minimizes a loss Z(9; F) over parameters 9 using data F. The gradient points in the direction of greatest local increase under the Euclidean norm. Its negative therefore provides a local descent direction. Gradient descent uses

Illustrations are not included in the reading sample

The learning rate «k controls the step size. A sufficiently small step can decrease a smooth objective locally, but an arbitrary step need not do so. Training may stop after a fixed budget, when improvements become small, or when performance on a separate tuning set indicates that further fitting is undesirable. Nonconvex neural-network training does not generally guarantee a global minimum [31].

Backpropagation efficiently calculates the gradients needed by an optimizer. It is a differentiation algorithm, whereas gradient descent is a parameter-update rule. Keeping these roles separate avoids confusing the computation of a gradient with the choice of how to use it.

Section 4.4 returns to this distinction when explaining residual and dense encoders. A shortcut changes the graph through which derivatives are accumulated; the gradient still follows the chain rule. Equation (4.10) gives a concrete additivepath example relevant to adapting wound-image encoders.

2.7.2 Stochastic gradient descent with momentum

Evaluating the entire dataset for every update can be costly. Stochastic gradient descent instead estimates the gradient using one example or a minibatch +k, a small subset of training examples. One pass through the training dataset is called an epoch; it usually contains many minibatch updates. Write gk = V2+iftk:+k). Momentum retains information from preceding updates. With ft1 the initial parameter vector and u0 = 0, use k = 1, 2,... in the following convention:

Illustrations are not included in the reading sample

Starting from u0 = 0, the coefficient 7 controls how much of the preceding update is retained. Contributions accumulate when successive gradients point in similar directions, while opposing components can partly cancel. This can reduce oscillation across narrow valleys, although inappropriate settings can increase it and convergence is not guaranteed. The learning rate is already included in uk, so the second line subtracts the accumulated update directly.

2.7.3 AdaGrad

Momentum uses the history of update directions. AdaGrad addresses a different issue: parameters may require different effective step sizes. It adapts that size

separately for each coordinate [53]. For parameter i, define the accumulated squared gradient

Illustrations are not included in the reading sample

A diagonal AdaGrad update can be written as

Illustrations are not included in the reading sample

Coordinates with large accumulated squared gradients receive smaller effective step sizes. The accumulator therefore tracks gradient history, rather than the displacement of the parameter itself. The stabilizing constant avoids a zero denominator. Some implementations place a stabilizer inside the square root; the chosen convention must be used consistently.

2.7.4 Adam

Adam combines a smoothed gradient direction with a smoothed estimate of squared- gradient magnitude. These are exponentially weighted first and second moments, which give recent gradients more influence than older ones [54]. Initialize m0 = 0 and v0 = 0. For k = 1, 2, ..., compute

Illustrations are not included in the reading sample

where 0 < fil,fi2 < 1 and O denotes elementwise multiplication. The first moment smooths the direction of the gradient; the nonnegative second moment sets a separate scaling for each coordinate.

Because the moments start at zero, Adam applies bias correction:

Illustrations are not included in the reading sample

The update is

Illustrations are not included in the reading sample

with division and square roots applied elementwise. The first- and second-moment estimates are corrected separately because both were initialized at zero.

Wound application. Wang and colleagues used Adam to optimize their foot-ulcer segmentation network from annotated photographs.[35] Adam is a training component in that study, while the wound mask is the application output. Chapter 5 develops the spatial task and Section 8.6 connects optimization to wound-classifier training.

2.7.5 Backpropagation and the chain rule

All of these optimizers require gradients of the same objective. Differentiating the full network separately for every parameter would duplicate many calculations. Backpropagation reuses intermediate results and applies the chain rule from the output of a computation graph toward its inputs [31].

For a scalar chain zg = hg(x), z2 = h2(zg), through f = hn+1(zn), let n count the intermediate variables in this example. The chain rule gives

Illustrations are not included in the reading sample

An individual backward step is

Illustrations are not included in the reading sample

In a graph with multiple paths, contributions from all downstream uses are added. Vector-valued transformations require the corresponding Jacobian products. The symbols zt denote intermediate variables, avoiding confusion with trainable weights.

A forward pass computes activations and the loss. Values required for differentiation are retained or, in memory-saving implementations, recomputed. The following procedures use the row-wise weight convention of Equation (2.16). All activations are column vectors. Let np be the width of layer £, so that hp, zp, bp G Rnp and Wp G IRnpxnp—1. The input width is n0.

Here d counts all parameterized layers, including the output layer; earlier, L counted hidden layers only. The index £ identifies a layer. We write ¿data for the scalar loss of one example, keeping its symbol distinct from that index, and Z = ¿data + AQ(0) for the complete objective. The penalty Q depends directly on the parameters; set A = 0 when it is omitted.

Algorithm: Forward propagation through a multilayer perceptron

Inputs: depth d; weights W^; biases bp; elementwise activations ap; input x; target y.

1. Set ho = x.
2. For p = 1,..., d, compute and store

Illustrations are not included in the reading sample

3. Set y = hd and evaluate Illustrations are not included in the reading sample
4. Form Illustrations are not included in the reading sample

The input to each layer is the preceding layer’s activation, not the original x at every iteration.

Two different gradients are needed at each layer. The vector gp = Vh^data measures sensitivity to the layer’s output activation. The vector dp = Vz^data measures sensitivity before that activation function. Both have length np. The symbol O means elementwise multiplication; the superscript T means transpose. Consequently, dphT-1 is an np x np—1 outer product, matching the weight matrix.

Algorithm: Backward propagation through the same network

Inputs: stored forward values, the data loss, and the penalty. Keep parameters fixed throughout this backward pass.

1. Initialize gd = Vh^data.
2. For p = d, d — 1,.,1, perform all three steps:

(a) Differentiate the activation:

Illustrations are not included in the reading sample

(b) Calculate parameter gradients, adding the direct penalty contribution:

Illustrations are not included in the reading sample

(c) Pass the data-loss gradient to the preceding activation: g^_x = WTSk.

3. After completing the loop, use the chosen optimizer to update parameters.

The bias gradient has length ng and the weight gradient has the shape of Wg. If biases are excluded from the penalty, their penalty gradients are zero. For a vector-valued activation such as softmax, step 2(a) uses dg = Jag(zg)Tgg, where Ja^ is its Jacobian. A fused softmax-cross-entropy implementation can simplify this product. For a minibatch mean loss, average the per-example data gradients and add the penalty gradient once. This keeps the regularization strength consistent with Equation (2.32).

Worked one-layer gradient calculation. The following example traces the forward values and then separates the data-loss and penalty contributions to a gradient. Take the synthetic scalar case x = 2, W) = 0.5, 6X = 0.1, an identity activation, target y = 1, and Zdata = |(FX _ y)[2]. Then zX = FX = 1.1, Zdata = 0.005, and dx = 5X = 0.1. The data gradients are 9Zdata/cWX = 0.1(2) = 0.2 and 9Zdata/cFX = 0.1. With Q = xWX[2] and A = 0.2, the complete weight gradient becomes 0.2 + 0.2(0.5) = 0.3; the bias gradient remains 0.1.

Wound application. Wang and colleagues trained an end-to-end convolutional wound segmenter with a differentiable binary cross-entropy objective and Adam parameter updates.[35] This places gradient-based learning inside a published footulcer mask-prediction pipeline. Section 5.5 develops segmentation training, and Section 8.6 follows a wound-classification training workflow.

Illustrations are not included in the reading sample

Figure 2.14 provides a small example in which a variable is used twice. A correct backward calculation adds its direct contribution and its contribution through the exponential branch.

2.8 Activation functions

The backward pass multiplies gradients by activation derivatives. Activation choice therefore affects both the functions a network can represent and the signals used to train it. Small derivatives along many successive layers can greatly attenuate those signals [31].

Activation functions introduce nonlinear transformations between affine layers. They are usually applied to each component of a hidden representation, although some output transformations operate on an entire vector. Figure 2.15 compares four scalar activations and their derivatives [31].

We now examine sigmoid, hyperbolic tangent, and rectified linear units, followed by softmax as a vector-valued output transformation. For each, connect its output behavior to the derivative used during training.

2.8.1 Sigmoid

The logistic sigmoid is

Illustrations are not included in the reading sample

Its output lies in (0,1). Near zero it is approximately affine, with value 1/2 and slope 1/4. Large positive inputs produce outputs near one, whereas large negative inputs produce outputs near zero. In both tails the derivative becomes small, a behavior known as saturation.

Wound application. Anisuzzaman and colleagues used sigmoid output layers for binary wound-classification experiments, alongside softmax outputs for multiclass experiments.[14] The activation belongs to the prediction head and does not independently establish diagnostic reliability. Section 4.2 connects output heads to wound-classification targets.

2.8.2 Hyperbolic tangent

The hyperbolic tangent is

Illustrations are not included in the reading sample

Its range is (—1,1) and it is centered at zero. Like the sigmoid, it saturates for inputs of large magnitude.

2.8.3 Rectified linear unit

The ReLU activation is

Illustrations are not included in the reading sample

Its range is [0, m), including zero. Unlike sigmoid or tanh, it does not saturate on the positive side. Its derivative is one for positive inputs and zero for negative inputs; a subgradient convention is needed at zero. The inactive negative region can also make optimization difficult for units that remain there. Learned or modified activations provide alternatives in some architectures [55].

Wound application. Anisuzzaman and colleagues used ReLU in dense layers of their wound image and anatomical-location classifiers.[14] This is a componentlevel wound application: the nonlinear layers transform features before the category prediction. Sections 4.2 and 7.4 develop the image and metadata branches.

2.8.4 Softmax

The activations above act on individual scalar values. A multiclass output instead combines its class scores through a vector transformation. Softmax maps a vector of C real-valued scores, or logits, to positive normalized outputs:

ezi

Illustrations are not included in the reading sample

It is commonly used in the output layer of a multiclass classifier. The values can be interpreted as model probabilities. Subtracting maxy z3 from every logit before exponentiation leaves the result unchanged and improves numerical stability.

For one example whose class is y, cross-entropy is — log py: assigning a larger probability to the correct label reduces the loss. Equation (2.72) later writes the average of this loss in terms of learned embeddings and class weights.

The probability-evaluation principles from Section 2.5.8 apply to these nor-malized outputs. Calibration asks whether confidence agrees with observed cor-rectness. For example, among many predictions made with confidence near 0.8, a well-calibrated model would be correct about 80% of the time. This is an ex-planatory example, not a reported wound-classification result. Softmax enforces normalization but does not ensure this agreement [44].

Wound application. Anisuzzaman and colleagues used softmax heads when predicting several wound categories from images, locations or their combined features.[14] The resulting class scores belong to a specified wound taxonomy. Section 4.10.2 develops category-level evaluation, while Section 7.4 follows the multimodal application.

2.9 Convolutional neural networks

A dense network can process an image after its pixels are flattened into a vector, but this representation does not explicitly use the arrangement of neighboring pixels. Convolutional networks build that local structure into their connections. They retain the same overall training loop: forward computation, a task-specific loss, backpropagation, and parameter updates.

Convolutional neural networks (CNNs) use structured connectivity and shared filters to process data such as images. Their historical motivation includes locally organized visual processing, buta CNN is a computational architecture rather than a literal model of the visual cortex. Convolutional methods are also used for signals, audio, and text [31].

Common components and design principles include the following:

• Convolutional layers apply learned filters to local regions. They do not necessarily reduce spatial size; this depends on stride and padding.
• Sparse connectivity limits a unit’s direct input to a local receptive field.
• Parameter sharing reuses a filter at multiple spatial locations.
• Pooling aggregates nearby values and often reduces spatial resolution.

A traditional image classifier combines convolution, pooling, and fully connected layers. These are component types that may be repeated, combined, or omitted according to the architecture; they do not specify a fixed network depth.

2.9.1 Convolutional layers

An image can be represented as a tensor with height, width, and channels. An RGB image has three input channels, corresponding to red, green, and blue values. Applying one filter across the image produces a spatial array of responses, called a feature map; several filters produce several output channels. In deeper layers, these channels contain learned features rather than raw color values.

A convolutional layer learns filters, also called kernels, that extract responses from the input. Local connections allow it to represent relationships between 70

neighboring pixels or positions. Sharing a filter across positions can substantially reduce the number of parameters relative to a dense layer with comparable input and output sizes. This structure supports translation equivariance: shifting the input shifts the response under appropriate boundary and sampling conditions. Equivariance is not the same as complete invariance to object position [31, 56].

2.9.2 Pooling layers

Pooling is often applied after a convolution and activation. Max pooling returns the largest value within each selected region, whereas average pooling returns its mean. These operations can reduce the size of a feature map and hence the cost of subsequent computation. Standard max and average pooling have no learned weights of their own.

Research has introduced alternatives, including stochastic pooling, which samples activations according to a local distribution; spatial pyramid pooling, which combines responses from regions at multiple scales; and deformation-aware pooling in object-detection architectures [57-59]. These examples show how the aggregation step can be adapted; pooling is one component of the broader CNN design.

Wound application. Wang and colleagues used a spatial-pyramid pooling block in their wound-segmentation decoder to combine information at different spatial scales.[35] Pooling is therefore one component of a foot-ulcer delineation system. Sections 5.3 and 5.9 connect spatial aggregation to segmentation architectures.

2.9.3 Fully connected output layers

In a traditional classification network, a feature tensor is flattened into a vector before one or more fully connected layers produce output scores. Flattening is a reshaping operation; the dense layer then learns a transformation of that vector. The result may be used for classification or as a representation for further processing.

The allocation of parameters depends on the architecture. Dense layers can account for a large proportion in some networks, while other CNNs use global pooling and a small classifier or retain spatially arranged outputs for segmentation. The output design should match the task.

For wound-type classification, a final softmax can summarize the image with one probability per category. Segmentation instead needs predictions at individual spatial locations, so the network must preserve or recover the correspondence between its output and the input image.

Wound application. Anisuzzaman and colleagues added dense layers to pre-trained image encoders and to fused image-location features before predicting wound categories.[14] These heads convert a learned representation into the study’s output labels. Section 4.2 develops classifier heads and Section 7.4 develops the fusion case.

2.9.4 Convolution mechanics

A convolutional filter has learnable weights and often a bias. Early layers may respond to edges, color contrasts, or simple textures; subsequent layers combine responses into more complex patterns. This interpretation is useful but not a guaranteed meaning for every learned filter. Parameters are optimized using backpropagation and a chosen optimizer.

Operationally, a kernel is moved across the input. At each position, corre-sponding kernel and input entries are multiplied and summed. Padding extends the input around its boundary, often with zeros. The stride specifies how far the kernel moves between output positions. A larger stride generally produces a smaller spatial output. The number of filters determines the number of output channels.

Let the input have width Wg, height Hg, and Dg channels. For K filters with square spatial size F, stride S, symmetric padding P, and unit dilation, the output dimensions are

Illustrations are not included in the reading sample

Here Wg ,Hg,F,S,K and the channel counts are positive integers, P is a non-negative integer, and the padded height and width must each be at least F. Unit dilation means that adjacent kernel entries sample adjacent input locations. Each filter spans all Dg input channels in an ordinary dense convolution, so its shape is F x F x Dg: two spatial dimensions and a depth set by the input channels. Figure 2.16 illustrates this relationship [56].

The dimension formulas count where a filter can be placed. To describe the value calculated at each placement, we now write the filtering operation itself. In the following formulas, K names the kernel function rather than the filter count used above. Convolution combines two functions to produce a third. For discrete one-dimensional data, one convention is

Illustrations are not included in the reading sample

with finite support or suitable convergence assumptions. In a neural-network context, I denotes the input and K the kernel. In a finite array, the treatment outside its boundaries is determined by the padding convention.

In Equation (2.51), t selects the output position and a runs over input positions. The product weights each input value by a shifted kernel value, and the sum combines those contributions. The two-dimensional version applies the same idea along both image axes.

For two-dimensional arrays,

Illustrations are not included in the reading sample

With compatible domains, mathematical convolution is commutative. This property is different from the fact that a kernel is translated across an input.

Most deep-learning libraries implement cross-correlation and call the resulting operation convolution:

Illustrations are not included in the reading sample

The distinction is the reversal of the kernel indices. In two dimensions, reversing both axes corresponds to a 180° rotation. For freely learned kernels, this change in convention does not restrict the family of filters that can be learned. It remains important when reproducing a specified numerical calculation [31, 56].

2.9.5 Stride and padding

Stride and padding control the sampling and extent of the output. To simplify the derivations, consider a square input with side length i, a square kernel with side length k, stride s, padding p on each side, and unit dilation. The input and kernel each have two spatial axes. A 2x2 kernel is one possible two-dimensional kernel; its side length is a separate choice.

Throughout these counting formulas, i,k,s are positive integers, p is a nonnegative integer, and i + 2p > k, so at least one complete kernel placement exists.

No padding and unit stride. With p = 0 and s = 1, the kernel visits every valid position. For i > k,

Illustrations are not included in the reading sample

A 3x3 kernel on a 4x4 input therefore gives a 2x2 output. With unit stride, the kernel advances one input position at each step.

The four highlighted placements in Figure 2.17 implement Equation (2.54) along both axes. Each placement gives one output entry: two positions along each axis produce four entries in total.

Padding and unit stride. Padding increases the effective side length from i to i + 2p, giving

Illustrations are not included in the reading sample

For i = 4, k = 3, p = 2, and s = 1, the output side length is six. The same values with s = 2 would instead give three. Figure 2.18 depicts the unit-stride case.

Half or same padding. To preserve spatial size at unit stride with an odd kernel, write k = 2n + 1 and choose p = (k/2j = n. Then

Illustrations are not included in the reading sample

For even kernels or nonunit stride, a library’s “same” convention may involve asymmetric padding and must be checked separately.

Illustrations are not included in the reading sample

Figure 2.18. A 4x4 input with two zero-padding cells on each side, a 3x3 kernel, and unit stride produces a 6x6 output. The highlighted kernel placement shows one output location. Original drawing.

Full padding. Choosing p = k — 1 and s = 1 includes every position with at least some overlap under the usual finite-support convention:

Illustrations are not included in the reading sample

The output is larger than the original input in this case.

Nonunit stride without padding. For p = 0 and s > 1, the kernel skips positions:

Illustrations are not included in the reading sample

The floor accounts for the final partial step, which does not form a complete valid

kernel placement.

General padding and stride. Combining both gives

Illustrations are not included in the reading sample

The same spatial counting applies to max or average pooling with the same window, stride, padding, and floor convention. For unpadded pooling, set p = 0. Implementations that use ceiling mode or other boundary conventions can produce different dimensions [56].

2.9.6 Receptive fields and parameter sharing

The preceding subsections counted how many output positions a convolution produces. We now ask two different questions: which input values can influence one output, and which weights are reused when the filter moves? The first concerns the receptivefield; the second concerns parameter sharing. Keeping these questions separate makes it easier to understand both the information available to a CNN unit and the number of parameters the network must learn.

Which inputs can influence one output? In a fully connected layer, every output can depend directly on every input. In an ordinary convolutional layer, an output at one spatial position receives a local patch from all input channels. Its local receptive field is that patch. For example, a 3x3 filter applied to an RGB image reads nine spatial positions, with three channel values at each position: 3 x 3 x 3 = 27 input values. It combines these values into one scalar response for one output channel. Applying the filter at another position reads a different, usually overlapping patch [31].

Following the connections through two layers. Figure 2.19 uses a one-dimensional input so that the connections remain visible. Write the five input values as x1,_,x5. A first layer with a two-entry kernel, unit stride, and no padding produces four outputs:

Illustrations are not included in the reading sample

Here a is an elementwise activation. Thus hx reads (xx,x2), while h2 reads (x2 ,x3 ). The two outputs share an input position, but they are different computed values.

For a concrete calculation, choose

Illustrations are not included in the reading sample

Then F1 = ReLU(2 • 1 - 2 + 0.5) = 0.5 and F2 = ReLU(2 • 2 - 0 + 0.5) = 4.5. Continuing in the same way gives (F1,F2,F3,F4) = (0.5,4.5,0, 5.5). The kernel has moved; its learned values have stayed the same. These are illustrative inputs and weights, rather than fitted measurements.

A second two-entry layer can be written as

Illustrations are not included in the reading sample

The output 9i directly reads only F1 and F2. Following those connections back to the original input shows that ^1 can depend on X1,X2,X3. Its local receptive field therefore contains two first-layer positions, while its receptive field with respect to the original input spans three positions. This is a statement about possible influence through the architecture. A zero weight or an inactive ReLU can remove an influence for particular parameter or input values.

What is shared, and what is different? Within the first layer, every position uses the same w0,w1,b; there is no separate kernel for each F,. Within the second layer, every position uses the same L0,L1,C. The second layer has its own parameters: sharing across positions does not require sharing across layers. In Figure 2.19, solid and dashed connections distinguish the two relative kernel positions within each layer. Repeated line styles across the two layers do not mean that r0 = w0 or L1 = w1; biases are omitted from the drawing.

How receptive fields grow in an image network. The same reasoning applies

along both image axes. With unit stride, unit dilation, and no intervening spatial

78

Each unit reads two neighbors. Two layers reach three original inputs.

Within each layer, two weights are shared across positions.

Figure 2.19. Five input positions (top), four first-layer outputs, and three second-layer outputs. Each unit reads two neighbors. The leftmost second-layer output can depend on the three original inputs inside the outline. Within each layer, solid and dashed connections reuse two kernel weights across positions; the two layers have separate parameter sets. Biases are omitted. Original diagram.

resampling, one 3x3 layer has a 3x3 receptive field in the original image. Two such layers have a 5x5 receptive field, and three have a 7x7 receptive field. The second layer combines overlapping first-layer patches: it does not combine nine disjoint 3x3 patches. This overlap explains why the side length grows from three to five.

For a sequential chain of convolution or pooling layers with unit dilation, this counting can be summarized along one axis as

Illustrations are not included in the reading sample

Here tg is the receptive-field span measured in original input positions, Jg is the spacing between neighboring layer-f positions measured on that same input grid, //,• is the kernel side length, and Sg is the stride. A layer adds pg — l gaps, each of length Jg—1. For example, a first layer with Y = 3, SX = 2 gives rx = 3, Ji = 2. A second layer with 92 = 3, S2 = l then gives t2 = 3 + 2 • 2 = 7, J2 = 2.

These recurrences describe the bounding span; some architectures leave unsampled positions inside it. Padding affects where the span lies relative to the image boundary, and boundary units may read padding instead of actual pixels. Pointwise activations do not enlarge the span. The formula assumes a single sequential path; dilation and networks with multiple branches require corresponding extensions. Receptive-field span is also different from output spatial size: two padded 3x3 layers can preserve image height and width while enlarging the receptive field. Finally, the theoretical span does not imply that every included pixel contributes equally to the learned prediction.

Counting parameters rather than output values. A dense layer with m inputs and n outputs has

Illustrations are not included in the reading sample

parameters when each output has a bias. An ordinary two-dimensional convolution with kernel dimensions &^ x &w, Cin input channels, and Cout output channels has

Illustrations are not included in the reading sample

Each output channel has its own k^kwCin kernel weights and one bias. Those parameters are reused at every spatial position, so the count is independent of the number of output positions. The formula assumes an ordinary convolution with all input channels connected to each output channel and one bias per output channel. Grouped, depthwise, or bias-free convolutions need different counts. For one input and one output channel it reduces to k^kw + 1.

Consider a 32 x 32 RGB input and 16 output channels. A 3x3 convolution with unit stride and one padding cell on each side produces a 32 x 32 x 16 output. One filter needs 27 + 1 = 28 parameters, so all 16 filters need 16 • 28 = 448 parameters. The output still contains 32 • 32 • 16 = 16,384 scalar values. Output values are computed responses, not additional learned parameters.

The following comparison holds the input and output shapes fixed. A locally connected layer uses the same local patch geometry but learns separate weights and a bias at each output position; the dense layer connects every output to all 32 • 32 • 3 = 3,072 inputs.

Layer Parameter calculation Total

Shared convolution 16(27+1) 448

Locally connected, unshared 16,384(27+ 1) 458,752

Fully connected 16,384(3,072 + 1) 50,348,032

The convolution and locally connected counts assume a full kernel parameter set at boundary positions as well. Local connectivity reduces the number of connections per output; sharing further reduces how many of their weights are independently learned. Reusing weights does not eliminate the computation or activation storage needed at each position.

Sharing encodes the assumption that a useful local pattern may occur in several places. This is useful for image features such as edges and textures, while locationspecific filters may be appropriate when absolute position matters. Sharing can reduce parameter storage and overfitting risk, but it does not prevent overfitting or guarantee position-invariant predictions [31]. The next section turns from these architectural choices to methods that constrain learning and stabilize intermediate values.

Wound application. Wang and colleagues used depthwise spatial filters followed by pointwise channel mixing in a MobileNetV2-based foot-ulcer segmenter.[35] This gives shared spatial filtering a concrete wound-region task. Section 5.10 develops the efficiency mechanism, and Chapter 5 connects those features to pixel masks.

2.10 Regularization and normalization

Architecture determines which functions a model can express, while training determines which of those functions it learns. A model may fit the training data well yet perform poorly on new data, a problem called overfitting. Regularization aims to improve generalization by constraining or perturbing learning. Normalization changes the scale and distribution of intermediate values and can aid optimization. The following methods serve different purposes, even when both affect training and generalization [31, 60].

The two examples below are dropout and batch normalization; compare what each changes during training and what is used when making a prediction.

Figure 2.20. A complete network and one sampled dropout mask during training. Crossed nodes are inactive only for the illustrated pass. Original diagram of the mechanism in Srivastava et al. [61].

2.10.1 Dropout

Dropout randomly suppresses selected activations during training [61]. Although introduced here after CNNs, it can also be used in other neural networks and does not depend on dense layers dominating the parameter count. Let q E (0,1] be the probability of retaining an activation. Under the commonly used inverted-dropout convention,

Illustrations are not included in the reading sample

During ordinary inference, dropout is

disabled and h, is used directly. Another convention omits training-time scaling and scales activations or weights at inference; the two conventions must not be mixed.

Dropout discourages excessive dependence on particular combinations of units. A dropped unit is temporarily inactive for that pass, not permanently removed from the model. Dropout does not guarantee faster training or better accuracy in every setting.

The crossed nodes in Figure 2.20 correspond to zero entries of m, in Equa-tion (2.66). Anew training pass can sample a different mask; the complete network is used for ordinary inference with the stated inverted-dropout convention.

Wound application. Anisuzzaman and colleagues included dropout layers in the dense heads added to pretrained wound-image classifiers.[14] Dropout was part of the training architecture rather than a separate wound decision rule. Section 4.3 develops this transfer-learning setting and Section 8.6 connects regularized fitting to a wound experiment.

2.10.2 Batch normalization

Where dropout changes which activations participate in a training pass, batch normalization changes their scale and shift. As preceding layers change during optimization, the inputs to a layer can change as well. Batch normalization was introduced with a motivation based on this “internal covariate shift” [60]. It nor-malizes activations using minibatch statistics and then applies a learned scale and shift. Later work showed that explaining its benefits solely through reduced internal covariate shift is insufficient and studied its effect on optimization geometry [62]. These optimization effects do not imply that the small-gradient difficulties discussed above are universally eliminated.

For one scalar feature in a minibatch B = {xi ,...,xn}, the transformation is

Illustrations are not included in the reading sample

where 7 and fi are learned scale and shift parameters. In the procedure below, e > 0 is a small stabilizing constant that prevents division by zero. Each x^ is the value of the same feature for example /, rather than an entire input image.

Algorithm: Batch normalization during training

The procedure is applied feature-wise; convolutional implementations com-monly compute statistics for each channel over the batch and spatial positions. Ordinary inference uses stored estimates of the training statistics rather than the statistics of a single new example. The choice of training or inference mode therefore changes the computation.

Wound application. Wang and colleagues placed batch-normalization layers in the convolutional blocks of their foot-ulcer segmentation network.[35] The normalization acts on intermediate features within the mask-prediction pipeline. Chapter 5 develops these encoder-decoder representations, while Section 8.6 follows the wider training workflow.

2.11 Deep metric learning

A CNN can produce either a final class prediction or an intermediate feature vector. We now ask how to train that vector so that distances between images are meaningful. This changes the training objective while retaining the network operations and gradient-based optimization introduced above.

In this setting, “metric” refers to a learned distance or similarity. It differs from the performance measures introduced in Section 2.5; those measures are still needed to evaluate the resulting system.

Classification assigns an input to one of a set of categories. Metric learning instead learns a representation ora distance in which relevant similarities are reflected by proximity. A learned embedding can support classification, nearest-neighbor retrieval, verification, and clustering. Deep metric learning uses a neural network to construct that embedding, rather than relying entirely on a fixed, manually designed descriptor [63].

The objective is to bring examples judged similar closer together and separate examples judged dissimilar. What counts as similarity depends on the task: two photographs may depict the same person, two observations may share a diagnosis, or two images may have comparable visual findings. The choice of labels and sampling procedure therefore helps define the geometry learned by the network. FaceNet and subsequent work on triplet losses illustrate this approach in face recognition and person re-identification [64, 65]. Mining, or selecting informative training examples, can improve the usefulness of a batch, but selecting only the most difficult examples is not universally optimal, particularly when labels are noisy [64, 66].

The subsections first connect metric learning to medical-image applications, then develop distances and transformations, pairwise and triplet objectives, and angular-margin classification. This order links the desired neighborhood structure to the loss used to learn it.

2.11.1 Medical-image applications

Medical images often exhibit substantial variation within a class and subtle differences between classes. An embedding can help organize this variation, provided that its training labels and evaluation design match the intended use. Published applications include otitis-media classification from otoscopic images and cervical- precancer classification [67, 68]. These studies establish results for their particular datasets and evaluation protocols; they do not establish universal clinical effectiveness.

In content-based image retrieval, a query image is mapped into an embedding space and compared with images in a reference collection. A useful representation should retrieve images relevant to the chosen clinical or visual question. Pair, triplet, and larger-group objectives provide different ways of encoding relations between training examples. Evaluation should distinguish successful retrieval of similar-looking images from correct diagnosis, and should keep patient records separate across training, tuning, and test partitions [20].

A classifier trained with softmax cross-entropy learns features that help separate its training classes. That objective alone does not explicitly require small distances between every pair of examples from the same class. Metric objectives add such constraints or modify the classifier’s angular decision boundaries; Figure 2.21 il-

Learn

Initial representation Learned representation

Figure 2.21. A learned embedding aims to place examples with the same label near one another while separating different labels. The illustrated arrangement is conceptual, not a projection of a measured medical dataset.

lustrates the intended neighborhood structure. They may be useful when comparing images across patients or retrieving examples from a growing collection. Their benefit must be measured against an appropriate classification baseline; adding a metric loss does not by itself demonstrate improved performance on a new disease or institution.

2.11.2 Distances and learned transformations

To see how a representation changes distance, begin with a transformation whose effect can be written explicitly. An instructive starting point is a linear transformation L G Rrxd of an input vector x G Rd. Euclidean distance after transformation is

Illustrations are not included in the reading sample

The matrix M is positive semidefinite. If it is positive definite, this is a Maha- lanobis distance; ifit is rank deficient, distinct inputs can have zero distance, so the expression defines a pseudometric on the original input space. Deep metric learning generalizes the transformation to a nonlinear embedding z = ffx"). It is not restricted to learning a single Mahalanobis matrix.

Wound application. The SCARWID preprint retrieved labeled wound examples

using Euclidean distances between learned image-caption embeddings.[25] The

resulting neighborhood supported infection classification rather than a physical

86

measurement of the ulcer. Section 7.7 develops this wound-specific relationship between an embedding, a distance and a decision.

2.11.3 Pairwise contrastive loss

Contrastive training presents pairs with a similarity label. Let si3 = 1 for a similar pair and si3 = 0 for a dissimilar pair, and write

Illustrations are not included in the reading sample

An attractive term reduces the distance for similar pairs. A repulsive term penalizes dissimilar pairs that lie within a specified margin a > 0. Once a dissimilar pair is farther apart than the margin, its repulsive penalty is zero.

One unsquared hinge variant is

Illustrations are not included in the reading sample

A widely used squared contrastive formulation is

Illustrations are not included in the reading sample

These objectives have different gradients. The squared formulation in Equation (2.70) follows Hadsell et al.; their dissimilar-pair label is Y = 1 — sij, so the label convention has been reversed here [69]. Earlier paired similarity learning was also developed for face verification [70]. Both images pass through the same embedding function with shared parameters; gradients from the two branches contribute to updating that function.

2.11.4 Triplet loss and example mining

A triplet contains an anchor a, a positive p with the same label, and a negative n with a different label. Instead of prescribing an absolute distance for either pair, triplet training requires the anchor-positive pair to be closer than the anchor-negative pair by a margin. FaceNet uses squared Euclidean distances between normalized embeddings [64].

Illustrations are not included in the reading sample

Figure 2.22. Negative examples relative to an anchor and positive example. Concentric bound-aries represent the squared-distance thresholds dap and dap + a in a conceptual embedding.

Illustrations are not included in the reading sample

It is zero when dan > dap + a. A hard negative has dan < dap; a semi-hard negative satisfies dap < dan < dap + a; an easy negative already satisfies the margin. Equality cases lie on the boundaries of these categories. Sampling only easy triplets yields little or no learning signal.

For an illustrative triplet with dap = 02 dan = 0^3, and a = 02 the loss is 0A. If dan increases to 0^5 while dap remains fixed, the loss becomes zero. These values are squared embedding distances, not physical distances or experimental measurements.

The most difficult triplets are not always the most useful: they can reflect noise, incorrect labels, or unstable early embeddings. Mining strategies balance informativeness with stability, and may operate within a batch or over a larger pool [64-66].

Use Figure 2.22 to locate a negative example relative to the two thresholds in Equation (2.71). The drawing concerns embedding distances: a farther point is not necessarily a clinically more severe wound.

An embedding can be classified with a nearest-neighbor rule, but this is not its only use and a metric loss does not prohibit adding a classifier. Pair and triplet methods require suitable construction of training examples. Degenerate embeddings, insufficient negative diversity, and poorly chosen margins can impede training.

Illustrations are not included in the reading sample

Figure 2.23. Two class-weight directions and an example embedding. The angles between the embedding and class weights determine normalized cosine logits. The diagram illustrates geometry rather than observed feature distributions.

A related family of methods retains a classification objective while imposing an explicit margin in angular or cosine space.

In Figure 2.23, each class-weight direction supplies a reference for the angle of the same embedding. This prepares the angular logits below; it is different from comparing the anchor with two other images in triplet learning.

Wound application. The SCARWID preprint trained its image-text fusion module with triplet loss to organize representations for wound infection retrieval.[25] The learned neighborhood then supplies labeled support cases for classification. Section 7.7 develops this application, including the distinction between fitting embeddings and retrieving examples.

2.11.5 Softmax and angular margins

Pair and triplet losses compare examples directly. Angular-margin methods instead compare each example with learned class-weight directions. Normalization isolates the angle from vector magnitude, allowing a margin to specify how strongly the correct class should be separated from its competitors.

Let ^ = ^(xj G Rd be the embedding of training example i, 9, G {1,..., C*} its label, and W7,bj the parameters for class ). For N examples, ordinary softmax cross-entropy is

Illustrations are not included in the reading sample

Each denominator term uses the weight of its own class ). The denominator therefore compares the target-class score with scores for all classes.

Since IL ' :, = iiWj-klkAcosft,., setting the biases to zero gives

Illustrations are not included in the reading sample

When both features and class weights are normalized, a positive scale s is commonly applied to the cosine logits. A margin modifies the target-class logit during training while leaving the competing logits unchanged. A convenient common notation is

Illustrations are not included in the reading sample

Zmalgin = "N \ log exp (s^)) + E^’ exp(s cos ft,.)a ([2].[74])

SphereFace introduces a multiplicative angular margin [71]. Its central idea is to replace the target angle ft by mft, for an integer m > 1. A bare cos(mft) is not monotone over the full interval [0, T] when m > 1. The original angular-softmax construction therefore uses a piecewise extension,

Illustrations are not included in the reading sample

The original formulation normalizes the class weights and retains the feature norm as the logit scale. The fixed-scale notation in Equation 2.74 is useful for comparing margin geometries, but it does not by itself reproduce every normalization and training detail of SphereFace.

ArcFace introduces an additive angular margin [72]:

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 2.24. Unscaled target functions /(b) for normalized softmax and three margin con-structions; the target logit is sfi(ff). Parameters in the legend are illustrative. The ArcFace curve shows the core cos(b + m) expression over [0, %], including its nonmonotone end beyond v — m; it does not depict a full boundary-handling implementation. The curves do not establish an empirical ranking.

Here m > 0 is measured in radians. With normalized features and weights, the margin has a direct interpretation as an angular separation on a hypersphere. Practical implementations must handle angles near the boundary of the monotonic range consistently with the chosen method.

CosFace instead subtracts an additive cosine margin [73]:

Illustrations are not included in the reading sample

Thus its target logit is s(cos 9 — m): the margin is subtracted from the cosine before the scale is applied. Subtracting a positive margin makes the correct class harder to select during training and encourages stronger separation. The numerical values of m in ArcFace, CosFace, and SphereFace have different meanings and are not interchangeable.

Figure 2.24 compares the target-logit functions used in Equation (2.74). The horizontal variable is the embedding-weight angle. Lowering the target logit makes the training requirement stricter; the curves alone do not rank wound-classification performance. Metric and margin-based approaches should be chosen according to the downstream task, available labels, and evaluation protocol. A successful face-recognition loss is a methodological starting point for medical imaging, not evidence that the same settings will be optimal for wounds or other clinical images.

2.12 Federated learning

The discussion so far has focused on what a model computes and which loss trains it. A separate question is where training data and computation reside. For wound research across several hospitals, a shared learning task may need to be organized without assembling all patient images in one repository. Federated learning addresses this organization of training and can be combined with the architectures and objectives already discussed [30].

Federated learning (FL) enables multiple participants, called clients, to train a model while retaining their raw training data locally. A coordinating server may distribute model parameters, receive updates computed by the clients, and aggregate those updates into a shared model. Federated averaging, introduced by McMahan and colleagues, is an influential example [74]. Keeping data at its source can facilitate collaboration across institutions and devices, but does not by itself provide a mathematical guarantee of privacy.

Healthcare illustrates both the motivation and the difficulty of this approach. Data may be distributed across hospitals that use different equipment, serve different populations, and face restrictions on transferring patient records. Federated studies have explored collaborative prediction without pooling those records, including prediction of clinical outcomes in patients with COVID-19 [30, 75]. Applications also extend to finance, connected devices, and edge computing [76, 77]. Their suitability depends on the data, communication constraints, and threat model: the assumed access and capabilities of a potential attacker.

Federated learning is a form of distributed learning. Federated settings emphasize decentralized data ownership, communication constraints, partial participation, and differences between clients [77]. These differences may be statistical, such as non-identically distributed data that cause local training directions to disagree, or

operational, such as unequal device availability and computational resources. Such data differences can also occur in other forms of distributed learning.

We next develop the averaging objective and client partitions, introduce federated reinforcement learning, and examine information leakage and split learning. This separates the training organization from the privacy and information-flow questions that accompany it.

2.12.1 Federated averaging and its objective

Suppose client k E {1,..., K} holds a dataset

Illustrations are not included in the reading sample

For a prediction function fe and example loss f, define the local empirical risk

Illustrations are not included in the reading sample

A common global objective weights each client by its number of examples:

min F(O),

Illustrations are not included in the reading sample

Alternatively, K-[1] ^k Lk(O) gives every client equal weight. These objectives coincide when the client dataset sizes are equal, but generally answer different questions: equal weight per example versus equal weight per client.

At communication round t, the server selects a set of clients St and sends each the current parameters Ot. A selected client initializes its local model at Ot and performs a prescribed number of optimization steps on Lk, commonly with minibatch stochastic gradient descent. Cross-entropy is one possible choice of f for classification. Local training produces parameters 0*.’local; a finite local computation need not find an exact minimizer of Lk.

Illustrations are not included in the reading sample

1. Solid: distribute model 2. Train locally

3. Dashed: return updates 4. Aggregate and repeat

Illustrations are not included in the reading sample

Figure 2.25. One round of federated averaging: distribute the model, train on local data, return updates, and aggregate. Raw records remain with each client. Their absence from the messages does not establish that the messages reveal no information about them. Original diagram of the procedure in McMahan et al. [74].

The client sends an update

Illustrations are not included in the reading sample

The server then forms

Illustrations are not included in the reading sample

where i/s is a server step size. For i/s = 1, this is the data-size-weighted average of the participating local models. Uniform weights 1/|£t| instead average clients equally.

For example, with two participating clients holding 100 and 300 examples, sample-size weighting assigns weights 1/4 and 3/4. Equal-client weighting as-signs 1/2 to each. This is an arithmetic illustration of the chosen objective, not a recommendation that one weighting rule is always preferable. Client sampling and weighting must be interpreted together when estimating the full objective. Communication rounds continue until a chosen stopping rule or training budget is reached [74].

Follow Figure 2.25 through one round of Equation (2.81): every participating client starts from the broadcast model, computes its local change, and returns that change for aggregation. The arrows transport model information rather than raw wound photographs.

2.12.2 Client data partitions

The averaging procedure above assumes that clients can train compatible versions of the same model. That assumption is natural when they record the same variables for different patients. Other arrangements divide the variables themselves across organizations and require different coordination. The following taxonomy makes this distinction explicit.

One useful classification distinguishes horizontal federated learning, vertical federated learning, and federated transfer learning [76]. Let ,Tk denote a client’s feature schema, £ its label space, and Jk its set of sample identifiers. A shared schema means that the variables have compatible meanings; it does not mean that their observed numerical values are equal.

Horizontal federated learning. Clients have compatible feature and label spaces but different samples. An idealized disjoint partition is

Illustrations are not included in the reading sample

For example, two hospitals may record the same variables for different patients. Each trains on its own subset, and collaboration seeks to use evidence from the combined population. Real datasets can have partial sample overlap, requiring additional care in record linkage and evaluation.

Vertical federated learning. Clients hold complementary features for overlap-ping samples:

Illustrations are not included in the reading sample

One organization may hold test measurements and another a different set of observations for some of the same people. Training must align corresponding samples and combine information across feature partitions. Labels may be available at only

one party; there is no general requirement that every party have a different label space. Appropriate alignment and secure computation are part of the protocol, not consequences of the word “vertical.”

Federated transfer learning. The parties differ in feature spaces and have limited overlap in samples:

Illustrations are not included in the reading sample

Transfer mechanisms seek to use knowledge from a source domain to improve learning in a target domain, often where target labels are scarce. The method must specify how the domains are related and how useful representations can be aligned. Merely having different datasets does not guarantee successful transfer. These categories describe data organization and modeling needs; privacy protection still depends on the protocol.

The two axes in Figure 2.26 distinguish sample identifiers from measured variables. This explains why the horizontal averaging setup cannot simply be reused when different organizations hold different features for the same patient.

2.12.3 Federated reinforcement learning

The preceding examples learn from labeled records. We now consider an advanced extension in which participants learn from sequences of actions and rewards. This section first defines the sequential objective, then explains noisy gradient estimates, and finally examines collaboration and fault tolerance. These ideas provide background for distributed decision-making research; they are not prerequisites for ordinary wound-image classification.

Reinforcement learning (RL) concerns sequential decisions made through in-teraction with an environment. Its applications include games, robotics, resource allocation, and research on clinical decision support. Collecting useful trajectories can be costly, slow, or unsafe, and good simulation performance does not ensure successful deployment. Federated reinforcement learning (FRL) allows several agents to collaborate on a policy without exchanging their raw trajectories [78, 79]. Proposed applications include navigation, personalization, connected- device control, and autonomous-driving research. Each application requires its own assumptions about the agents, their environments, and their available experience.

Markov decision processes and policy gradients

An episodic Markov decision process can be described by

Illustrations are not included in the reading sample

where S is the state space, A the action space, P(sz | s, a) the transition law, r(s, a) the reward, 76 (0,1) the discount factor, and p the initial-state distribution. For the bounded-reward setting considered here, assume 0 < r(s, a) < Rmax. A policy Tg(a | s) gives the probability of action a in state s. A trajectory of horizon H is

Illustrations are not included in the reading sample

with discounted return

Illustrations are not included in the reading sample

The terminal state is included to write the trajectory probability conveniently; no additional reward is assigned to it in this definition [36].

The state summarizes the information needed to predict the next transition under the Markov assumption. The discount factor reduces the contribution of more distant rewards, and the expectation below averages returns over the trajectories sampled under the policy.

Let pgÇr) be the trajectory distribution induced by p, P, and ~(l. The objective is to maximize expected return,

Illustrations are not included in the reading sample

Assuming the environment and reward do not depend on 9, and differentiation can be interchanged with integration,

For discrete trajectories, the integral denotes the corresponding sum. The score of the trajectory is

Illustrations are not included in the reading sample

Policy-gradient methods directly optimize a parameterized policy and can accommodate stochastic actions. Value-based methods use estimates of future return to help select actions. Their relative merits depend on the decision problem; highdimensional inputs alone do not establish that either family is superior.

For independent trajectories rl,^,rB sampled from the current policy, an estimator takes the form

Illustrations are not included in the reading sample

The plus sign performs gradient ascent on return. A basic REINFORCE estimator is g(r | 9) = R(ryVe logpe(r); its expectation equals the policy gradient under

the preceding conditions [80]. Reward-to-go and suitable baselines can reduce variance. GPOMDP provides another policy-gradient estimation approach, with its own assumptions and estimator properties [81]. Unbiasedness is a statement about the expectation over sampled trajectories, not about each trajectory’s estimate being equal to the true gradient.

Variance reduction

A policy-gradient update is computed from finitely many sampled trajectories, so its direction varies from batch to batch. Averaging more trajectories can reduce this sampling noise but requires more data collection. Variance reduction instead uses a reference estimate to cancel part of the noise. We first illustrate the idea for a fixed dataset before returning to the policy-dependent trajectory distribution.

For comparison, finite-sum optimization considers

A full gradient evaluates all B component gradients, whereas stochastic gradient descent can use a sampled component. Their convergence rates depend on the objective’s assumptions. Linear convergence, meaning a geometric decrease in optimization error, requires conditions such as strong convexity and smoothness; smooth convexity alone is insufficient. Stochastic methods have cheaper iterations but suffer from gradient noise. Variance-reduced methods use a reference estimate to construct a better-controlled update [82].

For example, with snapshot 9 and full gradient p = VF(0), the SVRG estimate

is

For a uniformly sampled component, Eju] = VF(0). Stochastically controlled stochastic gradient methods replace expensive full-gradient computations with appropriately chosen batch estimates [83]. Applying this idea to policies requires further care because changing a policy also changes the trajectory distribution.

Stochastic variance-reduced policy gradient (SVRPG) addresses this distribution change using importance weighting [84, 85]. For an e-stationarity criterion

Illustrations are not included in the reading sample

Xu et al. establish a trajectory complexity of order O(e—[5]/[3]) under their assumptions, improving on the O(e—[2]) comparison in that analysis [85]. This criterion concerns a small gradient, not guaranteed convergence to a globally optimal policy.

To separate collaboration from variance reduction, first consider ordinary federated averaging of policy gradients. The following procedure provides that starting point; the additional correction is introduced immediately afterward.

Algorithm: Federated policy-gradient averaging

Choose T rounds, K agents, batch size B, step size p, and initial parameters 6Q . For each round t = 1,..., T:

1. Set 9t = dt—i and broadcast it to all agents.
2. Each agent k samples B trajectories from pgt and returns

Illustrations are not included in the reading sample

3. Aggregate pt = K—[1] ^K=i p^ and update

Illustrations are not included in the reading sample

A theoretical output rule can select one of the iterates uniformly at random; practical evaluation must specify its own model-selection rule.

This basic procedure averages gradients. It does not yet include a variance-reduction correction or a filter for faulty client messages, which is the subject of the next subsection. It is therefore a starting point rather than the full variance-reduced or fault-tolerant method. In a variance-reduced inner loop, the additional estimate has the form

Illustrations are not included in the reading sample

where rg ~ pGn and p estimates the gradient at the snapshot 0. The ratio requires compatible probability support.

Intuitively, the correction subtracts a snapshot-policy estimate evaluated on the current samples and then adds the snapshot gradient estimate p. Importance weights account for the fact that those samples were drawn under the current policy rather than the snapshot policy. The algorithm must also specify how it chooses the snapshot, batch sizes, inner-loop length, and any robust aggregation rule [86]. Equation 2.93 shows the additional mechanism that distinguishes this inner loop from ordinary policy-gradient averaging.

Fault tolerance and convergence limits

The preceding estimators assume that participants follow the stated sampling and update rules. Collaboration introduces another source of error when a participant sends an incorrect or deliberately manipulated update. Fault-tolerant methods modify aggregation to address a specified model of such behavior.

A Byzantine participant can send arbitrary messages, whether because of a failure or deliberate manipulation. This is a strong fault model used in distributed computing [87]. A robust aggregation rule seeks to limit the damage caused by a specified fraction of such participants. A guarantee is conditional on its model of honest agents, the adversarial fraction, and other assumptions; the label “Byzantine resilient” does not guarantee correct learning under every system behavior.

Fan et al. analyze federated policy gradient with Byzantine resilience (FedPG-BR), combining variance reduction with gradient filtering [86]. In their homogeneous-agent setting, with the derivative, gradient-deviation, and importance-weight conditions in their analysis, the reported per-agent trajectory complexity for Equation 2.92 is

Here K is the number of agents and a the Byzantine fraction. This statement follows their Theorem 6 and Corollary 7, including their required parameter choices. When a = 0, the first term decreases with K; when K = 1 and a = 0, it recovers the

Illustrations are not included in the reading sample

Policy parameters flow down; gradient estimates flow up.

Illustrations are not included in the reading sample

Figure 2.27. Agents interact with local environments and transmit policy-gradient estimates to a server. A potentially faulty participant can send an arbitrary vector. The server cannot infer honest behavior merely from the identity of the sender. Original schematic of the setting studied by Fan et al. [86].

stated single-agent order. Vanishing adversarial fraction removes the adversarial term in the bound; it does not imply that filtering has no computational cost. The theorem does not establish clinical benefit or a guarantee for arbitrary heterogeneous hospitals. Later work also develops decentralized fault-tolerant federated policy gradients [88]. Convergence guarantees must therefore be read for the particular method, data assumptions, and fault model being analyzed.

Figure 2.27 replaces labeled-image fitting with local trajectories and policy-gradient estimates. The faulty-message path motivates the filtering assumptions discussed above; ordinary averaging of those arrows does not establish the bound in Equation (2.94).

2.12.4 Information leakage and split learning

Fault tolerance asks whether unreliable messages can corrupt the learned model. Privacy asks what a recipient can infer from the messages it observes. A method can address one question without resolving the other, so both must be assessed for a distributed training design.

Keeping records local still leaves a communication channel. A hospital may retain every original wound photograph while transmitting a gradient computed from those photographs. The recipient sees the gradient rather than the image file, but the gradient is a function of the image, target, model, and loss. It can therefore carry information about the training example. Published gradient-reconstruction attacks demonstrate this possibility under specified settings [89]. Reconstruction asks whether an attacker can recover an input; membership inference asks whether a particular record participated in training. Neither should be confused with poisoning or backdoor attacks, which aim to change what the model learns [77, 90, 91].

Before assessing a design, identify the observer and its access. Does a server see an individual client’s gradient, an average over many clients, model changes after several local updates, or intermediate activations? Does it know the architecture and current parameters? Can it only inspect messages, or can it alter the model sent to a client? These choices define different inference problems. The following calculation deliberately starts with the simplest observable gradient.

A worked example of input recovery. Let x E Rd be one input, w E Rd the weights, b a scalar bias, and a the sigmoid from Equation (2.44). For the single-example data loss, let

Illustrations are not included in the reading sample

For one example, differentiation gives

Illustrations are not included in the reading sample

Both derivatives contain the same scalar factor, c = 2(hd(x) — y)a'(wTx + 6). Hence dj/dwk = cxk and dj/db = c. If an observer receives these matching, unmodified derivatives and the bias derivative is nonzero, division cancels the For example, choose x = (2,—1)T, w = (0,0)T, b = 0, and y = 1. Then h#(x) = 0.5, CTZ(0) = 0.25, and c = —0.25. The transmitted weight gradient is (—0.5, 0.25)T and the bias gradient is —0.25. Their coordinate-wise ratios are (—0.5)/(—0.25) = 2 and 0.25/(—0.25) = —1, recovering the input. These chosen values illustrate an algebraic mechanism; they are not an experiment on patient images.

The result depends on what was observed. If the bias derivative is zero, the ratio is undefined. For a mean over B examples, the same ratio becomes

Illustrations are not included in the reading sample

which generally does not identify an individual xik. The coefficients c^ need not be positive, so this expression need not be a convex average. Batching therefore changes this direct recovery argument; it does not prove that all reconstruction attacks fail. Additional penalty gradients, compression, noise, and updates pro-duced by several optimizer steps also change the calculation. Recovering a deeper network’s input may instead require an attack-specific optimization procedure [89].

What changes in split learning? Federated averaging usually lets a client train a complete local model and then communicate a model update. In split learning, the computation for a training example is divided between a client and a server. The cut layer is the boundary between their network segments. Write

Illustrations are not included in the reading sample

where 9C contains the client parameters, 9S the server parameters, and z the activation transmitted at the cut. It may be a vector or a feature tensor; it is not necessarily a class prediction.

In a basic configuration where the server computes the loss, one training step proceeds as follows:

1. The client keeps x locally, evaluates f$c, and sends z to the server.
2. The server evaluates gdg and the loss. This configuration requires the server to have the target y, or a protocol that gives it the information needed to compute the loss.
3. The server computes its parameter gradient and the cut-activation gradient Sz = VzZdata. It sends Sz back to the client.
4. The client continues backpropagation through its own segment:

Illustrations are not included in the reading sample

Here the Jacobian differentiates the cut activation with respect to the client parameters. Each party then uses its computed gradient to update its own parameters.

The exchanged derivative has the same shape as z. The server does not need the original image to perform its segment’s forward and backward computations, and the client does not need the server’s full parameter gradient to continue its backward pass. Other configurations return later computation to the client or place labels differently; the actual messages and access must be specified for the chosen protocol [92].

Why an intermediate representation is not automatically private. Moving the cut changes which representation leaves the client. It does not establish that this representation conceals the input. As a simple counterexample, suppose a client sends

Illustrations are not included in the reading sample

Then z = (8,3)T. An observer who knows A recovers x2 = z2 = 3 and x1 = z1 _ 2z2 = 2. This deliberately invertible example shows why replacing raw values with activations is insufficient as a privacy argument. It does not imply that every nonlinear cut representation is exactly invertible, or that a server always knows the client’s parameters. A deeper or smaller representation also needs its own assessment rather than an assumption of safety.

Matching a protection to the observer. Encryption in transit protects messages against an observer of the communication link; the intended recipient normally still obtains their contents. Secure aggregation can hide individual client updates from a server while revealing an aggregate, under the protocol’s participation and collusion assumptions. Differential privacy instead bounds how much a specified observable output distribution can change when one protected record or client changes. Its protection depends on the adjacency definition, mechanism, privacy parameters, and composition over repeated releases [77]. None of these descriptions makes the protections interchangeable.

For a wound-learning study, the design should therefore state who sees images, labels, activations, gradients, and aggregates; what the proposed attacker knows; and which protection or attack evaluation supports the privacy claim. The worked ratio explains a possible leakage mechanism, while the split-learning workflow identifies a different set of messages to assess. Together they show why a claim about keeping image files at a hospital must be accompanied by an account of what the training communications reveal.

2.13 Chapter review

The chapter has introduced several choices that can coexist in one wound-analysis system: the learning setting, model representation, training objective, evaluation procedure, and organization of training data. The comparison below brings these choices together. Practice questions and worked answers then revisit their mathematical and practical consequences, before the summary connects them to the methods used later in the book.

2.13.1 Learning methods compared

Table 2.2 separates supervision, representation, and training organization. Its first two groups summarize the learning and network principles developed in this chapter; a metric-learning embedding may feed a supervised classifier.[31, 64] The final group concerns the placement and exchange of computation: federated or split learning can train a supervised CNN, rather than replacing either supervision or convolution.[77, 92] Reinforcement learning instead requires actions, rewards, and sequential consequences; a collection of independently labeled wound photographs does not by itself define that problem.

Read the comparison columns using Section 2.5: per-class recall describes missed cases; macro F1 and balanced accuracy summarize different functions of the confusion counts. Ranking measures use continuous scores, whereas probabilityquality assessment requires probabilities. Calibration concerns agreement between stated probabilities and observed frequencies; it cannot be inferred from hard-label accuracy. The Brier score evaluates probability error and is not a pure calibration measure. These distinctions apply to all later architecture comparisons.[21]

Table 2.2. Selected learning choices occupy different design levels and can be combined. Potential wound uses do not constitute measured comparative results.

Illustrations are not included in the reading sample

The input configuration and any reasoning procedure provide further design choices. Section 2.6.6 introduced how multimodal inputs and intermediate checks can accompany the approaches in this table; they do not specify a new supervision category or training location.

Illustrative research choice. Consider three clinics with labeled wound pho-tographs and additional unlabeled images. The team first defines one classification target and reserves independent patients for testing. It can compare supervised

CNN training with a declared use of the extra images, then separately compare centralized and federated training if pooling is permitted. Changing supervision and training location in the same experiment would obscure their contributions. The same classification metrics apply across these choices; communication and privacy questions require additional measurements and assumptions.

2.13.2 Practice questions

The following questions check dimensions, optimization, evaluation, and the origin and interpretation of model outputs. Numerical examples are synthetic teaching calculations.

1. Let x = (1, —2)T, let the rows of W be (1,0) and (2, —1), and let b = (0,1)T. Find the shape and value of z = Wx + b.
2. For one binary example, a sigmoid gives p = 0.8 and the target is y = 1. With binary cross-entropy and logit z = wx + b, find dL/dz and dL/dw when x = 2. What is the change in w under gradient descent with learning rate 0.1?
3. At a fixed threshold, a binary classifier has TF = 18, F.V = 2, FF = 6 and 7+ = 14. Compute accuracy, precision, recall and F1. Separately, compute the binary Brier score for two predictions (0.8,0.3) with targets (1,0).
4. A 32 x 32 RGB image passes through a 3x3 convolution with 16 output channels, unit stride, unit dilation, one padding cell on each side, and one bias per output channel. Find its output shape and parameter count. If a second 3x3 layer also has unit stride and unit dilation, what is the theoretical receptive-field span of an interior second-layer unit in the original image?
5. An observer receives the unmodified single-example data-loss gradients Vwj = (—0.5,0.25)T and dj/db = —0.25 for the sigmoid model in Section 2.12.4. What input does the ratio recover? State why the same operation generally does not recover one record from a batch. In the basic split-learning workflow, which two kinds of tensors cross the cut during a forward and backward pass?
6. A system produces a caption from a wound photograph and returns a class with an explanation. (a) Does the caption constitute a new patient measurement? (b)

If the predicted class agrees with the reference, does that establish that every statement in the explanation is correct? Explain both answers.

2.13.3 Worked answers

1. W is 2x2 and x, b, z are 2 x 1 column vectors. Direct multiplication gives

Illustrations are not included in the reading sample

2. With natural logarithms, the binary cross-entropy is L = — [p log p + (1 — p) log(1—p)] and p = £z). Differentiating and applying the sigmoid derivative yields 9L/9z = p — p = —0.2. Since dz/dw = x = 2, the weight gradient is (p — p)x = —0.4. Gradient descent subtracts this gradient, so the change is △w = —0.1(—0.4) = +0.04. This determines the change in w, not its final value, because an initial w was not supplied.

3. There are 18 + 2 + 6 + 14 = 40 examples, of which 18 + 14 = 32 are correct. Thus accuracy is 32/40 = 0.8, precision is FF/(FF + FF) = 18/24 = 0.75, and recall is FF/(FF + FN) = 18/20 = 0.9. The count form gives

Illustrations are not included in the reading sample

For the separate probability example, the squared errors are (0.8 — 1)[2] — 0.04 and (0.3 — 0)[2] — 0.09. Theirmeanis (0.04 + 0.09)/2 — 0.065 under the binary Brier convention. These two probabilities are a separate teaching dataset; the threshold counts alone cannot determine a Brier score.

4. The spatial side length is (32 + 2 — 3)/1 + 1 = 32, so the output shape is 32 x 32 x 16. Each filter has 3 • 3 • 3 = 27 weights and one bias; the layer has 16(27 + 1) = 448 parameters. With unit stride, the second layer adds two original-input positions along each axis to the first layer’s span: r2 = 3 + (3 — 1) • 1 = 5. Its theoretical receptive field is therefore 5x5, independently of the number of output channels.
5. Dividing each weight-gradient coordinate by the nonzero bias gradient gives x = (2, —1)T. For a batch, Equation (2.99) instead gives a ratio of sums; it generally mixes information from several inputs. In basic split learning, the forward message contains the cut activations z, and the return message contains their loss gradient Sz, of the same shape. Labels or other messages depend on the specified configuration. Neither batching nor transmitting activations alone establishes privacy.
6. No to both questions. The model produces the caption from an existing pho-tograph; it does not independently measure another property of that patient. Pretrained knowledge may help interpret the image but cannot verify an un-recorded symptom. Agreement on the final class establishes agreement with that reference label for the case. It does not verify the explanation’s individual claims, which require their own evidence checks.

2.13.4 Chapter summary

This chapter connected five design questions: what feedback is available, how performance is evaluated, what a model computes, how it is trained, and where that computation takes place. Supervised, semi-supervised, self-taught, and self-supervised approaches use labels and unlabeled data in different ways. Reinforcement learning addresses actions and their consequences over time; an image-label dataset alone does not define that sequential problem. Table 2.2 separates these learning choices from network representations and training organization so that compatible choices can be combined.

Evaluation begins with the target, reference standard, and prediction unit. Confusion counts describe specified category errors; class imbalance and prevalence affect how their summaries should be interpreted. Ranking, probability quality, and spatial overlap answer further questions. In particular, normalization by soft- max does not establish calibration, a Brier score is not a pure calibration measure, and mask Dice is not image-classification accuracy. Section 2.5 develops these distinctions together with patient separation, uncertainty, and fair comparison. A training loss and a test metric may share a formula while serving different roles on different data.

Neural networks form predictions by composing affine transformations and activations. Width, depth, and parameter choices together determine the functions represented; the illustrative curves are not fitted clinical results. Backpropagation applies the chain rule to calculate gradients, and an optimizer uses those gradients to update parameters. Dropout and batch normalization change training computations in different ways and require the corresponding inference conventions.

Section 2.6.6 extended the input representation to multiple forms of information and introduced the separate question of intermediate reasoning or explanation checks. Concatenating feature vectors does not establish a benefit from the additional inputs, and correct classification does not establish that an accompanying explanation is supported. Chapter 7 develops the architectures, training methods, and evaluations needed to examine these choices.

For CNNs, Section 2.9.6 distinguished the input region that can influence a unit from the number of output positions and the number of learned parameters. Local connections restrict each direct input patch, depth can enlarge the receptive field in the original image, and sharing reuses a filter across positions. These properties support image modeling without guaranteeing generalization or position invariance. Metric learning, developed in Section 2.11, instead specifies how embeddings should reflect chosen similarities; retrieval and downstream classification still need their own evaluation.

Federated learning distributes model training across clients, while split learning divides a network’s computation at a cut layer. Neither arrangement establishes privacy solely by keeping original records local. Section 2.12.4 showed how an observed single-example gradient can reveal an input and identified the activations and derivatives exchanged during split learning. Reconstruction arguments and protective mechanisms depend on the observer’s access and stated assumptions. Likewise, the policy-gradient convergence rates discussed here are conditional theoretical results, rather than guarantees for arbitrary hospitals or clinical decisions.

For wound research, the practical task is to combine these choices into a pipeline with meaningful labels, declared data access, independent patients for testing, and task-appropriate measures. Chapter 3 next examines explicit features, classical classifiers, and clustering under the same evaluation principles. It provides the complementary question: how much can be achieved with a specified feature representation before introducing a more elaborate learned one?

Chapter 3

Classical Machine Learning for Wound Image Analysis

3.1 Representations and classical models

Chapter 2 described how neural networks learn representations from data. This chapter asks a complementary question: what can we infer when an image is represented by a chosen set of measurements, and the prediction rule is fitted separately? A color histogram, a texture descriptor, or a vector of learned features can all be supplied to a classical classifier. Thus, the distinction concerns how the representation and prediction rule are constructed; it does not require classical methods and neural networks to be used in isolation.

A wound photograph contains several possible prediction units. A model may assign one label to the entire image, classify a region already identified as wound tissue, or assign labels to pixels or superpixels. A superpixel is a small group of nearby pixels with similar appearance. These tasks require different annotations and different evaluation procedures. Before selecting an algorithm, specify the unit of analysis, the target label, and the intended use of the output. In particular, a visually coherent region is not automatically a clinically meaningful tissue category.

The feature-based pipeline makes these choices explicit: prepare the images, construct measurements, select or transform the features, fit a model, and evaluate the complete procedure on held-out data. The following sections develop the

Illustrations are not included in the reading sample

Figure 3.1. From a real clinical photograph to a defined feature vector. The photograph of right-leg venous ulcers is reproduced from Figure 1 of the source article by Talat et al. (2025); CC BY 4.0.[93] The original photograph is retained. New boxes describe processing choices; no patient features or descriptor values are computed here. Measurements and scaling require a declared analysis.

components before examining wound studies. Classical methods provide useful comparison models because their inputs and decision rules can often be examined directly. Whether they are competitive for a particular task remains an empirical question under a common evaluation protocol.

Notation for this chapter. Table 3.1 distinguishes the symbols used for support vector machines (SVMs), other classifiers, and clustering. The local definitions explain changes of role between methods.

Table 3.1. Notation guide for Chapter 3.

Symbol Meaning Dimensions or scope

Illustrations are not included in the reading sample

3.2 Image preparation and feature selection

Before a classifier can use a wound photograph, the analysis must specify how that photograph becomes a set of inputs. We first distinguish image preprocessing, feature extraction, and feature selection. We then examine ways to select features and explain which preparation steps must be fitted within training data. This order establishes the representation and its evaluation boundaries before a decision rule is chosen.

3.2.1 Preprocessing, extraction, and selection

Preprocessing changes the image or its representation before measurements are constructed. Examples include checking image orientation, selecting a region of interest, suppressing acquisition noise, and applying a documented color correction. Feature extraction converts the resulting image or region into numerical descriptors. Feature selection retains a subset of those descriptors. Combining these operations under one heading obscures which information is modified and which quantities are learned from data.

For a region R, simple color features include channel means and dispersions. Texture features describe spatial variation: examples include statistics derived from a gray-level co-occurrence matrix, which counts pairs of intensities at a specified displacement. Shape measurements require a region boundary and therefore inherit its uncertainty. Feature definitions should state the color space, spatial scale, image resolution, and any normalization. A texture descriptor measured at a fixed pixel distance need not represent the same physical scale in photographs taken at different distances.

Once the descriptors have been computed, each observation is represented by a vector x{ E Rd. The index i might refer to an image, region, superpixel, or pixel; these units must not be mixed silently. Multiple regions from one photograph and repeated photographs of one patient are related observations. Increasing their number does not create the same amount of independent information as recruiting additional patients.

Wound application. Odame and colleagues applied CLAHE to wound pho-tographs and extracted VGG19 features for subsequent classifiers.[94] The image enhancement and representation stages therefore precede the final category decision. Section 4.3 develops pretrained feature extraction, while Section 3.7 examines complete wound-analysis pipelines.

3.2.2 Filter, wrapper, and embedded selection

Feature selection can reduce redundancy and simplify the fitted model, but selecting a smaller set does not guarantee better predictions. The standard distinction is between filters, wrappers, and embedded methods. Filters rank or screen features using a criterion outside the final predictor; wrappers evaluate subsets through a fitted predictor; embedded methods select features as part of model fitting. These are different ways of linking selection to the learning procedure. [95]

A filter might remove nearly constant features or rank features by association with the target. A univariate score assesses each feature separately and can miss useful interactions. Highly correlated features may receive similar scores while contributing little additional information together. A wrapper instead evaluates candidate subsets using an internal validation procedure. Recursive feature elimination, for example, repeatedly removes low-ranked features and refits a model. Its ranking depends on the fitted model and its settings. Embedded selection includes sparsity penalties that can set coefficients to zero; ordinary ridge regularization shrinks coefficients but does not generally remove them exactly.

Tree-based importance scores require similar care. A score obtained from a fitted forest can help inspect or rank features, but the score itself does not establish that the feature causes the outcome. Permutation importance on held-out data measures how performance changes after that feature is disrupted under a stated procedure. Correlated predictors can share or mask their contributions. [96] If an importance ranking is used to choose features, that choice becomes part of model development and must be evaluated accordingly.

Wound application. Veredas and colleagues used recursive feature elimination in wound-tissue classification, while Jiang and colleagues combined Boruta and LASSO for clinical-record infection prediction.[37, 46] These applications con-cern different input types. Section 3.7 develops their distinction between image descriptors and clinical variables.

3.2.3 Leakage prevention

The split into training, tuning, and test data should precede any operation that learns from the dataset. Fit scaling, imputation, and feature selection using each training fold. Apply these fitted feature transformations to its validation fold without refitting. Apply resampling only to the training fold; retain the original validation and test distributions. Choosing the best subset using all labels before cross-validation leaks information into the evaluation. Official resampling guidance likewise warns against resampling the complete dataset before splitting. [97]

For medical images, data partitions should be disjoint at the patient level when the intended use is prediction for new patients. Repeated visits, multiple views, and image patches from the same patient should remain in the same partition. Report how training, tuning, and testing were separated and whether external testing was performed, as recommended by the CLAIM reporting guidance. [20]

Consider a synthetic example with 100 patients and five images per patient. A random split of the 500 images could place photographs of the same wound in both training and test sets. A patient-level split instead assigns each patient, with all five images, to one partition. The example illustrates a design choice; it makes no claim about the size of the resulting performance difference.

3.3 Classification tasks and class imbalance

The feature representation is now defined; we next specify the prediction task. The subsections distinguish label structures, explain how class imbalance affects fitting and evaluation, and introduce resampling and alternatives before the classifier comparison.

3.3.1 Label definitions

In binary classification, the target set contains two alternatives, such as wound versus background. In multiclass classification, one of C > 2 mutually exclusive labels is assigned to each observation. A healthy or background class may be included if the task calls for it. In multilabel classification, the target is a vector in {0,1}C, allowing several labels to apply simultaneously; the task definition determines whether an all-zero vector is permitted. These distinctions concern the annotation scheme, not the number of visible colors in an image.

Write a labeled training set as

Illustrations are not included in the reading sample

A learning algorithm maps datasets to prediction functions,

Illustrations are not included in the reading sample

Here E' denotes the set of functions from inputs to labels. This separates the training procedure from the fitted predictor. A probabilistic model first estimates class probabilities and then applies a decision rule, often choosing the largest probability. The decision threshold and the consequences of errors may require attention beyond that default rule.

Figure 3.2 makes the prediction unit visible: the image-level output contributes one classification decision, whereas the spatial output contains many pixel decisions. A metric must count errors at the unit selected by the study.

Illustrations are not included in the reading sample

Figure 3.2. Two possible output structures beside a distinct clinical photograph. Prakash et al. (2016), Figure 3A, case 2, left-knee ulcer before grafting; CC BY 3.0.[12] Native panel pixels are retained. The new diagram contains neither a predicted class nor a reference mask. Segmentation can be supervised and need not use clustering.

3.3.2 Effects of class imbalance

An imbalanced dataset contains substantially different numbers of observations across classes. This can occur in binary, multiclass, or multilabel problems. In a wound study, the imbalance might concern wound-type labels, a separately defined infection endpoint, or wound pixels relative to background pixels. These are different prediction tasks, so the class counts must refer to the chosen unit of analysis. A predictor can achieve high overall accuracy by favoring common classes while missing a minority class that matters to the intended assessment. The frequency of a class does not establish the importance of its errors. Metric selection should therefore reflect both the task and the class distribution.[21]

Why fitting can favor common classes. Under an average per-example training loss, every observation contributes a term. A class with many observations therefore contributes more terms before any class weighting is applied; their actual influence also depends on the individual losses and model.[31] For a wound dataset, count independent patients as well as images: repeatedly photographing a few minorityclass wounds does not supply the same patient variation as recruiting additional cases. Class imbalance alone does not determine whether a classifier will fail; feature overlap and label quality also affect the problem.

The confusion-count definitions in Section 2.5.4 apply unchanged to classical predictors. For reference, the measures used below are

Illustrations are not included in the reading sample

Sensitivity, also called recall, asks what fraction of reference-positive cases are detected; specificity asks what fraction of reference-negative cases are correctly rejected. Precision instead asks what fraction of positive predictions match the reference. These denominators differ. State how undefined values are handled rather than silently treating them as successful predictions.

A synthetic wound-classification example. Suppose a test set contains 200 wound photographs, one from each of 200 patients, with 20 reference-positive infection labels and 180 reference-negative labels. These counts are chosen for arithmetic, not to estimate infection prevalence. A rule that predicts the negative class for every image has TP = 0, FN = 20, FP = 0, and TN =180. Its accuracy is 180/200 = 90%, yet its sensitivity is zero: it misses all 20 positive cases. Its specificity is 180/180 = 1, and its binary balanced accuracy, the mean of sensitivity and specificity, is (0 + 1)/2 = 0.5. Precision is undefined because it makes no positive predictions; the count-based F1 formula gives zero.

For comparison, another hypothetical rule detects 12 of the 20 positives but incorrectly flags 18 negatives. It has TP = 12, FN = 8, FP = 18, and TN = 162. Accuracy falls to 174/200 = 87%, while sensitivity rises to 12/20 = 60%. Specificity is 162/180 = 90%, precision is 12/30 = 40%, and balanced accuracy is (0.6 + 0.9)/2 = 0.75. The lower accuracy accompanies fewer missed positive cases and more false alarms. Choosing between such tradeoffs requires a declared assessment objective; neither rule is a clinical recommendation.

What to report and what to change. For multiclass wound-type results, a macro-

average gives each class equal weight, whereas a support-weighted average gives

more weight to classes with more test examples. Report class-specific errors and

their counts alongside either average. With continuous binary scores, precision-recall analysis helps examine positive predictions across thresholds, particularly when positives are uncommon. Precision and its curve depend on the class dis-tribution, so scores from differently sampled test sets need that context.[41] For segmentation, specify per-image versus pooled-pixel aggregation; large background regions must not obscure errors in small wound regions.[21]

Addressing imbalance during fitting and measuring performance are separate steps. Keep any resampling within the training portion of each development fold, and preserve the test set’s intended evaluation distribution.[97] The next subsection explains resampling, loss weighting, and threshold choices; each should be assessed on the same held-out patients with the relevant class-specific measures.

3.3.3 Resampling and alternatives

Random oversampling repeats minority observations; random undersampling discards selected majority observations. Neither operation creates new independent patients. In a synthetic binary dataset with 20,000 minority and 80,000 majority observations, balancing by duplication adds 60,000 minority copies, producing 160,000 training observations. Balancing by undersampling instead retains 20,000 from each class, producing 40,000 observations. Duplication changes the frequency with which an example contributes to training; deletion can remove useful variation.

The synthetic minority over-sampling technique (SMOTE) constructs synthetic feature vectors between a minority observation and selected minority neighbors. For a neighbor Xj of xt, an interpolated example has the form

Illustrations are not included in the reading sample

This operation acts in the specified feature space. It does not create a verified clinical case or guarantee that interpolation remains within the true minority distribution. The original SMOTE study introduced this feature-space approach in conjunction with evaluation of imbalanced classification. [98]

Several undersampling methods use the geometry of the labeled training data. The definitions below follow the official imbalanced-learn documentation; implementations and parameter settings should be reported. [97]

NearMiss-1. Retain majority observations with the smallest average distance to a chosen number of their nearest minority neighbors.

NearMiss-2. Retain majority observations with the smallest average distance to a chosen number of their farthest minority neighbors.

NearMiss-3. First form a candidate set of majority neighbors around each minority observation; then select candidates with the largest average distance to their nearest minority neighbors. The two neighborhood sizes have different roles.

Tomek links. Identify opposite-class observations that are each other’s nearest neighbor. A removal policy may delete the majority member or both members. State the chosen policy; the pair definition alone does not specify it.

Cluster centroids. Cluster the majority class and replace it by a smaller set of representatives. Soft voting uses the centroids themselves; hard voting uses observed examples nearest those centroids. The method does not simply remove points farthest from a single center.

Figures 3.3 and 3.4 separate changing observation frequency, selecting exist-ing observations, and constructing representatives. Track the retained points in each panel against its selection rule; none of these operations supplies additional independent patients.

Resampling is one option. Class-dependent loss weights can increase the training penalty for selected errors without changing the observed cases. Threshold selection can alter the sensitivity-specificity tradeoff after a model is fitted. These choices should be selected on the tuning subset or within the model-selection folds, according to the intended task. Keep the test set at its intended evaluation distribution: balancing a test set changes what its aggregate metrics mean. A resampled training distribution can also affect probability calibration, which should be assessed on data representative of the intended use.

Illustrations are not included in the reading sample

Figure 3.3. Synthetic resampling examples. Rings indicate a repeated minority observation without creating a new location. An undersampled set retains fewer majority observations. The marked opposite-class pair is a mutual nearest-neighbor pair; this panel illustrates deleting its majority member. Crosses in the prototype panel are majority-cluster means and need not coincide with original observations.

These preparation and sampling choices define what information reaches the classifier and how often it contributes during fitting. With those choices stated, the next section examines how different prediction rules use the prepared feature vectors and labels.

3.4 Classical classifiers

The preceding sections established how wound images become feature vectors, how patient data are separated, and why class frequencies matter. We now examine how a classifier uses those vectors and training labels to assign a class to a new observation. The methods share this task but construct different decision rules. We

Illustrations are not included in the reading sample

Figure 3.4. Synthetic NearMiss selections from the same observations. Each panel retains three majority points. NearMiss-1 and NearMiss-2 average distances to two nearest or two farthest minority neighbors, respectively. NearMiss-3 first takes two majority neighbors per minority point and then ranks those candidates by their average distance to two nearest minority neighbors. These parameter choices are illustrative.

begin with support vector machines and their separating margins, then consider nearest-neighbor voting, decision trees, ensembles of trees, and naive Bayes. For wound analysis, each can be tested on the same declared image, region, or pixel features. The following subsections explain their mechanisms and assumptions so that comparisons can keep the representation, patient partitions, and evaluation target consistent.

3.4.1 Support vector machines

An SVM constructs a decision boundary using a margin criterion. The modern support-vector formulation treats both separable and nonseparable training data, with kernel functions providing nonlinear decision rules. Cortes and Vapnik developed the support-vector network formulation for this setting. [99]

Assume that both classes are represented among binary training labels yt E {—1, +1}. Define a linear score

Illustrations are not included in the reading sample

The hyperplane g(x) = 0 is the decision boundary. Points with positive scores are assigned to the positive class and points with negative scores to the negative class; a tie convention is needed at zero. The parameter w determines orientation, and b changes position. In two dimensions the boundary is a line, in three dimensions a plane, and in higher dimensions a hyperplane. The interpretation is unchanged.

3.4.2 Separating hyperplanes

For two points xa,xb on the boundary, subtraction gives

Illustrations are not included in the reading sample

Thus, w is perpendicular to every displacement within the hyperplane. Let x0 be any point on the boundary and let w % 0. Projection onto the unit normal gives the signed distance

Illustrations are not included in the reading sample

The unsigned distance is |6(x)|. Its units are those of the feature space after preprocessing. Changing feature scales changes the geometry unless the model or distance is adjusted accordingly.

Multiplying (w, b) by the same positive constant leaves predictions unchanged. For strictly separable finite training data, choose this scale so that the smallest value of dz(wTxz + b) equals one. The canonical constraints then become

Illustrations are not included in the reading sample

The two margin hyperplanes are wTx + b = +1 and wTx + b = —1. Each lies 1/||w||2 from the decision boundary, so their separation is

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 3.5. A synthetic linear SVM geometry with w = (1, 0)T and 6 = 0. The decision boundary is xx = 0, the margin hyperplanes are xx = ±1, and the full margin is 2. The normal is horizontal. Filled observations on the margin illustrate support vectors; the shown geometry is specified analytically.

This is a perpendicular distance between parallel hyperplanes. It is not generally the Euclidean distance between an arbitrary pair of support vectors from different classes, because their displacement may also have a component parallel to the boundary. The standard margin derivation is developed in Bishop’s treatment of maximum-margin classifiers. [100]

If x+ and ./' lie on the two canonical margin hyperplanes, then

Illustrations are not included in the reading sample

This midpoint relation follows by adding their margin equations. It applies to such margin points with the chosen w; it is not a general recipe for finding the optimal boundary from any positive and negative training pair.

Illustrations are not included in the reading sample

Figure 3.5 specializes Equation (3.8) to a horizontal unit normal. The displayed distance of one is from either margin to the boundary; the full distance between margins is two.

3.4.3 Hard and soft margins

Maximizing the margin is equivalent to minimizing the squared norm of w. The hard-margin problem is

Illustrations are not included in the reading sample

It requires a feasible separator. Wound features can overlap because of acquisition variation, imperfect annotations, or genuinely similar appearances, so strict separation should not be assumed. Introduce nonnegative slack variables Ci to allow margin violations:

Illustrations are not included in the reading sample

Here C > 0 controls the penalty for violations relative to the norm term. Larger C penalizes violations more strongly within this sum-loss convention. Software using an average loss has a different scaling with n, so parameter values are not interchangeable without checking the objective. Eliminating the slack variables gives the hinge-loss form

Illustrations are not included in the reading sample

At the smallest feasible slack, Ci = 0 places an observation on or beyond its class margin; 0 < Ci < 1 places it inside the margin but on the correct side; Ci = 1 places it on the decision boundary; and Ci > 1 indicates a wrong-side prediction. A margin violation is therefore not synonymous with a classification error. [100]

The dual formulation writes the score as a weighted sum of training-point inner products. For the soft-margin problem, coefficients satisfy 0 < Q, < C and £, ti/y, = 0. Observations with nonzero coefficients are support vectors. Sequential minimal optimization solves the dual through a sequence of small subproblems, each involving two coefficients; it is an optimization method, not a different classification target. [101]

3.4.4 Nonlinear feature mappings and kernels

When no satisfactory linear boundary exists in the current representation, use a feature map o : x^ > W. A linear separator in W may correspond to a nonlinear boundary in the original space. A kernel supplies the inner product + .x. z) = (O(x).O(z)) without necessarily constructing 0 explicitly. The decision score becomes

Illustrations are not included in the reading sample

Common examples are the linear kernel xTz, the polynomial kernel (yxTz + c)[9] with 7 > 0, c > 0, and positive integer Q, and the Gaussian radial-basis kernel

Illustrations are not included in the reading sample

A valid kernel produces positive-semidefinite Gram matrices. A sigmoid expression is not automatically a valid kernel for arbitrary parameter choices. Nor does choosing a nonlinear map guarantee useful separation or generalization. [100]

A worked example clarifies the distinction between a curved boundary and its transformed representation. Consider the circle

Illustrations are not included in the reading sample

The curved boundary is now a line. A positive score z1 + z2 + 1/4 identifies the outside of the circle, and a negative score the inside. At (1/2.1/2) the score is —1/4; at (0.0) it is +1/4. These checks prevent reversing the class regions when drawing the transformation.

A different map, 0(x) = (#1. \/ 2xlx2.x2i', satisfies 0(#)T0(z) = (xTz)[2]. The factor >/2 is needed for the cross term. This identity explains a degree-two

homogeneous polynomial kernel; it does not imply that every dataset becomes separable in three dimensions.

In Figure 3.6, follow the same observations through Equation (3.18). Their coordinates change, but the inside/outside labels remain the comparison target. This illustrates representation change, not a new clinical labeling rule.

For multiclass tasks, binary SVMs can be combined through schemes such as one-versus-rest or one-versus-one. State the chosen scheme, preprocessing, kernel, and tuned parameters. An SVM score is a signed decision quantity; treating it as a probability requires an additional calibrated model or procedure.

Wound application. Mukherjee and colleagues used SVMs, including a polynomial-kernel configuration, to assign tissue labels to regions extracted from chronic-wound photographs.[102] The kernel operates on image descriptors rather than directly measuring wound size. Section 3.7 develops this tissue-classification example and its evaluation setting.

3.4.5 ^-nearest-neighbor (k-NN) classification

The k-nearest-neighbor classifier stores labeled examples and predicts from labels near a query. Let Xfc(x) be the indices of the k nearest training observations under a specified distance. A simple unweighted rule is

Illustrations are not included in the reading sample

Resolve ties explicitly. Distance-weighted voting is another choice, but it requires a policy for zero distance. Nearest-neighbor classification is supervised: the vote uses known training labels. Its classical statistical formulation is described by Cover and Hart. [103]

The neighborhood size controls how local the decision is. A small k can be sensitive to individual observations; a large k can smooth across boundaries and favor common classes. Feature scaling and irrelevant dimensions can change which cases are neighbors. A direct query against n vectors of dimension d requires O(nd) distance work before neighbor selection. Tree indexes can accelerate some searches, but their gains depend on dimension and data geometry. They do not provide a universal O(n log n) solution to all nearest-neighbor problems. [104]

Wound application. Jiang and colleagues included k-nearest neighbors among the classifiers compared for infection prediction from chronic-wound clinical records.[46] This is a clinical-variable application, distinct from voting over image embeddings. Section 3.7 develops record-based studies; Section 7.7 develops the embedding-based wound setting.

3.4.6 Decision trees

A decision tree recursively partitions feature space. At an internal node, a rule such as x3 < t sends an observation to one of two children. A leaf supplies a class label or a class-frequency estimate. One common split criterion is the reduction in Gini impurity. For class proportions pc at a node, c

Illustrations are not included in the reading sample

For left and right children with nL,nR observations, minimize (nLGL + ^RGR)/(nL + nR) over candidate splits. This gives a local split choice, not a globally optimal tree. Depth limits, minimum leaf sizes, and pruning constrain complexity. A small tree can be readable, while a deep tree may be unstable and difficult to inspect. Standard treatments explain these recursive partitioning and pruning ideas. [105]

Wound application. Song and colleagues evaluated a decision-tree model for pressure-ulcer prediction using clinical variables from hospitalized patients.[106] The tree therefore predicts an event from recorded patient information rather than delineating tissue in a photograph. Section 3.7 develops this application and its reporting limitations.

3.4.7 Random forests

A random forest aggregates randomized trees. In a common classification con-struction, each tree is fitted to a bootstrap sample and each split considers a random subset of features. The final class is obtained by voting across trees. Randomizing the trees seeks to reduce dependence among their errors while retaining useful individual predictors; the original random-forest paper develops this ensemble principle. [107]

The number of trees, candidate features per split, tree depth, and leaf size affect computation and behavior. More trees do not repair a biased training sample or a leaking evaluation. Observations omitted from a tree’s bootstrap sample can supply out-of-bag predictions, as explained in the original randomForest software account. [108] Ordinary observation-level bootstrapping does not itself ensure patient separation when several observations belong to one patient.

Illustrations are not included in the reading sample

Figure 3.7. Schematic decision rules for the same numerical input. A nearest-neighbor classifier votes using nearby labeled training examples; a tree follows successive feature tests; a forest aggregates predictions from several trees. These are explanatory constructions, not fitted woundstudy results.

Figure 3.7 holds the input representation fixed while changing the prediction rule. Nearest-neighbor voting uses Equation (3.19); the tree follows one path, and the forest combines several tree decisions.

Wound application. Veredas and colleagues evaluated a random-forest classifier for tissue recognition after clustering and feature extraction from wound images.[37] The forest was the supervised decision stage within that image-processing pipeline. Section 3.7 develops the wound example and distinguishes it from clinical-record risk prediction.

3.4.8 Naive Bayes

Naive Bayes combines Bayes’ rule with conditional independence of features given the class:

Illustrations are not included in the reading sample

The assumption concerns independence within each class; it does not assert un-conditional independence of all measurements. Gaussian naive Bayes models continuous feature likelihoods with class-specific univariate Gaussians. Categorical and count-based variants use different likelihoods, so the variant should match the representation. The empirical and theoretical behavior of the naive assumption is discussed by Rish. [109]

For classification, compute log scores logp(y = c) + £y. logp(xg | y = c) to avoid multiplying many small probabilities. Smoothing can prevent an unobserved categorical value from forcing an entire class likelihood to zero. Correlated color and texture features can violate the independence assumption; a useful classification rule under such violations does not imply well-calibrated probabilities. None of these classifiers is universally best. Their value must be assessed using the same targets, data partitions, and performance definitions.

Wound application. Jiang and colleagues evaluated a naive-Bayes comparator for infection prediction using routine variables from patients with chronic non-healing wounds.[46] This documents use of the classifier without establishing that its independence assumption holds clinically. Section 3.7 develops the distinction between clinical-record prediction and photograph analysis.

3.5 Distances, similarities, and clustering

Classification learns from target labels. Clustering instead organizes observations according to a specified notion of similarity, often without target labels during fitting. A cluster identifier is an algorithmic group name, not a diagnosis. To interpret image clusters as wound, background, or tissue categories, one needs a separate mapping or assessment against clinical annotations.

The representation and distance together determine which differences count. A method operating on color alone cannot use texture that was never supplied. Conversely, joining color and texture descriptors without appropriate scaling can allow whichever coordinates have the largest numerical ranges to dominate. Section 2.11 introduced learned metrics; here the focus is on fixed distances and their consequences for classical models.

A hard partition of n observations into K nonempty clusters C1,^,CK satisfies

Illustrations are not included in the reading sample

Pairwise disjointness matters: merely requiring the intersection of all clusters to be empty would still allow overlaps between pairs. Soft clustering instead assigns graded membership values, often constrained to sum to one for each observation. In a mixture model, these are posterior component probabilities. They should not be confused with simultaneous clinical labels in a multilabel classification task.

Before fitting a clustering model, we therefore examine the comparison functions it may use: metric distances, cosine and Jaccard similarity, and kernel-induced separation. The next section will use these foundations to develop clustering algorithms.

3.5.1 Metrics and distance functions

A metric 7(x, z) is nonnegative, is zero exactly when x = z, is symmetric, and satisfies the triangle inequality 7(x, z) < 7(x, y) + d(y, z). An ultrametric obeys the stronger inequality

Illustrations are not included in the reading sample

Many useful similarity functions are not metrics. Distinguish a similarity, whose larger values usually indicate greater resemblance, from a distance, whose smaller values indicate greater proximity.

For vectors in IRd, the Minkowski distance is

Illustrations are not included in the reading sample

The choices p = 1 and p = 2 give Manhattan and Euclidean distances, respectively.

The limit as p ^ m is maxg \xg — zg\. For 0 < p < 1, the expression is generally not a metric because the triangle inequality can fail. The choice of representation

and dissimilarity determines the partitioning problem; it must therefore be stated before algorithmic results can be interpreted.

The Euclidean triangle inequality follows by writing u = x — y and v = y — z and using Cauchy-Schwarz:

Illustrations are not included in the reading sample

Taking nonnegative square roots proves the result in any finite dimension. Squared Euclidean distance is useful as an objective, but is not itself a metric: on the real line, the squared distance from 0 to 2 is 4, exceeding 1 + 1 via the intermediate point 1.

For a synthetic pair x = (1,2) and z = (4,6), the coordinate differences are (3,4). The Euclidean distance is 5, Manhattan distance is 7, and maximum-coordinate distance is 4. These values measure different geometries; they are not competing estimates of a uniquely correct notion of similarity.

3.5.2 Cosine and Jaccard similarity

Cosine similarity measures alignment of nonzero vectors:

Its range is [—1,1] for real vectors and [0,1] when all coordinates are nonnegative. A value of one means positive collinearity, not necessarily identical magnitudes; zero means orthogonality. Zero vectors require a separate convention. For the worked example q = (1,2,3) and r = (4, —5,6),

Illustrations are not included in the reading sample

The frequently used dissimilarity 1 — scos is not generally a metric. For unit- normalized vectors, squared Euclidean distance equals 2(1 — scos), clarifying how angular and Euclidean objectives can be related after normalization.

For finite sets, Jaccard similarity compares shared elements with all distinct

Illustrations are not included in the reading sample

when the union is nonempty. With A = {0, l, 2, 5,6} and B = {0, 2, 3, 5, 7, 9}, the intersection contains three elements and the union eight, so J = 3/8 and dj = 5/8. Identical nonempty sets have similarity one and distance zero. For two empty masks, a common convention sets similarity to one; state this choice because it affects segmentation summaries. For binary region masks, Jaccard similarity is intersection over union (IoU).

Wound application. The small-VLM wound-classification preprint used cosine similarity to retrieve support images; Liu and colleagues used intersection-over- union to evaluate pressure-injury masks.[24, 110] These apply similarity to different objects. Sections 7.7 and 5.15 develop retrieval and spatial overlap, respectively.

3.5.3 Kernel-induced distances

A positive-semidefinite kernel defines feature-space separation through

Illustrations are not included in the reading sample

This follows by expanding ||^(x) — f(z)||[2]. If distinct inputs map to the same feature vector, their distance is zero, so the construction is a pseudometric on the original inputs. It becomes a metric when the map separates distinct inputs. Small negative values under the square root caused by floating-point roundoff should be handled numerically; substantially negative values indicate a problem with the kernel or calculation. The feature-space interpretation follows the kernel construction in Bishop. [100]

3.6 Clustering methods

The preceding section established ways to measure similarity; we now examine how algorithms use those relationships to organize feature vectors. We begin with the hard assignments of k-means, then develop Gaussian mixtures and the expectation-maximization steps used to fit them. The final subsection introduces fuzzy memberships and graph-based methods. For wound analysis, follow what each method groups and how its output would be linked to a separately defined tissue or wound target.

3.6.1 K-means objective

K-means partitions feature vectors around K centroids, where 1 < K < n. Its squared-error objective is

Illustrations are not included in the reading sample

provided nk > 0. Thus the arithmetic mean, not a selected member of the cluster, minimizes this particular within-cluster squared loss. Replacing Euclidean distance by another distance while retaining the same mean update generally changes the optimization problem and can invalidate this derivation.

Table 3.2 distinguishes the hard assignments used by k-means from the soft responsibilities introduced for Gaussian mixtures. In both cases, a cluster index describes a fitted group rather than a clinical class label.

Table 3.2. Notation for the clustering procedures. The number of clusters K is distinct from the neighbor count k used in a neighbor graph.

Illustrations are not included in the reading sample

Algorithm: Lloyd’s k-means iteration

Choose K initial centroids. Then alternate:

1. Assign every observation to a nearest centroid: cz ^ arg mink \x^ — dkll2•
2. Recompute each nonempty cluster mean: dk ^ n—[1] £z-c.—k xi.
3. Stop when assignments cease changing, the objective changes sufficiently little, or a declared iteration limit is reached.

Resolve distance ties deterministically. If a cluster becomes empty, apply a stated policy, such as relocating its centroid to a poorly represented observation, and continue checking the objective.

Each ordinary assignment and nonempty-mean update cannot increase the objective. This alternating minimization can nevertheless end at a local solution depending on initialization. Lloyd’s method and the probabilistic-learning treat-ment of k-means establish these update rules. [100, 111]

Randomly selecting K observed vectors is often called Forgy initialization. Random partition initialization instead assigns observations to groups and computes their means. K-means++ starts with a randomly selected observation and then

Illustrations are not included in the reading sample

Figure 3.8. Reproducible synthetic k-means iterations. Crosses are the centroids used for each displayed assignment; the last panel uses the updated means. The objective is computed from the plotted points and centers. Iteration labels describe actual recorded states rather than an assumed fixed number of steps to convergence.

chooses each additional center with probability proportional to its squared distance from the nearest existing center:

The original k-means++ algorithm uses this F[2] weighting. It does not choose the farthest point deterministically, and it does not weight by unsquared distance. [112] If all distances vanish, no additional distinct center is available. Repeated runs can reduce sensitivity to initialization, but do not certify the global optimum.

For a synthetic one-dimensional example, let the observations be 0,1,4, 5 and the first center be 0. The squared distances are 0,1,16, 25, so the next-center probabilities are 0,1/42,16/42, 25/42. If the next center is 5, one Lloyd assignment gives groups {0,1} and {4, 5}, whose means are 0.5 and 4.5. The objective falls from 2 to 1 after that mean update. The assignments then remain unchanged.

Figure 3.8 tracks the assignments and means entering Equation (3.31). Read its objective values as within-feature-space fit, not as classification accuracy or agreement with wound annotations.

A straightforward implementation uses O(nKd) work per assignment pass and O(nd) work to update means. Across T iterations its principal cost is O(nKdT). Storing the data, centers, and assignments requires O(nd + Kd + n) space when distances are processed without retaining a full n x K matrix. The iteration count

is data-dependent. K-means favors partitions well represented by means under squared Euclidean loss; outliers, unequal cluster spread, and nonconvex shapes can make this representation unsuitable.

Wound application. Veredas and colleagues used k-means to divide wound photographs into regions before classifying their tissue content.[37] The clusters supplied intermediate image regions, while separate supervised models assigned tissue labels. Section 3.7 develops the complete pipeline and Chapter 5 follows learned alternatives.

3.6.2 Gaussian mixtures

A Gaussian density models a distribution around a mean rather than assigning every point to a single nearest center. In one dimension,

Illustrations are not included in the reading sample

The mean sets location and the standard deviation sets spread. The curve integrates to one; its height is a density, not the probability of one exact real-valued observation. The three examples, (", -) = (8,2), (14,2), (14,3), distinguish moving the mean from changing the spread.

Illustrations are not included in the reading sample

Figure 3.9 changes one Gaussian parameter at a time. The lower peak of the wider curve preserves total probability; density height cannot be substituted for a class probability.

For independent observations from one Gaussian, the maximum-likelihood estimates are " = n—[1] ^ x^ and -[2] = n—[1] £/•''/ /"|[2]. The latter uses denominator n; the familiar unbiased sample-variance estimate uses n — 1 instead. These are different estimators with different objectives. In d dimensions, the density is

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 3.9. Gaussian probability densities computed from their stated functions. Moving the mean from 8 to 14 shifts the curve. Increasing the standard deviation from 2 to 3 widens the curve and lowers its peak while preserving total area one.

Here E is a symmetric positive-definite dzd covariance matrix, |E| its determinant, and E-[1] its matrix inverse. The determinant normalizes the density; it must not replace the matrix inside the quadratic form. The mean is a vector, and the exponent is a scalar. Bishop derives the Gaussian estimators and these multivariate forms. [100]

A Gaussian mixture model (GMM) combines K component densities:

Illustrations are not included in the reading sample

The weights rk are prior component probabilities. The mixture can be multimodal and is not generally itself Gaussian. A latent variable indicates which component an observation was sampled from under the model. Its posterior distribution provides soft assignments, allowing uncertainty where component distributions overlap.

3.6.3 Expectation-maximization in one dimension

Expectation-maximization (EM) alternates between inferring latent-component membership and updating parameters. Its general likelihood framework was introduced by Dempster, Laird, and Rubin; the Gaussian-mixture specialization follows directly from weighted sufficient statistics. [100, 113]

Initialize positive variances, component means, and normalized weights. In the E-step, compute a responsibility for each observation and component:

Illustrations are not included in the reading sample

The denominator includes all components, and £fc rik = 1. A density value alone is not a responsibility: both the mixture weight and the normalization are needed. In the M-step, let Nk = £i rik and update

Illustrations are not included in the reading sample

Use the newly updated mean in the variance expression. Each observation con-tributes fractionally according to rik; replacing these weights by hard labels changes the algorithm.

For a synthetic observation x = 1 and two components with equal weights, means 0 and 2, and variances 1, the two likelihoods are equal and the responsibilities are (0.5,0.5). At x = 0, the responsibilities are approximately (0.8808,0.1192). Nearness to a mean is not the sole determinant when weights or variances differ.

3.6.4 Multivariate EM and practical checks

For vectors, use Equation (3.35) in the E-step. The mixture-weight and mean updates retain the same form, while the covariance update becomes

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 3.10. Synthetic two-dimensional mixture fitting at recorded EM iterations. Ellipses show Mahalanobis-radius-2 contours for each component; crosses show means. Point colors indicate the largest responsibility for display only: the updates use all soft responsibilities. The figure data include the likelihood trace and normalized responsibilities.

The outer product is a d x d matrix. Reversing the multiplication yields a scalar and cannot serve as a covariance estimate. For three components, update all three weights from their responsibility totals; the third weight is lx| x2, not '+ • Algorithm: Gaussian-mixture EM

Initialize '^k-kk-Yk' for k = 1,...,A. Evaluate the log likelihood ¿(0) = £z log £k ^kx^xi I Mk,^k). Repeat the responsibility and parameter updates, reevaluate f, and stop using a declared tolerance and iteration limit. Compute log densities and log-sum-exp normalization for numerical stability. Monitor effective counts Nik and covariance conditioning.

Exact EM updates do not decrease the observed-data likelihood, but they do not guarantee the global maximum. An unrestricted Gaussian mixture can approach a singular solution by collapsing a covariance around an observation. Multiple initializations, restrictions on covariance structure, and regularization are practical safeguards; each changes the implementation or fitted model and should be reported. [100]

The ellipses in Figure 3.10 reflect the means and covariances updated by EM, including Equation (3.41). Displaying the largest responsibility as one color does not turn the soft updates in Equation (3.37) into k-means assignments.

K-means and GMMs are related but not interchangeable. With equal isotropic component covariances and equal mixture weights, selecting the largest Gaussian density is equivalent to selecting the nearest mean. As the common variance tends to zero, the responsibilities become concentrated on nearest centers away from ties.

A general GMM can instead model different covariance shapes and prior weights, at the cost of more parameters and additional estimation risks. [100]

3.6.5 Fuzzy memberships and neighbor graphs

Fuzzy c-means provides another form of graded assignment. For exponent m > 1, it minimizes

Illustrations are not included in the reading sample

The last constraint excludes empty clusters and a cluster containing every obser-vation with full membership. The centroid update is Ek - Mfi/M■ These memberships are not automatically probabilities from a generative model.

The original FCM account develops this fuzzy-partition objective. [114] Spatial penalties or image-specific neighborhood terms are additional modeling choices, rather than properties of the basic objective.

A neighbor graph is a different construction. Connect each observation to selected nearby observations and assign nonnegative edge weights. A directed k-nearest-neighbor graph can be symmetrized by retaining edges present in either direction or by retaining only mutual edges. These policies produce different graphs. The number of neighbors k controls connectivity and is distinct from the desired number of clusters K.

Spectral clustering uses this graph rather than a direct majority vote over cluster labels. With symmetric adjacency matrix W, degree matrix D where Dii = ^. Wig, and positive degrees, one normalized Laplacian is

Illustrations are not included in the reading sample

A standard normalized spectral procedure takes eigenvectors associated with the

smallest eigenvalues, normalizes each nonzero row of the eigenvector matrix, and

Symmetrized two-neighbor graph

Illustrations are not included in the reading sample

Figure 3.11. A synthetic neighbor graph. Edges express local proximity; they are not training labels. A supervised nearest-neighbor classifier votes with known labels, spectral clustering partitions a graph through an embedding, and semi-supervised label propagation uses known labels as anchors. These are distinct tasks.

clusters the resulting row representations. Positive graph degrees make F [12] defined but do not alone guarantee nonzero embedding rows. Before normalization, inspect connected components and row norms. A connected graph with nonnegative edge weights and positive degrees has a strictly positive first normalized-Laplacian eigenvector; including it prevents zero rows. For a disconnected graph, include the complete zero eigenspace or specify how components are processed or merged. If there are more connected components than the requested clusters, truncating the zero eigenspace can leave some components with zero rows. Such a row requires an explicit graph/component decision; adding an epsilon alone does not recover the missing component information. Handle isolated vertices separately because their inverse degrees are undefined. The graph construction, edge scale, and number of clusters materially affect the result. Von Luxburg’s tutorial derives these distinctions and algorithms. [115]

Figure 3.11 separates a connection rule from a clinical label. Edges identify selected neighbors in the supplied representation; an additional partitioning or prediction rule is needed before the graph can support a wound-analysis output.

If some labels are known, graph-based label propagation can spread their in-formation to nearby unlabeled observations under a stated smoothness and an-choring rule. The local-and-global-consistency formulation gives one explicit semi-supervised objective for this purpose. [116] Without fixed labels, simply assigning each point its neighbors’ most common current label is not a general replacement for a specified clustering method. It depends on initialization and update order and can collapse to one label. In particular, an objective that only penalizes differently labeled neighboring pairs is minimized by placing every observation in one cluster unless balancing or other constraints are imposed.

The cited KNN-SC study combines a nearest-neighbor construction with spectral clustering and noise handling; it should be described as that particular graph method. [117] It does not justify treating supervised FNN voting, spectral clustering, and unconstrained label updates as one algorithm. With these distinctions established, the wound literature can be read in terms of what each component actually contributes to a complete analysis pipeline.

Wound application. Chakraborty used fuzzy c-means in chronic-wound tissue analysis, while Dhane and colleagues used a similarity graph and spectral clustering to delineate wound beds.[118, 119] These are distinct uses of graded membership and graph structure. Section 3.7 develops both wound-analysis settings.

3.7 Evidence from wound studies

The classifiers and clustering methods described above provide components of an analysis pipeline. To understand their use in wound research, we now examine the tasks and evaluation settings in which they have been studied. The subsections move from supervised image analysis to prediction from clinical records, then to clustering and segmentation. This order keeps the input, prediction target, and supporting evidence visible in each application.

3.7.1 Supervised image analysis

The studies below illustrate how representations, classifiers, and segmentation stages are combined. Their results are not a common leaderboard. A tissue-region classifier, an image-level wound classifier, and a wound-boundary detector have different targets. Even when two papers both report “accuracy,” their denominators, sampling units, annotations, and evaluation partitions may differ.

Mukherjee and colleagues combined saturation-based wound segmentation with color and texture features and compared Bayesian and SVM tissue classifiers. Their dataset contained 74 wound images with 767 expert-identified tissue regions. The abstract reports 87.61% overall accuracy for the third-degree polynomial SVM, but the source's numerical summaries conflict. Its Table 2 matrix contains 195 + 410 + 75 = 680 correct classifications among 767 regions, giving 680/767 « 88.66%, whereas Table 3 reports 86.13%. [102] These values are not reconciled here, and no single performance estimate is endorsed. The matrix totals correspond to the annotated regions, although the paper also calls them tissue pixels. A separate patient-disjoint evaluation is not established in the reported protocol; these internal figures do not establish performance on new patients or clinical effectiveness.

Veredas and colleagues subsequently evaluated a pipeline with k-means segmentation and neural-network, random-forest, and SVM classifiers, including recursive feature elimination. Their comparison concerns classifiers within that pipeline. [37] An earlier study from the same group combined mean-shift and region-growing segmentation, color and texture measurements, and a committee of neural-network and Bayesian classifiers. [120] These examples also show why a pipeline may contain unsupervised and supervised components simultaneously: the initial grouping of image regions and the final assignment of tissue labels are different operations.

Wannous and colleagues emphasized the complete color-processing chain, including color correction, expert-label aggregation, and segmentation-driven SVM classification. [121] Their multiview work mapped and merged tissue labels on a reconstructed three-dimensional wound surface. [122] These studies motivate attention to acquisition and viewpoint. They do not justify assuming that a model trained on one camera or lighting setup will work unchanged in every clinical setting.

Read Table 3.3 by prediction target: pixel or superpixel classification can support wound delineation, but those experiments do not estimate image-level etiological accuracy.

Wang and colleagues addressed diabetic-foot-ulcer boundary determination using images acquired in a controlled capture box. The cascaded SVM pipeline

Illustrations are not included in the reading sample

Table 3.3. Selected supervised wound-image studies. “Reported evaluation” describes the available source, without implying prospective clinical validation. See the accompanying text for interpretation.

used superpixel descriptors, followed by conditional-random-field refinement. The study collected 100 photographs from 15 patients, and its image-based leave- one-out evaluation reported sensitivity of 73.3% and specificity of 94.6% for the refined method. [123] Repeated photographs from a small patient group and the controlled acquisition setup constrain the interpretation. The source establishes a system evaluation under those conditions; it does not establish performance across unrestricted smartphone capture conditions.

Silva and Machado used an SVM to classify superpixel descriptors before a modified GrabCut procedure delineated pressure-ulcer area. [124] This ordering is useful conceptually: classification supplies evidence for a spatial segmentation procedure. The paper’s comparisons with selected deep-learning methods should be read in the context of its dataset and experimental settings, rather than as a general ranking of classical and deep methods.

Two additional examples illustrate why the reported details require scrutiny. Chakraborty described color-channel selection, fuzzy c-means segmentation, and supervised tissue classification. The paper’s comparative accuracy wording is ambiguous about which values correspond to each classifier, limiting a reliable model- by-model ranking. [118] Mawarni and colleagues used gray-level co-occurrence features with an SVM for external-wound images, but their abstract gives inconsistent accuracy values. The methodological example is retained; a single reconciled headline accuracy is not asserted. [125]

3.7.2 Prediction from clinical records

Pressure-injury detection from clinical notes and risk prediction from structured records should be distinguished from analysis of photographs. Sotoodeh and colleagues used negation-aware features from unstructured MIMIC-III notes and evaluated several classifiers for pressure-ulcer detection. [126] That result does not demonstrate recognition of wound tissue in images. Qu and colleagues conducted a network meta-analysis of pressure-injury prediction models; it is a synthesis of studies, not one original image experiment. [127]

Song and colleagues retrospectively compared models using clinical variables from 5,814 patients, including 1,673 pressure-ulcer events. The authors explicitly raised possible overfitting when interpreting the exceptionally high random-forest indicators. [106] The source table also contains inconsistencies between displayed counts and summary metrics. Accordingly, it is used here to illustrate the clinical- record prediction task and the need for cautious validation, rather than to claim near-perfect generalizable performance.

3.7.3 Clustering and segmentation evidence

Clustering in a wound pipeline may propose candidate regions, supply spatial structure to a classifier, or form the final segmentation after a rule maps clusters to anatomical labels. The word “unsupervised” should describe the relevant fitting

Table 3.4. Selected clustering and segmentation studies, separated by input domain. The in-vitro model in the last row is not patient wound-image evidence.

Illustrations are not included in the reading sample

stage precisely. Choosing color channels or settings using annotated evaluation images can still introduce supervision into model development.

Dhane and colleagues used a similarity graph and spectral clustering after color homogenization and filtering, with morphological postprocessing of the resulting wound regions. Their evaluation used 105 images and dermatologist annotations. [119] A later fuzzy spectral method used a spatial similarity measure and selected the Db color channel from a comparison of channels; it was evaluated on 70 images with reference annotations from two dermatologists and a surgeon. [128] The latter reported a Dice index of 86.7%, but the figure refers to its wound-region segmentation experiment, not to tissue diagnosis, patient outcomes, or an external deployment test.

Table 3.4 separates patient photographs from controlled experimental measurements. Its rows support different uses of clustering and therefore do not form a common performance ranking.

Kumar and Jeeva J. B. described extracting area, perimeter, length, and width after color clustering and using those measurements for proposed healing-time prediction. [129] A geometric measurement pipeline and a clinically validated prognostic model are different achievements. Healing-time predictions require outcome definitions, follow-up, and evaluation beyond agreement with an image boundary.

Wahabzada and colleagues studied a three-dimensional in-vitro wound model exposed to wound fluids using hyperspectral imaging and hierarchical clustering. [130] This is useful evidence that clustering can summarize spectral changes in a controlled experimental system. Its findings concern the in-vitro model and spectral measurements; they do not establish the performance of a color-based segmentation method on patient photographs.

3.8 Limitations and fair comparisons

The study examples raise questions that a method description alone cannot settle: which image differences matter, how reliable the reference labels are, and whether a comparison tests the complete system. We begin with acquisition and annotation limits, then examine how to compare pipelines fairly. The final subsection considers interpretation, computational cost, and the distinction between a useful prediction and evidence of clinical benefit.

3.8.1 Acquisition and annotation limits

Changes in illumination, viewpoint, camera processing, resolution, and surrounding skin can alter the descriptors even when the underlying wound is unchanged. Color correction and standardized acquisition can reduce some variation, but they do not prove invariance to all future conditions. The multiview and color-processing work discussed above demonstrates why these factors belong in the design of the whole system. [121, 122]

Reference annotations also have uncertainty. Morgado and colleagues had three wound specialists annotate a subset of 121 images and analyzed agreement for wound boundaries and tissue regions. They found lower spatial agreement for tissue boundaries than for the open-wound region, while agreement on tissue proportions was comparatively high. [131] Thus, two annotations can agree reasonably well about the amount of a tissue yet disagree about its exact location. A model evaluation should identify the reference standard, who produced it, and how disagreement was handled.

Zengarini and colleagues compared geometry-only and fuller image-descriptor models for wound-edge labels. Their retrospective study found low agreement among clinicians and better label agreement after adding visual descriptors. Its pipeline also used learned segmentation and depth estimation, illustrating why a complete system cannot always be classified as purely classical or purely deep. External validation remained necessary. [132]

The 2025 review by Reifs Jiménez and colleagues found substantial concerns involving annotation and validation in the chronic-wound AI literature it reviewed. Its search covered studies from 2013 through 2023, despite the review’s later publication date. [133] A recent publication date should therefore not be mistaken for evidence that every intervening study or deployment has been examined.

3.8.2 Comparing complete pipelines

Classical and deep models should be compared using the same prediction target and held-out cases. Give each model an appropriate development budget and report the chosen settings. Feature extraction, feature selection, resampling, probability calibration, and threshold selection are all parts of the classical pipeline; pretraining, augmentation, and fine-tuning are parts of the deep pipeline. Reporting only the final classifier conceals choices that can materially affect the comparison.

Patient separation and external testing deserve explicit attention. The CLAIM guidance recommends reporting data partitions and testing sources, including disjointness at the patient level. [20] If performance is intended to generalize to a different institution, camera, or population, testing only another random subset from the same collection does not answer that question. Report the population, image provenance, annotation process, and unit at which uncertainty is estimated.

Imbalance should be addressed at both training and reporting stages. Keep resampling inside development folds, state the original class distribution, and show class-specific errors. For repeated images, uncertainty estimates should respect patient grouping. For spatial outputs, report overlap and boundary behavior together with failure examples where relevant. A favorable average can conceal failure on small wound regions or uncommon tissue appearances.

3.8.3 Interpretation and practical limits

Classical models often make feature dependence visible, but interpretability is not automatic. An SVM with a nonlinear kernel may be difficult to explain case by case. A large forest aggregates many decision paths, and feature importance is not causal evidence. Naive Bayes can provide a transparent score decomposition while relying on a poor independence approximation. A nearest-neighbor result can be explained through retrieved examples, provided their similarity is meaningful and their data provenance is appropriate.

Runtime should include feature construction and preprocessing, not only the final prediction call. The stored examples required by nearest-neighbor methods, the number of support vectors in a kernel SVM, the number and depth of forest trees, and the size of a spectral graph can each affect deployment cost. These considerations depend on the actual data and implementation; broad claims that all classical methods are cheap or all deep methods are slow are unhelpful.

Finally, discrimination, segmentation agreement, and clinical benefit are dif-ferent endpoints. A model may reproduce a reference mask without improving treatment decisions, and a risk score may discriminate outcomes without being well calibrated. The evidence in this chapter supports particular computational methods and study-specific observations. Clinical effectiveness requires evaluation of the intended workflow and outcomes in the population where the system would be used.

3.9 Chapter review

This review reconnects the chapter’s two main uses of feature vectors: predicting supplied labels and discovering similarity structure. A comparison table brings the classifier and clustering families together, followed by practice questions and worked answers on their assumptions, calculations, and evaluation. The summary then explains how these explicit feature pipelines lead into learned image representations in the next chapter.

3.9.1 Classifiers and clustering compared

Table 3.5 returns to the explicit feature pipeline in Figure 3.1. The supervised rows summarize margin, neighborhood, recursive-partition, ensemble, and likelihood principles.[99, 100, 103, 105, 107] The supporting rows distinguish hard distancebased partitions, probabilistic mixtures, fuzzy membership, and graph structure; their relationship to clinical categories requires separate evidence.[111, 113-115] All fitting, feature selection and scaling must remain within development data; the comparison concerns the complete pipeline.

Table 3.5. Classical methods compared by their role in a wound-image pipeline. The lower group discovers structure; it does not directly supply adjudicated wound categories.

Illustrations are not included in the reading sample

Illustrative research choice. Suppose a small wound dataset offers color and texture descriptors but few independent patients. Compare an SVM, a forest, and a simple probabilistic baseline using identical patient partitions, with scaling and feature selection fitted inside each development fold. Nearest-neighbor retrieval can help inspect whether similar predictions depend on wound appearance or camera background. Clustering may identify acquisition groups worth investigating, but assigning each cluster a diagnosis after examining test labels would no longer provide an independent classification evaluation.

3.9.2 Practice questions

These synthetic feature examples concern the model’s geometry, not a diagnosis from a photograph.

1. A query is q = (0,0) and the candidate feature vectors are a = (0.1,100) and b = (1,0). Which is nearer under Euclidean distance? What happens if a scale established from training data divides the second coordinate by 1000?
2. K-means divides wound photographs into two stable clusters. Does stability establish two wound diagnoses? Give a plausible alternative explanation and an independent check.
3. A team fits feature scaling on all images, then uses patient-separated training and test sets to compare an SVM with a forest. Is patient separation sufficient to make this an untouched test? Where should scaling, feature selection and model selection be fitted?

3.9.3 Worked answers

1. Initially ||b — q||2 = 1 while ||a — q||2 = V10000.01 > 100, so b is nearer. After the declared scaling, a = (0.1,0.1) has distance A/0.02 « 0.1414 and b still has distance 1. Thus a is nearer. Scaling changes the geometry for neighbors and distance-based kernels; its parameters must be fitted using training data within the relevant development fold, then applied unchanged to that fold’s tuning data and the held-out test data.
2. No. A stable partition may reflect illumination, camera processing or back-ground. Compare the clusters with independently assigned clinical references and acquisition metadata, without using held-out labels to fit or rename the clusters. Clustering and clinical classification are separate claims.
3. No. Fitting the scale on all images lets test information influence the representation. Fit scaling and feature selection within each training fold, select settings on the corresponding tuning data, and evaluate the frozen complete pipeline once on the held-out patients. Appropriate preprocessing may differ across methods, but its fitting boundary must be the same.

3.9.4 Chapter summary

Classical wound-image analysis makes the representation and decision rule explicit. The feature construction in Figure 3.1 determines which aspects of color, texture, geometry, or learned appearance reach the classifier. SVMs use margins, nearest neighbors use labeled proximity, trees use successive partitions, forests combine trees, and naive Bayes combines class-conditional likelihoods. Their advantages depend on the features and development procedure rather than on the method name alone.

Clustering addresses a different question. K-means, Gaussian mixtures, fuzzy c-means, and spectral methods organize unlabeled observations through different objectives and assumptions. Their groups require additional evidence before they can be interpreted as wound or tissue categories. Table 3.5 keeps these roles distinct. The soft-margin objective in Equation (3.13) controls a decision boundary in the chosen feature space; it cannot restore a wound cue absent from that representation. Chapter 4 develops this connection through CNNs and capsules, which learn visual features and aggregation mechanisms rather than relying only on predefined descriptors.

Chapter 4

Convolutional and Capsule Networks for Wound Images

This chapter explains how convolutional neural networks (CNNs) and capsule networks convert wound photographs into predictions, how their representations can be transferred between datasets, and how to judge the resulting evidence. Chapter 2 established the mathematical foundations of learning; Chapter 3 examined preparation, handcrafted representations, and classical classifiers. Here the emphasis moves to learned image representations and the architectural choices that determine their capacity, cost, and limitations.

The clinical motivation is substantial: wound assessment requires interpreting appearance together with cause, anatomical location, history, and other findings. Photographs can support this process, but the visible surface does not contain every variable needed for diagnosis. A system trained to recognize an image label is therefore evaluated first as a predictor of that label. Evidence that it improves treatment decisions or healing requires additional study. This distinction is particularly important for diabetic foot ulcers, where infection and impaired perfusion involve information beyond a red-green-blue (RGB) photograph.[3, 6]

By the end of the chapter, the reader should be able to formulate a wound-image task; choose and evaluate an adaptation strategy when labels are scarce; explain the historical motivation and gradient paths of CNN families; distinguish supervised and self-supervised pretraining; calculate representative costs and routing updates; and interpret class-specific errors, explanations, and patient-independent comparisons. This chapter discusses selected developments published in 2026 and earlier. It is a focused technical update, not an exhaustive systematic review.

Notation for this chapter. Table 4.1 connects the image, encoder, prediction head, and capsule-routing symbols. Read the dimensions before tracing a computation through these components.

Illustrations are not included in the reading sample

Table 4.1. Notation guide for Chapter 4.

4.1 Defining the prediction task

Before choosing a neural architecture, we must define the output it is meant to produce from a wound image. The first subsection separates classification, detection, segmentation, and longitudinal assessment. The second formalizes the labels, patient identifiers, and acquisition information needed to distinguish observations and evaluate that chosen task. These definitions will determine the prediction heads and losses introduced next.

4.1.1 Wound analysis tasks

A single photograph can support several learning problems. In image classification, the output is a label or set of labels for the whole image or a specified crop. Examples include wound etiology, presence of a diabetic ulcer, or image-visible signs associated with infection. In detection, the output also includes one or more bounding boxes. In segmentation, each pixel receives a label such as wound, background, or a tissue category. In longitudinal assessment, several observations are linked to estimate change over time. These tasks share encoders but require different annotations, prediction heads, and performance measures.[17]

Consider an image with one ulcer and surrounding intact skin. A classifier can correctly identify the wound category while a segmentation model traces an incorrect boundary. Conversely, a precise boundary does not establish the cause of the wound. A tissue label, such as granulation, describes a region within the wound bed; it is not interchangeable with an etiological label, such as venous ulcer. Read Figure 4.1 from left to right: the photograph is the common input, while the label, box, and colored region illustrate different output structures. The classification panel corresponds to the target yn in Equation (4.1) and the class-score vector in Equation (4.2). The detection panel adds coordinates; the segmentation panel requires a spatial label map. Consequently, the classification counts in Equation (4.32) and the mask overlaps in Equation (4.34) evaluate different objects. The colored patch does not assign a clinical tissue category or demonstrate a correct wound boundary.

4.1.2 Labels and independent observations

Let the dataset contain N observations, where yn is the prediction target, gn identifies the patient, and sn identifies the acquisition site or source. Additional fields can record wound identity, visit, device, and anatomical location. Several images may share one patient or wound. Thus N

Illustrations are not included in the reading sample

Figure 4.1. Different outputs from the same schematic wound image. The colors and boundary are illustrative, not clinical annotations. Classification, detection, and segmentation require separate validation.

images need not represent N independent clinical cases. An augmentation produces another view of an existing observation; it does not create another patient.

For mutually exclusive classes, yn E {1,..., K}. A softmax head produces K scores summing to one. For overlapping findings, use a vector yn E {0,1}K and separate sigmoid outputs unless a justified dependence model is introduced. Infection and ischemia can coexist. They can be modeled as two binary targets or as four explicitly defined joint states, but these formulations have different class frequencies and evaluation requirements. A hierarchy can first separate wound from non-wound and then classify wound type, provided errors from the first stage are included in evaluation of the complete system.

Labels must also have an operational definition. “Infected” might refer to expert image review, a clinical assessment incorporating other observations, or a diagnosis supported by diagnostic test results. These references are not equivalent. Record who assigned each label, what information they used, how disagreement was resolved, and whether uncertain cases were retained. The model cannot recover a reliable clinical definition from inconsistent annotations alone.[20]

4.2 Learned image representations

With the target defined, we can follow the computation from a wound photograph to a prediction. We first separate the encoder, feature aggregation, and prediction head, then trace how the loss supplies gradients to their trainable parameters. The

final subsection examines spatial information and aggregation, preparing the reader to assess what different architectures preserve or discard.

4.2.1 Encoders, aggregation, and prediction heads

A useful decomposition is ./•■>/’ + ./•!■>.:■> p. The encoder produces a spatial feature tensor F}(v) E ^hxwxd. Global average pooling (GAP) converts it into a vector z E Rd:

Illustrations are not included in the reading sample

Here A E RKxd and b E RK. The head has Kd + K trainable parameters. For d = 1280 and four classes, this is 5124 parameters. By comparison, directly connecting every element of a 7 x7 x 1280 feature tensor to four outputs uses 250884 parameters. GAP therefore reduces the head size, although averaging can discard spatial arrangements that a particular task needs.

This encoder-head decomposition applies the hidden representations introduced in Chapter 2. Its practical consequence is that the representation and prediction head can be adapted separately. Learned features reduce reliance on manually specified descriptors, while sample size, label quality, domain shift, and the choice of comparison model still govern the experiment.[31]

Figure 4.2 connects this decomposition to a wound image. In panel A, the map stacks belong to F}(v); the GAP arrow implements the spatial average in Equation (4.2); and the feature vector, linear head, and softmax correspond to z, q, and p. The drawn map patterns are deliberately schematic: an actual channel is a learned response, and cannot be named “boundary” or “tissue” without examining its behavior. Panel B takes the prediction p and training target t into the loss in Equation (4.3). Its update box uses the resulting gradients to change the head and any unfrozen encoder layers. The dashed return marks this parameter-update step;

it is not an extra input at inference. Thus a wound photograph can receive class scores without its label being known, whereas supervised learning requires the reference label.

Wound application. Anisuzzaman and colleagues combined pretrained image encoders with dense prediction heads for wound-type classification, and also joined image features to location features.[14] This supplies a wound example for separating representation from decision. Section 7.4 develops the combined imagemetadata route.

4.2.2 Losses and head gradients

For a one-hot target t, cross-entropy for one observation is

Illustrations are not included in the reading sample

Consequently, df/dA = (p — t)zT, df/db = p — t, and d£/dz = AT(p — t). The last expression passes the training signal to the encoder when its weights are unfrozen. Backpropagation computes these derivatives; an optimizer uses them to update parameters. A stochastic update need not improve every example or even the next validation measurement.

For example, suppose a three-class model outputs (0.7,0.2,0.1) and the sec-ond class is correct. Its loss is — log(0.2) « 1.6094, and the logit gradient is (0.7, —0.8,0.1). If one feature component is y. = 2, the three entries in column c of the weight gradient are (1.4, —1.6,0.2). These numbers illustrate the direction and magnitude of the local training signal; they are not wound-study results.

With imbalanced classes, one option is a weighted objective

Illustrations are not included in the reading sample

The normalization shown here is by N; implementations that divide by the sum of observed weights have a different loss scale. Weights should be estimated from the training partition and documented. They change the objective, and their use may change probability calibration. Focal loss adds a factor (1 — pn,yn)[7], with 7 > 0, to reduce the relative contribution of easy examples. It was developed for dense detection and can be tested for classification, but noisy or ambiguous wound labels may become influential when hard examples receive more attention.[134]

Wound application. The severity-aware CNN-Transformer wound-triage study used focal classification loss alongside a separate severity-regression objec- tive.[135] The classification term trained the wound-category head within a multitask system. Section 6.13 develops classifier training, while Section 6.16 places wound-study objectives in context.

4.2.3 Spatial operations and clinical information

Convolution combines local neighborhoods using shared weights. Pooling or strided convolution reduces spatial resolution; neither is required after every layer.

If an early operation removes a small boundary or color transition, later layers cannot simply reconstruct the original observation from nothing. Conversely, retaining full resolution everywhere increases activation memory. The appropriate compromise depends on the target: fine tissue segmentation often needs higher- resolution features than coarse image classification.

CNNs can learn spatial relationships through receptive fields, nonlinear layers, and architectural design. The claim that a CNN recognizes only isolated parts and can never encode their arrangement is too strong. Pooling can provide some tolerance to small shifts, but it does not guarantee invariance to arbitrary rotation, perspective, or illumination. Capsule networks offer a different representation and routing mechanism for exploring these relationships; their advantages must still be measured.

Figure 4.3 shows precisely what can be lost by aggregation. Panel A separates the presence of parts from their relative positions. In panel B, apply Equation (4.2) to one channel with h = w = 2: both maps give zc = (1 + 0 + 0 + 1)/4 = 0.5, despite their different arrangements. Their global maxima also coincide. If these were the only features supplied to the same head, its logits and class scores would be identical. Preceding convolutions may, however, encode the arrangement in additional channels, so this example does not establish a general CNN failure. For wound classification, the analogous question is whether the distribution of visible patterns within the bed and surrounding skin matters beyond their average response. That question motivates testing spatial aggregation against GAP; the face drawings do not establish wound anatomy or a capsule advantage.

4.3 Transfer learning with limited data

A wound dataset may contain many photographs while providing relatively few independently labelled patients. Building a large representation from this small supervised sample asks the same data to establish both useful visual features and the final clinical label distinction. Transfer learning separates these demands: a source-trained encoder supplies an initial representation, and target wound data

Illustrations are not included in the reading sample

Figure 4.3. Part arrangement and spatial aggregation. The two abstract faces contain corre-sponding parts in different positions. The binary maps below are independent numerical teaching examples, not features extracted from those faces. Both maps have maximum 1 and mean 0.5. determine how that representation should be used or changed. This section connects that motivation to source and target domains, adaptation choices, and controls for negative transfer. The central question is how much useful knowledge survives the move to the intended wound task.

4.3.1 Domains and tasks

Why reuse matters in wound research. Expert-labelled wound images are not interchangeable with ordinary object photographs: the reference may require clinical history or specialist adjudication, and several images can repeat one patient’s appearance. Reusing a source representation can reduce the amount of target supervision devoted to learning basic image structure, leaving the wound labels to shape the relevant decision boundary. This is the motivation for transfer, not a promise that every source feature is clinically useful. In an image-location wound classifier, Anisuzzaman and colleagues reused pretrained image encoders and trained added prediction layers. Their experiment demonstrates the practical use of transferred features; it does not establish a universal sample-size requirement or prove that freezing is always optimal.[14, 136]

The value of transfer is a better target-task learning process under a stated data and compute budget. Useful outcomes include stronger performance with fewer labelled patients, more stable fitting, or a simpler trainable head. Measure these outcomes on held-out target data. A high source benchmark score alone does not show that wound boundaries, tissue appearance, or etiological distinctions are represented adequately. Following the classical transfer-learning formulation, a domain is D = (X, Px): a feature space and its marginal distribution. A task is X = (y, f), where y is the output space and f is the predictive relation to be learned. Source and target domains can differ because of camera characteristics, clinical population, anatomical coverage, or image preparation. Tasks can differ because one dataset labels natural objects and another labels wound types.[136]

The target risk is

Illustrations are not included in the reading sample

Only a finite sample approximates this expectation. Good source-domain performance does not by itself bound the target risk. Even if Ps(y | x) = PT(y | x), a change in Px can move images into poorly sampled regions. In clinical practice the labeling rule may also change, making the problem more than a shift in appearance.

4.3.2 Transfer mechanisms and suitability

Three questions organize a transfer experiment: what information is reused, how it is adapted, and whether reuse helps the target task. Parameters are the most familiar transferable object, but instance weighting, shared representations, and relations between examples can also transfer. Transfer learning is not restricted to neural networks. Self-taught learning, for example, studies representations learned from unlabeled data for use in a supervised target problem.[38]

The historical taxonomy distinguishes inductive transfer, where target-task supervision is available and tasks differ; transductive transfer, where tasks coincide but domains differ, typically with labeled source and unlabeled target data; and unsupervised transfer, where the target objective is itself unsupervised. These names describe information available during learning, not three mutually exclusive software recipes. Modern supervised fine-tuning, self-supervised pretraining, and domain adaptation should therefore be described by their actual data and objectives rather than forced into an ambiguous label.[136]

For wound photographs, ImageNet pretraining followed by labeled wound finetuning is a common parameter-transfer setting. Adapting a wound model from hospital A to unlabeled images from hospital B is a different experiment. Access to hospital B’s test images during adaptation must be declared, even if their labels are hidden. Otherwise a transductive protocol could be mistaken for an untouched external evaluation.

Read each row of Figure 4.4 as a separate experiment using the same woundlabel definition. All rows train the new A, b head in Equation (4.2). The frozen row constrains every encoder parameter to bs; the partial row permits only a selected subset of 0 to change; and the full row permits all encoder parameters to change.

Illustrations are not included in the reading sample

Figure 4.4. Three adaptation strategies. A frozen encoder, partial fine-tuning, and full fine-tuning expose different numbers of parameters to the target training set. All strategies require independent model selection and final evaluation.

Equation (4.6) below distinguishes a soft penalty toward 6S from the hard constraint used by freezing. The arrows carry features in every row, including through frozen layers: “frozen” stops parameter updates, not forward computation. Matching patient partitions makes the rows a comparison of adaptation choices rather than of different wound samples.

Figure 4.5 answers a prior question: what information is available in the source and target problems? In row A, the task changes from object labels to wound labels, so target supervision can estimate the risk in Equation (4.5). In row B, the wound label space remains fixed while the acquisition domain changes; unlabeled hospital-B images cannot directly supply the target classification loss because y is unavailable. An adaptation objective is therefore needed, and target labels must be reserved for a separately specified evaluation. In row C, target clustering has no class-label loss at all; any later use for wound classification requires a labeled evaluation. These distinctions explain why identical-looking reuse arrows do not imply identical learning objectives or comparable clinical evidence.

4.3.3 Adaptation workflow

Start by replacing the source classifier with a head matching the target labels. A frozen-encoder experiment measures how informative the existing representation

Illustrations are not included in the reading sample

is. Partial fine-tuning then adapts the last encoder stages; full fine-tuning permits every stage to change. None is automatically preferable. A frozen model can underfit a substantial domain difference, while an extensively updated model can overfit a small or biased target sample.

Consider a hypothetical four-category wound study with a fixed patient-level training, tuning, and test split. First train a four-output head on frozen source features. This asks whether the source representation already separates the wound categories. Next unfreeze the final encoder stage: this permits higher-level features to adjust while earlier filters remain fixed. Finally compare full fine-tuning, which can alter early color and texture responses as well. Use a suitably tuned scratch- initialized encoder as another reference. These are proposed conditions, not reported results.

The most adaptable condition need not win with the smallest training cohort. More trainable parameters create more opportunities to fit source-specific back-grounds or annotation noise. Conversely, freezing every layer can preserve a mismatch in illumination or acquisition style. Choose the adaptation depth using target tuning data, and compare learning curves over several patient counts. Repeated photographs must follow their patient when forming these subsets. Keep the checkpoint, head, input preparation, and tuning budget explicit so that a gain can be attributed to the adaptation choice rather than an undisclosed change in data or resources.

The source head and the target head also have different meanings. A natural-image class probability is not a wound probability, even if the encoder is reused. The new head needs target supervision; its confidence needs target calibration checks. Sections 4.10.2 and 4.10 explain how class errors and probability quality can reveal a transfer strategy that looks successful in aggregate but fails on an important wound class.

A useful regularized objective, presented here as a design option, is

Illustrations are not included in the reading sample

where 9S denotes pretrained encoder parameters and A > 0. Its additional gradient is A(9 — 9 g). This penalty favors proximity to the source initialization; it differs from ordinary weight decay toward zero. Freezing is the hard constraint 9 = 9 g. Intermediate penalties do not guarantee preservation of useful functions because parameter distance and predictive similarity are different quantities.

Batch-normalization behavior deserves explicit attention. Freezing trainable weights while still updating running means and variances changes the effective model. A small wound dataset or a very small batch may make those estimates unstable. Record both gradient settings and training/evaluation mode. Likewise, retain the normalization expected by the pretrained checkpoint unless an alternative is deliberately evaluated. RGB order, intensity range, resize policy, and crop size are part of the model specification.

Algorithm: Controlled transfer experiment

1. Define patient groups, labels, and an untouched test partition before preprocessing or aug-mentation.
2. Select a documented pretrained checkpoint. Replace its output head and establish a frozen- encoder baseline.
3. Use training-only augmentation. Choose learning rates and stopping rules on validation data.
4. Compare partial and full fine-tuning under the same data partitions and a stated tuning budget. Record normalization-layer behavior.
5. Select the final configuration without inspecting test outcomes. Evaluate once, then report uncertainty and failure cases.

Wound application. Anisuzzaman and colleagues adapted pretrained image features for wound classification; Niri and colleagues used pretrained encoders in wound segmentation.[14, 137] These applications reuse representations for different outputs. Sections 7.4 and 5.16 develop the classification and segmentation settings, respectively.

4.3.4 Negative transfer and shortcuts

Transfer is negative when reuse worsens the relevant target outcome relative to an appropriate baseline. To detect it, compare against a model trained from scratch and a simpler frozen representation, allowing each a reasonable, documented tuning budget. A poorly tuned scratch model is weak evidence of a universal transfer advantage. Learning curves over several training-set sizes can reveal whether pretraining primarily helps data efficiency or the attainable performance under the available budget.

A source representation may encode irrelevant backgrounds, instruments, or source-specific color statistics. In wound data, anatomical site can be informative but also highly correlated with labels. A classifier that recognizes “foot” may appear successful at recognizing diabetic ulcers while failing on the intended clinical distinction. Crop-only, context-only, and image-plus-location ablations

help separate these possibilities. External-site evaluation then tests whether the learned relation survives a change in acquisition practice.

4.4 CNN architectures

CNN architectures became useful reusable encoders through a sequence of attempts to improve visual representation, optimization, and computational efficiency. Understanding that sequence explains why these families remain common starting points for wound studies. We first connect their original recognition results to the problems they addressed, then examine receptive fields, information flow, and resource use. Wound-specific evidence is evaluated separately in Section 4.9; a historical benchmark achievement establishes architectural motivation, while the target wound task determines clinical relevance.

4.4.1 VGG: depth and small kernels

From successful recognition to reusable representations. AlexNet’s 2012 Im- ageNet work demonstrated a strong recognition result using a deep CNN, rectified activations, GPU computation, and regularization. The lesson was that learned hierarchical features, supported by an effective training recipe, could compete strongly with earlier recognition pipelines. Its published results belong to the stated ImageNet settings; they are not wound-diagnosis accuracies.[138]

VGG then investigated depth systematically through repeated small filters. Its 2014 challenge entry placed second in classification and first in localization, and its authors also tested transfer of the learned representations to other datasets. GoogLeNet’s Inception design pursued depth and multi-scale computation with economical branches and won the 2014 classification challenge. These achieve-ments helped make a pretrained visual encoder a practical research starting point. Their different tracks and evaluation settings should not be collapsed into one interchangeable score.[139, 140]

Residual and dense networks next addressed how information and gradients travel through increasing depth. MobileNet, EfficientNet, and later modernized CNNs placed additional emphasis on the relationship between representation and cost. The result for wound research is a set of useful design alternatives: a regular reference encoder, a multi-branch encoder, a network with short information paths, or a compact deployment candidate. Historical success explains why a family deserves consideration; a controlled wound experiment determines whether it is suitable. The following subsections unpack these choices rather than treating network names as a ranking. VGG uses repeated small convolutional kernels to build depth with a regular structure. VGG-11, VGG-13, VGG-16, and VGG-19 designate configurations with different numbers of weight layers, including the original fully connected layers. They are not four different clinical systems. Their simplicity makes them useful for teaching and as reproducible reference encoders, although the original dense classifier is expensive.[139]

Figure 4.6 distinguishes depth from spatial resolution. Each stage applies several convolutions at a fixed resolution; its pooling operation then halves the side length in this standard configuration. VGG-19 adds convolutions in stages 3-5, rather than adding three more pooling stages. Starting from 224 pixels per side, the five pools give 224/2[5] = 7, while the final channel count is 512. In the lower panel, Equation (4.2) therefore uses h = w = 7 and d = 512: GAP produces 512 features, and a four-class wound head has 512(4) + 4 = 2052 parameters. This count excludes the encoder. The adapted head replaces the original three dense layers and must be reported as such. The 7-by-7 grid describes feature-map resolution, not a seven-pixel wound or a physical wound size.

For stride-one convolutions without dilation, L consecutive 3x3 kernels have theoretical receptive-field side length

Illustrations are not included in the reading sample

Thus two layers cover a 5x5 neighborhood and three cover a 7x7 neighborhood.

With equal input, hidden, and output channel count C, and excluding biases, two

small kernels use 18C[2] weights compared with 25C[2] for one 5x5 kernel: a

reduction of 28%. Three small kernels use 27C[2] compared with 49C[2] for one

Illustrations are not included in the reading sample

Figure 4.6. VGG-16 and VGG-19 convolutional stage counts for a 224-by-224 input, with standard stride-two pooling. Spatial dimensions shown are after each pool. The GAP head is an explicitly illustrated adaptation, not the original VGG classifier.

7x7 kernel: a reduction of approximately 44.9%. These are different comparisons. Channel changes, grouping, and biases alter the calculation.

Intervening nonlinearities make the stacked network more expressive than a single linear convolution with the same theoretical field. They also mean that the two operations are not numerically equivalent. The effective receptive field, describing which pixels strongly influence a prediction, depends on learned weights and input as well as topology. A large theoretical field alone does not establish use of clinically meaningful context.

For layers with kernel side /j, stride sz, and dilation dz, track both the receptive field rz and input-space jump j:

Illustrations are not included in the reading sample

For a 3x3 stride-one convolution, 2x2 stride-two pooling, and another 3x3 convolution, (r, j) progresses from (3,1) to (4,2) to (8, 2). The third layer covers

an 8x8 input region. This calculation helps choose a crop size that preserves enough context around a wound.

The shaded squares in Figure 4.7 are the input positions that can influence one output location after one, two, or three small-kernel layers. They implement rL = 3,5,7 from Equation (4.7), with no intervening pooling; they are not featuremap sizes. The counts below compare each stack with a single larger kernel covering the same theoretical region. In a wound crop, a wider region can include both a local texture and adjacent skin, but whether the network uses either cue depends on learning. Use Equation (4.8) when downsampling is present, and remember that pixels correspond to different physical areas when camera distance or resizing changes.

Illustrations are not included in the reading sample

Figure 4.7. Stacking small kernels increases the receptive field. The parameter comparison assumes constant channel width, stride one, no dilation, and no biases.

Wound application. Anisuzzaman and colleagues evaluated VGG16 and VGG19 image branches for wound categories and combined them with location en- coders.[14] The VGG features were inputs to a wound classifier rather than a direct wound measurement. Section 7.4 develops the image-location application.

4.4.2 Inception and Xception

An Inception block processes the same input through parallel branches and con-catenates the outputs. Small and larger spatial supports can therefore coexist at one stage. A 1x1 bottleneck reduces channel width before an expensive spatial convolution. GoogLeNet is the original Inception network; Inception-v3 and Inception-ResNet variants modify the design. Inception-ResNet combines multi-branch transformations with residual connections. The later paper titled Inception Transformer is a different model and should not be used as the original GoogLeNet reference.[140, 141]

To see the bottleneck saving, compare a 5x5 convolution from C to M channels with a 1x1 reduction to B channels followed by 5x5 processing. The parameter counts are 25CM and CB + 25BM. For C = M = 128 and B = 32, these become 409600 and 106496. The bottleneck saves about 74% of these weights, at the cost of constraining the intermediate representation. This arithmetic does not include the other Inception branches.

Xception emphasizes depthwise separable convolution: spatial processing is performed separately within channels, followed by pointwise channel mixing. It is related to the idea of separating spatial and cross-channel correlations, but is not simply an Inception block with renamed branches. The order of operations and placement of nonlinearities matter.[142] For wound images, multi-scale or separable processing can be tested for recognition of boundaries, texture, and broader surrounding skin; those interpretations should be checked through ablation rather than inferred from the architecture name.

Wound application. Anisuzzaman and colleagues evaluated InceptionV3 image features for wound classification; the GMRNN author preprint paired Xception features with a location-processing branch.[14, 143] These document specific variants and roles. Section 7.4 develops these applications; Table 7.6 records the GMRNN evidence boundary.

4.4.3 ResNet and DenseNet

Why making a plain network deeper was not enough. Greater depth can represent more complicated transformations, but it also changes the optimization

problem. The ResNet study observed that deeper plain networks could have higher training error than shallower counterparts. This degradation differs from ordinary overfitting: overfitting would concern poor held-out performance despite successful fitting of the training data. If added layers could simply preserve the shallower solution through identity mappings, increased depth would not inherently require worse training error; finding that solution with the chosen parameterization and optimizer was the difficulty.[144]

Residual learning changes the parameterization of the desired mapping. Instead of asking a block to learn the whole transformation H(x) directly, it learns a correction F(x) = H(x) — x and adds the input back. If preserving the input is useful, the residual branch can approach zero. This made substantially deeper networks easier to optimize in the original experiments: the paper studied a 152- layer ImageNet network and reported a winning 2015 classification ensemble with 3.57% top-five error. This is an ensemble ImageNet test result, not the accuracy of a single ResNet or a wound model.[144]

What changes during backpropagation. The chain rule and the backpropagation algorithm from Chapter 2 remain the same. What changes is the computation graph: an additive shortcut provides an additional route from the loss toward earlier representations. The following equation states the ideal additive block before any post-addition nonlinearity. A residual block adds a learned transformation to a

shortcut:

The identity term provides a direct path for signals and gradients. This supports optimization of deep networks; it does not eliminate every vanishing-gradient problem or guarantee convergence. Addition requires matching shapes. A pro-jection shortcut is needed when spatial size or channel count changes. ResNet-50 commonly uses bottleneck blocks that compress channels, process them spatially, and expand them again.[144]

Let g/+i = V,.r|Z’ be a column gradient and dj = dFz/dxz. Applying the chain rule to Equation (4.9) gives

Illustrations are not included in the reading sample

A corresponding plain block xz+1 = Fz (xz) supplies only dj? dz+1 • Across many blocks, gradients involve products of these Jacobians; the additive identity creates paths that do not all require multiplication through every learned residual branch. This explains a mechanism for easier signal propagation. It does not give a positive lower bound on the gradient: a residual derivative can oppose the identity, and other paths can amplify or suppress the result.[145]

For an original scalar teaching example, take two linear blocks, each with derivative Fz' = 0.1, and an incoming loss gradient of 1 at the output. A two-block plain path gives 0.1[2] = 0.01 at its input. Two ideal additive residual blocks give (1 + 0.1)[2] = 1.21. These are local derivatives of two specified functions, not measured training behavior. If instead Fz' = —1, the ideal residual derivative is zero; a shortcut is therefore not a guarantee against vanishing gradients.

The placement of activations matters. If Xz+1 = ReLU(xz + Fz(xz)), the backward expression becomes (I + 7^)?¿dd-i, where Pz contains the postaddition activation derivatives. The ideal identity path is then gated as well. The 2016 identity-mapping analysis motivated pre-activation residual units that move normalization and activation before the learned weight layers, leaving an identity route after addition. For a linear projection shortcut /'.Q, replace I by Fz and use (Fz + dj )Tdz+1. These distinctions prevent the simplified additive equation from being mistaken for every ResNet implementation.[145]

A ResNet bottleneck uses a 1x1 convolution to reduce channel width, a 3x3 convolution for spatial processing, and a 1x1 convolution to restore or expand channels. This allocates most spatial work to a narrower representation. A projection matches dimensions when necessary; it does not perform clinical feature selection. For wound adaptation, these blocks provide a trainable visual representation, while Section 4.3 still determines which stages may change and how success is assessed.

DenseNet instead concatenates earlier features within a dense block:

Illustrations are not included in the reading sample

If each layer contributes k channels, called the growth rate, a block beginning with Co channels has Co + Lk channels after L layers. For Co = 64, k = 32, and L = 6, this is 256. Concatenation preserves feature channels explicitly, while residual addition combines them in a shared channel space. Dense connectivity can be parameter-efficient but creates activation-storage and memory-traffic demands.[146]

Dense connections also change backpropagation paths. An earlier feature map is an input to several later transformations, so its loss gradient sums contributions from those uses. Concatenation routes the appropriate channel slice back to each contributing feature map; it does not add all earlier feature values into one tensor of unchanged width. This can encourage feature reuse and shorter routes for supervision, while the growing set of stored activations creates a separate resource cost. DenseNet’s original object-recognition evidence supports these architectural motivations, rather than a universal wound-classification advantage.[146]

For wound models, easier optimization and useful clinical discrimination are separate achievements. A residual or dense encoder may train reliably while learning a camera, dressing, or anatomical shortcut. Compare its wound-class errors and external performance as carefully as its training loss. The segmentation application below demonstrates encoder reuse for a mask; it must not be read as evidence that the same backbone necessarily improves etiological classification.

This distinction matters when a model must run on a portable device. Counting only trainable weights misses the memory occupied by intermediate tensors. A model with fewer weights can still have an unfavorable latency or memory profile. In wound experiments, residual and dense encoders are useful comparison points because they test different ways of preserving and reusing visual information under otherwise matched training conditions.

Figure 4.8 makes the combining operations explicit. On the left, the same input enters two illustrative Inception branches; concatenation keeps their output

channels side by side and requires matching spatial sizes. This is a simplified block, not the complete original branch list. In the middle, the bypass carries Xi directly to the plus node of Equation (4.9); addition requires corresponding elements to have matching shapes. On the right, H2 receives [X0 ,XX], the I = 2 case of Equation (4.11), rather than their sum. For a wound classifier these paths provide different ways to combine local and contextual responses before the final head. They do not designate particular branches as tissue detectors, nor does any arrow imply a clinical accuracy gain.

ResNet DenseNet

Wound application. Niri and colleagues evaluated ResNet50 and DenseNet as encoder backbones within U-Net wound-segmentation models.[137] Their role was feature extraction for a spatial mask, rather than standalone wound-type prediction. Section 5.16 develops the study and distinguishes encoder comparisons from comparisons of complete clinical tasks.

4.4.4 MobileNet variants

A standard kxk convolution with Cin input and Cout output channels uses ' Cout

weights. A depthwise convolution followed by a pointwise convolution uses

Illustrations are not included in the reading sample

This comparison excludes biases and normalization. At each output spatial position, the corresponding multiply-accumulate (MAC) counts have the same form. For k = 3, Cin = 32, and Cout = 64, the counts are 2336 versus 18432, or approximately 12.7% of the standard-convolution cost. Depthwise separability changes the representational constraint as well as the arithmetic cost.

MobileNet-v1 builds on this separation and uses width and resolution multipliers. MobileNet-v2 introduces an inverted residual block: a narrow representation is expanded, processed by depthwise convolution, and projected back through a linear bottleneck. The shortcut, when valid, joins narrow representations. MobileNet-v3 adds hardware-aware design choices, including attention and activation-function changes. These variants should be named precisely; Thin MobileNet is a later modification and is not the founding MobileNet paper.[147-149]

MobileNet-v4 extends the family with a universal inverted bottleneck and mobile multi-query attention in hybrid variants. Its design addresses multiple mobile processors rather than assuming that one operation has equal efficiency everywhere.[150] The 2025 Gemma 3n developer documentation also describes MobileNet-v5 as a vision encoder. That is a current architecture development, but its role and scale in a multimodal model do not establish that it is the smallest or most suitable wound classifier.[151]

For mobile wound imaging, measure latency on the intended hardware at the actual input resolution and batch size one. State the runtime, precision, thread settings, and whether timing includes image decoding and preprocessing. A reduction in theoretical MACs can be offset by memory access, unsupported kernels,

or conversion overhead. “Mobile” in a model name is a design intention, not a deployment measurement.

In Figure 4.9, the 32 input channels are intermediate learned features, not 32 camera color channels. With depth multiplier one, the first block applies one spatial filter per channel and retains 32 maps. The second block mixes those maps at each location to produce 64 outputs. The two boxes account for the two terms in Equation (4.12): 288 + 2048 = 2336 weights. Multiplying these per-location MAC counts by the number of output locations gives the corresponding layer arithmetic cost. For a phone-based wound classifier, this factorization offers a smaller convolutional component to test; it neither removes the need for a class head nor establishes acceptable runtime or preservation of subtle visual cues.

Illustrations are not included in the reading sample

Figure 4.9. Depthwise separable convolution factors spatial filtering and channel mixing. The arithmetic example uses a 3x3 kernel, 32 input channels, and 64 output channels, excluding biases and normalization.

Wound application. Wang and colleagues used MobileNetV2 as the encoder of a foot-ulcer segmentation system and combined its features with a decoder and mask postprocessing.[35] The published application concerns this particular MobileNet variant. Section 5.10 develops lightweight segmentation, and Section 5.16 supplies further wound examples.

4.4.5 NASNet and EfficientNet

NASNet uses architecture search to identify reusable cells, then transfers those cells

to larger networks and datasets. Its relevance is the distinction between learning

model weights and searching the structure that contains them. Search cost is part of the development process. A comparison that reports only final training cost should state whether a publicly available searched architecture was reused.[152]

EfficientNet couples a searched baseline with compound scaling. In an idealized convolutional model, compute grows approximately as depth times squared width times squared resolution. With

Illustrations are not included in the reading sample

an increment in / approximately doubles compute. The approximation ignores details such as channel rounding and operations that scale differently.[153] For an illustrative choice a = 1.2, fi = 1.1, and 7 = 1.15, the factor is 1.9203, not exactly two. Increasing only resolution may preserve finer detail but also increase activation memory; increasing only depth cannot recover input detail lost by downsampling.

EfficientNetV2 revisits the block mixture and training process, including fused mobile inverted bottleneck blocks and progressive learning. Fusing early operations may improve actual training speed despite increasing arithmetic in some blocks.[154] For a wound study, the useful question is whether the improved tradeoff survives the target image size, available memory, and label count. A larger member of the family should not be assumed better when it forces a smaller batch, less stable optimization, or destructive image resizing.

Wound application. Liu and colleagues used EfficientNet models for separate ischemia and infection classification tasks in diabetic-foot-ulcer photographs.[155] These targets differ from classifying wound etiology or outlining a wound. Section 4.9 develops the study, while Section 6.3 connects clinical findings to appropriate reference labels.

4.4.6 ConvNeXt and ConvNeXt V2

ConvNeXt updates a convolutional hierarchy using design choices associated with contemporary vision models, including large depthwise kernels, inverted bottlenecks, and revised normalization and activation placement. It remains a convolutional architecture rather than becoming a transformer merely because its design was informed by transformer comparisons.[156]

ConvNeXt V2 combines fully convolutional masked-autoencoder pretrain-ing with an architectural change called global response normalization (GRN). Its purpose is to improve feature behavior in that training setting.[157] To un-derstand the operation, let X E ^HxWxC and define a response magnitude Gc = (Xh>w Xhwc)R[2]. A normalized response is \ = Gc/{C~r ^. Gj + e). A channel-wise residual modulation has the form

Illustrations are not included in the reading sample

The learned coefficients allow the model to regulate relative channel responses. This equation describes the operation; it is not evidence of improved wound recognition. Contemporary wound evidence for a ConvNeXt-B encoder is discussed in Section 4.9.

Wound application. Busch and colleagues used ConvNeXt-B for chronic-leg-wound classification; Brehmer and colleagues evaluated ConvNeXtV2 for pressureulcer and dermatitis classification.[50, 158] These are distinct variants and clinical targets. Sections 4.9 and 7.4 develop the studies and their evaluation settings.

4.5 Encoder extensions

The preceding families change how an encoder computes visual features and how its gradients propagate. A wound study can nevertheless remain limited by what the training images reveal and what the available labels can teach. A close crop may omit anatomical location; a small labelled cohort may not constrain a large encoder; local texture may need interpretation alongside wider image context. This section

connects those remaining problems to four design choices: reweighting features with attention, learning from unlabelled images, adding recorded location, and combining convolution with token interaction. The choices act at different points in the pipeline and can be used separately or together. For each, ask what information or learning signal is added and what matched comparison would demonstrate its contribution.

4.5.1 Channel and spatial attention

An attention module reweights features according to the current input. For example, squeeze-and-excitation (SE) first summarizes each channel by global averaging, then computes gates:

Illustrations are not included in the reading sample

The sigmoid a is applied componentwise. SE therefore changes channel amplitudes without explicitly assigning a class label to each channel.[159] Spatial attention instead weights locations, and modules such as CBAM combine channel and spatial reweighting. In a wound model, these mechanisms may help emphasize useful regions, but the gates can also reinforce a background shortcut. Their presence is not proof of clinical interpretability.

The appropriate experiment holds the backbone, input size, augmentation, and training budget fixed, then adds the module. Report the resulting change in classwise performance, calibration, parameters, and latency. If several components change together, the overall system can be compared, but the gain cannot be attributed uniquely to attention.

Wound application. Patel and colleagues incorporated channel and spatial squeeze-and-excitation, axial attention and a gated metadata branch in wound clas- sification.[160] The attention operations were components of an image-location model. Section 7.4 develops feature fusion, and Section 5.9 follows spatial attention in wound segmentation.

4.5.2 Self-supervised pretraining

Obtaining another photograph and obtaining another reliable clinical annotation are different tasks. Self-supervised pretraining uses the former without requiring the latter for every pretraining image. A wound encoder can first learn regularities of local appearance and spatial structure, then use a smaller labelled development cohort to learn the specified wound categories. This makes self-supervision relevant to limited-data wound studies, while leaving the target-label definition, patient independence, and final evaluation essential. It also connects directly to transfer: self-supervision describes how a representation is learned, and transfer describes how that representation is reused.

Azizi and colleagues studied self-supervised pretraining followed by supervised adaptation for dermatology photographs and chest radiographs. Their domainspecific unlabelled pretraining and multi-image positive pairing provide medical evidence for this strategy; those tasks are not wound-type classification. A wound-specific example appears below, with its own protocol limitations.[161] An unlabelled image can contribute to representation learning without supplying the clinical answer that the final classifier must learn. Self-supervised learning creates a training signal from the data rather than requiring a manual class label for every example. In a contrastive approach, two transformations of the same image form a positive pair. A normalized temperature-scaled contrastive objective for an anchor i and positive partner j is

Illustrations are not included in the reading sample

In the usual two-view batch, the denominator includes the positive partner as well as other views. SimCLR studies this approach with augmented views and a projection head.[162] The projection space used for pretraining need not be the final classifier input.

For a wound photograph, the positive-pair decision says that the two views should retain the information of interest. A pair consisting of the wound and

an accidentally wound-free crop may teach an inappropriate invariance. Images from different visits can also differ in clinically meaningful ways; shared patient identity alone does not prove they should be forced to the same representation. Use repeated views only under a declared pairing rule. The loss provides a computational training signal, not a diagnosis or a guarantee that medically relevant differences are preserved.

The choice of augmentation defines which changes the representation is en-couraged to ignore. Strong color changes may be suitable for some natural-image tasks but can erase cues of interest in wound appearance. Cropping can remove the wound entirely or convert a labeled wound image into a background patch. Therefore, inspect actual transformed examples and evaluate augmentation choices. When repeated images from one patient occur in a batch, treating them as unrelated negatives can also conflict with their clinical similarity.

Masked autoencoders use a different signal: reconstruct hidden image content from visible regions. A simple masked-pixel objective is

Illustrations are not included in the reading sample

where M is a nonempty set of masked patches and the vector xu represents a patch.[29] Reconstruction encourages representation learning but can emphasize nuisance appearance as well as useful structure. A masked reconstruction objective and a diagnostic objective are not interchangeable. Unlabeled images used for pretraining should be inventoried so that inadvertent inclusion of evaluation patients is visible.

For wound analysis, hidden patches might contain tissue texture, a boundary, surrounding skin, or a measurement ruler. Reconstructing them can teach spatial organization, but the objective does not distinguish the diagnostically useful content from an acquisition artifact. A low reconstruction error must therefore be followed by a labelled wound evaluation. Contrastive and reconstruction objectives are alternative ways to learn an initial representation; neither replaces the downstream reference standard.

Partition patients before constructing the unlabelled pretraining pool. For an untouched new-patient evaluation, pretrain only with permitted development patients or an independently documented external source; do not silently include evaluation patients because their labels were hidden. If target test images are used without labels, describe the evaluation as transductive and compare it under that same access condition. Test the value of self-supervision with matched random-initialization, supervised-pretraining, and self-supervised-pretraining conditions, followed by the same downstream adaptation and tuning budget. Learning curves over labelled patient counts expose data efficiency more clearly than a single final score.

Wound application. The severity-aware CNN-Transformer study reports Sim- CLR initialization before supervised wound-category and severity learning. Its protocol descriptions require qualification: one subsection describes pretraining on training-corpus images, while another specifies all 24,925 corpus images, ex-ceeding the stated supervised training partition. The exact exposure of held-out images during pretraining is therefore unresolved from those descriptions. Treat it as a reported wound application, not as unambiguous proof of leakage-free label efficiency or a causal gain from self-supervision alone.[135] Section 6.7 develops pretraining routes; Section 4.9 discusses this wound-triage study and its evaluation limits.

4.5.3 Image and location fusion

A multimodal classifier can combine pooled image features zx = GAP(F^(x)) G ^dx with an encoding zm = (fl. (m) G xd'" of anatomical location or other permitted information. This notation preserves the distinction between the spatial encoder output and its vector summary in Equation (4.2). A simple feature-level fusion classifier is

Illustrations are not included in the reading sample

Here the branches meet before one class head; probability-level late fusion instead combines the outputs of separate class heads, as in Equation (7.7). Concatenation is not the only option: gated fusion can vary each modality’s contribution, and separate branches can be combined at the score level. The baseline should include image- only, metadata-only, and fused models. A metadata-only model is particularly informative when wound type is strongly associated with body location. Published wound studies have investigated image/location fusion, but its benefit remains conditional on the population and labeling scheme.[14, 160]

Missing metadata must be handled explicitly. A missing-value indicator, a learned missing token, or modality dropout during training can be tested, but none should silently encode an unknown location as a common anatomical site. If the user workflow sometimes omits location, evaluate that condition directly. Also test whether the model remains useful when the training association between location and class changes.

Figure 4.10 separates the two information paths in Equation (4.18). The image branch supplies zx, the location branch supplies zm, and the fusion box concatenates them into a vector of length dx + dm. Consequently, A has K rows and dx + dm columns; the classifier produces scores for the same K wound classes used by the image-only baseline. The anatomical marker represents recorded metadata, not a location inferred from the drawing. In this illustrated design, m includes a missingness flag so that G!X can encode an unavailable location explicitly. A location-only baseline reveals how much classification is possible without the photograph. Compare all three input conditions under identical patient partitions, then test missing location and changes in the location-class association.

Wound application. Patel and colleagues combined wound-image features with anatomical-location information using an adaptive gated MLP.[160] The location branch contributes clinical context to the category decision rather than replacing image analysis. Section 7.4 develops concatenation and gating, while Section 7.3 addresses paired image-metadata records.

Figure 4.10. Image/location fusion with an explicit missing-metadata path. The wound and body outline are original schematic illustrations. The diagram describes information flow and required ablations, not a validated clinical system.

4.5.4 CNN-Transformer hybrids

Hybrid networks use convolution for local feature extraction and attention to exchange information across positions. For tokens collected in a matrix Z, scaled dot-product attention is

Illustrations are not included in the reading sample

Softmax acts across the key positions for each query. Dense attention forms a token-by-token matrix, so windowing or token reduction can be useful when spatial resolution is high. This mechanism differs from channel gating and from capsule routing, even though all three use input-dependent weights.

Recent wound work includes a 2026 severity-aware framework combining selfsupervised pretraining, an EfficientNet encoder, transformer fusion, and multiple output heads, and a 2026 multi-scale graph-transformer classifier.[135, 163] These publications extend the range of available designs; their complex pipelines also increase the need for component ablations and transparent label harmonization. They do not establish that adding every available module improves a given dataset. Within this chapter, hybrids are considered extensions of the representation problem, while the main mathematical comparison remains between CNN encoders and capsule-based aggregation.

Wound application. Maurya and Mirza combined a convolutional branch with a multiscale Transformer branch in MCTFWC for wound-image classification.[164] Their application uses complementary representations within one classifier. Section 6.10 develops this wound-specific hybrid and Section 6.16 explains its evaluation conditions.

4.6 Capsule representations and routing

The spatial-aggregation examples earlier in the chapter motivate examining another way to represent and combine visual features. This section introduces capsule vectors, then distinguishes invariance from equivariance before developing votes, coupling weights, and routing updates. A worked routing calculation makes those operations concrete. The final subsections connect the representation to losses and computational cost so that a capsule classifier can be compared as a complete system.

4.6.1 Vector feature representations

A conventional scalar activation indicates the strength of a learned feature. A capsule groups several outputs into a vector or matrix intended to represent both the presence and properties of a feature. The properties may include pose or other variation that helps relate a local pattern to a larger structure. This is a representational hypothesis: the coordinates are learned and do not automatically correspond to named clinical quantities.

The vector-capsule model associated with dynamic routing uses vector length as an activation score and vector direction to carry additional information. Matrixcapsule models separate a pose matrix from an activation value. These are distinct constructions. The 2017 dynamic-routing paper should be cited for its particular mechanism, rather than treating that year as the origin of every capsule idea.[165, 166]

For wound images, a possible motivation is to represent the arrangement of local texture, edges, and surrounding skin. However, wounds are deformable and their visual parts may not follow the rigid geometry of a face or manufactured object. Whether capsule representations help depends on the task and data. They do not inherently solve small sample size, class imbalance, or domain shift.

Wound application. Odame and colleagues evaluated FixCaps for classifying diabetic, pressure, surgical and venous wound photographs.[94] This gives capsulebased feature aggregation a published wound-category application. Section 4.9 develops the study and separates its capsule experiment from the paper’s other classification branches.

4.6.2 Invariance and equivariance

Let Tg transform an input image, for example by an allowed rotation. A representation F is equivariant to that transformation if

Illustrations are not included in the reading sample

where Sg is the corresponding transformation in representation space. A classifier h is invariant if

Illustrations are not included in the reading sample

The transformations on the two spaces need not be identical. Writing the same word “transform” on both sides without defining its action conceals this distinction.

A representation can change predictably under rotation while the final class stays fixed. For example, rotating a schematic oval changes its orientation vector but need not change its category. In wound imaging, the chosen transformation 194

must preserve the intended label and acquisition meaning. A horizontal reflection can alter laterality; a large perspective change can obscure a boundary; a color transform can change the appearance of tissue. Therefore, neither invariance nor augmentation should be imposed without considering the target.

Capsule routing is motivated by consistent part-to-whole predictions, but the standard dynamic-routing algorithm does not prove exact equivariance to arbitrary affine transformations. Likewise, ordinary CNNs are not incapable of representing geometry. The useful comparison is empirical: evaluate controlled transformations and external acquisition conditions, then determine which model retains the desired behavior.

In Figure 4.11, the lower oval is Tgx, a rotated version of the upper input. The two arrows represent F(x) and F(Fgx): their predictable rotation illustrates Sg in Equation (4.20). The unchanged “oval” labels illustrate Equation (4.21), where h denotes the complete classifier, including its representation. For woundtype classification, a label-preserving camera rotation motivates a stable class prediction even if orientation-sensitive features change. The diagram states the desired relationship; it does not show that a trained CNN or capsule model satisfies it. Test that relationship on permitted transformations and report class errors, rather than treating the drawing as a robustness result.

TgX

Representation changes predictably: equivariance.

Final category stays fixed: invariance.

Figure 4.11. Equivariance preserves a predictable change in representation; invariance preserves the final label. The oval and orientation arrow are mathematical teaching objects, not wound measurements.

4.6.3 Votes, couplings, and the squash function

Suppose a layer has I lower-level capsules u{ E R%n and J candidate parent capsules. A learned transformation produces a vote for each parent:

Illustrations are not included in the reading sample

The lower-level vector is indexed by i, not by the proposed parent j. For din = 8 and dout = 16, each unshared transformation contains 128 weights. A vote predicts the parent’s representation; it is not itself a probability.

Nonnegative coupling coefficients cig distribute each child capsule’s contribution among parents:

Illustrations are not included in the reading sample

The normalization is across parents for a fixed child; the weighted sum is across children for a fixed parent. Confusing these indices changes the algorithm. Agreement occurs when several votes point toward a compatible parent representation, increasing the magnitude of their combined evidence.

The standard squash nonlinearity preserves direction while bounding length:

Illustrations are not included in the reading sample

For r = ||sj|, the output norm is r[2]/(l + r[2]). Small inputs have approximately squared norm, while large inputs approach unit norm. The definition at zero avoids division by zero. A numerical implementation may use an (-stabilized norm, whose exact convention should be documented.

The derivative of the output norm with respect to r is 2r/(l + r[2])[2]. This becomes small near zero and for large r, illustrating the saturating behavior. A capsule length is a bounded activation score; boundedness alone does not make it a calibrated probability. Furthermore, lengths of different class capsules need not sum to one.

Follow Figure 4.12 from each child on the left to both candidate parents. Equation (4.22) gives different votes from the same ui because Wi1 and Wi2 differ. For parent 1, Equation (4.23) forms s1 = c11W11u1 + c21W21u2; Equation (4.24) then gives v1, and the lower path repeats the computation for parent 2. In a wound classifier, child vectors could be produced from spatial CNN features, while final parent capsules can be assigned to the defined wound classes. For a mutually exclusive task, one possible decision is y = argmaxfc \\vk\\, trained with Equation (4.29) below. Intermediate parents need not be classes, and neither a vote nor a coupling is itself a wound-class probability.

Illustrations are not included in the reading sample

Update routing logits using vote-output agreement. Normalize each child’s couplings across candidate parents.

Illustrations are not included in the reading sample

Figure 4.12. A capsule layer transforms child vectors into parent-specific votes, forms weighted sums, and squashes their lengths. Couplings vary by input; learned transformation matrices are shared across examples according to the architecture.

The geometry in Figure 4.13 makes two different operations visible. The equallength vectors in panel A are abstract coordinate examples, not outputs of the bounded squash function. Their different directions can produce different parent votes through Equation (4.22), even though a scalar length alone cannot distinguish them. Panel B evaluates Equation (4.24): for s = (2,1), the squared norm is 5, giving v = (5/6)(2, 1)/A/5. The input and output arrows use the same scale. In wound classification, this separates two quantities that must not be conflated: a vector’s learned configuration and a final class capsule’s activation strength. Neither coordinate axes nor arrow length automatically measure wound orientation, area, or severity.

Illustrations are not included in the reading sample

Figure 4.13. Vector direction, vector length, and squash. The top vectors have equal norms and different directions. Below, squash maps an input of length approximately 2.236 to an output of length approximately 0.833 along the same direction.

4.6.4 Dynamic routing by agreement

Dynamic routing iteratively adjusts the coupling coefficients for the current example. Initialize routing logits 6iy- = 0 in the standard formulation and compute

Illustrations are not included in the reading sample

The dot product rewards directional agreement and is also affected by vector magnitude. Repeating the weighted-sum, squash, and agreement steps reallocates a child’s contribution among potential parents. The update is additive: replacing 6iy- by only the latest agreement discards the accumulated routing evidence and defines a different procedure.[165]

Algorithm: Dynamic routing for one example

1. Compute all votes U^ = Wjju,. Set b^j = 0 for this example.
2. For r = 1,... ,R:
(a) Normalize each row of b across parents using Equation (4.25).
(b) Compute Sj = ^i c^jUj^ and Vj = squash(sj) for every parent.
(c) If r < R, add Uj^Vj to each routing logit.
3. Return the final Vj after the last pass.

Skipping the final logit update is harmless because those logits are not used again. Three iterations are a common experimental choice, not a mathematical requirement. Routing logits are recomputed for each example; carrying their final values from one unrelated image to the next would change the model.

Backpropagation remains necessary to learn W^ and the preceding feature extractor. Routing is an input-dependent computation inside the forward model, not a replacement for gradient-based learning. Implementations may differ in whether gradients pass through intermediate routing updates; such choices affect training and must be reported when reproducing a result.

Wound application. Odame and colleagues configured dynamic routing in the digit-capsule layer of their FixCaps wound classifier.[94] Routing was therefore a component of the category-prediction model, rather than a separate wound diagnosis. Section 4.9 develops the corresponding experiment and its reported evaluation boundaries.

4.6.5 Worked routing example

Consider four two-dimensional votes, chosen only for instruction:

Illustrations are not included in the reading sample

Initially every coupling is 0.5. Therefore s1 = (0.9,0.1) and s2 = (0.05,0.25). Their squared norms are 0.82 and 0.065, so the first output lengths are 0.82/1.82 « 0.45055 and 0.065/1.065 « 0.06103. The first parent receives stronger mutually consistent votes.

The first output vectors are approximately v1 = (0.44779,0.04975) and r2 = (0.01197,0.05985). For child 1, the agreement scores are 0.44779 and 0.01197. Its next coupling to parent 1 is consequently e0.44779

Illustrations are not included in the reading sample

The complete calculation gives Table 4.2. It shows routing becoming more decisive for these votes. It does not show improved classification accuracy, since no clinical dataset or learned model is involved.

Table 4.2. Worked numerical routing example. Each child’s coupling to parent 2 is one minus its displayed coupling to parent 1.

Illustrations are not included in the reading sample

Figure 4.14 shows the routing couplings computed from the votes in Equa-tion (4.27), matching Table 4.2. Read a row as one child’s allocation across candidate parents; it sums to one under Equation (4.25). A column collects different children’s allocations and need not sum to one. For example, Equation (4.28) produces the upper-left 0.607 entry in iteration 2. Darker cells indicate larger couplings, not greater clinical accuracy. In the lower loop, normalization uses Equation (4.25), weighted summation and squash use Equations (4.23) and (4.24), and the return path adds agreement through Equation (4.26). For a wound-class capsule head, this loop runs within each image’s forward prediction; it is not a sequence of patients, training epochs, or healing visits. The vote matrices stay fixed during these passes and are learned separately through training.

There is no guarantee that more iterations yield better clinical predictions. If a misleading pattern produces mutually consistent votes, routing may reinforce it. It-

Routing couplings: two children and two parents

eration count is therefore a hyperparameter to assess against validation performance, stability, and inference cost.

4.6.6 Classification and reconstruction losses

For a class capsule A, a margin loss can encourage a large length for a present class and a small length for an absent class:

Illustrations are not included in the reading sample

where Tk G {0,1} and 0 < m- < m+ < 1. The commonly used choices m+ = 0.9, m- = 0.1, and A = 0.5 belong to a particular formulation and should not be interpreted as clinical thresholds.[165] If a true-class length is 0.8 and an absent-class length is 0.2, their contributions are 0.01 and 0.005, respectively.

A decoder can reconstruct the input from selected capsule outputs, producing an auxiliary term p||x - x||2. If the implementation uses mean squared error rather than a sum over pixels, the effective scale differs by the number of reconstructed values. Report both the reduction and 9. During training, reconstruction may use the reference-label class capsule; during inference, any analogous selection must use available information rather than the unknown label.

Reconstruction can encourage retention of appearance information, but it can also retain irrelevant background and illumination. A reconstruction that looks plausible is not a diagnostic explanation. Test whether the auxiliary objective improves the intended classification measure and whether its effect survives changes in acquisition conditions.

4.6.7 Parameters, memory, and routing cost

With fully connected, unshared vote transformations, the capsule layer has IJdindout transformation weights. For I = 32, J = 4, din = 8, and dout = 16, this is 16384 weights. Spatial or type-wise sharing changes this count and should be stated. A capsule layer is therefore not automatically smaller than a dense or convolutional alternative.

For batch size B, forming votes costs on the order of BIJdindout multiply- accumulates. Routing adds terms on the order of RBIJdout, plus normalization and squash operations. Stored votes occupy BIJdout scalar values, before gradients and other activations. Vectorized implementations can be fast, but a large number of child capsules or routing iterations can still dominate memory and latency. Resource claims must specify the actual architecture and implementation.

4.7 Capsule variants and evidence

The routing construction just developed is one capsule design. We now examine alternatives involving matrix-valued capsules, expectation-maximization routing, learned routing, attention, and pruning, followed by medical-image variants. The purpose is to identify what changes in the representation or aggregation procedure and what evidence accompanies that change. This prepares the comparison with other wound-classification approaches in the following sections.

4.7.1 Matrix capsules and EM routing

Matrix capsules use a pose matrix and a separate activation. Their votes can be grouped through expectation-maximization (EM) routing, in which assignment probabilities and parent statistics are updated iteratively.[166] To understand the statistical component, flatten a pose vote to vig E Rn and suppose rig is its current responsibility for parent j. With child activation a^, weighted Gaussian statistics have the form

Illustrations are not included in the reading sample

These equations require Zg > 0 and stabilized variances. They illustrate the weighted-statistics step, not the complete published routing algorithm, which also defines parent activation costs and its scheduling. A density-based reassignment uses compatibility with the parent distribution rather than only a vector dot product.

This variant changes both representation and routing. Comparing it with dy-namic routing therefore requires care: a performance difference may reflect pose dimensionality, activation modeling, or routing, as well as optimization. EM routing is not synonymous with an ordinary clustering procedure applied after a fixed classifier.

4.7.2 Learned routing, attention, and pruning

Self-routing capsule networks learn routing decisions without iteratively enforc-ing agreement in the usual dynamic-routing loop.[167] This can reduce iterative overhead while preserving a capsule-oriented representation. It also changes the inductive assumption: learned feedforward assignments are not the same computation as repeated agreement updates. A fair comparison reports both the routing mechanism and its parameter budget.

OrthCaps, presented in 2024, combines orthogonality, sparse attention routing, and pruning.[168] Such designs investigate redundancy and the cost of capsule interactions. Orthogonality is a geometric constraint on representations or transformations; it does not establish that features are clinically independent or interpretable. Pruning reduces selected components, but its practical value depends on whether the resulting sparsity is supported by the execution hardware.

For a wound-focused experiment, an informative sequence is a common CNN backbone with GAP, then the same backbone with a capsule head, then an alternative routing rule at a comparable budget. Additional attention or pruning should be tested separately where feasible. This isolates whether gains arise from the representation, aggregation, or simply a stronger backbone.

4.7.3 FixCaps and medical variants

FixCaps was originally proposed for skin-cancer diagnosis and combines changes to feature extraction with capsule processing.[169] Its later use in a 2025 multiwound study provides direct wound evidence, considered in Table 4.3. The original skin-lesion result and the wound adaptation are separate experiments; performance does not transfer merely because the architecture name is shared.

Recent variants include an attention-gated multidimensional CapsNet for skin cancer, AEC-CapsNet with attention and expansion-contraction mechanisms across medical-imaging datasets, and a 2026 attention-based CapsNet using a pretrained CNN for skin-cancer detection.[170-172] These are relevant architectural developments, but they do not establish effectiveness on chronic-wound etiology, ischemia, or wound-bed tissue classes. Dermoscopic lesion images and ordinary wound photographs differ in acquisition, morphology, labels, and population.

A 2025 SSRN preprint also investigates transfer-learning models and modified capsules for image/location wound classification.[173] It is included as emerging direct wound work, with its preprint status explicit. Without a fully verified evaluation protocol, it should motivate replication and careful comparison rather than a definitive ranking. The correct conclusion from the current literature is that capsule variants offer testable alternatives for structured representation; superiority in wound classification remains a study-specific empirical claim.

Wound application. Odame and colleagues used a FixCaps model in an experiment on four wound categories drawn from public image sources.[94] The wound application is separate from the original skin-cancer setting of FixCaps. Section 4.9 develops the wound experiment, and Chapter 8 connects category definitions to data preparation.

4.8 Comparing wound classifiers

The CNN and capsule families offer different mechanisms, but a mechanism alone does not decide which will help a particular wound task. We first translate architectural choices into hypotheses about information and aggregation. We then specify the controls needed to compare those hypotheses. This provides a basis for reading the wound-study evidence that follows.

4.8.1 Architectural hypotheses

Table 4.4 compares only the method families developed in this chapter. It describes mechanisms, potential advantages, and the evidence needed to use them responsibly. These advantages are conditional engineering arguments, not measured rankings. Classical classifiers were treated in Chapter 3 and remain useful baselines; they are not repeated here as if they were additional deep architectures.

The consolidated family comparison appears in the closing review (Section 4.11), after the evidence and evaluation requirements have been established.

4.8.2 Controlled comparisons

Suppose a CNN with GAP is compared with a CNN followed by capsules. If the second system also uses more pretraining data, a larger image, stronger aug-mentation, and more tuning, the experiment compares two complete pipelines. It cannot identify routing as the cause of a gain. A useful study first holds the encoder and training protocol fixed, changes the aggregation head, and then investigates additional improvements separately.

There are two legitimate resource comparisons. A fixed-protocol comparison holds data and training choices as constant as practical to isolate a component. A fixed-budget comparison allows each method to be tuned within the same compute or time budget. Report which question is being answered. An expensive model that performs best after unlimited tuning may not be the best choice for a limited annotation and deployment budget.

The experiment should also separate random variation from a consistent effect. Use the same patient partitions across models, repeat training where feasible, and report paired uncertainty for performance differences. Selecting the best seed from many runs and comparing it with a single baseline run introduces a selection advantage. For a small dataset, an apparently large point-estimate improvement can be dominated by a few difficult patients.

4.9 Evidence from wound studies

We now connect the architectural discussion to published wound research. The first subsection examines classification studies and their evaluation limits; the second separates evidence from related tasks whose outputs differ from a wound-type label. The final subsection uses those distinctions to choose a baseline. Throughout, read a reported result together with its task, data, and testing procedure.

4.9.1 Classification evidence and limits

The studies in Table 4.3 address different label spaces and datasets. The results are reported by their authors and were not independently reproduced for this chapter. A missing patient-level description is an uncertainty in the evidence, not proof that leakage occurred. Similarly, a strong internal result can justify further research without establishing clinical utility or generalization to other centers.

Table 4.3. Selected direct wound-classification evidence. Scores are not a cross-study leader-board. Data counts describe images unless explicitly stated otherwise.

Illustrations are not included in the reading sample

Two examples show why reading methods matters. The EfficientNet study describes augmenting validation and test images as well as training images.[155] Evaluation on transformed views is a legitimate robustness question, but those views do not increase the number of independent patients. A protocol should disclose their ancestry and aggregate repeated observations appropriately. The ConvNeXt study selects its checkpoint using the validation set and reports results

on that setting.[158] Such evidence differs from an untouched final test, even when photographs were obtained from several centers.

The FixCaps wound paper also illustrates the need to check units and equations. It describes model size in megabytes in passages about parameters, and its printed accuracy equation uses an incorrect numerator.[94] This chapter uses the standard accuracy definition in Section 4.10.2 and treats the published metrics as reported results, without attempting to reconstruct them from an erroneous printed formula. Precise parameter counts and serialized file size should be measured and reported separately.

4.9.2 Related tasks and evidence boundaries

Segmentation studies inform representation design but should not enter a woundtype accuracy ranking. Wang et al. investigated fully automatic wound segmentation, while Yap et al. evaluated diabetic-foot-ulcer detection in a challenge setting.[35, 175] Their segmentation or localization measures answer different questions from the image-classification metrics above. Pressure-ulcer assessment and burn assessment also depend on their own target definitions and reference standards.[176, 177]

A 2026 study by Huttunen et al. used 362 real-world wound images for woundarea and tissue segmentation. Its reported wound-area Dice score of 0.927 describes spatial overlap, not 92.7% etiological classification accuracy.[178] A 2025 unified segmentation/classification framework similarly requires separate reporting for its constituent tasks.[179] When a segmentation stage feeds a classifier, evaluate both the classifier with ideal annotations and the complete pipeline with predicted masks; the difference reveals error propagation.

Thermal imaging also changes the observation model. Eldin et al.’s 2025 study combines handcrafted and deep features from plantar thermograms with a neural classifier. It does not provide evidence for a CNN-versus-capsule comparison.[180] Thermal, RGB, dermoscopic, and depth images should not be pooled into a single performance ranking without describing their distinct information and acquisition requirements.

4.9.3 Choosing a baseline

For a new project with limited labels, a compact pretrained CNN with a simple head is a useful reference because it makes data and protocol errors easier to diagnose. A residual or modern convolutional encoder can then test the value of greater capacity. If portable inference is central, compare a MobileNet or EfficientNet variant under measured device constraints. If the research question concerns structured aggregation, hold the encoder fixed and compare GAP with a capsule head.

The choice should follow the scientific question. Investigating anatomical context calls for multimodal ablations. Investigating viewpoint sensitivity calls for controlled transformation tests. Investigating a capsule routing improvement calls for matched routing baselines. This alignment between question, mechanism, and measurement makes an experiment informative even when the proposed method does not outperform every alternative.

4.10 Evaluating the complete classifier

A complete wound classifier includes preparation, a representation, a decision rule, and the procedure used to select them. Evaluating that system therefore requires more than one reported accuracy. We begin with patient-level partitions and classification measures, then examine uncertainty, calibration, domain shift, and failure explanations. The closing protocol brings these checks together into a reproducible comparison.

4.10.1 Patient-level data splits

The evaluation unit must match the intended claim. If a system is expected to work on a new patient, photographs from that patient must not appear in training.

If several wounds belong to one patient, keeping only individual wound identi-ties separate may still permit shared patient-specific appearance across partitions. Repeated visits and near-duplicate crops require the same attention.[20]

Let Gtrain, Gval, and Gtest denote patient-identifier sets. Require

Illustrations are not included in the reading sample

All views derived from one original image inherit its partition. Fit normalization statistics, feature selection, class weights, and any learned preprocessing only on training data. Validation selects hyperparameters and thresholds; the final test estimates performance after those choices have been fixed. If cross-validation is used for selection, a nested design separates inner tuning from outer evaluation.

When public images lack patient identifiers, that limitation cannot be repaired by renaming files. Deduplicate exact and near-duplicate images, preserve known source and wound identifiers, and describe the remaining uncertainty. A source- held-out experiment can assess acquisition shift, but source separation does not automatically prove patient separation when repositories overlap. Conversely, patient separation within a pooled dataset does not establish performance at an unseen center.

The three branches in Figure 4.15 implement the disjoint patient sets of Equation (4.31), using gn from Equation (4.1). Apatient’s original wound image, another visit, and a derived crop therefore follow the same branch. The augmentation arrow appears only below training; deterministic input preparation is still applied consistently to all branches, with learned settings fitted on training data. Validation chooses the model and threshold, while the test branch supplies the held-out observations counted in Equation (4.32). This connection matters because a high score cannot establish new-patient wound recognition if related images crossed the branches.

4.10.2 Confusion-matrix metrics

The wound-analysis questions behind the fractions. A wound classifier can

have a high overall score while systematically missing a less common category. Re-

Illustrations are not included in the reading sample

Figure 4.15. A leakage-resistant workflow groups patients before preprocessing and augmen-tation. Every crop or transformed view retains its parent’s partition. External-site evaluation addresses an additional generalization question.

call asks how many reference-positive cases of that category were found; precision asks how often a prediction of that category was correct. In a binary image-based infection study, a false negative is a reference-positive image assigned the negative label, while a false positive raises an alarm on a reference-negative image. Their practical consequences depend on the intended review or referral workflow and on how infection was established. A photograph-level label must not be silently treated as a complete clinical diagnosis.

Specificity asks how frequently reference-negative cases avoid a positive prediction. Balanced accuracy and macro F1 prevent common classes from dominating the summary as strongly as overall accuracy, although neither assigns a clinical cost to a particular mistake. The confusion matrix identifies which wound categories are confused, enabling targeted review of label definitions, sampling, and image quality. Problem-aware metric selection connects these statistical questions to the intended biomedical task.[21, 22]

Learning these metrics is necessary to recognize a model that succeeds on common images while failing on the cases that motivate its use. Fix the positive class, reference procedure, prediction unit, and threshold before interpreting the

For the F1 term, the equivalent expression 2TP/(2TP + FP + FN) is often convenient. State the convention for zero denominators. A class absent from an evaluation partition provides no empirical estimate of its recall. Macro averaging weights classes equally; support-weighted averaging gives greater influence to common classes. These answer different questions.

For a binary task, accuracy is (TP + TN)/W, sensitivity is TP/(TP + FN), and specificity is TN /(TN + FP). The denominator TP + FN is the number of actual positive cases, not the number of correct predictions. Precision also depends on the prevalence of positives in the evaluation setting, so a reported value should be interpreted together with the sampling design.

High accuracy with a missed minority class. In a synthetic set of 100 independent image examples, suppose 5 carry a positive wound finding and 95 do not. A rule that always predicts negative has TN = 95, FN = 5, and TP = FP = 0. Its accuracy is 95%, specificity is 100%, positive recall is zero, and balanced accuracy is (0 + l)/2 = 0.5. Positive precision is undefined because there are no positive predictions; positive F1 is zero under the count formula. State any software convention that replaces the undefined precision with zero. This invented example illustrates a reporting failure, not the prevalence or performance of any clinical cohort.

Published wound work shows why complementary measures are useful. Birkner and colleagues compared PG recognition with conventional leg-ulcer recognition on 69 held-out validation photographs. The reported CNN sensitivity and specificity were 97% and 83.3%, respectively. These measure finding PG and rejecting it in different reference groups, and neither number replaces the other. Their study’s photographic comparison and limited sample do not establish performance in a complete clinical workflow.[181]

Changing a binary score threshold changes both the missed-positive and false- alarm counts. A threshold chosen for high sensitivity can increase review workload; precision can also change when the deployment population has a different prevalence. Report class support and uncertainty, choose the threshold on development data, and evaluate its consequences on the frozen test set. A larger macro score does not itself demonstrate that the most consequential wound error has become acceptable.

Consider the synthetic matrix

Illustrations are not included in the reading sample

There are 50 examples and 38 correct predictions, giving accuracy 0.76. The class recalls are (0.90,0.60,0.80), so balanced accuracy is approximately 0.7667. Precisions are (18/21,12/16, 8/13), and macro F1 is approximately 0.7468. The lower recall of class 2 and lower precision of class 3 are hidden by the single accuracy value. These are teaching calculations, not patient data.

Figure 4.16 displays Equation (4.33) as counts, with darker shading for larger counts rather than larger normalized error rates. To recover class-2 recall in Equation (4.32), read across row 2: 12/(3 + 12 + 5) = 0.60. To recover class-3 precision, read down column 3: 8/(0 + 5 + 8) « 0.6154. The cell containing 5 therefore means that five true class-2 examples were assigned to class 3. In a wound study, replace these generic indices with the prespecified wound labels and report their clinical definitions; the matrix alone cannot establish which mistake is more harmful. The 50 entries here are image-level examples, so they must not

be described as 50 independent patients unless the sampling design supports that statement.

Illustrations are not included in the reading sample

Figure 4.16. Synthetic confusion matrix for Equation (4.33). Rows are true classes and columns are predictions. Counts reveal the direction of errors that an overall accuracy obscures.

AUROC evaluates ranking across thresholds and should be computed from continuous scores, not only the final hard predictions. For multiclass data, specify one-versus-rest or another construction and its averaging rule. Precision-recall analysis is useful when the positive class is rare, but its baseline and interpretation depend on prevalence. A threshold selected to reach a desired sensitivity must be selected on development data and then evaluated on the independent test set.

Segmentation metrics use a different unit. For predicted and reference fore-ground sets A and B,

Illustrations are not included in the reading sample

State how empty masks are handled and whether averaging occurs per image or after pooling pixels. Millions of pixels from a few photographs do not supply millions of independent clinical observations. This is why an overlap score cannot be interpreted as image-classification accuracy.

4.10.3 Uncertainty and model comparison

A point estimate should be accompanied by uncertainty appropriate to the sampling

unit. A patient-level bootstrap samples patients with replacement and retains

all relevant images for each sampled patient. Recomputing a metric over these resamples yields an empirical interval. For comparing two models, use the same resampled patients for both and calculate the difference within each resample. This preserves their paired evaluation structure.

Small class counts can make estimates unstable even when the total image count appears large. Report the support for every class, the number of patients when available, and the number of independent centers. Repeated training seeds quantify a different source of variation from resampling patients: the former concerns optimization randomness; the latter concerns the evaluation sample. They should not be presented as interchangeable confidence intervals.

For longitudinal monitoring, define whether the target is a visit-level label, change between visits, or a patient-level outcome. Prediction aggregation across visits must be specified before testing. Otherwise, choosing the most favorable image or visit after observing the result can create an optimistic summary.

4.10.4 Calibration, selective prediction, and domain shift

Classification accuracy asks whether the most likely label is correct. Calibration asks whether probability statements correspond to observed frequencies. For example, among predictions assigned confidence near 0.8, roughly four out of five should be correct under the relevant sampling conditions. High accuracy does not imply this property.[44]

For normalized class probabilities pnk and one-hot labels tnk, the multiclass Brier score under the unnormalized-over-classes convention is

Illustrations are not included in the reading sample

For the earlier prediction (0.7,0.2,0.1) with true class 2, the score is 0.49 + 0.64 + 0.01 = 1.14. Some software divides this by K; reporting the convention avoids a misleading numerical comparison. Raw capsule lengths require an explicitly defined probability mapping before such a probability score is applied.

Temperature scaling replaces p = softmax(q) by p(T) = softmax(q/T), where T > 0 is fitted on held-out development data.[44] It preserves the ordering of logits and thus their argmax, apart from numerical ties. It can change confidence without changing predicted labels. It does not repair a wrong label ontology or guarantee calibration after a large domain shift.

A system can abstain when confidence is low. For a chosen confidence score s(x) and threshold r, define coverage and selective risk as

Illustrations are not included in the reading sample

Risk is undefined if no examples are accepted. Alow error rate at very low coverage may have limited practical value. Report both quantities, class-specific coverage, and the resulting review workload. High softmax confidence alone is not a reliable detector of images outside the training distribution.

Evaluate performance under plausible changes in lighting, focus, device, framing, skin appearance, and source population. Controlled corruptions test specific sensitivities; external data test broader shifts. Neither should replace the other. Describe observed subgroup counts and uncertainty without inferring demographic attributes from appearance alone.

4.10.5 Explanations and failure analysis

A wrong wound category can obscure a distinction that needs further clinical investigation. For example, PG and conventional leg ulcers can look similar but require different diagnostic reasoning; the published PG study explicitly connects delayed or incorrect recognition to patient risk. This makes inspection of model failures part of evaluating the intended use. An explanation should help investigators discover a problem or challenge a prediction, while the reference diagnosis and other clinical information provide separate evidence.[181]

An apparently plausible explanation cannot make a wrong prediction reliable. A model may produce a confident class using a dressing edge, a ruler, background texture, or a source-specific image style. Examining that possibility is especially important when a new clinic changes the acquisition process. Begin with recorded errors and class counts, then use attribution and controlled comparisons to investigate them. Grad-CAM uses gradients of a selected class score with respect to convolutional feature maps to construct a spatial attribution. In a common form,

Illustrations are not included in the reading sample

The resulting coarse map depends on the chosen layer and score.[182] A bright region indicates attribution under this construction; it does not prove that the highlighted tissue caused the clinical diagnosis. Attention maps and capsule activations have the same general limitation: internal weights are not automatically validated explanations.

Useful failure analysis begins with concrete questions. Does the model attend to a ruler, dressing, label, or background? Does a crop remove important context? Are errors concentrated in low-quality images or underrepresented sources? Does a confidently wrong prediction persist when irrelevant context is masked? Include representative correct and incorrect cases, selected by a stated rule, with labels and clinical context checked by qualified reviewers. Avoid presenting only attractive heatmaps from successful examples.

Use the following sequence for a wound-classification error review:

1. Read the class-specific confusion counts first. Identify missed positive cases, repeated category confusions, and confidently incorrect predictions under a fixed selection rule.
2. Check the reference and the input. Record whether the photograph shows the required region, whether its quality is adequate, and what clinical informa-tion supported the label. Separate an annotation dispute from a demonstrated prediction error.
3. Compute attribution for a declared class score and layer. Compare correct and incorrect cases, and inspect whether the displayed map changes when the chosen score or layer changes. A coarse map may be too broad to resolve a small wound border.
4. Test a concrete hypothesis with the full-frame, crop, and context controls be-low. Keep patient partitions fixed and distinguish test-time perturbation from retraining a matched model.
5. Summarize the error pattern with qualified review and class/subgroup counts. If it motivates a model change, return to development data; preserve an untouched evaluation for the revised system.

Attribution and clinical explanation answer different questions. Grad-CAM summarizes sensitivity of a selected score to internal feature maps; it does not establish wound etiology, causal tissue involvement, or treatment suitability. Failure review can reveal evidence against a model’s intended use even when its average score is favorable. Conversely, a plausible-looking map on one selected image cannot establish robustness. Sections 6.15 and 7.10 extend these checks to attention and multimodal outputs.

Figure 4.17 turns these questions into observable comparisons. The left view retains the wound, ruler, and surrounding context; the middle reduces context through cropping; the right hides the wound region. A crop can also remove informative surrounding skin. Formally, each view is a specified transformation of the input xn in Equation (4.1), while the intended reference label and patient partition remain fixed. Compare the resulting confusion matrices and class recalls using Equation (4.32); examine confidence changes separately with Equation (4.35) when probabilities are available. A location-only baseline from Figure 4.10 complements these image-based controls.

Distinguish retraining matched models on each input condition from perturbing only the test input of one fixed model. The former compares the predictive

information available under each condition; the latter tests that model’s response to a distribution change. A context-only classifier can exploit acquisition artifacts, anatomy, or even mask shape, so its performance must be interpreted with a documented masking policy. The panels contain no attribution measurements: Equation (4.37) would require actual model gradients. Neither a drop under masking nor a bright attribution map alone identifies a causal diagnostic feature.

Compare context under matched conditions

Fixed patient partitions; matched training and evaluation. Test-only masking changes the input distribution and does not establish causation.

Schematic views only; no patient data or measured model outputs.

Figure 4.17. Full-frame, wound-crop, and context-only views for a controlled shortcut analysis. These are drawn teaching examples with no patient data or model outputs. Cropping and masking change the available information and can also change the input distribution.

Wound application. Birkner and colleagues used Grad-CAM when examining a neural classifier distinguishing pyoderma gangrenosum from venous ulcers.[181] The maps visualize model attribution rather than independently verifying the clinical diagnosis. Sections 6.15 and 7.10 develop wound-specific interpretation and failure analysis.

4.10.6 Reproducible comparison protocol

Algorithm: Compare CNN and capsule systems

1. Define the intended task, label reference, population, image modality, and unit of prediction.
2. Inventory patient, wound, visit, source, and duplicate relationships. Freeze the partition manifest before constructing augmented views.
3. Establish a pretrained CNN with a simple head. Add a capsule head on the same encoder and compare routing settings under a declared budget.
4. Record checkpoint provenance, normalization, input resolution, optimizer, losses, class weighting, and stopping rule. Keep a complete selection history.
5. Report confusion matrices, class support, macro measures, continuous-score metrics, cal-ibration, and paired uncertainty. Include an external or source-held-out evaluation where feasible.
6. Measure parameters, serialized size, peak memory, and device latency separately. Evaluate preprocessing and any segmentation stage as part of the deployed pipeline.
7. Review failures, uncertain cases, and missing-modality behavior. State which claims remain untested.

Image-level classification identifies a category but does not delineate the wound. Chapter 5 develops that next task: predicting wound-region and tissue masks, reconstructing boundaries, and evaluating whether a mask supports a defensible measurement. The same requirements for patient separation and task-specific evidence remain central.

4.11 Chapter review

This chapter connected the limited-data wound problem to reusable representations, the historical reasons for CNN designs, the propagation of gradients, and taskspecific evaluation. This review brings those connections together: choose what is learned or reused, identify the mechanism changed, and examine the errors that 220

matter for the stated wound task. The comparison table and worked exercises support those decisions before the closing transition to spatial segmentation.

4.11.1 Architecture comparisons

What to retain for a wound study. Start with the target and the labels: transfer and self-supervision can provide a representation, while the wound reference defines what the head must learn. Read the computation graph: residual addition, dense concatenation, attention, and routing change different operations. Read the errors: recall, precision, specificity, calibration, and failure review reveal different limitations. These three habits connect the history and mathematics to an experiment that can answer a useful wound-analysis question. Table 4.4 brings together the families developed in this chapter. Read each potential advantage alongside its limitation and proposed test. Section 4.8 explains how to isolate architectural changes, while Section 4.9 gives the separate wound-study evidence. The references beside each method name identify its architecture or the particular adaptation discussed; they do not establish that the proposed wound-task advantage has been measured. The table therefore guides experiment design without treating an architectural mechanism as a demonstrated clinical improvement.

Table 4.4. Architectural choices for wound-image classification. The mechanisms suggest conditional uses; the checks are proposed comparisons, not measured rankings.

Illustrations are not included in the reading sample

Illustrative research choice. Suppose a transferred CNN often confuses wound categories with similar texture. A capsule head is one hypothesis for improving feature aggregation. First compare pooling and routing with the same encoder, input resolution, patient partitions, and adaptation budget. Then investigate encoder fine-tuning as a separate factor. Compare class-specific errors and calibration as well as device latency. A gain after simultaneously enlarging the encoder and changing the head would support that complete system, but would not identify routing as its cause.

4.11.2 Exercises

The additional questions on gradient flow, limited labels, minority-class errors, and explanations connect architectural mechanisms to the reasons for evaluating wound systems carefully.

1. Recalculate the depthwise-separable weight-count ratio for a 5x5 kernel and 128 output channels, excluding biases and using depth multiplier one. Explain why the result does not determine device latency.
2. In the routing example, reverse the direction of u1|2 while preserving its magnitude. Start with zero routing logits and couplings 0.5; compute the weighted sums, squashed vectors, and their lengths for the first pass, and explain the effect of conflicting votes.
3. Design an image/location ablation in which the test population has a different association between body location and wound type. State what each baseline would reveal.
4. Starting from Equation (4.33), move two class-2 errors from predicted class 3 to the correct diagonal. Recompute accuracy, balanced accuracy, and macro F1.
5. Propose a comparison between a CNN and an attention-capsule variant that separates the effects of pretraining, routing, and model size. Identify the patientlevel evidence needed before making a clinical claim.
6. For two scalar plain blocks xz+1 = 0.1xz and two ideal residual blocks xz+1 = Xi + 0.1XZ, take the output loss gradient as 1. Compute the input gradients. What changes if each residual branch derivative is —1, or if a post-addition ReLU is inactive?
7. Design a small-data wound comparison crossing random, supervised, and selfsupervised initialization with frozen, partial, and full encoder adaptation. State how patients, unlabelled data, checkpoints, and label budgets are controlled.
8. In the synthetic 100-image example, replace the always-negative rule by one with TP = 4, FN =1, FP = 10, and TN = 85. Calculate accuracy, recall, specificity, precision, F1, and balanced accuracy. Explain why lower accuracy need not mean less useful positive-case recognition.
9. A classifier predicts the wrong wound type with high confidence and a bright Grad-CAM region near a ruler. State what is observed, what remains a hypothesis, and which comparisons and clinical review should follow.

4.11.3 Worked answers

The numerical answers use the conventions stated in the questions. Questions 3, 5, 7, and 9 admit several valid experimental designs or investigations; the responses below are example solutions, not completed wound experiments.

1. For Cin input channels, an ordinary convolution uses 25Cin(128) weights. A depthwise convolution with depth multiplier one followed by a pointwise convolution uses 25Cin + 128Cin. Their ratio is
Thus the separable block uses 4.78125% as many weights, a 95.21875% re-duction under these assumptions. Including biases would change the counts. Parameter storage does not determine latency: image resolution, activation traffic, hardware, kernel implementations and operation scheduling also matter.
2. Reversing uX|2 gives (—0.8, —0.2) while leaving the other votes unchanged. With every coupling equal to 0.5,
Illustrations are not included in the reading sample
Applying Equation (4.24) gives
Illustrations are not included in the reading sample
The exact lengths are 0.02/1.02 and 0.065/1.065, respectively. The conflicting first-parent votes largely cancel, reducing its length from about 0.45055 in the original example. This forward calculation measures vote agreement, not clinical accuracy; it does not change the first pass’s initial couplings.
3. One valid design: train image-only, location-only and image-location models using the same training patients and wound-type definitions. Select settings on development patients, then freeze all models. Test them on a patient-disjoint cohort with documented changes in the location-type association, while retaining the same available fields and reference-label procedure. The location-only model tests dependence on that association; the image-only model supplies a visual baseline; fusion tests whether location adds useful information under the changed association. Report per-class results, calibration, uncertainty and location-stratified counts. A shuffled-location sensitivity control can expose dependence on metadata, but does not replace testing genuinely collected data. None of these comparisons alone establishes a causal clinical benefit.[20]
4. Rows remain true classes and columns predicted classes. Moving the two specified observations changes the second row to (3,14, 3):
Illustrations are not included in the reading sample
There are still 50 observations, with 40 correct, so accuracy is 0.8. The recalls are (18/20,14/20, 8/10) = (0.9,0.7,0.8); balanced accuracy is also 0.8. Column totals are (21,18,11), giving class F1 scores 36/41, 28/38 and 16/21. Therefore
Illustrations are not included in the reading sample
The numerical equality of accuracy and balanced accuracy in this modified example is not a general identity.
5. One valid design: cross the initialization condition (random or the same declared pretraining) with the aggregation head (standard CNN head or attention-capsule head). Hold the encoder family, input resolution, labels, patient partitions, augmentation and tuning budget fixed. Add attention-only and fixed-coupling controls to separate attention and routing, and a parameter-matched CNN-head control to assess capacity. Report parameter counts, actual computation, memory and device latency rather than inferring efficiency from size. Evaluate the frozen models on patient-disjoint data with documented reference labels, patient counts, class-specific errors, calibration and uncertainty; use an external cohort to assess transfer. A clinical-utility claim additionally requires an evaluation designed around the intended clinical decision and workflow. These controls support attribution to a mechanism only when the compared conditions isolate it.[20, 45]
6. The plain input gradient is 0.1(0.1)(1) = 0.01. Equation (4.10) gives (1 + 0.1)[2] = 1.21 for the ideal residual pair. With residual derivative —1, each additive local derivative is 1 — 1 = 0, so the propagated input gradient is zero. An inactive post-addition ReLU likewise blocks that local path. The examples demonstrate the chain rule for specified graphs, not a guarantee about training an arbitrary deep network.
7. One valid design: split by patient before selecting labelled subsets or building the self-supervised pool. For each label budget, reuse the same labelled training patients, tuning patients, untouched test patients, head specification, image preparation, and declared tuning budget across conditions. Document the source and objective of every pretrained checkpoint. Draw unlabelled pretraining images only from permitted development patients or a documented independent external source. Cross the three initialization choices with the three adaptation choices; label a frozen random encoder as a diagnostic control rather than a useful-pretraining baseline. Select all settings without test feedback and report learning curves, class errors, calibration, and compute. Hidden labels do not make test-patient exposure an untouched evaluation.
8. Accuracy is (4 + 85)/100 = 0.89, recall is 4/5 = 0.8, specificity is 85/95 « 0.8947, precision is 4/14 « 0.2857, and positive F1 is 8/(8 + 10 + 1) =
8/19 « 0.4211. Balanced accuracy is (0.8 + 85/95)/2 « 0.8474. Compared with the always-negative rule, this rule finds four of five positives but produces ten false alarms. Whether that tradeoff serves the intended review workflow requires a prespecified objective, reference quality, uncertainty, and workload analysis; the calculation alone does not prescribe a clinical threshold.
9. The observed findings are the reference/prediction disagreement, recorded confidence, and the map produced for a specified score and layer. Reliance on the ruler is a hypothesis. First verify the label and whether the image supplies the required information. Then examine representative correct and incorrect cases, use controlled masking/cropping with a documented policy, and compare context-only and full-image conditions under fixed patient splits. A drop after removing a ruler may reflect a distribution change as well as shortcut reliance. Qualified review should relate the pattern to the intended wound task. Neither the bright map nor high confidence validates the wrong prediction or identifies a causal diagnostic feature.

4.11.4 Chapter summary

Transfer learning addresses limited wound labels by reusing a representation and selecting how much to adapt. Self-supervision can supply that representation from unlabelled images, but its pretraining population and augmentation choices remain part of the evaluation. The historical progression of CNNs explains why depth, multi-scale processing, shortcuts, feature reuse, and efficiency became useful design choices. Residual connections change gradient paths through addition; they preserve the chain rule and do not guarantee useful wound features.

Table 4.4 connects these mechanisms to controlled comparisons, including capsule aggregation. The confusion-matrix examples show why overall accuracy can conceal missed minority cases and why recall, precision, and specificity must accompany an intended decision rule. Explanations and context controls help investigate failures; a plausible heatmap cannot validate an incorrect diagnosis. Match patient partitions, data access, adaptation, and resource budgets before attributing gains. Chapter 5 next develops pixel-level prediction, where correct categories and defensible spatial boundaries require separate evidence.

Chapter 5

U-Net and Modern Wound Segmentation

Chapter 4 asked how a network assigns a label to an image. Wound measurement asks a different question: which pixels belong to the wound, and which belong to surrounding skin or another structure? The difference is substantial. A correct image label does not provide an accurate contour, and an accurate contour does not establish wound cause, infection, perfusion, or treatment response. This chapter develops the spatial prediction problem, using U-Net as a common reference through which later architectural choices can be understood.

The discussion proceeds from the original model to the problems that motivate its extensions: loss of spatial detail, incompatible feature representations, distracting background, limited context, scarce annotations, computational cost, and ambiguous boundaries. Each extension changes part of the computation; whether it improves a particular wound task remains an empirical question. Modern transformers, state-space models, and promptable systems are included where they address these segmentation problems. Their evidence from organs, microscopy, or natural images is identified separately from evidence on wound photographs.

The mathematical examples use deliberately small arrays or explicitly specified synthetic configurations. They explain mechanisms and do not represent experiments on patients. This chapter discusses selected developments published in 2026 and earlier. It is a focused, expanded tutorial rather than an exhaustive systematic review or a claim to enumerate every published network name.

Notation for this chapter. Each photograph now contains a grid of targets. Table 5.1 distinguishes image and pixel indices, spatial dimensions, masks, and the symbols reused by separate segmentation methods.

Table 5.1. Notation guide for Chapter 5.

Illustrations are not included in the reading sample

5.1 Wound segmentation tasks

Chapter 4 distinguished an image label from a spatial prediction. Here we specify the spatial target before developing the network that predicts it. The following subsections define masks, distinguish semantic, instance, and panoptic outputs, and identify the roles of pixels, patients, and imaging modalities. These choices establish what a wound-segmentation result will mean and which observations its evaluation will count.

5.1.1 Mask definitions

An image-level classifier produces one label or score vector. A segmentation model produces a spatially organized prediction. For a photograph X E /<HxWxC, H and W are image height and width and C is the number of input channels. A red-green-blue (RGB) photograph has three color channels; these are not three anatomical slices. Let Q = {1,... , H} x {1,..., W} be its pixel grid. A binary reference mask Y : Q > {0, 1} identifies the region selected by a stated annotation protocol. The positive label could mean the visible open wound bed, a larger wound-associated region, or one tissue category. These choices produce different targets even for the same photograph.

For mutually exclusive tissue categories, use K class indicators Yik, where i E Q denotes a pixel and £^=1 Yik = 1. For example, a teaching taxonomy could contain background, red-appearing wound tissue, and yellow-appearing material. This appearance-based example does not establish histological identity. Clinical tissue annotation requires a defined protocol and appropriately qualified assessment. Published wound/tissue work illustrates why region boundaries and within-wound tissue labels must be assessed separately.[131, 178]

The network outputs logits, real-valued scores Z = f^(X) parameterized by weights d. Probabilities are obtained using

Illustrations are not included in the reading sample

The sigmoid form is appropriate for a binary mask or independent binary chan-nels. Softmax represents mutually exclusive classes. For overlapping attributes, independent sigmoid channels allow more than one positive label at a pixel. They should not be interpreted as mutually exclusive probabilities summing to one.

At inference, a binary mask can be obtained as Y = 1 [p^ > T], with threshold T selected using development data. A multiclass mask commonly uses p = argmaxk p^k • Thresholding is a decision rule, not part of the definition of a cali-brated probability. For logits (0, log 2, log 3), softmax gives (1/6, 2/6, 3/6). The largest score selects the third class, but a probability of one half does not express certainty. The same distinction applies to a binary probability of 0.51.

The probability transforms are the same as those used for image classification in Chapter 4; their application is now pixelwise. Accordingly, i indexes a pixel here, whereas n indexes a photograph in the dataset below. Section 2.5.9 supplies the common overlap definitions; Section 5.15 adds boundary, empty-mask, and aggregation considerations for segmentation.

5.1.2 Semantic, instance, and panoptic outputs

Semantic segmentation assigns categories to pixels without distinguishing separate objects of the same category. Instance segmentation additionally distinguishes, for example, two separate wounds in one image. Panoptic segmentation combines semantic categories for background-like regions with individual identities for countable objects. Mask R-CNN is an instance-segmentation framework; its object proposals and instance masks solve a different output problem from a single binary semantic mask.[183, 184]

A binary semantic output can still contain several disconnected regions. Connected-component analysis can assign separate identifiers afterward, but its success depends on a defined connectivity rule and on whether lesions touch or overlap. It does not make all semantic segmentation equivalent to instance seg-mentation. Likewise, a bounding rectangle localizes an object but includes pixels outside its true contour. Area estimated from the rectangle is not the segmented wound area.

In Figure 5.1, the image supplies appearance, while the adjacent masks specify different questions. The binary mask asks for membership in one region; the multiclass mask divides that region by an illustrative appearance rule; the instance panel assigns identities to separate schematic objects. Equation (5.1) specifies how scores become probabilities, but it cannot determine which annotation policy the investigator intended. That policy must precede model training.

Wound application. Liu and colleagues evaluated U-Net and Mask R-CNN for pressure-injury segmentation before constructing an area-measurement system.[24] This supplies wound examples for semantic masks and an instance-segmentation architecture, without establishing a panoptic wound taxonomy. Section 5.15 explains the distinction between mask evaluation and calibrated measurement.

5.1.3 Pixels, patients, and modalities

A training collection can be written as

Illustrations are not included in the reading sample

where M identifies annotated pixels, g identifies the patient, and s records acquisition source or site. An unannotated pixel is not automatically background. Several visits, crops, or augmented images can share one patient; millions of labeled pixels do not create millions of independent clinical cases.

Computed tomography (CT) and magnetic resonance imaging (MRI) produce anatomical images with physical spacing and acquisition-specific intensities. RGB photographs depict a visible surface and are strongly affected by illumination, color response, viewpoint, and occlusion. MRI reconstruction and CT acquisition are different physical processes; neither should be described as ordinary RGB photography of internal anatomy. Digital Imaging and Communications in Medicine (DICOM) is a medical-image information standard, not a segmentation algorithm. For the computations here, the consequential differences are dimensionality, spacing, intensity interpretation, and annotation structure. The methods developed for volumes become useful context for understanding U-Net variants, but do not establish that a single wound photograph contains depth measurements.

5.2 Development of segmentation methods

With the segmentation target established, we can examine how different methods construct a spatial prediction. The discussion moves from shape and atlas assumptions through engineered and learned features to fully convolutional prediction. The final subsection compares output grids and stride. This progression prepares the dimension and reconstruction questions that arise in the original U-Net.

5.2.1 Shape and atlas assumptions

Before end-to-end dense predictors, explicit priors helped restrict the possible boundaries. In an aligned statistical shape model, a contour represented by a vector s G R[2]L of L two-dimensional landmarks can be approximated as

Illustrations are not included in the reading sample

The mean shape s and principal directions P are estimated from training con-tours. The coefficients b describe permitted departures from the mean. A shape prior can reject implausible configurations, but depends on meaningful landmark correspondence and representative training variation. Active shape models use image evidence to position a constrained contour; active appearance models jointly represent shape and aligned appearance.[185, 186]

An atlas instead supplies a reference image A with labels LA. A registration map ^ aligns the reference with a target X; the transferred label at target position i is LA(^(i)) when ^ maps target coordinates to atlas coordinates. The mapping direction matters. With multiple registered atlases, a simple label-fusion rule is

Illustrations are not included in the reading sample

Here Ao is the number of atlases, and wai expresses their contribution at pixel or voxel i. The equation is a generic weighted-voting explanation; a particular published method may estimate more elaborate dependencies. Anatomical label propagation and decision fusion were studied for brain MRI.[187] Irregular wounds need not have the stable landmarks or anatomical correspondence that make such priors useful for an organ. This is a limitation of the assumptions, not proof that all prior-based methods fail.

5.2.2 Engineered and learned features

The classical methods in Chapter 3 can classify a pixel feature vector containing color, texture, neighborhood statistics, or location. Each prediction can be learned using a random forest, support vector machine, or another classifier. A spatial smoothing or region-merging stage may then improve coherence. A pixel classifier and a clustering method remain different learning problems: the former uses target labels, whereas the latter groups observations by a specified criterion.

A patch-based CNN replaces engineered features with learned features from a neighborhood XZ(X) and predicts the center label. Cire§an and colleagues demonstrated this approach for neuronal membranes in electron microscopy.[188] Its receptive field can exploit context, but evaluating overlapping patches repeats many intermediate computations. Small patches restrict context; larger patches increase computation and may introduce additional pooling. These tradeoffs motivated prediction over a complete spatial grid.

5.2.3 Fully convolutional prediction and stride

Fully convolutional networks remove the requirement that a fixed-length feature vector feed an image-level classification output. Learned spatial filters transform the image into class-score maps; upsampling restores the grid needed for dense prediction. A fully connected layer over an hxwxc input can be represented by a convolution with an h x w kernel and matching weights. It is a 1x1 convolution only when its input has already been reduced to a spatial singleton or when it acts independently at each spatial position.[189]

If a sequence of layers has strides s1,^,sL, the cumulative output stride is S = nf_x se .A score map with stride 32 samples the input much more coarsely than one with stride 8. Upsampling enlarges a map, but cannot by itself recover information that the coarse representation failed to retain. FCN skip fusion combines semantic predictions from coarse layers with finer features. Using Ps for projected class scores at stride s and U2 for aligned twofold upsampling, a schematic FCN-8s fusion is

Illustrations are not included in the reading sample

Both terms in each addition must have the same spatial alignment and number of class channels. This is score-map addition, whereas the original U-Net concatenates feature channels. Padding and cropping offsets must be checked in an actual implementation; equal array sizes do not prove that pixel centers correspond.

Follow the bottom-to-top connections in Figure 5.2: the stride-32 scores enter a stride-16 map and then a stride-8 map through Equation (5.5). The finer pathways provide information unavailable from simply enlarging the coarsest grid. This explains the design rationale, but does not imply that reducing stride always improves a model regardless of supervision or capacity.

The original FCN paper illustrates this distinction with actual FCN-32s, FCN- 16s, and FCN-8s outputs in its Figure 4 and a controlled comparison in Table 2. Combining finer-stride information improved detail in that PASCAL VOC

Illustrations are not included in the reading sample

Figure 5.2. Dense prediction and coarse-to-fine fusion. FCN fusion combines aligned class-score maps at strides 32, 16, and 8; the arrows identify the upsampling factors. This schematic describes computation, not measured accuracy.

setting, with diminishing gains between the later configurations.[189] Those are natural-image experiments, not wound results. The following independent con-struction explains the sampling mechanism without relabeling a recreated picture as a published prediction.

Wound application. Wang and colleagues evaluated fully convolutional segmentation models, including an FCN-VGG16 comparator, for foot-ulcer masks.[35] Their application predicts spatial labels from image features instead of producing only a category. Section 5.16 develops wound-region studies and Section 5.15 connects their outputs to mask evaluation.

5.2.4 Comparing segmentation grids

Let a synthetic binary signal Y occupy a 16 x 16 grid. It contains an irregular oval and a thin projection, deliberately chosen to expose loss of detail. Partition the

Figure 5.3. Original, reproducible segmentation-grid comparison. A 66-pixel synthetic fore-ground is reconstructed using block sizes 4 and 2. The error panel compares the block-4 result with the reference: teal is overlap, rose is extra foreground, and gold is missed foreground. These are signal-processing examples, not patient masks or trained-model outputs.

grid into disjoint blocks B&b of side q and replace each block by its foreground fraction:

Illustrations are not included in the reading sample

This is block averaging, nearest-neighbor enlargement, and thresholding of a known signal. It is not the forward pass of an FCN or U-Net, and the block sizes are not claims about those models’ output strides.

In Figure 5.3, the coarse reconstruction has 57 true positives, 7 false positives, and 9 false negatives. The finer reconstruction has 65, 15, and 1, respectively.

Smaller blocks recover more of the thin structure in this example, but also introduce additional false positives at the chosen threshold. The Dice values are approximately 0.877 and 0.890 under the definitions developed in Section 5.15. The conclusion is specific: sampling and thresholding change different errors differently. The diagram does not establish that a particular architecture is better. A learned skip pathway can provide finer evidence, but its usefulness still depends on training and the target. This motivates examining how U-Net transports that evidence.

SegNet subsequently used encoder pooling indices to guide decoder unpooling. FPN developed a top-down feature pyramid with lateral connections; PSPNet aggregated context at several pooled scales; DeepLabv3+ combined atrous spatial context with an encoder-decoder design.[190-193] These mechanisms help distinguish what a U-Net variant actually changes. They are not interchangeable names for U-Net, and image-level AlexNet results do not establish the performance of DeepLab.

5.3 The original U-Net

We now follow the original U-Net from its input image through contraction and expansion to a spatial output. The first subsection explains the two paths and their connections; the next traces their dimensions in a concrete configuration. We then examine upsampling, pooling, receptive fields, and parameter cost. These details provide the reference construction for the extensions later in the chapter.

5.3.1 Contracting and expanding paths

Ronneberger, Fischer, and Brox designed U-Net with a contracting path for contextual features and an expanding path for localization. Its early demonstrations involved biomedical microscopy, not chronic-wound photography. Strong augmentation and an overlap-tile strategy were part of that work; the architecture alone was not the entire experimental procedure.[194]

Let E^ be an encoder feature map at level £, where level zero is the finest resolution. A simplified padded version is

Illustrations are not included in the reading sample

The operation C^ denotes a convolution block, T downsampling, U upsampling, S decoder processing, and brackets channel concatenation. At the deepest level, the bottleneck initializes the decoder. The final 1x1 convolution maps decoder channels to class logits. This recurrence explains the information flow; it does not specify normalization, activation, padding, or every channel count, which must be given separately.

Downsampling increases the spatial extent represented by subsequent filters and makes deeper computations less expensive spatially. Fine edges may become harder to reconstruct. The skip pathway exposes higher-resolution encoder features directly to the decoder. Concatenation preserves both sets of channels so a subsequent learned block can select useful combinations. It does not guarantee perfect recovery of every original detail, nor does it turn coarse feature maps into clinical explanations.

5.3.2 Dimension trace

For a one-dimensional axis, a convolution with input size n, kernel size k, padding p, dilation d, and stride s has output size

Illustrations are not included in the reading sample

Apply this separately to height and width. A valid 3x3 convolution has p = 0, d = s = 1 and removes two positions per axis. Two such convolutions change 572 to 570 to 568. A 2x2 stride-2 max pool then produces 284. Table 5.2 follows the original example to the final 388 x 388 output.[194]

At decoder level 3, the encoder copy has side length 64 while the upsampled

bottleneck has length 56. Cropping four pixels from each side aligns their spatial

Table 5.2. Spatial sizes in the original U-Net example. Each entry denotes one side of a square map. Encoder copies are cropped to the decoder size before concatenation.

Illustrations are not included in the reading sample

extents. At the finest skip, the encoder map has length 568 and the upsampled decoder length 392, requiring a crop of 88 from each side. Cropping follows the geometry of valid convolutions; it is not justified by declaring all edge information unimportant.

Read Figure 5.4 down the left side and up the right side. The horizontal connections retain fine-scale information while the bottom path carries coarser context. The listed sizes match Table 5.2; the input is larger than the output because boundary context is consumed. Modern implementations often use same padding, with 256 > 128 > 6 1 > 32 > 16 encoder resolutions and a return to 256. Such an implementation is a U-Net-style model, but its padding behavior is not identical to the 2015 network.

5.3.3 Upsampling and pooling

Nearest-neighbor interpolation repeats values; bilinear interpolation combines nearby values according to position; a transposed convolution learns the weights of an upsampling operator. A transposed convolution applies the transpose of the matrix representing a convolution, not generally its inverse. For a single axis its output size is

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 5.4. Original U-Net geometry, with spatial sizes after each two-convolution block. Channel counts increase along the encoder and decrease along the decoder. Dashed arrows denote copied and cropped features; they are concatenated, not added.

where o is output padding. With n = 28, s = k = 2, p = o = 0, and d = 1, the output is 56. Different combinations can yield the same output size but different sampling behavior. Interpolation followed by convolution provides another explicitly separable design. Uneven overlap in a learned upsampler can create spatial artifacts; the choice should be assessed with the complete network and inference pipeline, rather than assumed superior by its name.[195]

The values in Figure 5.5 distinguish enlarging a representation from recreating lost observations. Interpolation fills positions using an explicit rule; a convolution after interpolation learns new combinations. The crop panel addresses coordinate alignment, not interpolation quality. A decoder needs both a chosen upsampling rule and a valid alignment rule.

Illustrations are not included in the reading sample

Figure 5.5. Upsampling and alignment are separate operations. A small numerical signal illustrates interpolation; a second panel shows why an encoder copy may need cropping before channel concatenation.

5.3.4 Receptive field, parameters, and cost

The theoretical receptive field can be traced using a field size rg and jump jg, the separation between neighboring feature positions measured in input pixels:

Illustrations are not included in the reading sample

Two 3x3 stride-1 filters give r = 5; a 2x2 stride-2 pool gives r = 6, j = 2; another 3x3 filter gives r = 10. Thus local filters can accumulate a broad receptive field. It is inaccurate to say that a CNN can never use distant information. Explicit global attention and state-space processing change how information is combined, rather than creating context where none could ever exist.

A dense k x k convolution with cin input and cout output channels has k[2]cincout weights, plus cout biases if used. At k = 3, cin = 32, cout = 64, this is 18,432 weights. The approximate multiply-accumulate count multiplies that number by output height and width. Activations, saved gradients, optimizer states, precision, and batch size contribute to memory; parameter count alone is insufficient.

An architecture now specifies where information can flow. Training must still decide which errors matter and supply a signal that changes the weights. The next section develops those objectives from the target definitions rather than treating a named loss as an unexplained ingredient.

Wound application. Niri and colleagues used a U-Net with a VGG16 encoder and dual attention to delineate wound areas, alongside several backbone compar- isons.[137] This connects the contracting path, skip features and expanding path to a clinical-photograph task. Section 5.16 develops the study and its adaptation setting.

5.4 Loss functions and deep supervision

An encoder-decoder specifies how a mask prediction is computed; a training objective specifies how that prediction is compared with annotations. We begin with likelihood-based losses, then examine overlap and boundary objectives using worked calculations. The final subsection introduces supervision at multiple outputs and anatomical labels. Keep the predicted object and the source of supervision in view when comparing these objectives.

5.4.1 Likelihoods and training objectives

A network architecture specifies a family of functions; a loss specifies which errors training penalizes. In this subsection the image index is suppressed: yi = Y{ and mi = Mi for the chosen image. For binary segmentation, assume a Bernoulli observation at each labeled pixel, conditional on the image and network. Its probability is pyi (1 — pi)[1]—yi. Taking the negative logarithm converts a product of probabilities into an additive objective. Let mi G {0,1} indicate whether pixel i is annotated and M = ^ mi > 0 denote the annotated-pixel count, rather than the mask array. Binary cross-entropy is

Illustrations are not included in the reading sample

The negative sign is essential for minimization. The conditional pixel factorization is a training likelihood, not a claim that neighboring anatomy is independent.

Spatial dependence enters through the network. In implementation, a stable loss operates directly on logits rather than taking the logarithm of a rounded probability. A minibatch containing no annotated pixels supplies no supervised loss and must be skipped or handled explicitly.

For a single pixel, differentiating through p = a(z) gives d/jdz = p — y. Thus, a positive pixel with p = 0.2 has derivative —0.8: gradient descent increases its logit. For K mutually exclusive classes, weighted cross-entropy becomes

Illustrations are not included in the reading sample

The nonnegative weights wk alter the cost of errors. With this normalization, changing every weight by the same factor changes the gradient scale. Normalizing instead by ^. miwyi gives a different convention that should be reported. Inversefrequency weights may help a rare class influence training, but extremely large weights can amplify annotation noise. Class weighting also changes the probabilityestimation objective; the resulting scores need not be calibrated to deployment prevalence.

The original U-Net additionally emphasized borders between touching objects with a spatial weight map. Its design can be written where d±,d2 are distances to the nearest and second-nearest object boundaries, wc balances classes, and w0 ,ab control border emphasis. This was motivated by separating neighboring cells. Applying it to a single wound mask requires a meaningful definition of neighboring objects; it is not automatically a woundboundary loss.[194]

Wound application. Wang and colleagues trained a foot-ulcer segmenter with binary cross-entropy; Niri and colleagues used weighted cross-entropy to address wound-versus-background imbalance.[35, 137] These are objectives used within specific spatial-prediction pipelines. Section 5.16 examines Niri’s wound-area study; Section 5.10 discusses Wang’s lightweight segmenter.

5.4.2 Overlap losses

Cross-entropy assesses individual pixel probabilities. Dice instead couples pixels through a region-level overlap. For one foreground class, define A = £i mpg.7 and B = £. m^ + £i m^p^. A common soft Dice loss is

Illustrations are not included in the reading sample

Every pixel’s gradient depends on the entire region through A and B. This differs from a local cross-entropy gradient. V-Net used a related differentiable Dice formulation with squared probabilities and targets in the denominator; these formulations should not be silently interchanged.[196]

Smoothing is part of the loss definition. When both the target and prediction contain no foreground, Equation (5.14) gives zero loss. When the target is empty but predicted foreground is present, the gradient depends strongly on e and the summed prediction. Omitting empty targets from the Dice average avoids one instability but also removes their false-positive penalty; cross-entropy or an explicit background term is then needed. Report whether Dice is computed per image, over a minibatch, or across an entire volume. These produce different optimization behavior.

Generalized Dice combines classes with class-volume weights. With Vk = £i miYik and nonnegative ak, one form is

The proposed inverse-squared-volume weighting, ak = ^¡Vk , increases the con-tribution of small classes. An absent class makes this weight undefined, so an implementation must specify smoothing, exclusion, or dataset-level weights. This choice cannot be hidden under the phrase “generalized Dice.”[197]

To control false-positive and false-negative penalties separately, define soft counts T = £. m^i, FP = £. mipi(l - yj, and FN = £. m^(l - p^y*. Here the Tversky index uses the explicit convention

Illustrations are not included in the reading sample

Increasing fi relative to a places more weight on missed foreground. Some publications exchange the names of these coefficients. With a = fi = l/2 and compatible smoothing, this reduces to a Dice-like overlap. The rationale is asymmetric error cost; a chosen asymmetry must still match the actual task.[198]

Focal cross-entropy downweights easy examples. Let pt = p when y = l and pt = l — p otherwise. Then ¿F = -at(l — pt)[7] logpt, where at is a class weight and 7 > 0. At 7 = 0 it is weighted cross-entropy; at 7 = 2, a correct-class proba-bility of 0.9 receives a multiplicative factor 0.0l. This changes training emphasis, not the definition of evaluation Dice.[134] Focal Tversky instead exponentiates an overlap error. Writing ¿FT = (l — TI)[9] makes the convention explicit: the cited formulation uses q = l/7T with a separate parameter 7T > 0. Its derivative is q(l — TI)[9]-[1] times the Tversky-loss derivative, so an exponent below one has a different near-zero behavior from an exponent above one.[199]

Wound application. Curti and colleagues combined Dice and binary focal losses while training a wound-segmentation U-Net through an active semi-supervised procedure.[39] The overlap term was part of a larger training objective, rather than a complete wound-assessment system. Section 5.5 connects the loss to that annotation-limited application.

5.4.3 Boundary losses: worked example

A high overlap score can coexist with a clinically inconvenient contour error. Boundary loss addresses geometry through a signed distance map /y(i), negative

Illustrations are not included in the reading sample

Figure 5.6. Original teaching plots and a four-pixel calculation. Cross-entropy and focal loss are shown for a positive target with unit class weight. The mask example is synthetic; its perfect thresholded overlap does not make its probability losses zero.

inside the reference region and positive outside. A discrete version of its regional integral is

Illustrations are not included in the reading sample

The loss can be negative; it is not a probability or a distance metric. The distance map’s units and scale affect its magnitude relative to cross-entropy. A combined objective AnZn + Ar7’BCE + ABZB therefore needs explicit coefficients and a policy for masks without a boundary. The original boundary-loss study combined the boundary term with regional losses in medical segmentation. It does not establish that every wound dataset benefits from it.[200]

Consider four synthetic pixels with target (1,1,0,0). Their probabilities are (0.8,0.6,0.2,0.1). Equation (5.11) gives —[log0.8 + log0.6 + log0.8 + log0.9]/4 « 0.2656. With e = 0, A = 1.4 and B = 3.7, so soft Dice is 2.8/3.7 « 0.7568 and its loss is 0.2432. Thresholding at 0.5 produces the exact target mask and hard Dice equals one. There is no contradiction: the training loss still rewards greater confidence in correct probabilities. Figure 5.6 compares the pixel penalties and shows the distinction between soft scores and the thresholded mask.

5.4.4 Deep supervision and anatomical labels

An auxiliary output head supplies a loss at an intermediate decoder level. If z(r) denotes its logits and Ur resizes these logits to the annotation grid, a transparent objective is

Illustrations are not included in the reading sample

The final head is included as r = 0. A multiclass head uses softmax. Resizing logits preserves categorical target labels; if masks are resized instead, nearest-neighbor interpolation preserves class IDs, whereas ordinary bilinear interpolation creates intermediate values requiring an explicitly soft-target interpretation. For losses 0.20,0.30,0.50 and weights 0.6,0.3,0.1, the total is 0.26. Auxiliary gradients encourage intermediate representations to be useful, but cannot guarantee correct predictions. UNet++ and UNet 3+ incorporate deep supervision in their designs.[201, 202]

A brain-tumor example shows why mutually exclusive class labels and over-lapping clinical regions need different treatment. These are anatomical labels, not wound tissues. In the BRATS 2015 convention described by Huang and colleagues, labels 1, 2, 3, and4 designate necrosis, edema, nonenhancing tumor, and enhancing tumor, respectively, with 0 for background. Thus,

Illustrations are not included in the reading sample

These targets overlap and are nested, so three independent region scores are not a

three-class softmax partition. If the network predicts the five mutually exclusive

original labels, region probabilities can be formed by summation: Pi whole = Pil +

Pi2 + Pi3 + Pi4, Pi,core = Pil + Pi3 + Pi4, and Pi,enhancing = Pi4'; background

remains Pi0. Apply Equation (5.14) separately to each region and its corresponding

indicator. For the region set X = {background, whole, core, enhancing}, a com-

Illustrations are not included in the reading sample

bined objective is ¿regions = XreX N^D , with explicit nonnegative weights.

Equal unit weights reproduce an unnormalized sum; normalized weights change its scale. Dataset editions can change label encodings; the year and mapping must travel with the equations. Huang and colleagues used parallel 2D networks for this brain-tumor problem.[203] Once target and loss conventions are fixed, the next task is to ensure that data preparation and inference preserve them.

5.5 Data preparation, training, and inference

The losses above assume that predictions and annotations refer to corresponding locations. This section follows the data pathway that makes that comparison possible: transforming images and masks together, handling sparse labels and teacher-student consistency, and combining predictions from overlapping patches. The subsections connect training-time supervision to the spatial reconstruction required when a large wound image is processed in parts.

5.5.1 Image-mask alignment

A geometrical augmentation T must transform the image and annotation together: (X, y) ^ (TX, Ty). Image intensity interpolation can be smooth; categorical mask interpolation must preserve labels. Color changes act on the photograph, not on the class identifiers. Rotations or elastic deformations are useful only within the range that preserves the intended anatomy and acquisition conditions. Original U-Net training used substantial augmentation, including elastic deformations, in its microscopy setting.[194]

Cropping should be recorded because it changes class prevalence and contextual information. A foreground-centered patch sampler supplies more wound pixels than uniform sampling, but a model trained only on positive crops may oversegment intact skin. Include appropriately sampled negative regions and evaluate on the intended full-image distribution. Patient-level splitting must precede patch extraction and augmentation; otherwise neighboring patches or transformed copies can leak between training and testing.

Normalization can be written Xc = (Xc — dc)/(sc + e), with channel-specific center and scale. Estimate any dataset statistics using training data only. Per-image normalization and pretrained-encoder normalization are different choices. Aggressive independent channel normalization may alter clinically relevant color relationships; its value must be tested under the acquisition variation of interest. Transfer learning initializes some parameters from a separately trained model, whereas freezing them prevents their adaptation. Neither practice removes the need to train the decoder and check domain mismatch.

Section 4.3 explains the frozen, partial, and full adaptation choices in more detail. Residual and dense encoders also differ in their gradient paths, as developed in Section 4.4. Those mechanisms remain relevant inside a U-shaped model, but the present task trains and evaluates a spatial mask rather than an image category.

Figure 5.7 shows real photographs with different framing, anatomy and background. They illustrate the need to record acquisition context, but their differences cannot isolate a camera or lighting effect because they are different cases. More generally, shadow changes intensity, glare can erase visible texture, and a dressing can hide the target. Enhancing contrast cannot recover tissue that was not observed. A model should not be rewarded for inventing a hidden wound contour unless the task explicitly asks for an amodal estimate and provides a valid reference for it.

5.5.2 Sparse labels and teacher-student consistency

An unannotated pixel is not necessarily background. The validity mask m in Equation (5.11) excludes unknown labels from supervised loss. This distinction is especially important when only selected slices or scribbles are available. The 3D U-Net study learned from sparsely annotated volumetric data by weighting unlabeled voxels out of the supervised objective.[205]

Consistency learning supplements labeled examples with a requirement that predictions remain compatible under suitable perturbations. In Mean Teacher,

student parameters Ot are optimized by gradient descent and teacher parameters 0t are updated by an exponential moving average:

Illustrations are not included in the reading sample

A scalar example with previous teacher weight 2, current student weight 3, and p = 0.9 gives 2.1. A consistency objective can compare student and teacher prediction fields after spatial alignment. Write

Illustrations are not included in the reading sample

Each W maps the prediction field to the common comparison grid on its valid domain; it need not be a global inverse of a crop. Index the aligned field afterward. Then

Illustrations are not included in the reading sample

where ci indicates accepted, mutually visible pixels and the denominator must be positive. Photometric perturbations need not be inverted, but spatial coordinates must align. Teacher predictions are treated as fixed targets during that student update. Mean Teacher introduced the weight-averaging idea; uncertainty-aware adaptation to left-atrial segmentation used uncertainty to select more reliable consistency targets.[206, 207] Confident errors can still reinforce themselves. These sources motivate a supervision strategy, not a demonstrated wound-specific gain.

Wound application. Curti and colleagues expanded a wound-segmentation training set by asking clinicians to review model-predicted masks and retaining accepted examples for retraining.[39] This documents one semi-supervised wound application, rather than the specific Mean Teacher consistency algorithm. Section 5.16 connects annotation procedures to study interpretation.

5.5.3 Patch stitching

Large images can be processed as overlapping tiles. Let tile t provide probability pt(i) for global pixel i and a nonnegative blending weight at(i), zero outside its valid output. Then

Illustrations are not included in the reading sample

For tile probabilities °.7 and °.9 with weights 1 and 3, the reconstructed probability is °.85. Threshold after blending rather than voting over prematurely rounded probabilities. Original valid-convolution U-Net used overlap-tile prediction with mirrored context; a padded network still requires a documented policy for image edges and overlap.[194]

Figure 5.8 follows the complete path: a shared transform preserves image-mask alignment during training, while overlapping predictions are returned to a common coordinate system at inference. These operations are separate from the loss. Training minimizes a differentiable surrogate; evaluation measures the resulting decision masks on held-out cases. Selecting thresholds, postprocessing, or stopping epochs on the final test set invalidates its role as an independent check.

Illustrations are not included in the reading sample

Figure 5.8. Original schematic of paired training transforms and overlapping inference. Colored tiles contribute to one image grid; the overlap is averaged before thresholding. The drawing illustrates coordinates and workflow, not experimental performance.

5.6 Volumetric U-Net

The preceding constructions used image grids; a volumetric model must also account for a third spatial axis. We first distinguish spatial depth from image channels, then examine how voxel spacing affects the physical extent of a receptive field. The final subsection brings these choices into a reproducible configuration. This establishes the dimensional assumptions needed before applying a U-shaped network to volume data.

5.6.1 Spatial axes and image channels

A volume has shape D x H x W x C, where D indexes slices and C indexes modalities or channels. A 2D network processes each slice independently. A 2.5D approach supplies neighboring slices as input channels while commonly predicting a central slice. A 3D network applies kernels across all three spatial axes. The choice determines which spatial relationships can be learned directly. Ordinary wound photographs do not become volumes by stacking unrelated views or treating RGB channels as depth.

For a 3D kernel K E Rk^xkyxk^xCinxCout, an output feature at voxel (d, h, w) is a weighted sum over neighboring voxels and input channels. Ignoring bias, the parameter count is

Illustrations are not included in the reading sample

A 3x3x3 kernel has three times the parameters of a 1x3x3 kernel with the same channels. Activation storage is proportional to DHWC; doubling all spatial dimensions multiplies that storage by eight before accounting for gradients, optimizer states, and saved intermediates. This explains why volumetric patches and smaller batches are common, without implying that any particular hardware runtime follows from the parameter count.

The 3D U-Net replaced planar operations with volumetric counterparts and addressed sparse slice annotations. V-Net used a volumetric encoder-decoder with residual connections and a Dice-based objective. Their original evaluations concern volumetric medical structures, not surface wound photographs.[196, 205]

5.6.2 Voxel spacing and receptive fields

Let voxel spacing be (sz,sy,sx) in millimeters. A three-voxel extent corresponds to 3sz, 3sy, and 3sx along the axes. With spacing (5,0.5,0.5) mm, a nominal 3[3] neighborhood spans approximately (15,1.5,1.5) mm. These extents count three voxel widths; the distance between the first and last voxel centers is two spacings, namely (10,1,1) mm here. An isotropic index-space kernel is therefore highly anisotropic in physical space. Early 1x3x3 kernels or delayed depth-axis pooling can preserve useful in-plane detail when slices are thick. Resampling to an isotropic grid changes representation and memory demand; it does not create anatomical information between acquired slices.

Figure 5.9 compares slice-wise, neighboring-slice, and volumetric inputs and annotates the spacing example. Its three panels distinguish spatial depth from color channels. When patches are reconstructed, retain orientation, spacing, and the transform back to the original patient coordinate system. A voxel count multi-

Illustrations are not included in the reading sample

Figure 5.9. Original comparison of 2D, 2.5D, and 3D processing. The numerical spacing example shows why equal index-space extents can cover unequal physical distances. This is a volumetric medical-imaging example, separate from RGB wound photography.

plied by s^sysz yields volume only under the stated spatial calibration and mask definition; it is not a wound-surface area measurement.

5.6.3 Reproducible configuration

A volumetric U-Net needs more than a familiar outline. Its configuration should state how much downsampling fits the smallest dimension, whether upsampling uses interpolation followed by convolution or a learned transposed convolution, how normalization behaves with small batches, and which decoder levels receive auxiliary losses. Channel counts and depth should follow the data and memory budget rather than an unexplained fixed recipe. Self-configuring pipelines revisit these choices in Section 5.10. Before that, the next sections distinguish changes inside blocks from changes to the paths connecting them.

5.7 Residual, dense, and recurrent extensions

Having established the U-Net pathway and training procedure, we now examine changes inside its computational blocks. The subsections compare residual addition, dense concatenation, and recurrent updates. Follow which tensors each operation combines, whether their shapes must match, and which parameters are reused.

These distinctions provide a basis for understanding the extended architectures without treating their similar diagrams as equivalent computations.

5.7.1 Residual connections

Increasing depth can increase representational capacity while making optimization more difficult. A residual block learns a correction to a shortcut rather than requiring every layer to reconstruct the full representation. For an input tensor x and a learned transformation F, write

Illustrations are not included in the reading sample

Here / is an activation and F is the identity only when spatial sizes and channels match. Otherwise, a learned projection, often a 1x1 convolution with an appro-priate stride, aligns the shortcut with F(x). Residual learning was introduced and evaluated as an optimization strategy for deep networks; adding a shortcut does not guarantee that every deeper segmentation model trains faster or generalizes better.[144]

Before activation, the local derivative includes F + dF/dx. For an identity shortcut this contains an identity term, supplying a direct gradient route. It does not prevent every vanishing-gradient problem, because the surrounding operations and nonlinearities still matter. A residual U-Net uses such blocks inside the encoder and/or decoder while retaining the U-shaped multiscale arrangement. This internal addition is different from the encoder-to-decoder concatenation of the original U-Net.

If x and F(x) each have shape 32 x 32 x 64, addition produces the same shape. Concatenating them produces 32x32x 128. Addition requires corresponding channels to be combined; concatenation preserves distinct channels for a later learned transformation. Figure 5.10 makes this difference explicit so that an architectural drawing cannot silently interchange the two operations.

Wound application. Huttunen and colleagues evaluated a U-Net-related model with a pretrained ResNet34 encoder for wound-area and tissue segmentation in clinical photographs.[178] Residual features were therefore components of spatial prediction. Section 5.16 develops the application and distinguishes wound-area masks from individual tissue labels.

5.7.2 Dense connectivity

A dense block supplies each layer with the concatenation of earlier features:

Illustrations are not included in the reading sample

All tensors inside the brackets share a spatial grid. If xo has Co channels and each layer produces g new channels, the concatenated representation after L layers has Co + Lg channels. With Co = 32, g = 16, and L = 4, this is 96. The final new feature tensor alone still has 16 channels. DenseNet’s feature reuse motivates dense blocks in segmentation; its original classification evidence should not be described as a wound-segmentation experiment.[146]

Dense connectivity provides many routes for feature reuse but may require substantial activation memory. A transition layer can compress channels before downsampling. A dense U-Net therefore needs a channel budget, not merely more arrows. Residual and dense connections answer related optimization questions using different algebra: summing aligned representations versus preserving earlier representations as separate channels.

Wound application. Niri and colleagues included a DenseNet-backed U-Net in their wound-segmentation backbone comparison.[137] Dense connectivity supplied encoder features within the evaluated segmenter, rather than serving as an independently tested clinical mechanism. Section 5.16 develops the shared task and the limits of comparing backbone results.

Illustrations are not included in the reading sample

5.7.3 Recurrent residual blocks

R2U-Net combines recurrence within convolutional blocks with residual connections. A simplified recurrence for a fixed block input x is

Illustrations are not included in the reading sample

The convolution symbol * emphasizes that each update is spatial. The same Wy,Wr are reused across the T updates; this is not a stack of T independently parameterized convolutions. The residual output and recurrent feature must have compatible shapes. The paper evaluates recurrent residual U-shaped networks on retinal vessels, skin lesions, and lung segmentation, which motivates but does not establish performance on chronic-wound photographs.[208]

For a scalar teaching case, let x = 1, H j = 0.5, Tr = 0.25, 6 = 0, and use ReLU. Then ^([1]) = 0.5, ^([2]) = 0.625, and //'[3] = 0.65625. With an identity residual path, the third-step output is 1.65625. Parameters are reused, but computation and stored training states grow with the number of updates. Recurrence should therefore be compared at a stated number of steps and measured resource budget.

Figure 5.10 follows Equations (5.25)-(5.27): a bypass adds features, a dense path collects them, and a recurrent path updates them repeatedly. These changes alter local computation. The next question is how features at different resolutions should meet in the decoder.

5.8 Skip connections and multiscale fusion

Block design determines how features are transformed locally; fusion design de-termines which representations meet in the decoder. We now examine nested skip pathways, aggregation across several resolutions, and multiscale convolutional blocks. The subsections use UNet++, UNet 3+, and MultiResUNet to make those choices concrete, with attention to the spatial alignment and channel dimensions required before features can be combined.

5.8.1 UNet++: nested skip pathways

A shallow encoder feature emphasizes local detail; a deep decoder feature has undergone more abstraction. Concatenating them is valid when shapes match, but the representations may be difficult to combine. UNet++ addresses this semantic gap with nested intermediate convolutional nodes and optional deep supervision.[201] Let xz,° be an encoder feature at depth i; larger i means a coarser grid. A nested node at column j > 0 can be written

Illustrations are not included in the reading sample

The upsampling operator Ui+1^ aligns spatial dimensions before channel con-catenation. The learned block H^- maps the resulting channel count to its se-lected output width. For example, two 64 x 64 x 32 skip tensors and one aligned 64 x 64 x 64 decoder tensor concatenate to 128 channels; a convolution can then return 32 channels. A summation would be a different computation and would be invalid before matching widths.

Auxiliary output heads can supervise multiple top-row nodes. They also allow particular inference configurations to use fewer nested paths, but the chosen pruning rule and trained heads must be identified. More intermediate features can improve representational flexibility while increasing memory, implementation complexity, and opportunities to overfit a small dataset.

Wound application. Li and colleagues reported comparisons with U-Net++ in their study of wound-area segmentation during skin-graft surgery.[209] U-Net++ was a comparison architecture, while their proposed model was RACL U-Net. Section 5.15 develops the spatial evaluation needed to interpret such wound-model comparisons.

5.8.2 UNet 3+: multiscale fusion

UNet 3+ extends fusion beyond an adjacent encoder-decoder pair by aggregating features from multiple resolutions. Its full-scale connections aim to combine fine localization with larger-scale semantic context.[202] A dimensionally explicit abstraction is

Illustrations are not included in the reading sample

Here Sy is a selected encoder or already available decoder feature, Tyi pools or upsamples it to target grid i, and Py, projects its channels to a common width d. Concatenation yields nd channels. Five branches of width 64 therefore produce 320 channels before H,. The dependency order must use only features already computed; the diagram is a directed computation, not an instruction to solve circular equations.

Full-scale fusion makes context available at each decoding level, but its additional paths have a cost. The paper also studies deep supervision and a classification- guided component. A classification gate that suppresses a segmentation when an image is deemed negative can eliminate false positives while also eliminating a true small lesion if the gate is wrong. Such behavior requires case-level evaluation, not an architectural guarantee.

Wound application. Li and colleagues included U-Net3+ in the model comparisons reported for a wound-segmentation study of skin-graft surgery images.[209] This documents its use as a comparison model rather than the proposed RACL architecture. Section 5.15 develops task-matched interpretation of segmentation results.

5.8.3 MultiResUNet: multiscale blocks

MultiResUNet combines successive small convolutions to form features with different effective receptive fields, concatenates them, and uses residual paths to reduce the discrepancy between encoder and decoder features.[210] Three stride- one 3x3 convolutions have theoretical receptive-field sizes 3, 5, and 7 relative to their shared input, assuming unit dilation. If their outputs have widths c1,c2,c3, concatenating the three gives c1 + c2 + c3 channels. A residual projection must produce this same width before addition.

This construction should not be described as three independent large kernels with identical parameter counts. Sequential small kernels introduce intermediate nonlinearities and different parameter sharing. Nor does a larger theoretical receptive field prove that the trained network uses distant context effectively. Figure 5.11 compares a processed skip path, full-scale fusion, and a multiresolution block. Each panel shows how features are aligned before fusion; the benefit sought is clear, while its empirical value remains dataset-dependent.

These models enlarge or restructure the information delivered to the decoder. Sometimes the difficulty is not missing information but distracting information. Attention mechanisms address that next problem by learning how strongly particular features should contribute.

5.9 Attention and staged refinement

The preceding fusion methods specify which features reach the decoder. We next examine mechanisms that weight those features or use an earlier prediction to guide

Illustrations are not included in the reading sample

Figure 5.11. Original abstractions of nested skip refinement, full-scale aggregation, and mul-tiresolution features. Arrows indicate computation and resizing; concatenation preserves separate channel groups. The layouts illustrate principles rather than reproduce published architecture artwork.

a later stage. The discussion begins with gated skips, broadens to channel and spatial attention, and then introduces cascades and dilated context. Follow both the information supplied to each stage and the errors that its input could carry forward.

5.9.1 Attention U-Net: gated skips

An encoder skip can carry both useful boundary detail and irrelevant background. Attention U-Net uses a coarser contextual signal to gate the skip feature before fusion.[211] At location i, let x^ E R[6]^ be the skip vector and g. E Rc^ an aligned gating vector. An additive attention gate is

Illustrations are not included in the reading sample

The projections Wx E ^FxCx and Wg E ^FXC9 produce the same intermediate width F; c E -F maps to one scalar. If the projections operate on different spatial resolutions, resampling must align them, and the gate must return to the skip grid. The scalar a^ is broadcast over Cx channels. The gating operation is multiplication,

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 5.12. Original attention-gate computation. The sigmoid produces a spatial scalar map, broadcast across skip channels. Multiplication gates the skip; concatenation is a later, separate operation.

not concatenation. The gated feature may subsequently be concatenated with a decoder feature.

For xi = (2, —1) and ai = 0.25, the output is (0.5, -0.25). If ai = 0.75, it is (1.5, —0.75). These weights modulate a representation; they are not probabilities that the pixel is wound tissue. Figure 5.12 separates projection, addition, sigmoid, multiplication, and decoder concatenation. The original gate study concerns abdominal-organ segmentation. Wound-specific evidence must come from a wound study using a specified gate, not from the word “attention” alone.

Wound application. Niri and colleagues incorporated a spatial attention module, together with channel attention, into a VGG16 U-Net for wound-area segmenta- tion.[137] This is a specified wound adaptation of attention-based skip processing. Section 5.16 develops its comparison and transfer settings, rather than inferring wound performance from the original pancreas study.

5.9.2 Channel and spatial attention

Channel attention weights feature types. For X G RHXWXC, squeeze-and- excitation first pools tc = (BW)-[1] £. Xic and then computes a channel vector a = mH 2 ReLU(W1t)). The output is Xic = acXic, broadcasting over space.

Spatial attention instead supplies weights varying over positions. CBAM applies channel attention followed by a spatial attention map computed from channel- pooled features.[159, 212]

Using both operations is often called dual attention, but this name does not uniquely identify a network. A paper must specify the pooling, order, projections, and fusion. Niri and colleagues combined a VGG16-based U-Net with squeeze- and-excitation and spatial attention for chronic-wound segmentation. Their transfer and evaluation settings, discussed later, are part of the result.[137] A gate can also suppress subtle true tissue or learn an acquisition cue, so inspecting its map does not by itself establish faithful explanation or clinical validity.

Wound application. Zhang and colleagues incorporated CBAM into an improved UPerNet for chronic-wound tissue segmentation, alongside a feature-aligned pyramid and an updated prediction head.[213] The attention module was one component of that pipeline. Section 5.15 connects the tissue masks to appropriate spatial evaluation.

5.9.3 Cascades and atrous spatial pyramid pooling

A cascade uses one model’s output to guide a later model. DoubleU-Net combines two U-shaped networks and uses the first predicted mask to modulate the input supplied to the second stage; its design includes atrous spatial pyramid pooling (ASPP) for multiscale context.[214] A simplified computational description is

Illustrations are not included in the reading sample

where the mask is broadcast over input channels and F([1]) denotes any specified first-stage features passed to the second. The exact paper’s fusion/head design should be distinguished from this abstraction. If p([1]) nearly erases a true region, a second stage receiving only the masked input has limited opportunity to recover its original appearance.

Illustrations are not included in the reading sample

Figure 5.13. Original cascade and dilated-context schematic. The first probability mask modu-lates the image; multiscale branches collect context before fusion. Rates 1, 2, and 4 are a teaching configuration, not a claim about every DoubleU-Net implementation.

An atrous convolution samples a kernel at a dilation rate r; a k x k kernel has effective extent 1 + (k — 1)r along each axis. For k = 3 and r = 1,2,4, the extents are 3, 5, and 9. ASPP applies parallel context branches with different dilation rates and fuses their aligned outputs. This differs from downsampling the whole feature map. DeepLabv3+ uses an encoder-decoder design with atrous separable convolution; it is a related segmentation approach rather than an original U-Net block.[193]

Figure 5.13 shows both the advantage and the risk of staging: coarse localization focuses a refinement network, but early omissions can propagate. The multiscale branch diagram identifies the dilation rates as a synthetic example. A convincing comparison should control total computation, supervision, and inference stages, because a two-network cascade has more resources than a single baseline.

Wound application. Wang and colleagues localized foot ulcers before segmentation and used spatial-pyramid pooling in their decoder.[35] This documents staged processing and multiscale pooling; it does not establish use of atrous pooling or DoubleU-Net. Sections 5.16 and 8.9 connect wound regions to subsequent analysis.

5.10 Efficient models and self-configuring pipelines

This section explains how to choose a wound-segmentation pipeline when computational resources and dataset properties constrain the design. Wang and colleagues used a MobileNetV2-based wound segmenter and compared its parameter count with larger models, providing a wound-specific reason to examine efficiency alongside mask quality.[35]

We develop these decisions at three levels. First, we derive how depthwise and pointwise convolutions change the parameter cost of a dense convolution, following the mechanism used in MobileNets.[147] Next, MedNeXt illustrates the design of convolutional blocks for three-dimensional medical segmentation.[215] Finally, nnU-Net connects dataset properties to the configuration of preprocessing, architecture, training and post-processing.[216] By the end, you should be able to distinguish operation cost, network design and pipeline configuration, and identify the comparisons each requires in a wound study. Parameter savings must be checked against measured resource use, while evidence from volumetric imaging requires separate evaluation on wound photographs.

5.10.1 Efficiency tradeoffs

A dense k x k convolution from Cin to Cout channels has k[2]CinCout weights. A depthwise convolution applies one spatial filter per input channel; a following pointwise convolution mixes channels. Their combined count is

Illustrations are not included in the reading sample

For k = 3 and Cin = Cout = 64, this is 4,672 versus 36,864 weights, a ratio of approximately 0.127, ignoring biases. This arithmetic explains an efficiency mechanism, not an observed speedup. Memory access, kernel implementation, device, batch size, and image size determine actual latency. Lightweight pretrained encoders discussed in Chapter 4 can be paired with a U-shaped decoder, but tiny targets may suffer if spatial detail is discarded too early.

Wound application. Wang and colleagues selected a MobileNetV2-based en-coder for foot-ulcer segmentation and reported model-size comparisons with larger segmentation networks.[35] The application connects separable convolution to a complete wound-mask pipeline. Section 5.15 explains how to assess the resulting masks; Chapter 4 compares image-encoder families.

5.10.2 MedNeXt and its extensions

MedNeXt adapts ConvNeXt-style large-kernel convolutional blocks to volumetric medical segmentation, combining depthwise convolution, channel expansion/com- pression, residual paths, and a U-shaped hierarchy. Its UpKern procedure supports transfer between kernel sizes.[215] A block can be abstracted as y = x + W2fl(W1 Nonmi/\dw * x)), with projections when shapes change. A larger spatial kernel gathers more local context; it does not become global self-attention.

The MedNeXt-v2 preprint extends this line through architectural and train-ing scaling, including global response normalization and medical-image pretrain- ing.[217] A representative channel response normalization computes gc = ||Xc||2 over spatial locations, nc = gc/{C~[1] gJ + e), and

Illustrations are not included in the reading sample

The normalized response compares a channel’s activation magnitude with the average across channels; learnable yc,flc control its contribution. This is not voxelwise class normalization. The 2025 preprint is included as a recent volumetric development, with its publication status explicit. Its CT/MR evidence does not establish a wound-photograph advantage, and its larger pretraining resources must be considered in any comparison.

5.10.3 The nnU-Net pipeline

A network can fail because of unsuitable spacing, patch size, training schedule, loss, augmentation, or inference, even if its block design is sound. nnU-Net addresses these coupled choices through dataset analysis and a systematically configured

Illustrations are not included in the reading sample

Figure 5.14. Original distinction between an architectural block and a configured segmentation pipeline. The same architecture can produce different results under different preprocessing, supervision, and evaluation choices.

segmentation pipeline.[216] Its input is a dataset with defined images and labels; its output includes a processing/training/inference configuration. Calling it merely another skip-connection variant misses this distinction.

Figure 5.14 places architecture inside the larger pipeline. A wound baseline should document resizing and color processing, patient splits, target taxonomy, augmentation, training budget, thresholding, and postprocessing. The nnU-Net Revisited study emphasizes that strong, properly configured convolutional baselines remain competitive and that training choices can confound claimed architectural advances.[218] This supports fair experimental design; it does not imply that convolution always beats transformers, state-space models, or promptable systems.

With a credible baseline established, newer mechanisms can be evaluated for the specific limitation they address. The next section examines direct interactions between distant image regions, followed by recurrent state-space context and prompt-guided segmentation.

5.11 U-shaped Transformer segmentation

We now extend the context discussion from convolutional neighborhoods to attention over token representations. The first subsection explains the conversion

between spatial grids and tokens; the next follows that conversion in TransUNet and UNETR. Windowed variants then introduce a different interaction pattern. Throughout, track how the model returns from its internal representation to the spatial mask required by the segmentation task.

5.11.1 From grids to tokens

Convolutions build context through repeated local operations. Self-attention allows one token to combine information directly from other tokens in the same attention set. This may help connect spatially separated evidence, but it introduces representation and computational choices that a segmentation decoder must resolve. The attention mechanism introduced in the Transformer provides the computational foundation; segmentation architectures determine how it is applied to images.[219]

Divide an H x W x C image into nonoverlapping PxP patches, assuming P divides both dimensions. Flattening gives N = HW/P[2] vectors of length P[2]C. A linear embedding E E ^p[2]Cxd and positional vectors eg E Rd produce tokens

Illustrations are not included in the reading sample

A hybrid encoder can tokenize convolutional features instead of raw pixels. Positional information is needed because the attention operation alone does not know the original spatial arrangement. Learned absolute embeddings may require interpolation when the grid changes; relative position terms describe offsets within an attention neighborhood.

For one head, projections give Q = TWQ, K = TWK, and V = TWV, with Q,K E ^Nxdk and V E ^Nxdv. Scaled dot-product attention is

Illustrations are not included in the reading sample

Each row of A E qNxN sums to one and describes how an output token combines value vectors. For row scores (0, log 3), the weights are (0.25,0.75). Values (2,0) and (0,4) then yield output (0.5,3). Multiple heads use separate projections, concatenate their outputs, and project back to the model width. Residual paths, normalization, and feed-forward blocks complete a Transformer layer; attention is only one component.

For a 256 x 256 RGB image with P = 16, there are 256 tokens and each flattened patch contains 768 numbers. A global attention matrix has 65,536 entries per head. At 512 x 512 with the same patch size there are 1,024 tokens and 1,048,576 entries, sixteen times as many. Naive global attention has quadratic token-pair work and storage for the attention matrix; optimized kernels can reduce materialized memory without removing the underlying pairwise interaction count. A patch token is not a full-resolution mask pixel.

5.11.2 TransUNet and UNETR

The original 2021 TransUNet combines a convolutional feature extractor, Transformer encoding, and a decoder that uses high-resolution CNN features to recover localization.[220] This hybrid addresses a practical conflict: tokens support long- range interaction, while convolutional skip features retain local detail. Token outputs must be reshaped to their spatial grid before staged upsampling. The expanded 2024 journal version examines Transformer components in both encoder and decoder, including candidate-region refinement through cross-attention, and supports 2D and 3D frameworks. These are related publication versions with different scope, not interchangeable descriptions of the original model.[221]

Cross-attention uses queries from one representation and keys/values from another: O = softmax(QaKb / \/dk')Vb. If there are na region queries and nb spatial features, the attention matrix is na x nb. The operation asks which image features support each query, rather than requiring every query to originate from an image patch.

UNETR applies a Transformer encoder to volumetric patches and connects intermediate representations to a convolutional decoder.[222] For a 128[3] volume with 16[3] patches, N = 8[3] = 512 tokens. Reshaping a token sequence restores an 8x8x8 feature grid; it does not itself restore the original voxel resolution. Decoder

Illustrations are not included in the reading sample

Figure 5.15. Original token-to-mask schematic and two-token attention example. Patch embeddings interact as a sequence, then return to a spatial feature grid for decoding. The numerical weights are constructed teaching values.

upsampling and skip processing must supply the remaining spatial reconstruction. Attention can aggregate distant information, but patchification, training data, and positional representations can still limit boundary accuracy.

Figure 5.15 traces patch formation, token interaction, and reconstruction. Its attention example is the two-token calculation above. Keeping the tensor shapes visible prevents a common explanatory gap: calling a Transformer output a seg-mentation without explaining how a sequence returns to a spatial prediction.

Wound application. The TransUNet-GradCAM study combined convolutional processing and a Transformer bottleneck to segment foot ulcers.[43] This is a wound-specific TransUNet application, rather than evidence that every U-shaped Transformer variant was tested. Section 5.16 develops the study, including its ablations and reporting qualifications.

5.11.3 Windowed attention: Swin-Unet and Swin UNETR

Global attention becomes costly on high-resolution grids. Windowed attention divides the grid into local groups. With N tokens and m tokens per window, there are N/m windows, each with m[2] pairwise scores, for Nm scores overall. A 2D window of side w has m = w[2]; a 3D cubic window has m = w[3]. This is linear in N only when the window size remains fixed.

Illustrative grid; boundary masking is required.

For 256 tokens and 16-token windows: 4096 scores/head.

Figure 5.16. Original illustration of regular and shifted attention neighborhoods. Colors identify local groups; the dashed shifted partition permits communication across earlier boundaries. The cost example counts attention scores only.

Swin-style shifted windows alternate partitions so that information can cross previous window boundaries. Hierarchical patch merging reduces resolution and increases representation width. Swin-Unet builds a U-shaped encoder-decoder around Swin Transformer blocks, with patch expansion and skip connections.[223] Swin UNETR instead uses a hierarchical Swin encoder with a convolutional decoder for volumetric medical segmentation.[224] Their similar names should not conceal different dimensionality and decoder designs.

For a 16x16 token grid and 4x4 windows, there are 16 windows, each with 256 scores, or 4,096 total versus 65,536 for global attention. This excludes projections and other layers, so it is not a full-network speed ratio. Figure 5.16 shows how shifting changes neighborhood membership. Windowing lowers pairwise cost but requires multiple layers or hierarchy for distant communication; neither windowed nor global attention guarantees improvement over a properly trained convolutional baseline.

5.12 State-space extensions

Attention is one way to exchange information across a representation. This section introduces another pathway based on a recurrent state. We begin with the statespace recurrence and its discretization, then introduce input-dependent selection before examining U-Mamba and SegMamba. The progression connects the update

equations to spatial scan choices and the U-shaped decoder that must ultimately reconstruct the segmentation output.

5.12.1 State-space recurrence

State-space models offer another way to propagate context without explicitly constructing every token pair. Begin with a continuous linear system: hidden state h(t) E u", scalar input u(t), and scalar output y(t) satisfy

Illustrations are not included in the reading sample

where A E Rnxn, B E Rnx[1], C E R[1]xn, and D is a direct-path coefficient. In a neural sequence model the time index may represent token order, not physical elapsed time. Under a constant input over a step of length △, exact integration gives

Illustrations are not included in the reading sample

If A is invertible, B = A-[1] (eAA — 7)B; the integral form remains valid when it is singular. This derivation explains how continuous parameters become a discrete recurrence. Some implementations use a simplified discretization for the input term, which must not be silently called the exact formula.

Take A = —1, B = C = 1, D = 0, and △ = log 2. Then A = 1/2 and B = 1/2. Starting with h0 = 0 and inputs (1,0,1) gives states (0.5,0.25,0.625). The state retains a decaying summary of earlier inputs; it does not store each earlier token independently. Figure 5.17 follows this calculation and maps an image grid to alternative scan orders.

5.12.2 Input-dependent selection

Mamba introduces selective state-space computation in which quantities such as step sizes, input mappings, and readouts depend on the current input.[225] Schematically,

Illustrations are not included in the reading sample

The functions a, b, c are learned projections and At, Bt use the stated discretiza-tion. Positive step sizes and a suitable parameterization of A control how the state evolves. Content-dependent updates allow the model to retain or suppress information selectively. Real Mamba blocks also include feature projections, local convolution, gating, and output projection; Equation (5.38) isolates the state update rather than reproducing the entire block.

For fixed state size and feature width, a scan can have work proportional to sequence length. This theoretical scaling does not establish measured wall-clock speed or training memory on a specific device. Parallel scan implementation, saved activations, channel expansion, convolution, precision, and batch size all matter. A spatial feature map flattened to L = HW tokens keeps sequence length L during an ordinary channel expansion; doubling feature width changes C to 2C, not L to 2L.

Wound application. Nataliani and colleagues introduced DFU-MambaLiteUNet, combining a lightweight U-Net with a Mamba-lite context module for diabeticfoot-ulcer segmentation.[226] The state-space component belongs to that specific wound architecture. Section 5.16 connects the published design to its documented evidence boundary.

Figure 5.17. Original state-space teaching example. The upper path evaluates ht = 0.5ht_x + 0.5ut; lower grids show that scan order is a modeling choice. All states and inputs are synthetic.

5.12.3 U-Mamba and SegMamba

U-Mamba combines convolutional local processing with Mamba-based context inside a U-shaped medical segmentation framework.[227] A feature tensor is flattened or rearranged into a sequence, processed, and restored to its spatial grid. An internal channel expansion preserves the token count while expanding feature width. Keeping these axes distinct is essential when restoring the sequence to an image or volume.

SegMamba combines convolutional spatial modeling with state-space sequence modeling for 3D medical segmentation, using multiple spatial sequence orientations to capture volumetric relationships.[228] Scanning a volume along different orders changes which voxels become nearby in a sequence. Raster-order neighbors are not always anatomical neighbors, and a single forward scan has a direction preference. Multiple directions and local convolutions help address this mismatch; they do not turn a one-dimensional recurrence into unrestricted pairwise attention.

The figure links a mathematical recurrence to its spatial use: memory propagates along the selected ordering, while the U-shaped decoder reconstructs a mask. The original U-Mamba evaluations include abdominal organs, endoscopic instruments and microscopy; SegMamba reports brain-tumor segmentation on BraTS2023.[227, 228] Those tasks establish the models’ original evidence setting. Related wound studies below show how the broader convolution-state-space idea has been used in wound photographs; their architectures should be identified by their own names.

Lightweight ulcer segmentation. DFU-MambaLiteUNet places a Mamba-lite module in a Mobile U-Net bottleneck, with attention gates in the decoder and a Tversky training objective. The publisher’s introduction describes evaluation on DFUC2022, FUSC2021 and a primary clinical dataset.[226] For a wound researcher, this connects wider spatial context to a specific engineering question: can a compact encoder-decoder retain an irregular ulcer region without losing boundary detail? The combination also means that any improvement must be separated into contributions from the context module, attention gates and training choices. The available publisher preview supports this design description; it does not provide a fully verified patient-independent protocol for the comparisons here.

Nested skips and wound context. Velladurai and colleagues combined U-Net++ pathways with bidirectional Mamba blocks for diabetic-foot-ulcer segmentation, reporting DFUC2022 and FUSC2021 experiments.[229] This application places the long-range component alongside nested feature fusion: a useful control would compare U-Net++, U-Net++ with the state-space block, and the complete proposed training recipe. The paper’s FUSC2021 total and per-fold image counts do not reconcile, so this chapter uses it as a documented architecture example without importing a numerical ranking. Neither this study nor DFU-MambaLiteUNet is a direct wound evaluation of the original SegMamba network.

Direction-aware wound masks. DIRANet uses a VMamba backbone with direction-aware decoding and spatial consistency mechanisms; its reported evaluation includes WoundSeg and FUSeg alongside other medical-image datasets.[230] It supplies a wound-specific connection to the scan-order issue: converting a twodimensional grid into sequences changes neighborhood relationships, so directional feature fusion must be tested rather than assumed helpful. For wound masks, examine missed small regions, broken contours and false foreground as well as overlap, under a shared split and training budget. This evidence concerns DIRANet’s complete design, not an isolated proof that a scan direction or every Mamba variant is superior.

These applications motivate controlled wound experiments with a convolutional baseline, explicit scan choices, and measured latency and memory. A different limitation remains: a model may not know which visible region a user intends to segment. Promptable systems address that question by supplying target information with the image.

5.13 Promptable segmentation

A wound photograph may contain an open wound bed, surrounding skin, dressings and several candidate regions. A segmentation system therefore needs both an image representation and a clear indication of the region the analysis intends to measure. Promptable segmentation supplies some of that indication at inference through points, boxes, previous masks or, in newer systems, concepts. SAM formalizes this image-plus-prompt interface; a pediatric-burn adaptation illustrates its use in wound assessment.[231, 232]

This section follows the prompt through the complete workflow: how it specifies a target, how a model encodes it, how medical adaptation or sequence memory changes processing, and how a user can inspect and correct the resulting mask. We then examine concept prompts and the evidence needed for wound use. By the end, you should be able to distinguish interactive annotation from an automatically prompted pipeline and evaluate mask quality together with the information, effort and errors introduced by the prompt provider.

5.13.1 Region prompts

An automatic binary U-Net learns a predefined target from its training labels. A promptable model conditions its mask on additional information, such as posi- tive/negative points, a box, or a previous mask. A useful abstraction is

Illustrations are not included in the reading sample

where P is the prompt and s is a predicted quality score. The score is a learned estimate, not an observed overlap with an unknown reference. SAM separates an image encoder, prompt encoder, and mask decoder and can return multiple candidate masks for ambiguous prompts.[231] These components form a promptable segmentation system; calling every such system a U-Net variant would obscure its different operating assumptions.

The image encoder can compute features once for repeated interaction with the same image. The prompt encoder represents both the location and type of supplied information, allowing the decoder to combine it with those image features.[231] A prompt is therefore part of the inference input and must be available when the system is used. It is not a training label simply because an experimenter derived it from a reference mask. That derivation instead creates a particular evaluation condition, potentially supplying otherwise unavailable target location.

A positive point says that a location belongs to the intended object; a negative point excludes a location. Abox localizes a candidate region but does not determine the exact tissue boundary. The same image may legitimately yield different masks for “open wound bed” and “wound-associated region.” Figure 5.18 places editable prompt and contour overlays on a sourced clinical photograph. Its two contours illustrate alternative annotation conventions; neither was predicted by SAM or any other model.

An illustrative wound-annotation workflow. First define the intended label, such as the visible open wound bed under an agreed annotation protocol. A user

Illustrations are not included in the reading sample

Figure 5.18. A real clinical photograph with new editable prompt overlays. Kunjalwar et al. (2024), Figure 1A, a foot wound after toe disarticulation in the reported diabetic-foot case; CC BY 4.0.[233] The native A panel is selected. The box, points and schematic contours explain prompt structure and alternative boundaries; they are not clinical reference labels or SAM outputs.

could place a positive point inside that region and a negative point on an unwanted dressing or surrounding region. Alternatively, a box could localize the candidate wound while leaving the precise edge to the model. These are proposed teaching choices, not a validated clinical prompt prescription. After decoding, inspect both included and omitted tissue; an attractive mask or high predicted quality score does not confirm the target definition. Add a correction prompt where the mask fails, record the interaction, and obtain the expert-reviewed annotation before treating the result as a training reference. If several masks are returned, specify how one is selected rather than choosing retrospectively by its agreement with the test reference.

A prior mask can provide a dense spatial prompt, but it must be expressed in the current image’s coordinates. Resizing, cropping or changing viewpoint can invalidate a previously placed point, box or mask. Preserve the coordinate transformation and prompt history with the image. For physical area estimation, the accepted mask still needs the acquisition and scale assumptions developed in Section 5.15.

Wound application. Wang and colleagues adapted SAM in SAM-DR for pedi-

atric burn assessment from smartphone photographs, with box-based interaction and

adjustable depth thresholds.[232] This is an application to burn regions and depth-

related outputs. Section 5.15 connects the spatial predictions to target-specific assessment.

The burn study replaced SAM’s segmentation head with dense depth regres-sion and used clinician annotations to examine disagreement.[232] Its threshold- adjustable depth-related output is a task-specific adaptation, not a physical depth measurement in millimeters. This example shows why adapting a general mask interface requires defining both the target and the interpretation of the output.

A detector-plus-segmenter wound application. Choi and colleagues’ DFUCare conference abstract reports YOLO-based wound localization followed by SAM segmentation of diabetic-foot-ulcer photographs, with later extraction of wound characteristics.[234] This supplies a reported application of segmentation inside a broader wound-analysis pipeline. The abstract does not fully specify the prompt interface, interaction budget or patient-level separation; it should not be treated as a complete independently validated protocol. For a deployed automatic version, evaluate the localization stage and SAM together, retaining missed wounds in the failure count.

5.13.2 Medical adaptation and sequence memory

MedSAM adapts SAM to medical-image segmentation using broad medical-image training and box prompts.[235] Domain adaptation changes the learned representation or decoder to better match medical appearances; it does not remove ambiguity in the target definition. Full fine-tuning updates many parameters, whereas freezing the image encoder and training a decoder reduces trainable parameters but limits adaptation. Either approach must specify the source checkpoint, training data, prompt construction, and independent test protocol.

For wound photographs, keep the patient’s images within one development or test partition before adapting the model or constructing training prompts. A generic medical checkpoint and a wound-adapted checkpoint have different training access and should be reported separately. Compare them under the same promptconstruction rule; a tighter reference-derived box can improve localization information without demonstrating a better learned representation. If model-predicted masks are used to propose annotations, expert review and a separately maintained test reference remain necessary.

SAM 2 extends promptable segmentation to images and video with a memory mechanism that carries information across frames.[236] A simplified recurrence is Mt = Update(Mt_x,EXt, Yt), followed by decoding conditioned on current features, prompts, and memory. This is object-tracking memory, distinct from the selective state-space recurrence of the preceding section. Errors in a mask can enter memory and influence later frames.

MedSAM2 adapts this line to three-dimensional medical images and video.[237] Treating adjacent volume slices as a sequence uses anatomical continuity; treating wound photographs taken on different days as an equivalent video is not automatically justified. Dressing changes, viewpoint shifts, and actual healing can alter both appearance and target. The MedSAM2 preprint discussed here is the work by Ma and colleagues; similarly named independent projects should not be conflated with it.

Wound application. WILLIE incorporated a SAM2-Hiera backbone in its largest integrated wound model, alongside other pretrained representations.[26] This documents use of the SAM2 image backbone, rather than temporal tracking of serial wound visits. Section 6.16 develops the model and separates its classification, segmentation and localization evaluations.

5.13.3 SAM 3 and MedSAM3: concept prompts

SAM 3 expands prompting to concepts specified by short phrases, visual exemplars, or their combination, and returns masks for matching instances. Its system combines image-level detection with memory-based video tracking.[238] This development is relevant when the intended segmentation target must be expressed semantically, but a general concept vocabulary does not establish expertise in wound tissue taxonomy.

The MedSAM3 preprint investigates medical-concept prompting and adaptation of this newer family.[239] It is included as a recent direction for reducing dependence on manually placed geometric prompts, with its preprint status explicit. The chapter does not infer wound-specific clinical performance from broad medical benchmarks. A phrase such as “wound” can still be underspecified when annotators disagree about whether surrounding erythema belongs inside the mask.

An investigation might therefore compare a general concept such as “wound” with a protocol-defined target such as “visible open wound bed,” while recording the exact phrases and any geometric corrections. This is a proposed experiment, not evidence that either phrase is reliably recognized by a particular checkpoint. Clinical wound categories or tissue names require their own labelled evaluation. A concept prompt that finds the region cannot by itself establish infection, etiology or a treatment recommendation.

5.13.4 Evaluating human input

An interactive result with a reference-derived box answers a different question from fully automatic segmentation. Record who supplied the prompt, how it was constructed, whether it used the reference mask, how many corrections were allowed, and whether interaction time was measured. A detector-predicted box makes a pipeline automatic only when the detector is itself included in evaluation. Its failures cannot be excluded from the denominator.

For a wound study, predefine a stopping rule and report the first-prompt result, subsequent corrections and time spent per case. Separate the work of finding the wound from the work of refining its boundary. Include difficult cases in which prompting fails or the user cannot confidently define the target, and examine whether performance changes across acquisition conditions. Abox computed from the test reference is a useful information-rich control, with its reference access explicitly stated; it is not the automatic prompt source available in routine use.

For J successive prompts, a mask-quality curve D1,...,DJ shows improvement versus interaction budget. Reporting only the best mask after unlimited attempts hides effort and selection. Compare automatic methods at zero human prompts, or compare interactive methods under the same prompt policy. Prompt refinement resolves some target ambiguity, but disagreement can remain even after the task is specified. That motivates distributions over plausible masks rather than one forced answer.

5.14 Ambiguous boundaries and uncertainty

A poorly defined wound edge can leave several coherent contours consistent with the visible image, and the chosen contour changes the region whose area or tissue composition is assessed. In pediatric burns, the SAM-DR study examined disagreement between clinician annotations, illustrating that the reference itself can require scrutiny.[232] Model confidence must therefore be interpreted alongside the target definition and annotation process.

This section distinguishes uncertainty at individual pixels from uncertainty over complete boundaries. We first explain why an averaged probability map need not preserve a coherent alternative contour. Probabilistic U-Net then introduces an image-conditioned distribution over masks, while diffusion-based segmentation produces masks through successive denoising steps.[240, 241] These are broader medical-imaging mechanisms to investigate for wound tasks, with their original evidence settings kept explicit. The reader should be able to explain what each representation captures and what annotation, calibration and error checks are needed before interpreting its alternatives.

5.14.1 Pixel confidence and contour uncertainty

A soft mask supplies marginal pixel probabilities. Thresholding it yields one contour, potentially averaging incompatible interpretations. If two annotators choose different but internally coherent boundaries, independent pixel sampling from their averaged probabilities can produce scattered, anatomically implausible 284

masks. A distribution over whole masks can represent structured alternatives. Annotation disagreement may reflect visibility, different protocols, or mistakes; it should not automatically be treated as irreducible biological uncertainty.

Predictive uncertainty can arise from limited model knowledge or variability in the observations and labels. Repeated predictions from an ensemble or stochastic model can reveal disagreement, but disagreement alone is not calibrated error probability. For S sampled binary probabilities p(s), the mean p^ = S—[1] ^$ p(s) and entropy p, log p^ — (1 — pj log(1 — pj describe aspects of the predictions. They do not identify the cause of uncertainty without further assumptions and validation.

Wound application. The TransUNet-GradCAM study evaluated pixel calibration and uncertainty alongside foot-ulcer masks, including whether uncertainty tracked segmentation quality.[43] This is a wound application of uncertainty assessment rather than proof of reliable failure detection. Section 5.16 develops that distinction and the reported study findings.

5.14.2 Probabilistic U-Net

Probabilistic U-Net combines a U-Net representation with a conditional latent-variable model to sample plausible segmentations.[240] Let z G Rd be a latent vector, p£z | X) an image-conditioned prior, and p0(K | X,z) the segmentation likelihood. Then

The integral is generally intractable. During training, a posterior network q^(z | X, y) uses the image and an observed annotation. Jensen’s inequality gives a lower bound on log likelihood:

Illustrations are not included in the reading sample

Minimizing the negative bound combines a reconstruction loss with a KL penalty. Apractical weighted objective is

Illustrations are not included in the reading sample

It is the ordinary negative evidence lower bound when fl = 1; other weights deliberately change the objective. Reparameterizing z = //q + aq Oe, e ~ N(0,1), permits gradients through the sampled latent. At inference, the reference mask is unavailable, so samples come from the image-conditioned prior, not the training posterior.

For diagonal Gaussian posterior and prior, the KL term is

With one-dimensional q = W(1,0.5[2]) and p = W(0,1), this is (log4 + 0.25 + 1 — 1)/2 ^ 0.8181. The KL term encourages the inference-time prior to cover latent choices learned from annotations; too strong a penalty can suppress useful diversity. Figure 5.19 distinguishes the training-only posterior from the inference prior and shows several synthetic coherent contours.

5.14.3 Diffusion-based mask refinement

Diffusion-based segmentation offers a different way to construct a spatial prediction: a model learns to turn a noisy mask representation into an image-conditioned segmentation through repeated updates. The photograph supplies the conditioning information; the output object is the mask. Here, “refinement” refers to these successive denoising steps and does not assume that a separate coarse segmenter or a user has supplied the starting contour. MedSegDiff develops this approach for fundus, MRI and ultrasound segmentation.[241]

For wound research, the question is whether such sampling can represent de-fensible alternative boundaries and justify its added inference cost. The cited MedSegDiff experiments do not establish that benefit for wound photographs. The following equations separate the forward process used to create noisy training examples from the reverse process learned for prediction, so that the role of noise, conditioning and repeated sampling can be followed explicitly. For a clean encoded mask Y0, define noise levels Pt E (0,1), at = 1 — Pt, and at = HE as. A forward sample is

Illustrations are not included in the reading sample

A noise predictor can be trained with E||e — ed(Yt,t,X)^2, often supplemented by task-specific terms. A standard noise-parameterized reverse mean has the form

The selected sampler adds a specified variance term or uses a deterministic update; the final continuous representation must be decoded to class labels. For at = 0.64, the forward sample is 0.8Y0 + 0.6e. This calculation explains the noise mixture, not a prediction-quality claim.

MedSegDiff develops image-conditioned diffusion for medical segmentation, including dynamic conditioning and feature-frequency processing.[241] This is a related mask-prediction approach, even when its denoiser contains U-shaped components. Multiple denoising steps increase inference cost; diverse samples can

be wrong in the same way, and averaging can erase meaningful alternatives. The relevant question for wounds is whether the method represents defensible boundary uncertainty and improves a specified evaluation, not whether it can produce visually convincing images. The next section makes those evaluation requirements explicit.

5.15 Mask evaluation and wound measurement

A predicted mask can be assessed as a spatial label map or used to estimate a physical wound measurement. These require different comparisons. We begin with overlap, then examine boundary distances, coordinate conventions, and aggregation across cases. The final subsection introduces calibrated area estimation. Together, the subsections distinguish agreement with a reference mask from a measurement supported by image geometry.

5.15.1 Overlap metrics

Using the mask convention from Section 2.5.9, let A be a predicted region and B its reference on the same grid. The overlap counts are TP = |A A B|, FP = |A \ B|, and FN = |B \ A|. Then

Precision describes how much predicted foreground is correct; recall describes how much reference foreground is recovered. Overall pixel accuracy can be high when a small wound is entirely missed because background dominates the count. Specify the positive class and whether the reported score includes background. The metric-pitfalls analysis and Metrics Reloaded framework explain why task properties, class imbalance, and aggregation must guide metric selection.[21, 22]

For one nonempty pair of masks, D = 2J/(l+J), where D is Dice and J isIoU. Thus D > J. This identity applies to the same masks and counting convention; it does not generally transform a mean IoU into a mean Dice. For a synthetic

Illustrations are not included in the reading sample

Figure 5.20. Original set-based explanation of mask errors. The numerical counts are synthetic and independent of the drawn region areas. Dice and IoU use the same overlap counts but different denominators.

example with TP = 80, FP = 20, FN = 40, Dice is 160/220 « 0.7273, IoU is 80/140 « 0.5714, precision is 0.8, and recall is 2/3. Figure 5.20 marks the three regions that contribute to these calculations.

If both masks are empty, the overlap fractions are undefined without a convention. Assigning a score of one recognizes a correct negative prediction but can inflate an average dominated by negative images. Excluding empty pairs changes the evaluated population. If only one mask is empty, Dice and IoU are zero; precision or recall may still have a zero denominator. State the rule and report the number of empty cases separately.

5.15.2 Boundary distances and coordinates

For boundary point sets cM. and CB, let d(a,5B) = minbG(9B ||u—b^2 • Asymmetric Hausdorff distance is

It highlights the worst boundary discrepancy but is sensitive to a single outlier. HD95 replaces the maximum with a stated 95th-percentile convention. Two possible conventions take either the maximum of the two directional percentiles or a percentile of pooled distances. These need not agree. A point-count-weighted average symmetric surface distance is

Illustrations are not included in the reading sample

Other conventions average the two directional means equally. State which is used, how the boundary is extracted, and whether points represent equal surface area. An empty boundary requires an explicit failure or exclusion rule; a finite distance should not be invented.

Distances measured on resized images are in resized pixels unless converted with a valid scale. A five-pixel error has different physical meaning at different resolutions and camera distances. Overlap and boundary metrics therefore com-plement each other. They also remain conditional on the reference annotation; disagreement among experts should be examined rather than hidden behind the term “ground truth.”

Wound application. The TransUNet-GradCAM study reported HD95 and av-erage symmetric surface distance for predicted foot-ulcer boundaries.[43] These measures evaluate contour disagreement in the stated coordinate system, separately from overlap. Section 5.16 develops the wound study and Section 8.8 connects spatial errors to failure analysis.

5.15.3 Aggregation, independence, and uncertainty

Macro averaging gives each case equal weight: D = n-[1] £y. D-.. Micro averaging sums pixel counts first: D^ = 2 £y. TPy/(2 £y. TPj + ^. FPj + ^. FNj). Large wounds contribute more to the latter. For one perfect large case with TP = 100 and one missed small case with FN = 1, the macro Dice is 0.5 while micro Dice is 200/201 « 0.9950. Neither number is an arithmetic mistake; they answer different questions.

Repeated photographs from one wound or patient are correlated. Splitting images at random can place the same patient in both training and testing, and

treating all their photographs as independent can make intervals artificially narrow. Group splitting by patient, and when appropriate by wound episode, should precede augmentation. An external cohort should remain independent of model selection. Device, center, skin appearance, acquisition distance, and wound type should be described so that readers can judge what changed between cohorts.

A practical patient-level bootstrap resamples patients with replacement and includes all their associated observations in each resample. It then recomputes the chosen aggregate metric and derives a percentile interval from the bootstrap distribution. This is an analysis recommendation, not an interval supplied for the studies below. Variation across random training seeds measures a different source of variability and is not a substitute for a patient-sampling interval. Report both when available, together with failure counts and per-case distributions.

5.15.4 Calibrated wound area

A mask identifies pixels; physical area requires geometry. If a planar target is imaged with a valid constant scale sx ,sy in millimeters per pixel, then

Illustrations are not included in the reading sample

For a 20-mm reference spanning 100 pixels in the same plane, an isotropic scale is s = 0.2 mm/pixel. A 5,000-pixel wound then has estimated projected area 5000(0.2)[2] = 200 mm[2] = 2 cm[2]. The scale must apply at the wound; a ruler closer to the camera is not an interchangeable reference. Perspective rectification requires an appropriate planar calibration, and curved surfaces may require 3D geometry rather than a single scale.

The first-order sensitivity of A = Vs[2] is kA/A A ky y . 2ks/s. A 5% scale error alone yields approximately a 10% area error; exactly, increasing scale by 5% increases area by 1.05[2] — 1 = 10.25%. For small independent random errors, relative variances instead add approximately as (GA/A)[2] A ia.v/.V r +4(as/s)[2].

Illustrations are not included in the reading sample

Assumptions: common plane, valid scale, defined contour.

A scale error is squared when converting pixels to area.

Illustrations are not included in the reading sample

Figure 5.21. Original calibrated-area example. The scale and mask counts are synthetic. Converting a mask to physical area requires a reference in the applicable plane; the result is projected planar area under the stated assumptions.

Neither expression accounts for systematic perspective or curvature errors. Fig-ure 5.21 separates segmentation, scale calibration, and physical assumptions.

A segmentation metric alone cannot establish accurate depth, volume, healing rate, infection assessment, or a treatment benefit. Longitudinal area change additionally requires consistent target definitions and measurement geometry. These distinctions guide the evidence review that follows.

Wound application. Liu and colleagues combined wound masks with LiDAR information to estimate pressure-injury area and compared the measurements with a manual reference.[24] This is a physical-measurement application beyond agreement in image pixels. Chapter 1 introduces the assessment question, while Section 5.16 places measurement beside segmentation studies.

5.16 Evidence from wound studies

The preceding sections provide mechanisms and evaluation tools; we now use them to read wound-study evidence. We begin with wound-region segmentation and its testing conditions, then separate tissue, measurement, and preclinical studies by their targets. The closing subsection explains how to design an informative comparison. This keeps the evidence for an architectural choice tied to the question that the study actually tested.

5.16.1 Tasks and evaluation settings

The studies below were selected to connect the architectural mechanisms to woundregion segmentation, tissue labels, and measurement. They are not a league table. A result obtained after fine-tuning on the target dataset is different from transfer without retraining; a validation result is different from an untouched test result; a preclinical wound model is different from a patient photograph. The 2026 Mind the Gap survey catalogs wound datasets and methods and discusses clinical translation. It is used here for its synthesis and dataset-overlap concerns, not as a substitute for primary numerical evidence.[242]

Niri and colleagues assembled WTS with 2,230 images and a stated 70/20/10 image split; their segmentation target in this study was wound area, despite the availability of tissue annotations. The reported 94.10% Dice and 89.30% IoU are from the WTS test evaluation after adaptation, not the initial cross-dataset evaluation. Table 5.3 therefore ties the numbers to Table 5 and the generalizationexperiment section of that paper.[137] The finding supports the studied pipeline and setting; it does not independently isolate every architectural component or establish effectiveness in a new hospital.

The 2026 TransUNet-GradCAM study provides a useful ablation lesson. Its hybrid loss was the only tested component with a statistically significant effect on in-domain Dice; removing the Transformer bottleneck, gates, or augmentation produced smaller nonsignificant changes. Internal evaluation used the 200-image FUSeg validation set, with a reported five-seed mean Dice of 0.8035 ± 0.0053 (95% confidence interval across seeds). External application without fine-tuning achieved Dice 0.7460 on 278 AZH images, while the eight-image Medetec subset was too small for a reliable benchmark. These are author-reported findings of partial transfer, not robust generalization to arbitrary clinical settings. Threshold descriptions require care: the abstract describes a single fixed threshold, while the

Table 5.3. Selected human wound-region studies under different evaluation protocols. The interpretation column and accompanying discussion state the relevant source-specific limitations; scores are not a cross-study ranking.

Illustrations are not included in the reading sample

detailed results explain validation-based threshold selection separately for each seed, followed by a fixed threshold for subsequent evaluation of that run. The per-seed tables follow the latter description. Read these as seed-specific operating points, rather than one shared threshold across all runs.[43]

The same study found a distinction between attribution localization and faithfulness: a visually concentrated Grad-CAM map was not automatically the more faithful account of model behavior. Its uncertainty score also did not predict perimage Dice in the reported analysis. Thus, neither a persuasive heat map nor a low aggregate pixel-calibration error should be described as a validated failure detector.[43]

Marchal and colleagues compared U-Net with YOLO segmentation across several data configurations and selected thresholds using mean IoU across folds. Their U-Net Dice of 62.2% and IoU of 43.2% belong to a particular within-FUSeg setting in Table 6, not to U-Net in general. Comparing them with a headline result from another configuration would confound architecture with evaluation. Moreover, the published Dice/IoU pair cannot be reconciled as equally weighted means of the same per-case binary masks using the identity above: mean IoU of 0.432 permits mean Dice of at most approximately 0.6034, below the quoted 0.622. This identifies a need to clarify the aggregation or table values; it does not justify inventing corrected scores.[243] ERYXSeg provides another reporting lesson: its primary foot-ulcer dataset is described as 1,109 images, but the stated split counts 567, 121, and 122 sum to 810 and do not match the stated percentages. This discrepancy remains unresolved; no replacement count is inferred.[244]

5.16.2 Tissue, measurement, and preclinical studies

Table 5.4 separates the additional evidence by its task and reporting boundary. Use those conditions when deciding whether a method informs wound-region or tissue analysis.

Huttunen and colleagues evaluated wound area and several tissue structures using routine clinical photographs. Their 362 images came from 62 patients and included repeated images; 289 images were assigned to training and 73 to validation, without a separate test set. The paper reports weaker results for less represented tissues and excludes several extremely rare structures from analysis.[178] This is useful evidence about the difference between region segmentation and tissue segmentation, but it should not be rewritten as independent patient-level test performance.

Alabdulhafith and colleagues’ ResNet34-U-Net study used an experimental mouse wound dataset with repeated observations and reference splints.[245] Its population is essential to interpreting the experiment. Describing it simply as chronic-wound evidence conceals that distinction. It is an animal-model segmen-

Table 5.4. Distinct tasks and populations that must not be merged into one wound-segmentation ranking.

Illustrations are not included in the reading sample

tation example; its high reported overlap does not predict performance on patient photographs.

UlcerNet combines dense convolution with attention and receptive-field modules; it should not be mislabeled a Transformer model. The article was published in 2026. Its reported headline Dice and mean-IoU values require a clearer reconciliation of aggregation conventions before they can enter a comparable numerical table. The paper separately reports a matched-baseline analysis with per-image metrics, illustrating why the specific table and aggregation convention should accompany any quoted result.[246]

5.16.3 Designing an informative comparison

A useful ablation changes one component at a time while retaining the data split, preprocessing, optimizer, training budget, and inference policy. Compare a new attention or state-space block with a credible baseline of similar capacity, and report parameter count, computational work, and measured latency separately. If pretraining differs, its data and cost belong in the comparison. If prompts differ, their source and interaction budget belong in the comparison.

Failure analysis should show missed small wounds, boundary leakage into skin or dressings, confusion among tissue appearances, and errors under glare or blur. A larger average score can conceal systematic failure on underrepresented appearances. Report subgroup sample sizes and uncertainty before interpreting differences, and avoid treating a skin-tone scale as a complete description of ac-quisition or demographic variation. A model’s appropriate role depends on the consequences of its errors, not only on its mean overlap.

Evidence of accurate masks is an intermediate technical result. Demonstrat-ing improved care requires a separate clinical study with relevant endpoints and workflow assessment. This chapter therefore distinguishes published segmentation findings, original teaching examples, and worked arithmetic throughout.

5.17 Chapter review

This review helps you justify a segmentation pipeline for a defined wound target and identify the evidence needed to evaluate it. Begin by stating the limitation: missing boundary detail, limited annotations, long-range context, constrained computation, unclear target intent or disagreement between annotations. The first comparison links these problems to candidate mechanisms and the checks each requires. A shared architectural diagram then helps distinguish changes to an operation, an encoder-decoder, or an entire configured pipeline.

Use the worked exercises to check geometry, loss interpretation, context cost, state updates, physical measurement and fair access to prompts. In interpreting the wound studies, keep the tested architecture, data and protocol visible: a related Mamba design is not a wound validation of every state-space network, and an interactive mask includes information and effort from its prompt provider. The closing summary connects these choices to uncertainty assessment and to the downstream classification pipelines developed in the following chapter.

5.17.1 Model selection by task

The architectural families can be organized by the limitation they target. Table 5.5 is a reasoning guide, not an empirical ranking. Begin with an explicit mask definition and a well-configured U-Net baseline. Add complexity when an error analysis identifies a problem that the proposed change can plausibly address, then test that explanation with controlled comparisons.

Table 5.5. A problem-driven selection guide. Each candidate requires validation on the intended wound population and acquisition conditions.

Illustrations are not included in the reading sample

Illustrative research choice. Suppose predicted masks miss small peripheral wound regions in smartphone photographs. Inspect input resolution, output stride, and annotator disagreement before adding a larger context module. Compare one targeted change with the configured U-Net baseline under the same training budget. Report overlap per image and an explicitly defined boundary distance on a common coordinate grid, with an empty-mask policy. Large central regions can dominate overlap while clinically relevant edges remain inaccurate. This experiment tests spatial reconstruction; classification requires its own endpoint.

A model choice also determines what evidence must be collected. A volume model needs spacing and orientation; an interactive model needs prompt accounting; a measurement system needs calibration; a tissue model needs tissue-specific annotation and evaluation. Improving the architecture cannot compensate for a mismatched target or an invalid test design.

5.17.2 Architectural mechanisms compared

Figure 5.22 keeps the encoder-to-decoder path visible while marking what changes between families. U-Net copies encoder features; UNet++ processes them through nested paths; Attention U-Net multiplies them by learned gates. These are distinct operations, even when their outer diagrams all resemble the letter U.[194, 201, 211] The shared drawing is an explanatory abstraction: exact layer counts, padding, normalization, and output heads remain model-specific.

The TransUNet row highlights token interaction in a hybrid encoder, while the U- Mamba row highlights a selective-state block in a bottleneck configuration. Neither operation eliminates the decoder’s need to reconstruct a spatial grid.[220, 227] The final row deliberately separates promptable segmentation: the mask decoder receives image features and an encoded target prompt rather than relying only on a fixed training-time label definition.[231]

copy

Illustrations are not included in the reading sample

Figure 5.22. Original comparison of architectural mechanisms on a shared visual scaffold. Dashed paths carry encoder features, with their processing stated above each path. Colored central blocks identify context operations. The promptable row has two inputs to its mask decoder. These simplified flows are not complete implementation specifications or a performance ranking.

What each block does. Read each arrow as the transfer of a feature representation. The ordinary encoder-decoder rows and the promptable row have different input requirements. The labels in Figure 5.22 denote the following operations:

• Encoder and convolution. The encoder converts an image into feature maps, usually reducing spatial resolution while increasing the feature channels. A convolution combines nearby values with learned filters. Its local processing is the reference mechanism in the first three rows.[194, 201, 211]
• Decoder and skip paths. A decoder reconstructs a spatial grid and fuses features to predict the mask. U-Net concatenates copied encoder features with decoder features; UNet++ processes intermediate skip features through nested blocks; Attention U-Net weights skip features using learned gates before fusion. Copying, processing, and gating are different operations.[194, 201, 211]
• Token attention. TransUNet represents encoded image information as tokens and combines token values using learned attention weights. This supplies interactions beyond a local convolutional neighborhood, while the decoder restores spatial detail.[220]
• Selective state. The U-Mamba bottleneck shown here propagates an input-dependent state through an ordered feature sequence and combines this context with convolutional processing. The state block supplies context features; it does not itself define the final wound mask.[227]
• Image encoder and prompt encoder. In the promptable row, the image encoder produces image features. The prompt encoder converts points, boxes, or a mask indicating the requested region into feature representations. In SAM, points and box corners use positional encodings with learned type embeddings; mask prompts use convolutions. The prompt specifies the target rather than supplying a wound-type diagnosis.[231]
• Mask decoder. SAM combines image and prompt representations through attention and a mask-prediction head. It can return several candidate masks with learned quality estimates when a prompt is ambiguous. Section 5.13 develops the inputs and interpretation of this promptable alternative.[231]

The comparison must also include what a figure cannot show. An attention gate can suppress a true low-contrast region; a state-space block can propagate an unhelpful scan-order bias; a prompt can supply localization information unavailable to an automatic baseline. Table 5.6 links the visual mechanism to the comparison needed to evaluate it. The proposed checks are study-design recommendations, not reported improvements.

Table 5.6. Segmentation mechanisms and their possible contribution to classification. Classifi-cation benefit must be tested downstream using predicted outputs.

Illustrations are not included in the reading sample

Illustrative classification comparison. Suppose a team proposes Attention U- Net to remove distracting dressings before wound-type classification. Compare full-image classification with classification from automatically predicted crops. A crop from a reference mask is a separate oracle control: it supplies localization unavailable at automatic inference. Use the same classifier development procedure for the deployed alternatives and include segmentation cost. For shared features, compare classification-only and joint training explicitly. Higher Dice alone cannot establish which pipeline classifies better, and the oracle control cannot substitute for testing automatic localization.

Evidence can overturn an attractive architectural story. The nnU-Net Revis-ited benchmark found strong configured CNN baselines across its six volumetric datasets and showed that training choices affect comparisons with newer families; its results are not wound-specific.[218] In the wound-specific TransUNet-GradCAM ablation, adding the Transformer did not produce a significant in-domain Dice gain, whereas the hybrid loss did, subject to the reporting qualifications in Section 5.16.[43] Consequently, the recreated architecture and segmentation panels teach what the computation can change. The empirical evidence determines whether that change helped in a stated experiment.

5.17.3 Worked review exercises

1. Geometry. A padded block preserves a 64 x 64 x 32 encoder feature. An upsampled decoder feature has shape 64 x 64 x 64. What is the concatenated shape, and can the features be added directly? Answer: 64 x 64 x 96; direct addition is invalid because channels differ. A projection can align them, but then addition implements a different fusion.
2. Original U-Net. Why does the original 572-pixel input produce a 388-pixel output? Answer: valid convolutions shrink the feature grids repeatedly. Encoder features are cropped to the decoder grid before concatenation. Padding every convolution would change this dimension trace; consult Table 5.2 rather than applying a modern padded assumption.
3. Loss and decision. For reference mask (1,1,0,0), probabilities (0.8,0.6,0.2,0.1), threshold 0.5, no smoothing, and mean binary cross-entropy with natural logarithms, can hard Dice be one while cross-entropy is nonzero? Answer: yes. Thresholding gives the exact reference mask, so hard Dice is one. Mean binary cross-entropy is — [log0.8 + log0.6 + log0.8 + log0.9]/4 « 0.2656. Correct decisions and perfectly certain probabilities are different properties.
4. Attention cost. A 16 x 16 token grid uses 4x4 windows. How many pairwise attention scores are formed per head? Answer: 16 x 16[2] = 4096, versus 256[2] = 65536 globally. Projection and decoder costs are excluded.
5. State memory. For ^f = 0.5dt_x + 0.5ut, A0 = 0, and u = (1,0,1), compute the final state. Answer: successive states are 0.5, 0.25, and 0.625. This is a worked recurrence, not a trained model result.
6. Area. A 20-mm ruler segment spans 100 pixels and the wound mask contains 5,000 pixels. What area follows under planar isotropic calibration? Answer: 2 cm[2]. The scale is 20/100 = 0.2 mm/pixel, so 5000(0.2)[2] = 200 mm[2] = 2 cm[2]. If this millimeters-per-pixel scale is 5% too large, area is multiplied by 1.05[2], giving 2(1.05)[2] = 2.205 cm[2] before any segmentation error.
7. Evidence. One model has a higher test Dice after target-domain fine-tuning; another is applied without retraining. Does this establish a superior architecture? Answer: no. Training access and domain adaptation differ. A fair architecture comparison must hold these conditions fixed or explicitly study their effects.
8. Prompting. A reference-derived box is supplied to one model, while another must locate the wound automatically. What is missing from the comparison? Answer: equivalent localization information or an explicit accounting of the box provider’s accuracy and effort. The prompted result does not by itself establish automatic performance.

5.17.4 Chapter summary

Segmentation predicts a spatial mask whose meaning depends on the wound or tissue annotation. U-Net combines contextual features with spatial detail through an encoder, decoder and skip connections. Its extensions change feature fusion, context propagation, efficiency or the output representation. Distinguish the cost of a separable convolution, the design of a network such as MedNeXt, and nnU- Net’s configuration of a complete pipeline. Published wound-specific Mamba designs provide application examples, while the original U-Mamba and SegMamba evidence retains its own task boundaries.

Promptable systems add target information through points, boxes, masks or concepts. Their evaluation must account for prompt access, correction effort and localization failures. Uncertain edges may require coherent alternative contours; pixel confidence, latent-mask sampling and diffusion denoising represent different aspects of that problem. Evaluate overlap, boundaries, calibration and failures under a stated annotation protocol. Physical area additionally requires acquisition and scale assumptions. When masks supply classifier crops or features, assess downstream performance and total cost. Chapter 6 develops the corresponding classification and hybrid-model questions.

Chapter 6

Transformer-Based Wound Classification

6.1 Motivation and objectives

An image can document a wound’s appearance, but interpreting that appearance requires a clinical question. Is the target the wound’s cause, the presence of infection, a tissue component, or the boundary of an open region? These questions require different reference labels and different evidence. Diabetes-related foot disease, for example, can involve neuropathy and impaired circulation; a photograph does not directly measure either process. Infection assessment also depends on clinical signs and symptoms, rather than an image label alone.[247, 248]

The motivation for computational assistance is therefore specific: organize reproducible image measurements and predictions that can be evaluated against a defined reference standard. Diabetes-related foot ulcers can impose prolonged care and substantial burden, but retrospective image accuracy does not demonstrate improved healing, reduced amputation, or safer treatment. Clinical motivation and technical performance must be established separately. The clinical overview in Chapter 1 and the reporting principles in CLAIM provide the context for this distinction.[6, 20]

Chapter 4 developed convolutional classification, while Chapter 5 explained how a network predicts a spatial mask. This chapter returns to classification and asks how a model can combine texture, wound extent, surrounding anatomy, and optional metadata. Attention offers a learned way to exchange information between representations. Vision Transformers turn image regions into tokens; hierarchical and hybrid designs alter how those tokens are formed and connected. These mechanisms motivate testable hypotheses, rather than a presumption that a Transformer must outperform a CNN.[219, 249, 250]

By the end of the chapter, the reader should be able to define a classification endpoint, trace tensors through an attention model, choose a defensible baseline, implement a training procedure from pseudocode, and explain what an evaluation does and does not establish. The numerical examples are original teaching calculations. No clinical model is trained in this chapter. A practical study still requires suitable data, permission to use them, clinical label review, and an independently evaluated implementation.

Notation for this chapter. Table 6.1 emphasizes token matrices and their di-mensions. In attention, inputs are arranged as rows; classification counts and probabilities retain the meanings established in the evaluation tutorial.

Table 6.1. Notation guide for Chapter 6.

Illustrations are not included in the reading sample

6.2 Defining wound classification

Before developing a Transformer classifier, we must specify which wound-related decision its output represents. The following subsections define the input record, target, and decision rule, distinguish task-specific labels, and formulate a measurable research endpoint. This gives the later attention equations a concrete purpose and establishes the reference information needed to evaluate their predictions.

6.2.1 Inputs, targets, and decisions

Let a dataset contain n observations. Observation i consists of a red-green-blue (RGB) image Xt E RHXWX[3], optional metadata m, E R[9], and a reference label Pt. Here H and W are pixel counts, not physical lengths. Retain a patient identifier pt, a wound identifier, acquisition time, and source institution separately from the model inputs. Their immediate purpose is grouping and auditing; feeding them to a model would usually encourage memorization.

For K mutually exclusive labels, a classifier produces logits z = fe(X,m) E RK . A logit is an unconstrained real score. Softmax converts scores into a categorical probability vector:

Illustrations are not included in the reading sample

Subtracting the same maximum leaves the result unchanged and avoids unnecessarily large exponentials. The probabilities sum to one, but this algebraic property does not establish calibration or clinical certainty. A model trained on four wound categories will still select one of them when given an unfamiliar lesion unless an explicit rejection policy is provided.

In a multilabel problem, p E {0,1}K permits several positive endpoints. Sep-arate sigmoid probabilities pk = a(zk) = 1/(1 + e~zk) and thresholds tk give Pk = 1[pk > tk\. They need not sum to one. A photograph could contain both gran-ulation and slough, or depict a diabetes-related ulcer with a separately annotated infection endpoint. This does not make every wound-etiology dataset multilabel: its labeling rules determine the formulation. Thresholds are chosen using development data, never the final test labels.

6.2.2 Task-specific labels

Wound-type classification assigns an image or region to an etiological or op-erational category. Tissue classification assigns a label to a patch or a set of visible components. Semantic segmentation assigns labels at spatial locations, M E {0,..., C — |}//x'r. Localization predicts a box or another region representation. Infection assessment asks a different clinical question and may coexist with any wound type. These outputs should have separate heads, targets, and evaluation definitions when they are modeled jointly.[14, 26, 251]

Figure 6.1 connects a sourced photograph to the choices needed to define these outputs. The whole-image label does not determine a pixel mask, and a visible red region does not establish infection. The workflow boxes do not supply a reference annotation. A classifier may use the full photograph, a crop, or masked pixels; those choices change the information available at inference and must be recorded.

6.2.3 Measurable research endpoints

A usable question is: “Among eligible photographs with one reference wound, can the model distinguish the four specified categories in previously unseen patients?” State who assigns the label, what clinical information they use, how disagreements are resolved, and whether mixed or indeterminate cases are excluded or represented. A narrower endpoint is preferable to an apparently broad claim with undefined labels. CLAIM recommends reporting the reference standard, data partitions, acquisition characteristics, and evaluation procedures.[20]

For the main worked example, let labels l, 2, 3,4 denote pressure, diabetes- related foot, venous, and surgical wounds. These are teaching labels matching categories used in the source literature, not a complete clinical taxonomy.[14] A

Illustrations are not included in the reading sample

Figure 6.1. A real photograph and the decisions connecting spatial targets to classification input. Pereira et al. (2025), Figure 1, sacrococcygeal pressure ulcer after initial debridement and rectal-sleeve application; CC BY 4.0.[252] The original pixels are retained. Boxes B-D are a new conceptual workflow, not an observed crop, reference mask or model prediction. No treatment benefit is inferred.

pressure-related heel injury in a person with diabetes illustrates the ambiguity: diabetes in the medical history does not automatically make the image a diabetes- related foot-ulcer example. The study needs a rule for primary cause, concurrent conditions, and uncertain adjudication before training begins.

6.3 Categories, datasets, and reference labels

A mathematical target becomes an experimental task only when its categories and source records are defined. We first examine clinical category boundaries, then distinguish dataset identities, releases, and derived images. The final subsection addresses reference quality and leakage prevention. These steps establish what the training labels mean and which observations may legitimately be treated as separate evaluation cases.

6.3.1 Clinical category boundaries

Table 6.2 provides a teaching vocabulary. The defining information includes mechanism and clinical context; no listed visual feature should be treated as a diagnostic rule. Mixed arterial and venous disease, trauma in a neuropathic foot, and postoperative infection illustrate why labels need an explicit reference standard. Table 6.2. Teaching categories and the information needed to define them. Each row cites its clinical basis.

Illustrations are not included in the reading sample

Figure 6.2 places four documented clinical examples alongside their source contexts. Their labels come from the clinical sources, rather than being diagnosed from the pictures. These separate cases illustrate the first four teaching categories; they do not constitute a classifier dataset or a visual decision rule. The chapter discusses the broader categories in Table 6.2 when considering other datasets and external testing.

6.3.2 Dataset identity and provenance

Different publications may use different subsets, crops, class mappings, and releases of the same named collection. A photograph and several crops from it are not independent observations. Repeated photographs from one patient may show the same wound at several visits. A reproducible manifest therefore links every derivative to its original photograph, wound, patient, and source, where those identifiers are available.

Table 6.2. Four distinct clinical examples: a diabetes-related right-foot wound (Wadgaonkar et al., 2024, Figure 1), sacral pressure ulcer (Minoretti et al., 2024, Figure 1A), non-healing surgical wound of the right upper thigh (Driver, 2016, Figure 1), and left-leg venous ulcer (Minoretti et al., Figure 3A).[204, 259, 260] Licences: CC BY 4.0 except Driver, CC BY 3.0. Native panels are selected in a new layout; Driver’s panel is cropped to the wound region, excluding the handwritten ruler. Labels follow the clinical sources, not visual diagnosis. The cases do not constitute one dataset.

Table 6.3 separates dataset provenance from permission and evaluation claims. Public visibility is not a blanket license for redistribution or commercial publication. A paper’s permission to analyze images also does not establish this book’s permission to reproduce them. The wound photographs in this chapter are licensed sourced clinical images; conceptual diagrams and model outputs are identified separately.

Table 6.3. Dataset contexts relevant to the chapter. Access terms and identifiers must be checked for the exact release used.

Illustrations are not included in the reading sample

Dataset download and access routes. The following owner or organizer pages identify the available files and access procedures. A dataset name alone does not establish that two downloads contain the same images, labels, or partitions.

Confirm the current access conditions before planning an experiment.

• AZH image/location classification: https://github.eom/uwm-bigdata/w ound-classification-using-images-and-locations. The repository supplies image archives and location information; its release includes additional normal/background categories beyond the four wound categories. Preserve the release identifier and chosen class mapping.[14, 263]
• Medetec stock images:
https://www.medetec.co.uk/files/medetec-image-databases.html. Follow the category pages to the images. This stock-image collection does not itself supply the harmonized WILLIE labels or split manifests.[26, 261]
• FUSeg release:
https://github.com/uwm-bigdata/wound-segmentation. Use the data/Foot Ulcer Segmentation Challenge directory and the organizer’s instructions. Enumerate the image/mask pairs and test images in the release you obtain, and record their partition roles. Keep that release inventory distinct from the 610/400 partition reported by WILLIE; state which protocol is used.[26, 262]
• DFU infection/ischaemia data: the original study and author access details are at https://doi.Org/10.1016/j.compbiomed.2020.103616. A separate later classification release, DFUC2021, has organizer access instructions at https://dfu-challenge.github.io/dfuc2021.html. Its control, infection, ischaemia, and combined categories must not be silently substituted for the earlier binary datasets.[251, 264, 265]
• WILLIE benchmark:
https://huggingface.co/datasets/QianGroup/willie-benchmark;
code and preparation instructions:
https://github.com/Qian-Group-HRI/Willie. Consult the task-specific manifests and the dataset card’s source-specific access terms; the code license does not replace the image-source conditions.[26]

6.3.3 Reference quality and leakage prevention

Construct the label dictionary before selecting a model. Include definitions, per-mitted clinical inputs, adjudicator qualifications, disagreement resolution, and missing-label codes. An unrecorded endpoint must not silently become a negative label. For example, an image without an infection assessment cannot be treated as confirmed noninfected. Group all derivatives and repeated patient photographs before splitting. If patient identifiers are unavailable, report that patient independence cannot be verified; image-level deduplication does not prove it. These are study-design requirements consistent with transparent reporting of reference standards and partitions.[20]

Figure 6.3 follows one patient through several visits and crops. Every derivative remains in one partition. This step precedes augmentation, fitted normalization, feature selection, calibration, and hyperparameter selection. The next sections develop the model computations, but the validity of their comparison already depends on this data structure.

Split groups before creating derivatives

Illustrations are not included in the reading sample

Figure 6.3. Original patient-grouped preparation schematic. Related photographs and crops follow the patient into one partition; training transformations are applied afterward. The example is synthetic.

6.4 From recurrence to attention

A wound photograph contains several regions that may matter to a prediction; a series of photographs also contains observations from different visits. In both cases, a model needs a way to combine information, but the ordering means something different. A recurrent network carries a learned summary from one sequence position to the next. Attention instead forms a weighted combination of available representations for a particular query. Understanding that change makes the later Transformer equations easier to interpret: their purpose is to control information exchange, rather than simply to replace one model name with another.[219, 266]

We begin with the recurrent state and its training difficulty, then examine how LSTM and GRU gates control updates and how IndRNN changes recurrent connections. Finally, attention gives a query access to several stored representations. Each mechanism is explained before its equation. The wound examples are constructed teaching cases; they distinguish genuine visit histories from the spatial tokens of one image.

6.4.1 Sequence and image tasks

A sequence is an ordered collection of observations. Sequence labeling maps each input position to a label; sequence classification maps a whole sequence to one label; forecasting predicts future observations from an available history. In a proposed longitudinal wound study, these could mean assigning a reference-defined state at each visit, assigning one prespecified category to the observed history, or predicting the next measured wound area. The target determines which visits may be used. A prediction made at visit three must not receive a photograph or clinical measurement from visit four.

A static image classifier can also arrange patches in a sequence, but its order describes image positions, not the passage of clinical time. Moving a token in that sequence changes its spatial interpretation; it does not create a later wound visit. For actual follow-up photographs, preserve visit times, missing visits, and the prediction cutoff. An equally spaced sequence index alone does not represent irregular follow-up intervals.

The recurrent state is a vector of learned features summarizing the observations processed so far. At a new visit, the network combines current input features with its preceding state and reuses the same update parameters. It need not store the original photographs in that vector, and an individual coordinate has no guaranteed clinical meaning.

For a sequence xt E Rd, a basic recurrent network maintains ht E Rr:

Illustrations are not included in the reading sample

Here Wx E ^rxd, Wh E Rrxr, and Wy E ^Kxr; p acts elementwise. Apply softmax to zt for position labels, or to a chosen pooled/final representation for sequence classification. Recurrence shares parameters across time. It does not require a new set of weights for each visit.

The biases bh and by have lengths r and K, respectively; the initial state h0 must be specified, for example as zeros. In the gated equations below, v(v) = [1]/([1] + e—v) is the sigmoid and tanh(r) = (ev — e~v')/(ev + e~v). Both act elementwise on vectors.

A constructed wound sequence. Suppose three eligible visits produce one nor-malized image feature each, x1 = 0.8, x2 = 0.4, and x3 = 0.2. To isolate the

carry-forward calculation, use a scalar state, identity activation, Wx = Wh = 0.5, zero bias, and h0 = 0. The states are h1 = 0.4, h2 = 0.4, and h3 = 0.3. The third state depends on both the new feature and the retained history; it is not just the latest value 0.2. These invented dimensionless values are neither wound areas nor a healing score. A practical nonlinear model learns its own parameters and requires an independently defined prediction target.

The same carry-forward path also links an early observation to a later training loss. If each step repeatedly shrinks the effect of the preceding state, a loss at a later visit can provide very little information about an earlier input. If it repeatedly amplifies that effect, updates can become unstable. The following derivative expresses this repeated multiplication; it does not measure the rate of wound healing.

Training through time multiplies Jacobians. With at = WxXt + Whht_± + bh and Dt = diag(#(aj),

Products with repeatedly small singular values can suppress gradient components; repeatedly large factors can amplify them. This explains a training difficulty, not an assertion that every RNN necessarily fails. Clipping a gradient limits its magnitude before the optimizer uses it.[267] It does not reconstruct information lost through a contracting recurrent path. Gated models introduce controlled additive paths to address this problem.[268, 269]

6.4.2 LSTM gates and cell state

An LSTM separates the carried cell state ct from the exposed hidden state ht. Its gates learn how much previous cell content to retain, how much new candidate content to add, and how much of the result to expose. For a hypothetical wound history, this allows the update to depend on both the current image features and the preceding summary. No gate is manually assigned to “infection” or “healing”: such clinical interpretations would require separate evidence. The useful distinction is

computational: a controlled additive cell path replaces repeated transformation of the entire summary.[268, 270]

Let ut = [xt;dt—1] G Rd+r. An LSTM uses input, forget, and output gates it,ft,ot G (0, 1)r and a candidate ct G (—1, 1)r:

Illustrations are not included in the reading sample

All four matrices have shape rx(d + r), and all four biases have length r. Initialize both £0 and c0 explicitly, for example as zero vectors. The symbol O denotes elementwise multiplication. The forget gate scales existing cell content; the input gate scales the candidate; the output gate controls what is exposed as dt. Gates are continuous, not literal on/off switches. The direct cell path has derivative ft when other dependencies are held fixed, but the full derivative includes gate dependencies. LSTM therefore facilitates learning some long dependencies without guaranteeing that all gradient problems disappear.[268, 270]

For a one-dimensional teaching calculation, take ct—1 = 0.8, ft = 0.75, it = 0.25, ct = —0.4, and ot = 0.5. Then ct = 0.5 and dt = 0.5 tanh(0.5) ^ 0.2311. The old value contributes 0.6 and the candidate subtracts 0.1. This explicit decomposition is more informative than calling the cell “memory” without explaining its update.

Wound application. Anisuzzaman and colleagues used an LSTM branch to encode anatomical wound location in an image-location classifier.[14] Their input was categorical location information, not a longitudinal healing sequence. Section 7.4 develops the multimodal application and distinguishes the supplied information from the network mechanism.

6.4.3 Gated recurrent units (GRU)

A GRU offers a gated update with one carried hidden state, without the separate

LSTM cell state. Its reset gate controls the contribution of the previous state when

forming a candidate; its update gate blends that candidate with the existing summary. In a hypothetical follow-up sequence, different observations can therefore cause different amounts of revision even though the same parameters are reused. This is an alternative state-update mechanism to test, rather than evidence that fewer gates necessarily suit wound data better. We use the convention in which a large update gate favors the candidate:

Illustrations are not included in the reading sample

Some implementations reverse the update-gate convention or apply the reset gate after the recurrent projection; PyTorch’s GRU documentation explicitly describes its reset-placement difference.[271] The checkpoint and equation must agree; the forms are not interchangeable by changing a caption. Here W, has shape r x d, U, has shape r x r, and all biases have length r.[269]

Zero preactivation gives R(0) = 0.5, not zero. Thus a zeroed gate-weight matrix 1’1 A 1 d A XXT'AI 1 cz V i 1 nr

with zero bias does not close the gate. With ht_1 = 0.8, ht = _0.4, and zt = 0.25, the update is 0.75(0.8) + 0.25(_0.4) = 0.5. This calculation uses the convention just defined. Figure 6.4 separates the additive state path from the gate-control path.

6.4.4 Independently recurrent neural networks (IndRNN)

An independently recurrent network changes which hidden units communicate during the recurrent update. In the basic RNN, a dense recurrent matrix lets every previous hidden coordinate contribute to every new coordinate. IndRNN instead gives each unit its own recurrent multiplier. For a constructed wound-history encoder, one coordinate carries its own previous activation while other coordinates do the same; feed-forward connections in stacked layers mix their information. These coordinates remain learned features, not independently measured clinical variables. This structure exposes the repeated gradient multiplier of each unit. Unlike the GRU in Section 6.4.3, its defining change is not a reset/update gate pair. It replaces the dense same-layer recurrent matrix by a vector u E Rr:

Illustrations are not included in the reading sample

Here asj is the preactivation of neuron j at step s, j = f...,r, and T > t is a later time. The product follows that neuron’s same-layer recurrent path, holding the external inputs fixed. Wx E Rrxd mixes input coordinates and b E Rr is a bias; the initial state h0 must be specified. This exposes a per-neuron recurrent gradient path that can be constrained through Uj. Neurons communicate through feed-forward connections between stacked layers rather than a dense same-layer recurrent matrix. The design changes gradient control and layer construction; it does not make arbitrary sequence lengths or optimization conditions harmless.[272]

6.4.5 Attention over representations

The preceding updates explain how a history becomes a state. Attention asks a further question: when making a particular prediction, must the model rely on one final summary, or can it refer back to several available representations? Additive attention retains encoder states and scores their compatibility with a query, then combines them using normalized weights. In a proposed wound-history model, the query could represent the current prediction problem and the keys could come from earlier eligible visits. For an image model, the available representations could instead describe spatial patches. The weights depend on learned features; they are not clinical judgments about the importance of a visit or tissue.[266]

Compressing a long sequence into one final state can make retrieval difficult. Additive attention computes a context from encoder states h E Rr using a query s E Rd:

Illustrations are not included in the reading sample

With an alignment width a, Wh E Raxr, Ws E Raxd, and v, b E Ra. The context c has length r. The query selects a weighted combination of available states, allowing different outputs to retrieve different information. This was developed for encoder-decoder translation; the same computational idea motivates comparison among image tokens without transferring translation benchmark scores into wound claims.[266]

A weighted wound-history example. Take two invented visit representations d1 = (1,0) and d2 = (0, 2), with compatibility scores e1 = 0 and e2 = log 3. Exponentiation gives (1,3), so normalization gives weights (0.25,0.75). The context is c = 0.25(1,0) + 0.75(0,2) = (0.25,1.5). It contains contributions from both visits, with more weight on the second for this query. Reversing the scores gives (0.75,0.5) instead. The inputs stay fixed while the retrieval emphasis changes. These feature coordinates and weights are constructed calculations; they do not establish healing, infection, or an explanatory account of a trained clinical model.

Attention does not generally keep only the largest weight. Finite unmasked softmax scores yield positive weights for all keys. Hard selection, sparse attention, and causal masking are additional design choices. The next section derives the dot-product form used in Transformers and makes those choices explicit.

Wound application. Patel and colleagues used axial attention with channel and spatial recalibration in a wound image-location classifier.[160] The attention operations processed features within a category-prediction pipeline. Section 7.4 develops multimodal feature combination, while Section 5.9 connects related attention mechanisms to wound masks.

6.5 Transformer mathematics

The preceding attention example selected information from several representations. We now express that operation using projected queries, keys, and values, and follow a small numerical calculation. The later subsections distinguish self-attention, cross-attention, and masks, then assemble multiple heads into a Transformer block and examine positional information. Track the dimensions at each step before applying the construction to wound-image patches.

6.5.1 Queries, keys, values, and scaling

Arrange N input tokens as rows of T E xNxd. For a single attention head, choose learned projections WQ,WK E ^dxdk and Wv E ^dxdv. Define

Illustrations are not included in the reading sample

The shapes are Q,K : Nxdk, V : N xdv, S, A : N xN, and O : N xdv .A query determines which keys receive weight; the corresponding values supply the vectors being combined. “Query,” “key,” and “value” describe roles in a computation, not three manually annotated kinds of image content. The scaled dot-product and multi-head construction follow the original Transformer.[219]

Why divide by /dk? Under the illustrative assumption that query and key components are independent, zero-mean, unit-variance variables, qTk = ^¿=1 daka has variance dk. Scaling the score gives variance one. Learned features need not satisfy these assumptions exactly; the calculation explains the chosen normalization rather than proving a universal distribution. Dividing both Q and K by ydk would divide their product by dk, implementing a different score.

Fornumerical stability, compute each row as Aig = exp(Sij—si)/ ^ exp(Sil — si) with si = maxz S^. Row sums equal one. The output is a convex combination of the value rows, although later projections and residual sums need not preserve that convexity. Softmax operates over keys for each query, not over embedding coordinates.

The row-token convention differs from the column vectors used in the dense- layer derivation in Chapter 2. For one token written as a column t, the same query projection is WQTt; stacking the transposed tokens as rows gives TWQ . The transpose changes the written orientation, not the learned operation. Here K is the key matrix; when K denotes a class count elsewhere, it is a scalar. Dimensions distinguish the two uses.

6.5.2 Worked attention calculation

Use a constructed two-key example with dk = 2. Let q = (A/2, 0), kx = (0,0), k2 = (log 3,0), and values vx = (2,0), v2 = (0,4). Then

Illustrations are not included in the reading sample

The larger score increases the second value’s contribution; it does not copy that value or discard the first. Figure 6.5 traces scores, normalization, and weighted addition. The calculation is small enough to reproduce before implementing a batched attention layer.

6.5.3 Self-attention, cross-attention, and masks

Self-attention obtains all three projections from the same token set. Cross-attention uses queries from Ta G R^axda and keys/values from Tb G ''\A7x'7 :

Illustrations are not included in the reading sample

The output has X,, rows; keys and values must share Xb rows. Thus two metadata queries attending to 196 image tokens produce a 2 x 196 weight matrix and two

Illustrations are not included in the reading sample

output vectors. In the original translation decoder, queries originate from the de-coder and keys/values from the encoder. Swapping only the value source generally breaks both the meaning and the dimensions.[219]

For Equation 6.10, the projections have shapes WQ : da x dk, WK : db x dk, and WV : db x dv. Thus the two source widths may differ while the query and key projection widths must agree.

An additive mask M E {0,—<x>}NaXNb changes scores to S + M. Zero permits an interaction; x excludes it. A causal self-attention mask permits j <i so that a position cannot access a future token. A static image classifier normally allows all image patches to interact; applying a causal mask merely because tokens are stored in a sequence would impose an unnecessary directional restriction. Padding masks exclude artificial tokens. If a row has no permitted keys, softmax is undefined: reject that input or provide a deliberately defined valid token instead of relying on a numerical accident.

In the two-key example, masking the second key gives weights (1,0) and output (2,0). Figure 6.6 compares the three information paths. A mask is a statement about available information, whereas an attention weight is a learned result conditional on that information.

Wound application. The SCARWID preprint used cross-attention to combine wound-image features with features of model-written captions before retrieving

labeled infection examples.[25] This is a wound application of interactions between two representations, rather than image self-attention alone. Section 7.7 develops the caption-assisted retrieval pipeline.

6.5.4 Multi-head attention and Transformer blocks

For h heads, use different projection matrices and concatenate their outputs:

Illustrations are not included in the reading sample

where ttn E RMvxd. With d = 192, h = 3, and dfc = d(, = 64, each head returns N x 64, concatenation returns N x 192, and the output projection preserves that width. Heads can learn different interactions, but their specialization must be investigated rather than assigned by a diagram. A residual addition requires the output width to match the incoming width.

Layer normalization computes statistics across the d coordinates of each token. For row t,

Illustrations are not included in the reading sample

Learned 7, fi E /\d rescale and shift the normalized coordinates; e > 0 protects against zero variance. These statistics are per token, not estimated over the test batch.[273] For t = (1, 3), p = 2, v = 1; with unit scale, zero shift, and negligible e, the output is approximately (—1,1).

A common pre-normalized vision block is

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Figure 6.7. Original pre-normalized multi-head Transformer block with explicit widths. Residual additions require matching shapes; concatenated heads return to the model width through an output projection.

Here GELU(v) = v$(v) acts elementwise, with $ the standard normal cumulative distribution function. The matrices Wr E ^dxdf and W2 E ^dfxd. The MLP mixes feature coordinates independently at each token; attention mixes information across tokens. The original Transformer instead used post-normalization, LN(T + Sublayer(T)). Its six-layer, width-512 configuration is a particular translation model, not a definition of all Transformers.[219, 249]

Figure 6.7 follows a complete residual block. Adding normalization, projection, and MLP costs prevents a misleading interpretation of attention-only complexity as total network cost. For dense global attention, pairwise score and value aggregation work scales as O(N[2]d), while projections contribute O(Nd[2]) and the MLP contributes O(Nddj). Optimized kernels may avoid storing the full attention matrix; this does not remove all pairwise arithmetic.[219, 274]

Wound application. The image-location Transformer author preprint used ViT image representations and Transformer-based location processing for wound clas- sification.[275] Its attention blocks belong to the specified multimodal system. Section 7.4 develops the application, while Section 6.16 separates the reported model from other Transformer variants.

6.5.5 Positional information

Global self-attention with shared token operations, no positional terms, and no order-dependent mask is permutation equivariant: permuting input tokens permutes outputs. More generally, equivariance holds when any attention mask and pairwise bias are permuted consistently with the tokens. Writing X(T; M) for shared selfattention on row tokens T with additive mask M, a permutation matrix IE gives

Illustrations are not included in the reading sample

Any pairwise bias must be permuted in the same way, and every query must retain at least one permitted key. A permutation-invariant pooling rule then gives an invariant output. Fixed causal or window masks already restrict that symmetry and can supply structural information. An image classifier can encode spatial arrangement through positions, relative biases, convolution, or another spatial mechanism.

A sinusoidal sequence encoding at nonnegative integer position p uses paired coordinates j = 0,...,d/2 — 1, assuming even width d:

Illustrations are not included in the reading sample

At p = 0, each pair is (0,1); at p = 1 the first pair is approximately (0.8415,0.5403). Images commonly use learned absolute patch-position embeddings, two-dimensional constructions, or relative position terms. These alternatives are not numerically interchangeable.[219, 249, 250] Changing the image grid may require interpolating learned spatial embeddings while preserving any separate class-token embedding. Patch order, coordinate convention, and interpolation policy belong in the implementation record.

Wound application. The image-location Transformer preprint added learned positional embeddings to image-patch representations in its wound classifier.[275] This encodes patch arrangement inside the model and differs from anatomical wound location supplied as metadata. Section 7.4 develops that second information source and its pairing with images.

6.6 Vision Transformer classification

We can now connect the Transformer block to an image-classification pathway. The first subsection explains how image patches become tokens, how a class representation is formed, and how the head produces wound-category scores. The second examines resolution and patch-size choices. These connect the input geometry to the information and computation available to the classifier.

6.6.1 Image tokenization

Let P be a square patch side in pixels, with P dividing H and W. The image produces N = (H/P)(W/P) patches. Flatten patch j to x^ E Rlx[3]p[2] and project it using E E |R[3]p[2]xd. A learned class token tcls E Rlxd gives

Illustrations are not included in the reading sample

After L blocks, a classification head maps the normalized class-token output to K logits. Mean pooling is a distinct alternative: average the patch-token outputs and apply a head. Record which representation is used, because removing the class token or changing pooling changes the computation.[249]

For 224 x 224 RGB input, P = 16, d = 192, and K = 4, there are 196 patches, each with 768 scalar pixel values. The projection has shape 768 x 192 and the sequence has 197 tokens. With batch size B = 8 and three heads, queries have shape 8 x 3 x 197 x 64 and attention scores have shape 8 x 3 x 197 x 197. The classifier returns 8x4, not a mask. This is an original dimension trace; it does not claim to reproduce a named pretrained checkpoint.

Figure 6.8 shows that the class token is learned and interacts with patch tokens; it is not the known wound label inserted into the input. A 230 x 224 image is incompatible with simple 16 x 16 partitioning. Resize, crop, or pad using a documented policy. If padding produces tokens with no image support, mask them where the model permits; partially padded patches require a deliberate treatment rather than silently assuming full observations.

Illustrations are not included in the reading sample

Figure 6.8. Original ViT classification dimension trace for a synthetic configuration. The input contains 196 patches plus one learned class token; the output contains four class logits.

Wound application. Reifs and colleagues evaluated a patch-based ViT for distinguishing hypergranulated from non-hypergranulated wound tissue in pho- tographs.[276] Image tokenization therefore served a defined wound-finding classification task. Section 6.16 connects Transformer studies to their targets, and Chapter 8 develops category-based experiments.

6.6.2 Resolution, information, and computation

With fixed patch size, doubling both image dimensions quadruples token count and approximately multiplies the global pairwise attention term by sixteen. With fixed resolution, larger patches reduce token count but combine more pixels before attention. That may obscure a small wound cue even though the final classifier still outputs a plausible probability. These are design tradeoffs to test at equal data access and stated compute, not evidence that one patch size is universally appropriate.

Patchification can be implemented as a convolution with kernel and stride P and output width d, provided its weight arrangement matches the linear projection. A useful implementation check compares both outputs on a small known image. Verify that channel order, spatial flattening, and patch order agree. A transposed spatial grid can produce correct tensor shapes while associating tokens with incorrect positions.

Algorithm: Transformer classification forward pass

Inputs: normalized images X E ^Bx[3]xHxW, model weights, and patch, position, and mask conventions.

Outputs: finite logits Z E RBx^. Reject incompatible dimensions or a query with no permitted key before softmax.

1. Input normalized images X of shape B x 3 x H x W; check the patch-size policy and checkpoint-specific preprocessing.
2. Extract patches in the recorded row/column order; project to B x N x d.
3. Prepend the learned class token if required; add compatible positions and construct a valid-token mask.
4. For each Transformer block:
(a) Normalize and project Q, K, V in the checkpoint’s stated order. Reshape to heads, scale scores by 1/y/df, apply permitted-key masks, and normalize over keys.
(b) Multiply by values; merge heads and project to d.
(c) Apply the attention residual and MLP paths, including their normalization and residual addition, in the checkpoint’s stated order.
5. Normalize and select the class token or recorded pooling rule. Apply the d x K head to obtain logits.
6. Assert finite outputs of shape B x K. Convert logits to probabilities only when needed for inference or metrics; a stable loss can consume logits directly.

6.7 Learning from limited labels

Choosing a Transformer does not explain how it will learn useful wound features when only a small set of reliable labels is available. A reference wound category, infection endpoint, and pixel mask require different annotation work; the number of photographs is therefore not the same as the amount of usable supervision. The practical question is which information can be reused from pretraining and how much of the representation should be adapted with the available wound labels. Section 4.5 introduced these data-access and augmentation issues, while Section 4.3 developed the frozen-versus-adapted comparison.

The following routes supply different learning signals. Frozen feature extraction trains a new head from wound labels; fine-tuning also changes encoder weights.

Distillation transfers a teacher’s predictions under a declared supervision policy. Masked-image pretraining learns to reconstruct withheld pixels, and DINO-style learning matches representations across views or patch targets. The latter objectives can learn from images without wound-category labels, but their downstream wound classifier still needs a defined way to associate features with categories. These methods change training information and objectives, not the meaning of the clinical reference labels.[29, 277, 278]

A limited-label wound study. Consider a constructed development collection with many unlabelled wound photographs but only a smaller, clinically reviewed subset carrying the target categories. First separate patients into development and locked test groups; any wound-specific pretraining in this comparison uses development images only. Compare a frozen pretrained encoder plus a label- trained head with partial and full fine-tuning on the same labeled subset. A separate experiment may pretrain on the permitted unlabelled development images before fitting that head. Record the additional image access as well as the trainable parameters. At prediction time, MAE’s reconstruction decoder or a distillation teacher need not remain; the chosen downstream encoder, head, preprocessing, and label order do. Their exact roles are developed below.

6.7.1 Feature extraction and fine-tuning

A frozen encoder maps X to a representation h^(X) while only a new classifier is trained. The question is whether the existing representation makes the new labels separable. Fine-tuning also updates some or all encoder parameters, asking whether adaptation improves that representation with the available labels. Freeze parameters and control normalization/dropout behavior deliberately; disabling gradient computation is not identical to selecting evaluation mode for every layer.

For a linear head W G x'/x/x and bias b, logits are h^(X")W + b. A useful sequence of comparisons is frozen features, a partly unfrozen encoder, and full fine-tuning. Record initialization, trainable parameter count, learning rates for each parameter group, augmentation, and checkpoint selection. Improvements between

these conditions cannot be attributed solely to a new architecture. Figure 6.9 makes the changing training paths visible.

Wound application. The small-VLM wound-classification preprint compared head-only transfer and full fine-tuning for pretrained visual backbones, alongside a ViT LoRA variant.[110] These were comparison classifiers rather than the retrievalbased language models themselves. Section 7.8 develops adaptation choices and Section 7.7 develops the retrieval route.

6.7.2 Knowledge distillation

DeiT combines a vision architecture with a training recipe that includes a distil-lation token supervised by a teacher. Its contribution is not a new clinical label or a guarantee of data efficiency in every domain.[277] A general soft-distillation teaching objective[279] for teacher distribution qT = softmax(^T/r) and student distribution pT = softmax(t5/r) is

Illustrations are not included in the reading sample

Temperature T > 0 softens the distributions; the factor T[2] compensates the gradient scale associated with temperature. DeiT also studies hard teacher targets. A teacher can transmit its biases and errors, so compare against ordinary fine-tuning and include teacher pretraining and inference costs in the research record. The teacher must not gain access to held-out wound labels merely because it is described as a pretrained component.

The original DeiT token mechanism makes the two supervision paths explicit. Append a learned distillation token as well as the class token, giving N + 2 tokens. Both interact with the image patches in the same Transformer blocks. Apply separate heads to their final representations. The class head learns from the reference label; the distillation head learns from a frozen teacher’s prediction. With hard teacher label yT = arg maxA. zT,k, the equal-weight training objective is

Illustrations are not included in the reading sample

The two heads share the encoder but have different targets. The paper’s joint inference rule adds their class probabilities; dividing the sum by two gives normalized probabilities with the same predicted class. The teacher is absent from this inference path.[277] This book’s original two-class example follows that paper rule: heads (0^8,0^2) and (0^6,04) give (0^7,0^3) after averaging.

The released reference implementation instead averages the two heads’ logits at evaluation.[280] With class-head logits zc and distillation-head logits zd, the two probability recipes are

Illustrations are not included in the reading sample

These rules can give different probabilities and, with three or more classes, different labels. In the two-class example, the code rule gives approximately (0^710102,0^289898). To reproduce a released checkpoint through the cited reference forward method, average logits and apply softmax afterward only if probabilities are required. Record the code revision and inference rule; do not silently substitute the paper’s probability average. The generic soft objective in Equation 6.16

explains temperature-based transfer; it is not a claim that DeiT’s hard-target recipe uses exactly that loss.

Here zT,zs G RK are teacher and student logits, p without a superscript uses temperature one, and CE is cross-entropy, derived in Section 6.13. The sum is the teacher-to-student Kullback-Leibler divergence. For fixed teacher outputs its gradient matches soft-target cross-entropy up to a teacher-only constant; the teacher is not updated through this term.

Wound application. The SCARWID preprint initialized its image encoder from a distilled DeiT checkpoint before training wound image-caption fusion.[25] This documents use of a pretrained distilled representation, rather than a new woundspecific DeiT teacher experiment. Section 7.7 develops the infection-classification application and its training stages.

6.7.3 Masked-image pretraining

A masked autoencoder hides a subset M of patches, encodes the visible subset, and uses a reconstruction decoder. A simplified squared-error objective is

The target may be normalized within each patch, which changes the exact loss definition. The reconstruction decoder is a pretraining component; downstream classification uses the encoder with a new head.[29] With 196 patches and a constructed 75% mask, 147 are hidden and 49 visible. This saves encoder token work during pretraining but does not imply that classification at inference also uses only 49 patches.

The vectors Xj and x3 contain the predicted and reference values of the 3P[2] patch components. The squared Euclidean norm sums their squared differences, so the two denominators average over components and masked patches. Require a nonempty masked set before evaluating this objective.

A complete MAE pass first records the original patch indices, then encodes only visible patches. It projects the encoded features into the smaller decoder width, reinserts learned mask tokens at the missing indices, adds decoder positional information, and reconstructs patch pixels. The loss selects masked indices; a decoder output at a visible index is not automatically part of that objective.[29] For a miniature teaching example with two masked two-component vectors, squared errors (1,0) and (0,1) sum to two. Averaging over four reconstructed components gives 0.5. This miniature component count illustrates the reduction; an RGB image patch instead has 3F[2] components. Restoring the wrong index order can yield valid tensor dimensions while supervising the wrong pixels.

6.7.4 DINO and later developments

DINOv2 develops transferable visual representations through self-supervised training, including image-level and patch-level objectives and curated training data.[278] For a wound study, a frozen representation with a linear head is a meaningful baseline because it separates representation transfer from the effect of a large taskspecific training procedure. It does not establish that the representation was trained on wound labels or that its predictions are clinically validated.

DINOv2’s training can be followed through two complementary paths. First, a student and teacher encode different augmented views; their image-level heads produce distributions over learned prototypes. A prototype is a training representation category, not a named wound class. Cross-entropy makes student predictions agree with the teacher across views. Second, the student receives masked patches and predicts the teacher’s unmasked patch targets at corresponding positions. The image and patch heads are separate. Teacher-target balancing and feature-spreading regularization are additional parts of the training recipe; simply matching two networks without these controls is not the full method.[278]

Let qvc be a fixed teacher probability for prototype c from view v, and puc the student’s probability from another view u. For a selected view pair, the image loss and teacher update have the form

Illustrations are not included in the reading sample

Here Cp is the prototype count, d5,dT are matching student/teacher parameter arrays, and m is an exponential-moving-average coefficient. Backpropagation updates the student; it does not differentiate through the teacher targets or the moving-average assignment. In the DINOv2 recipe, teacher distributions are balanced using Sinkhorn-Knopp normalization and student distributions use softmax; the equation above isolates their cross-entropy and moving-average roles. Distillation into a smaller model is a separate stage with a frozen larger teacher.[278] In a scalar teaching update, teacher value 2, updated student value 4, and m = 0.9 yield teacher value 2.2. Downstream wound classification discards the prototype heads and learns a head for the wound-label dictionary.

Figure 6.10 compares what supplies supervision in DeiT, MAE, and DINO. Its arrows distinguish an extra labeled-teacher target, a pixel-reconstruction target, and a representation target. These are different training signals even if each downstream system ultimately uses a ViT encoder.

DINOv3 addresses, among other issues, degradation of dense features during extended training through Gram anchoring and distills a large teacher into smaller model variants. It is a family of pretrained representations, not one wound-classification architecture.[281] To understand the geometric idea, let row- normalized patch features be F E ^Nxd. Their Gram matrix G = FFT contains pairwise feature similarities. An illustrative alignment penalty is

Illustrations are not included in the reading sample

This is a simplified teaching expression for preserving relational structure, not a

complete DINOv3 training recipe. It requires matched patch correspondences and

Illustrations are not included in the reading sample

Figure 6.10. Original comparison of pretraining information paths. DeiT’s hard distillation uses a teacher label; MAE reconstructs masked pixels; DINO uses detached teacher representation targets.[29, 277, 278] Downstream heads and labels are separate from pretraining targets.

distinguishes feature geometry from clinical labels. For Fs = FT, the penalty is zero even if both features are unhelpful for the desired wound endpoint. A downstream patient-separated comparison is still necessary. The wound applicability of DINOv3 remains a research question in the evidence reviewed here.

Subscripts S and T identify student and teacher features. Their Gram matrices both have shape N x N, even if their feature widths differ. The squared Frobenius norm sums all squared matrix entries; stopgrad holds the teacher term fixed during differentiation. Row normalization requires nonzero feature norms or a declared numerical safeguard.

For a Gram-matrix check, teacher rows (1,0), (0,1) give the identity matrix, while two identical student rows (1,0), (1,0) give a matrix of ones. The two off-diagonal differences contribute two; division by N[2] = 4 gives Z’G = 0.5. Matching the teacher’s orthogonal rows instead gives zero. This shows that the penalty constrains relationships, rather than requiring equal feature coordinates. DINOv3’s Gram anchor uses a reference teacher to stabilize dense features; it should not be confused with updating that anchor through the student’s gradient or with the complete DINOv2 objective.[281]

Wound application. WILLIE used a pretrained DINOv2 ViT-L backbone to supply representations for an integrated wound-analysis model.[26] This is a downstream wound use of DINOv2 features, rather than wound-specific evidence for every later DINO release. Section 6.16 develops the framework and its separately evaluated outputs.

6.8 Hierarchical and multiscale transformers

The previous section concerned how representations are learned. We now return to how token interactions are organized across an image. Swin introduces local windows, followed by patch merging and positional information; pyramid attention then changes the resolution of keys and values. The subsections trace these distinct operations so that changes in context, feature width, and computational cost can be compared explicitly.

6.8.1 Swin: local attention windows

Global attention becomes expensive on large token grids. Swin partitions a grid of Ht xWttokens into windows with side M, performs local attention, and alternates regular and shifted partitions. With divisibility assumed, the number of windows is HtWt/M[2], each with M[2] tokens. The total pairwise-score count per head is HtWtM[2], compared with (HtWt)[2] globally.[250]

For an 8 x 8 grid and 4x4 windows, there are four windows, each containing 16 tokens. Ahead computes 4(16[2]) = 1024 local scores versus 64[2] = 4096 global scores. For 2x2 windows, there would instead be sixteen windows. These counts refer to a token grid, not the pixel image. They exclude projections, MLPs, normalization, and memory-management overhead.

Illustrations are not included in the reading sample

Figure 6.11. Original Swin window example on an 8x8 token grid. Four regular 4x4 windows produce 1,024 scores per head; a cyclic-shift implementation masks invalid pairs in its batched score arrays. Shifted groups cross earlier boundaries; wraparound interactions are excluded.

Alternate blocks can be written

Illustrations are not included in the reading sample

WMSA denotes window multi-head self-attention; SWMSA uses shifted windows. A shift of |_M/2_| changes neighborhood membership. Implementations often use a cyclic roll for efficiency, followed by an attention mask to prevent artificial wraparound connections. Undo the roll after merging windows. Simply rolling the grid without that mask gives a different spatial graph.[250]

Figure 6.11 shows the regular and shifted partitions and identifies the image edges. Shifted windows allow interaction across earlier boundaries, but distant tokens still require paths through multiple blocks or hierarchy. For fixed window size, the pairwise term is linear in the number of tokens; this is not a measured runtime claim.

6.8.2 Patch merging and relative position

Patch merging concatenates the four d-dimensional tokens in a 2x2 neighborhood, producing a 4d-dimensional vector, then projects it to 2d. Thus an even HixWixd grid becomes (Hf/2) x (Wf/2) x 2d. The operation reduces token count by four while increasing channel width by two. Odd dimensions require documented padding or cropping.[250]

A 56 x 56 x 96 grid therefore becomes 28 x 28 x 192, then 14 x 14 x 384, then 7 x 7 x 768. These are feature dimensions, not four independent images. A hierarchy can retain early fine-scale features for fusion while a classifier pools the final representation. Relative position adds a learned bias Biy to £fcy/ ^d^ within each window, with Biy indexed by the two-dimensional displacement between tokens. It describes geometry in the attention score rather than adding a separate image channel.

Swin V2 addresses training stability and transfer across window resolutions using residual post-normalization, scaled cosine attention, and continuous relativeposition bias.[282] Its cosine score has the form cos(gi,fcy)/r + Biy, where r > 0 is a learned temperature with a numerical constraint. Normalizing query and key lengths changes the role of their magnitudes. A continuous function of transformed offsets can compute biases for different window sizes; it should not be described as an unchanged lookup table. These developments concern scalability, not demonstrated wound benefit by themselves.

The three V2 changes affect different steps. For nonzero vectors, cosine similarity is QT^/(||Q||2||&||2); implementations need a norm safeguard. A separate learned temperature for each head and layer controls its scale, with the paper constraining r > 0.01. Residual post-normalization means U = T + LN(Attention(T)): normalize the branch output before addition. It is neither the pre-normalized branch in Equation 6.13 nor the original Transformer’s normalization of the entire residual sum. Finally, a small network maps transformed spatial offsets to a head-specific bias. The sign-preserving transform sign(A) log(1 + |A|) compresses offset ranges;

the released design also specifies coordinate normalization. These steps explain why a V1 checkpoint cannot be converted into V2 merely by changing a name.[282]

Wound application. Mousa and colleagues used a Swin Transformer image branch together with a Transformer location branch for multimodal wound classifi- cation.[283] The application joins hierarchical visual representations with anatomical context. Section 7.4 develops image-location fusion and Section 6.16 discusses the wound-study setting.

6.8.3 Pyramid attention and spatial reduction

PVT builds a hierarchical representation and uses spatial-reduction attention. Queries retain N positions while keys and values use a reduced representation with roughly N/r[2] positions for a two-dimensional reduction factor rs .[284] The attention matrix is rectangular:

Illustrations are not included in the reading sample

Here R includes the spatial reduction and channel projection needed to produce compatible features. With N = 56[2] = 3136 and rs = 8, keys/values have 49 positions, yielding 153,664 scores per head rather than 9,834,496. The reduction saves pairwise work but compresses the source information available to each query.

PVT v2 adds overlapping patch embeddings and convolutional feed-forward processing, and studies a linear spatial-reduction variant that pools to a fixed grid.[285] Overlap means that neighboring token receptive fields share pixels: a kernel wider than its stride does not partition the input into disjoint patches. In the feed-forward branch, expand channels with a linear map, restore the token grid, apply a depthwise 3x3 convolution and activation, then project back to the model width. Each depthwise filter mixes neighboring positions within one channel; the surrounding linear maps mix channels. The linear reduction variant pools keys/values to a fixed Pg x Pg grid, so its pairwise term is NF[2], rather than N[2]/r[2] for ordinary fixed-factor reduction.[285] For Pg = 7, both variants in the

preceding 56 x 56 example happen to use 49 keys; that equality disappears when the input grid changes. The ordinary and linear variants should be named explicitly because their key/value counts differ. Figure 6.12 compares patch merging, reduced key/value attention, and pooling for classification. The common purpose is multiscale representation; the operations and information losses are different.

6.9 Compact CNN-Transformer architectures

A wound classifier may need fine local appearance and the relationship between distant image regions. Convolutional filters share a local feature computation across positions, while attention combines token representations according to their learned compatibility. A hybrid places these operations in one pathway so that attention can operate on locally processed features, or so that local and broader processing can alternate. CCT, CvT, and MobileViT make different versions of this design choice.[286-288] A CNN can also accumulate broad context through depth and pooling; the motivation is to test a particular combination of operations, not to assume that only a Transformer sees the whole image.

In a hypothetical wound photograph, small texture variations may occupy only a few pixels, while the relation between the wound margin, surrounding skin, and anatomical scene spans a larger region. A convolutional tokenizer can first combine neighboring pixels into features; attention can then exchange information among those feature positions. Downsampling reduces the number of tokens but can erase a small tissue cue. The useful balance depends on the wound target, resolution, pretraining, and available labels.

Compact designs are attractive research candidates when training data, memory, or inference resources are limited. “Compact” describes a design or resource objective, not guaranteed resistance to overfitting or measured speed on a particular device. We first examine convolutional tokenization and projections, then follow MobileViT between local grids and attention sequences. Keep token count and spatial correspondence visible, and compare a matched CNN and Transformer baseline before attributing any benefit to their combination.

6.9.1 Convolutional tokenization

A raw-patch projection commits to one partition before attention. Convolutional tokenization first mixes nearby pixels and may downsample them through overlapping filters. For input height H, kernel k, stride s, padding p, and dilation S, the

Compute width and height independently. The floor symbol rounds downward. A constructed 224x224 image with a 3x3, stride-2, padding-1, dilation-1 convolution becomes 112 x 112; repeating that operation gives 56 x 56. Flattening this grid creates 3,136 tokens. A convolutional stem does not automatically make global attention cheap: token count still matters.

CCT combines convolutional tokenization with a compact Transformer and sequence pooling. Its learned pooling scores can be expressed as ay = softmaxy-(iy-w) and h = £y. ay-iy-, where w G Rd and h G Rd. This yields one feature vector without requiring a class token.[286] For two tokens (1,0) and (0, 2) and w = (log 3,0), the weights are (0.75,0.25) and the pooled feature is (0.75,0.5). Learned pooling is still a model component to train and evaluate, not a manual assertion about which wound region matters.

To implement the CCT path, apply convolution, activation, and the specified pooling stages; flatten the resulting grid; process the tokens with Transformer blocks; compute one scalar pooling score per final token; normalize across tokens; and classify the weighted feature sum. The pooling weights sum to one but do not have to be uniform. The CCT paper investigates positional-embedding choices; a checkpoint’s actual choice must be retained rather than assuming every convolutional tokenizer removes all need for position handling.[286]

CvT introduces convolution in both token embeddings and attention projections within a hierarchical architecture.[287] A spatial projection can be written Q = flat(ConvQ(F)), with analogous key/value operations. If key/value convolutions use a different stride from the query convolution, the attention matrix is rectangular. Convolutional context and boundary handling now participate in token construction, so the exact kernels, strides, and padding are part of the architecture description.

Within a CvT stage, convolutional embedding produces a new grid and channel width. Reshape tokens to that grid for the spatial query/key/value projections, using the specified depthwise-separable convolutions and normalization, then flatten each projected grid for attention. Attention returns the query-grid count; residual and feed-forward operations preserve the stage width. The next stage can downsample and increase width. The original classification design introduces its class token in the last stage.[287] Check this token’s special handling in spatial projections: it is not an extra image pixel that can be inserted into an arbitrary rectangular reshape.

6.9.2 MobileViT: local and global processing

MobileViT uses local convolutional features, unfolds them into patch-organized sequences, applies Transformer processing, folds them back, and fuses them with local representations.[288] Suppose a feature grid is h x w x d and patches have PhPw = Pa positions. With Np = hw/Pa patches, an unfolding can organize

features as Fa x Xp x d. Attention operates across patches for corresponding within-patch positions, and folding restores the grid. Both the patch index and the within-patch offset must be retained; an arbitrary reshape does not preserve this relationship.

A reproducible unfolding uses row-major patch and within-patch indices. For a = 0,...,Fa — 1, let u = |_a/pwj and v = a mod pw. For patch row r and column c, set n = r(w/pw) + c. The unfolded entry is Tanj: = Prp^+u,cPw+v,:. Ona 4x4 grid with 2x2 patches, this gives four length-four sequences; sequence a = 0 contains positions (0,0), (0, 2), (2,0), (2, 2). Apply attention along the four patch positions, then invert exactly this indexing to fold. Local convolutions before and after this operation connect spatial neighbors and mix features; the original MobileViT block also fuses the transformed grid with its local input.[288] Nondivisible grids require the implementation’s declared resize or padding policy.

MobileViTv2 replaces the original multi-head attention with separable self-attention designed to reduce expensive interactions.[289] A simplified description forms normalized scalar token scores, a weighted context vector, and elementwise modulation of projected features. This reduces pairwise mixing but also changes the family of interactions represented. Distinguish an asymptotic operation count from measured device latency, peak memory, energy use, and sustained inference under the intended image resolution.

To make that operation explicit, take T G Rnxd, a learned scoring vector wz G Rd, and projections llA-,nv,lln G Rdxd. With biases omitted for readability, the separable operation is

Illustrations are not included in the reading sample

The same context vector c broadcasts to every token; each token still contributes

its own projected value. This is the computation in the MobileViTv2 formulation,

not an algebraically exact replacement for every dense attention matrix.[289] For

an original example with Tl = (1,0), T2 = (0, 2), wz = (log 3,0), and identity

projections, a = (0.75,0.25) and c = (0.75,0.5). The two outputs are (0.75,0)

Illustrations are not included in the reading sample

Figure 6.13. Original comparison of compact convolution-transformer mechanisms, based on CCT, CvT, and MobileViT.[286-288] Blocks indicate operations rather than published parameter counts or measured deployment performance.

and (0,1). Pooling and separable attention can share the same scoring calculation while producing different outputs: pooling returns one vector, whereas this operation returns two modulated tokens. The context reduction costs O(nd); the dense feature projections still cost O(nd[2]).

Figure 6.13 compares where convolution enters these designs. CCT changes token formation and pooling; CvT also changes attention projections; MobileViT repeatedly moves between grids and sequences. The distinction helps a researcher choose an ablation that tests a specific component instead of comparing unrelated model names.

Table 6.4 summarizes the architectural choices developed above. Compare where tokens are formed and how information moves before attributing a woundclassification result to a model family.

Table 6.4. Transformer families and the computation they change. Complexity statements concern the specified attention operation, not measured whole-system speed.

Illustrations are not included in the reading sample

Wound application. Reifs and colleagues evaluated MobileViT for binary classification of hypergranulated versus non-hypergranulated chronic-wound tissue.[276] This is a wound application of combined convolutional and Transformer processing, with a finding-specific target. Section 6.16 connects architecture choice to wound targets and evaluation settings.

6.10 Transformers with feature extractors

A feature extractor converts an image into numerical representations before the final decision. At a spatial CNN stage, each grid position contains a vector computed from a region of the image; its channels are learned features rather than named tissues. Instead of giving a Transformer only raw pixel patches, we can give it these representations, combine them with a separate Transformer branch, or alternate the two computations. This reuses local processing and, when specified, pretrained weights while retaining a way to exchange information between positions. The useful question is what information each stage contributes and what a controlled wound experiment can establish.[144, 164, 220]

For a wound researcher, the motivation might be to retain spatial appearance features while testing whether additional interactions improve a prespecified category decision. Adding a feature extractor also adds preprocessing requirements, parameters, and potentially another pretraining source. It does not supply clinical labels or guarantee complementary information. The following layouts explain where the feature grid enters, how branch coordinates and widths are aligned, and how the final class scores are obtained.

6.10.1 Hybrid layouts

In a sequential hybrid, a CNN produces F E ^hxwxc, which is flattened and projected into T E ^hwxd for a Transformer. In a parallel hybrid, separate CNN and Transformer branches see the image and exchange or fuse features. An interleaved design repeatedly alternates convolutional and attention operations. These are structural descriptions: a network can contain more than one kind of interaction.

Backbone names specify different feature computations. Residual networks add a transformed feature to a shortcut; DenseNet concatenates previous layer features; EfficientNet coordinates scaling of network dimensions; ConvNeXt develops a convolutional design informed by modern training and architecture choices.[144, 146, 153, 156] None is an interchangeable feature extractor without checking its stage strides, output widths, preprocessing, and pretrained weights. Nor does a CNN inherently lack all global context: repeated layers and pooling expand its receptive field.

For feature extraction, remove or bypass the original classifier and select a named spatial stage before global pooling. A residual stage preserves width through addition or uses a projection shortcut; a dense block increases width through concatenation, so its output channel count must be read from the actual block configuration. EfficientNet’s scaling choices and ConvNeXt’s stages likewise change the downstream feature contract.[144, 146, 153, 156] Chapter 4 develops the convolutional foundations. Here the implementation question is which grid enters the Transformer: using a pooled vector has already removed the spatial token set.

For a constructed sequential example, a 14x14x512 CNN feature map becomes 196 rows of length 512. A 512 x 192 projection yields 196 width-192 tokens. Add the positional representation at that grid resolution and optionally a class token.

The projection has 98,304 weights before bias. A global attention head then sees 196 or 197 tokens according to that choice, not the original 224[2] pixels.

Following one wound photograph. In an unexecuted teaching design, resize an eligible RGB photograph to 224 x 224 using the declared preprocessing, and select a CNN stage returning 14 x 14 x 512 features. Each of its 196 grid locations contributes one 512-component row, projected to width 192 as above. Preserve the grid order, add the positional representation, and apply the Transformer. Meanpooling its 196 final spatial tokens gives a length-192 vector; a 192 x 4 head produces four logits in the chapter’s teaching class order. If a class token is used instead, select its final representation and declare that choice. This is a proposed wound pipeline, not a claim that an image can determine etiology without an appropriate reference standard.

In a parallel version, the CNN branch and Transformer branch process the same photograph separately. If both are aligned and projected to 14 x 14 x 192, concatenation gives width 384; pooling gives 384 features, and a 384 x 4 head gives four logits. In a sequential version, the Transformer receives the CNN tokens directly. An interleaved version repeatedly returns to local grid processing between attention operations. These alternatives change the route to the same declared target. Test each branch and a simple fusion control to determine whether the added route supplies useful information rather than merely greater capacity.

6.10.2 Feature correspondence in fusion

Suppose aligned branch features are Fc G R^xwxc and Ft G R^xwxd. Concatenation produces h x w x (c + d). Addition requires a common width r:

Illustrations are not included in the reading sample

Sequential hybrid

where Fc G Rcxr and Ft G Rdxr act at each location. If spatial grids differ, specify interpolation, pooling, or cross-attention. Matching array sizes by arbitrary reshaping does not establish anatomical correspondence.

A gate can blend projected features:

Illustrations are not included in the reading sample

For a per-channel gate, Wff G R[2]rxr and G has shape h x w x r. A scalar spatial gate has one output channel and broadcasts over r. For Gc = (2,0), Gf = (0,4), and G = (0.25,0.75), the fused vector is (0.5, l). A gate’s shape determines what it can select; a globally pooled channel gate cannot directly select one spatial pixel independently of another.

Cross-attention permits different token counts. CNN queries of shape 196 x 64 and Transformer keys of shape 49 x 64 yield 196 x 49 scores. With width-64 values, the result has shape 196 x64. A reverse attention operation returns 49 rows and is a separate computation. Figure 6.14 contrasts serial feature extraction with parallel fusion and labels each conversion.

If the two branches receive different augmentations, matching grid dimensions is not sufficient. Either use the same geometric transform or explicitly map their coordinates before spatial fusion. For cross-attention without one-to-one alignment, preserve positional information in both branches and interpret the output on the query branch’s coordinates. These are checks on the teaching design, not claims that concatenation alone establishes correspondence.

Wound application. Maurya and Mirza fused convolutional and multiscale Transformer representations in MCTFWC for wound classification.[164] Their fusion aligns complementary feature streams before the final category decision. Section 6.16 develops the wound experiment, and Section 7.4 extends feature combination to different input modalities.

6.10.3 Wound-specific model and reproducibility

MCTFWC combines a ResNet branch and a pyramidal Transformer with spa- tial/channel attention and multiscale feature fusion.[164] Its conceptual contribution motivates a parallel hybrid, but its printed stage and fusion dimensions are not fully consistent: the stated early branch widths do not directly yield the stated first fused width. An implementation should resolve such details against author code or clarification. The dimensionally consistent worked design here is an independent teaching construction, not an asserted exact reproduction of MCTFWC.

6.10.4 Interpreting published explanatory maps

The examples that follow use a common reading order: identify the input; follow only documented processing; read a reported prediction only where one is supplied; compare it with a separate reference; then inspect any explanatory map. Clinical photographs, reproduced model outputs and unexecuted method diagrams are identified separately. Reference annotations belong to evaluation, outside the inference path. Each caption identifies the precise source, licence, source panels and changes; the photograph and a method paper can have different licences.

Illustrations are not included in the reading sample

Figure 6.15. A real PG photograph and its original Guided Grad-CAM and Grad-CAM panels. Birkner et al. (2022), Figure 4, clinical column 4; creator-supplied Fig4_2col.jpg, Mendeley Data version 1, DOI 10.17632/mzwv687gzn.1; CC BY 4.0.[181, 290] Exact panels are recomposed with new headings. The PG reference and correct-CNN marker document a PG prediction; both maps target PG. No probability or tissue mask is supplied.

Figure 6.15 makes this distinction concrete using Birkner and colleagues' binary comparison of pyoderma gangrenosum (PG) and conventional leg ulcers (UC in the source). The selected case is in the PG reference group, and the CNN is marked correct, documenting a PG prediction in this two-class task. Its two explanatory panels target the PG output.[181, 290] Grad-CAM is a gradient-based localization explanation; Guided Grad-CAM combines that localization with guided backpropagation to show finer image structure. Neither is the attention matrix in Equation 6.8, a tissue segmentation or a class-probability image.[182]

The maps emphasize parts of the lesion and surrounding scene in a correctly classified case. Correct classification still does not validate the explanation: a concentrated heatmap alone cannot establish calibration or causal faithfulness. Compare targets, layers and controlled perturbations before interpreting such patterns. Equations 6.25 and 6.26 describe feature fusion, while Figure 6.14 shows the feature path; the displayed VGG16-based CNN explanation is not a measurement of either hybrid-fusion equation. These selected validation examples do not estimate performance in a new patient population.[181]

Table 6.5 compares ways to combine convolution and attention. Its mechanisms motivate ablations of the combined components; they do not establish a woundspecific ranking.

Table 6.5. Hybrid operations and implementation checks. Numerical dimensions are original teaching examples; references identify related published concepts.

Illustrations are not included in the reading sample

Algorithm: Dimensionally checked hybrid feature fusion

Inputs: matched feature batches Fc G 'zBxCCxHCxWC and T G ^BxNTxdT, plus a declared alignment/fusion rule.

Outputs: one fused representation per image and logits in xBxK. Batch size B, CNN width Cc, grid sizes HC.WC, token count NT, and token width ¿T must be checked explicitly; equal widths alone do not establish spatial correspondence.

1. Obtain CNN and Transformer features for the same image batch. Record each grid, channel width, and spatial coordinate convention.
2. Choose a target grid; align features with an explicitly specified resampling operation. Preserve batch identity and anatomical orientation.
3. Project channels if addition, gating, or common-width attention requires it. Assert the expected dimensions before fusion.
4. Apply the selected operation: concatenate, add, gate, or query one branch with keys/values from the other. Do not silently substitute one for another.
5. Apply the post-fusion block and pool to one vector per image. Produce K logits with a classification head.
6. Test both branch gradients when training jointly. For an ablation, remove one branch while keeping data access and selection rules fixed; report the resulting compute change.

6.11 U-Net hybrids for classification

Chapter 5 developed models whose outputs are spatial masks. Here we examine how those models or their features can contribute to classification. The subsections distinguish feature reuse, predicted-mask cropping, and joint learning, then examine a published spatial output. Follow which information is available at inference and which annotations enter training or evaluation before attributing a classification result to segmentation assistance.

6.11.1 From segmentation to classification

TransUNet, UNETR, Swin UNETR, and Swin-Unet were developed for dense prediction. Their original task, dimensionality, and decoder design matter when adapting them to wound classification. The original TransUNet combines convolutional and Transformer features with spatial reconstruction; its expanded journal version studies a broader encoder/decoder design space.[220, 221] UNETR connects volumetric Transformer representations to a convolutional decoder. Swin UNETR uses a hierarchical Swin encoder with a convolutional decoder, while Swin- Unet uses a U-shaped Transformer architecture.[222-224] A 3D medical result is not evidence for a 2D wound-photograph classifier, and a U-shaped Transformer need not contain a CNN feature extractor.

Follow the four dense-prediction architectures in distinct steps:

1. TransUNet (original hybrid): obtain a CNN feature grid; flatten and project it into tokens; apply a global Transformer encoder; restore the grid; upsample through a convolutional decoder while incorporating compatible CNN skip features; output pixel logits. CNN skips carry finer spatial detail than the bottleneck tokens.[220]
2. UNETR: partition a volume into 3D patches; embed them; process a constantresolution token sequence through Transformer layers; select intermediate layer outputs; reshape and resample those outputs with convolutional blocks to the
decoder’s different resolutions; combine them during volumetric reconstruction.
Different Transformer depths are not already different spatial resolutions.[222]
3. Swin UNETR: embed volumetric patches; apply windowed/shifted attention and stage-wise patch merging; send hierarchical feature grids through con-volutional skip and decoder blocks; reconstruct a volumetric mask. Its en-coder supplies a spatial hierarchy, unlike the constant-token-count UNETR encoder.[224]
4. Swin-Unet: use a 2D Swin encoder with patch merging; expand patches in a Transformer decoder; concatenate compatible encoder/decoder features and project their widths; restore pixel-level predictions. Patch expansion redis-tributes learned channel features into a larger spatial grid. This U-shaped de-sign is not the CNN-encoder/Transformer-bottleneck hybrid of original Tran- sUNet.[223]

Chapter 5 provides their segmentation foundations. The classification adaptation below is a proposed reuse of these mechanisms, not an assertion that the original papers tested wound-type classifiers.

For spatial features F G R^xwxc, a simple reuse head computes ga = (Aw)-[1] £k=1 £™=j. Frsa for channel a, then z = gW + b with W G RcxK. A 14 x 14 x 384 feature grid becomes a length-384 vector and then four logits for K = 4. Pooling removes position-specific outputs; it does not produce a segmentation mask. If the chosen features come from the encoder, the decoder can be omitted from classification inference. If they come from the decoder, it must remain. For volumetric features, pool over depth as well and preserve the distinction between a volume label and a photograph label.

Three adaptations answer different questions. A segmentation-assisted pipeline predicts a mask, derives a crop, and classifies that crop. Feature reuse attaches a classification head to a spatial representation, possibly without retaining the segmentation decoder at inference. Joint learning trains classification and segmentation heads together. Figure 6.16 separates these paths so that the source of the classification input is explicit.

Illustrations are not included in the reading sample

Figure 6.16. Original comparison of segmentation-assisted cropping, feature reuse, and joint learning. A reference mask used to construct a test crop provides information unavailable to a fully automatic pipeline.

6.11.2 Cropping and available evidence

Before classifying a photograph, a researcher may want the model to examine a wound region rather than the entire scene. A region of interest (ROI) is the selected image area, not an additional clinical label. Cropping can reduce unrelated background, but it also decides which surrounding anatomy and skin remain available. The segmenter’s selection is therefore part of prediction: the classifier cannot recover a wound region that was discarded upstream. We must define both how the region is obtained and what happens when that selection fails. Figure 6.16 separates this route from reusing spatial features without an explicit crop.

Let a segmenter return a probability mask S'(X). Threshold it using a development-selected value, derive a region R, add a recorded context margin, and crop the original image: XR = crop(X, R). The classifier then predicts f(XR). A missed wound or incorrect crop is a pipeline error even if classification on ideal crops is excellent. Decide how empty masks, multiple components, tiny regions, and out-of-frame wounds are handled. Report fallback behavior, such as using the full image or abstaining, and include those cases in evaluation.

A constructed wound crop. Take a photograph 200 pixels wide and 160 pixels high, with horizontal coordinates x G [0,200) and vertical coordinates y G [0,160). Suppose thresholding the predicted mask at a development-selected 0.5 gives one retained component with bounding box [60,120) x [40,100). These half-open bounds describe a 60 x 60-pixel region. Adding a 10-pixel margin on every side gives [50,130) x [30,110), an 80 x 80 crop from the original photograph. Record any subsequent resizing separately. At an image edge, clip the expanded bounds to the image dimensions; an empty prediction produces no box and must trigger the prespecified full-image fallback or abstention. A multiple-component policy must likewise state which regions are retained. The numbers illustrate geometry only: no model was run and no physical wound area follows from these pixel dimensions.

Context can be useful: removing the foot, ankle, incision pattern, or surrounding skin may remove evidence relevant to the target. Conversely, retaining rulers, dressings, or institution-specific backgrounds can create shortcuts. Compare fullimage and predicted-ROI conditions under the same patient split. A crop constructed from a reference mask is a privileged-information diagnostic comparison. Label it explicitly and do not call it a guaranteed upper bound: even an accurate crop can remove useful context and reduce classification performance. It is not an automatic inference result.

Wound application. Anisuzzaman and colleagues automatically localized wound regions before extracting image inputs for their wound-category classifiers.[14] The category prediction therefore followed a region-selection stage rather than assuming an arbitrary full photograph. Section 8.9 connects predicted regions and crops to complete classification experiments.

6.11.3 Joint losses and missing labels

For sample i, let u G {0,1} indicate availability of a classification label and G {0,1} availability of a segmentation mask. With positive task weights AC,AS, Omit a task term when its denominator is zero; do not divide by zero or create a negative label. Normalize each available task separately so that annotation frequency does not silently set the task weighting. For constructed losses £c = 0.4, £s = 0.6, and weights 1 and 0.5, the total is 0.7. A class label and mask must refer to the same wound or have a documented image-level interpretation when multiple wounds appear.

In Equation 6.27, ^ and p^ are classification logits and their reference target; SA is the predicted segmentation representation and M^ its reference mask. The scalar functions £c and £s are the chosen classification and segmentation losses. State whether S^ contains logits or probabilities, because its loss must expect that representation.

Shared training can help or hurt either task. The gradients add in shared layers; if their directions conflict, increasing one task’s weight can worsen the other. Compare classification alone, segmentation alone, and joint learning using matched data access. WILLIE provides a wound-specific example of classification and segmentation with localization derived from masks, but its benchmark does not remove the need to examine task compatibility in another dataset.[26]

Wound application. WILLIE combined classification and segmentation objec-tives in one wound-analysis framework and obtained localization from predicted masks.[26] Its application uses task-specific supervision rather than treating category labels and pixel masks as interchangeable. Section 6.16 develops the model and the distinct datasets used to evaluate its outputs.

6.11.4 Spatial outputs before classification

A classification head usually returns one set of class scores for the image or selected region. A segmentation head instead retains spatial positions and predicts which pixels belong to a target. This difference matters when a wound study uses spatial output to prepare a crop, describe visible tissue, or provide an additional training task. Before interpreting a colored overlay, ask what its channels mean, how

Illustrations are not included in the reading sample

Figure 6.17. Postoperative wound photograph and published tissue prediction. Adapted from Ranade et al. (2026), Figure 5A-B, CC BY 4.0.[291] Original panel pixels and overlay are preserved; headings and the source legend are typeset in a new layout. No reference mask or whole-image class prediction is supplied. Full attribution, original-publication and licence links, and adaptation details appear in the Image Credits.

probabilities became displayed regions, and whether a matched reference annotation is available. A detailed-looking map does not answer those questions by itself.

Figure 6.17 provides a documented reading example. Ranade and colleagues publish an electro-optical photograph after total knee arthroplasty beside the same photograph with a predicted multilabel tissue overlay. Their Figure 5 uses a fixed threshold of 0.5 at native image resolution.[291] In a multilabel mask, each tissue channel has its own prediction; the formulation need not force every pixel into exactly one exclusive class. The source legend distinguishes granulating tissue, necrosis, infection-associated exudate (IAE), and the open-wound field. Read a legend entry as a defined output category, not as evidence that every listed tissue is present in this particular panel.

Read panel A as the input and panel B as a spatial prediction. In the source legend, green denotes IAE and orange the open-wound field. The colors identify predicted regions; their opacity is not a calibrated confidence scale. The pair supplies neither the reference mask needed to check the boundary nor a whole-image woundcategory decision. In particular, an infection-associated output label is not an independent clinical infection diagnosis. The paper’s segmentation backbone is not specified sufficiently to attribute this panel to TransUNet or another named architecture.[291]

A subsequent system could use a predicted wound-field mask to derive the crop described above, or use a tissue mask to count predicted tissue pixels under a declared rule. Those are additional processing choices, and neither downstream classification nor physical measurement is demonstrated by this figure. A pixel count requires a spatial calibration before it can represent physical area. If predictions from several channels overlap, their areas must not be summed as though they were disjoint without checking the task definition.

To evaluate the displayed spatial prediction, obtain a matched reference mask and compute a declared segmentation metric such as Dice or intersection over union (Equation 5.46). To evaluate a later classifier, obtain its class prediction and corresponding class reference. Neither result follows from the overlay alone. The task-specific masks in Equation 6.27 and the alternative paths in Figure 6.16 explain why a spatial prediction, reference annotation, and category decision must remain distinguishable.

Wound application. Ranade and colleagues studied an electro-optical and in-frared pipeline for postoperative-wound assessment after knee arthroplasty.[291] Their example connects spatial wound information to an additional measured modality in a defined postoperative setting. Section 7.5 develops the sensor inputs, registration and evidence boundary.

6.12 Multimodal wound classification

The preceding pathways use images and, in some cases, spatial predictions derived from them. We now ask how additional information enters a wound classifier. The discussion begins with available metadata and missing-input behavior, then introduces caption-assisted retrieval and multimodal language-model interfaces. These examples establish the input and decision distinctions that Chapter 7 develops in greater detail.

6.12.1 Information available at inference

Anatomical location may resolve ambiguity that an isolated crop cannot. Published wound studies have combined images with body-location information.[14, 275] Other clinical variables should be included only when their collection, meaning, and availability are established. A treatment choice recorded after assessment, a diagnosis encoded in free text, or a severity score used to define the target can leak the answer into the input.

Let an image encoder produce hx G X'dx and a metadata encoder produce hm G ■\d"f. Early fusion combines inputs before substantial processing; intermediate fusion combines learned features; late fusion combines decisions or probabilities. A simple intermediate classifier treats these as column vectors and uses z = W[h^;hm]+b, where W G ^Kx(dx+dm) and b G RK. A gated alternative projects both to a common width and applies Equation 6.26. Cross-attention instead allows metadata queries to retrieve spatial image features or the reverse. Retain the image tokens for this operation: two metadata queries and 196 image keys give two weighted image summaries, with an independent row-normalized distribution over 196 positions for each query. With only one pooled image key, softmax is always one and the query cannot select among image regions. Pooling before attention therefore changes what the fusion can learn. Figure 6.18 separates vector fusion from token-based retrieval and shows an explicit missing-data indicator.

Wound application. Anisuzzaman and colleagues supplied both the wound photograph and its anatomical-location encoding to their combined classifier.[14] This is a wound application in which metadata form part of the required prediction input. Section 7.3 develops paired records and Section 7.4 develops their joint use.

6.12.2 Missing metadata and shortcut learning

For a continuous metadata feature m3, estimate training-only mean p3 and scale s3 > 0, then transform observed values to (m3 — Rj)/sj. If missing, use a documented imputation and append availability indicator Cj, equal to one when

Illustrations are not included in the reading sample

Figure 6.18. Original image-metadata fusion schematic. Metadata must be available before prediction. A missingness indicator distinguishes absent values from measured zeros; image-only inference is a separate evaluated condition.

observed and zero when missing. This distinguishes an imputed zero from a measured average. Categorical location requires an unknown category or another missingness policy; a body-map index is not automatically a meaningful continuous coordinate.

Evaluate image-only, metadata-only, and fused models. If the metadata-only model performs well, determine whether it uses legitimate predictive context or an artifact of sampling and labeling. Evaluate missing and incorrect metadata, and report performance by source and body site. More information is not guaranteed to improve performance: the image-plus-location configuration in Mousa and colleagues’ preprint does not uniformly outperform its image-only comparison.[275] Optimization variants and changed inputs must be identified separately before a benefit is attributed to fusion.

6.12.3 Queries and retrieval decisions

SCARWID (Synthetic Caption Augmented Retrieval for Wound Infection Detection) offers a documented image-to-retrieval decision rule. Figure 6.19 explains that rule using a separately sourced clinical photograph; the photo is not a SCAR- WID test case, and the illustrated pipeline is not executed here.[25] In the original preprint's Figures 6-7, the same test query changes from an image-only “No infection” prediction to an image-and-model-caption “Infection” prediction, matching that query's reference label. Those study-specific outcomes are reported in prose, without attaching them to the independent photograph.

At inference, Wound-BLIP first writes a caption from the query image. SCAR- WID encodes the image with a DeiT model and the text with a Contrastive Language-Image Pretraining (CLIP) text encoder; image-derived queries attend to text-derived keys and values, and the fused representation is projected to 256 dimensions. The label is the majority among five support items nearest in Euclidean embedding distance.[25] This connects patch formation in Equation 6.15, crossattention in Equation 6.10, and the nearest-neighbor decision in Equation 3.19. The prediction is a retrieval vote, not the softmax head of the generic teaching example in Figure 6.8.

The original SCARWID image-only visualization displays four non-infection neighbors and one infection neighbor, explaining its majority vote. Its multimodal visualization displays three infection neighbors; the paper states that these are only three of five neighbors shown for readability. The other two must not be invented or treated as a three-neighbor classifier. The source also publishes an attention-rollout map, which combines internal attention information and differs from Grad-CAM.[25] Figure 6.19 shows the computational contract rather than those low-detail case panels. No calibrated per-image probability follows from a neighbor-vote fraction.

The caption is the model’s description of the image, not an independently collected clinical note. The source used label-guided GPT-4o descriptions to train the captioner, but Wound-BLIP does not receive the query’s reference label at inference.

Illustrations are not included in the reading sample

Figure 6.19. A distinct real photograph beside an unexecuted SCARWID method contract. Photo: Reddy et al. (2024), Figure 1, nitric-acid burn of the anterior right thigh shortly after injury; CC BY 4.0.[292] New boxes summarize Busaranuvong et al., arXiv:2502.20277v1, Sections 3.1-3.2.[25] No model is applied to this independent illustration, which is neither the source query nor a neighbor. No infection label, model-written caption, retrieved case, score or attention map is supplied.

Its underlying infection labels were assigned by two specialist physicians from visual appearance without medical notes or clinical tests.[25] Accordingly, agreement in this example means agreement with that visual annotation procedure. It does not establish clinically confirmed infection or show that model-written captions always help; the source's Figure 11 documents SCARWID misclassifications. Figure 6.24 separately illustrates reference-based error counting with an image-only CNN.

Wound application. The SCARWID preprint classified wound infection by retrieving nearby labeled examples in an image-caption embedding space.[25] Its model-written caption contributes to the query representation, while support labels contribute to the decision. Section 7.7 develops this wound-specific retrieval application.

6.12.4 Multimodal language models: scope

A multimodal language model accepts images together with text and produces a textual response. For a wound-classification experiment, the text can define the permitted categories and show labeled examples before the new query photograph. A 2026 preprint examines this route using small multimodal language models and retrieved support examples.[110] The central idea is in-context adaptation: the selected examples change the information supplied for a prediction while the language-model weights remain fixed. Fine-tuning a ViT head instead changes learned parameters using training labels. Both require declared labels and data access, but they adapt the predictor in different ways.

Follow the prediction in five stages:

1. Prepare the support bank. Store permitted development images with their reference labels and provenance. Separate the locked test patients before con-structing this bank; test images, derivatives, and related patient photographs must not become support items. Version the class dictionary and bank membership.
2. Retrieve examples. Encode the query and bank images with the fixed retrieval encoder and compare their embeddings. Select a prespecified number of similar support images. The cited preprint compares nearest-neighbor retrieval with a diversity-aware reranking stage; retrieval settings are part of the evaluated method.[110]
3. Construct the prompt. Supply the allowed labels, the selected support images paired with their labels, and the query image without its reference answer. Fix the template and support ordering. A model’s description of the query is not an independently collected clinical note.
4. Obtain and validate a model response. Ask for a permitted category under a fixed output rule. Retain the returned text and determine whether it is valid, invalid, or an explicit abstention. Do not silently turn an unrecognized answer into a successful prediction.
5. Evaluate the complete pipeline. Compare with zero-shot prompting, random support selection, and a retrieval-only classifier using the same selected bank items. Include retrieval, image/prompt processing, and response validation in the resource record.[110]

A constructed wound-classification prompt. Suppose an eligible query photograph is to receive one of the chapter’s four teaching wound categories. An illustrative three-item retrieval returns a pressure-wound example and two venous-wound examples from other development patients. Their images and labels, followed by the unlabeled query, form the prompt. The language model may return any permitted category; its rule is not defined as the majority vote of those three labels. A separate unweighted three-neighbor classifier would return venous, so it supplies a useful control. If the language model instead returns a phrase outside the fixed vocabulary, record an invalid output unless a prespecified parsing rule resolves it. No response or clinical result is asserted here. The three support items are a miniature teaching construction, not the cited preprint’s experiment configuration.

Retrieval becomes part of the predictor because changing the encoder, bank, selected items, or prompt can change the response even when language-model weights are unchanged. A claimed “training-free” route still relies on pretrained models and labeled support. Similar examples can also repeat acquisition shortcuts or incorrect labels. Treat this as a wound-research interface requiring independent evaluation, rather than assuming that a fluent answer provides calibrated probability or clinical confirmation. Chapter 7 develops these interfaces; the next sections retain a controlled discriminative-model pipeline for comparison.

Wound application. The small-VLM author preprint evaluated multimodal language models for wound-category classification using retrieved examples in their prompts.[110] The task was category prediction under specified support-selection policies. Section 7.7 develops the application, while Section 8.10 connects retrieved context to an experiment interface.

6.13 Training and implementation

We now bring the representation and input choices into a training procedure. The first subsection establishes the data record and partitions; the next connects classification losses to gradients. Optimization and checkpoint selection then determine the retained parameters, while the final inference procedure specifies how the frozen system processes a new image. This sequence links a model description to a reproducible prediction pathway.

6.13.1 Data preparation

Begin with a versioned manifest containing image paths, checksums, eligible labels, group identifiers, source, and acquisition metadata. Preserve raw photographs and record each derived crop or mask. Specify whether the intended input is a whole photograph, a clinician-selected region, or an automatically predicted region. Fit preprocessing statistics on training data only; apply the same frozen transformation at validation and testing. A pretrained model’s expected color order, resize policy, and normalization are part of its input contract.

Training augmentation should represent plausible acquisition variation without silently changing the target. A crop that removes the wound cannot retain an unquestioned wound-type label. Strong color transformations may remove information

relevant to tissue appearance. If a segmentation mask accompanies an image, apply identical geometric transformations and label-preserving interpolation to the mask. Preserve the original image for evaluation and audit transformations, including their probabilities and parameter ranges. These choices should be reported alongside data partitions and model selection.[20]

Algorithm: Dataset preparation and group separation

Inputs: raw images, available patient/wound identifiers, reference labels, and a prespecified eligibility policy.

Outputs: disjoint versioned split manifests, a class dictionary, and training-fitted preprocessing. Missing grouping identifiers are a reported limitation, not evidence of patient independence.

1. Define eligibility, class dictionary, reference standard, uncertain-case policy, and required metadata. Mark missing labels explicitly.
2. Create one manifest row per original image and link every crop, duplicate, mask, and repeated visit to its source wound and patient where available.
3. Detect exact duplicates by checksum; review near duplicates and conflicting labels. Keep a disposition record instead of silently dropping files.
4. Assign patients to training, validation, and test partitions before creating derivatives. Check that no patient or linked derivative crosses partitions.
5. Inspect class counts and source distributions in each partition. If grouped stratification cannot place a rare class in every partition, revise the design and report the constraint.
6. Fit imputation and normalization on training data; define training-only augmentation. Save split manifests, transformation settings, and source versions.
7. Lock the test set. If patient identity is missing, state the independence limitation and do not label an image split patient-separated.

6.13.2 Classification losses and gradients

For one-hot target y E {0,1}K, true-class index k*, and softmax probabilities p, Below, py and wy are shorthand for the probability and weight indexed by the true class k*. To derive the gradient, write A = %.* + log £y. ezi and differentiate each term. This reveals why the loss should be computed from stable log-softmax logits rather than taking the logarithm of rounded probabilities. For p = (0.1,0.6,0.2,0.1) and true class 2, A ^ 0.5108 and the logit gradient is (0.1,—0.4,0.2,0.1).

Class weighting changes the contribution of each labeled observation: £w = wy£CE. A weight of two doubles the example loss to approximately 1.0217 and doubles its gradient. State the reduction convention. Dividing a batch’s weighted sum by batch size differs from dividing it by the sum of its weights. Inversefrequency weights and class-balanced sampling both alter emphasis; applying both can overcompensate, so compare their effects instead of treating them as independent free improvements.

Focal loss downweights already confident examples, with a nonnegative class weight Qy and focusing parameter 7:

Illustrations are not included in the reading sample

For py = 0.6, 7 = 2, and Qy = 1, the loss is approximately 0.08173. Setting 7 = 0 recovers weighted cross-entropy. The modulating factor changes during differentiation; multiplying a cross-entropy gradient by a fixed scalar (1 — py)[7] omits part of the derivative. Focal loss was introduced for imbalanced dense detection, so its usefulness for a wound classifier must be tested.[134]

The missing term can be seen explicitly. Write p = pk* and use dp/d^- = p(Py—py). The product rule gives 9£/9p = Qy7(1—p)[7]—[1] log p —Qy(1—p)[7]/p. Hence, for 0 < p < 1,

Illustrations are not included in the reading sample

For the same example, the bracket is approximately 0.4052, rather

than (1 — 0.6)[2] = 0.16. The resulting gradient is approximately (0.04052,—0.16208,0.08104,0.04052). For an independent numerical check, perturb one logit at a time by h and —h, recompute the focal loss, and form [L(t + ftej — L(t — Aei)]/(2A), where e^ is the ith coordinate vector. With h = 10—[5], the centered differences reproduce the displayed gradient to the quoted precision. Implement 7 = 0 through the cross-entropy branch, and use stable log probabilities near the endpoints instead of evaluating expressions such as zero times an infinite logarithm.

For multilabel targets, binary cross-entropy is applied per endpoint:

Illustrations are not included in the reading sample

wherepk = a(zk) and Q. = 1 only when the endpoint is observed. Each probability has its own sigmoid; their sum need not equal one. The gradient for observedlabel averaging is rfc(pfc — y^)/ £?. r?. For probabilities (0.8,0.3,0.6), targets (1,0,missing), and availability (1,1,0), the loss is [— log0.8 — log0.7]/2 ^ 0.2899 and the logit gradient is (—0.1,0.15,0). The missing endpoint contributes neither a positive nor a negative target. Omit an example with no observed endpoints from this loss term. Softmax cross-entropy would incorrectly force competition among endpoints that can coexist. Classification losses should also remain distinct from the pixelwise and overlap objectives used in Chapter 5.

Label smoothing replaces a hard target by (1 — e)y /\'. It discourages

extreme certainty relative to a hard one-hot target, but it does not encode clinically adjudicated ambiguity unless that interpretation has been justified. Class weights, sampling, focal modulation, and smoothing change the optimization problem; choose them through the development protocol and evaluate calibration separately.

Wound application. The severity-aware wound-triage study trained a classi-fication head with focal loss and a separate severity head with a regression ob- jective.[135] These losses served different outputs within one CNN-Transformer pipeline. Section 4.9 summarizes this study’s evaluation limits; Section 8.6 connects objectives to wound-model fitting.

6.13.3 Optimization and checkpoint selection

Use separate parameter groups when a pretrained backbone and a new head re-quire different learning rates. AdamW separates weight decay from the adaptive gradient update; record the decay exclusions and optimizer settings.[293] Warmup, learning-rate schedules, gradient clipping, mixed precision, and accumulation are implementation choices that must be held constant or explicitly compared. In gradient accumulation, scale the loss so the intended effective-batch average is preserved; perform an optimizer step only after the accumulated microbatches are ready.

A training update has an explicit order. Clear stale gradients at the start of an effective batch. Run each microbatch forward, form a loss with the declared re-duction, and backpropagate its correctly weighted contribution. If mixed-precision loss scaling is used, unscale the accumulated gradients before clipping; PyTorch’s official examples specify this order and keep the scale fixed during an effective batch.[267] Check for nonfinite values, clip only if specified, perform the optimizer update, and advance an update-based scheduler only after an actual update. Parameters excluded from training must remain unchanged. Weight decay belongs to the optimizer update; adding it to an already decayed loss implements another objective.[293]

Equal microbatch means can be averaged only when their effective denominators are equal. For example, microbatches containing two and one observed labels need weights 2/3 and 1/3 to reproduce the mean over three labels. Weighting both by 1/2 overweights the smaller group. For the joint objective in Equation 6.27, accumulate each task’s numerator and normalization consistently; a task with no available label supplies no update from that term. These are implementation consequences of the defined losses.

Checkpoint selection must use a prespecified development metric. Macro-F1 emphasizes classes equally, whereas accuracy weights every observation equally. Select one primary criterion and tie-breaking rule; do not switch criteria after observing test performance. If calibration is fitted, use a separate calibration subset

Illustrations are not included in the reading sample

Figure 6.20. Original training and inference information flow. Training labels update parameters; validation supports model selection; the locked test set supports final evaluation. Inference uses the saved preprocessing, model, and decision policy.

or an explicitly nested development procedure. Figure 6.20 separates gradient updates, model selection, and final testing.

Algorithm: Training and validation

Inputs: training and validation manifests, batches X E KBX[3]XBXW, labels, availability masks, initial model, and fixed optimization/selection rules.

Outputs: selected checkpoint, preprocessing, class order, and development log. Test labels do not enter updates or checkpoint selection.

1. Initialize the declared pretrained backbone and new head; set trainable layers and optimizer groups. Save seeds, configuration, software versions, and checkpoint identifiers.
2. For each epoch:
(a) For each training batch, sampled under the chosen policy:
i. Apply training transformations; move images, labels, and masks together. Clear gradients at the start of each optimizer update or accumulation window.
ii. Compute logits, valid-label losses, and any auxiliary terms. Assert finite loss, expected class order, and nonempty supervision.
iii. Backpropagate using the declared accumulation and precision-scaling policy. At an optimizer-update boundary, unscale gradients before clipping if needed, clip if specified, and update only trainable parameters. Handle a final partial accumulation window explicitly.
(b) Use deterministic transforms and evaluation mode. Aggregate predictions over the complete validation set before computing the selection metric.
(c) Save the best checkpoint, preprocessing, and class mapping by the fixed rule. Apply the recorded stopping schedule or patience.
3. Reload the selected checkpoint, fit permitted calibration on development data, then evaluate the locked test set once. Report all planned seeds and unsuccessful runs under a prespecified rule.

Use Table 6.6 to locate each implementation choice in the training procedure. Record these choices alongside the model so that differences in optimization are visible in an architectural comparison.

Table 6.6. Training and evaluation choices to fix before comparing models. These are proposed study controls, informed by reporting guidance rather than claimed experimental findings.

Illustrations are not included in the reading sample

Wound application. WILLIE used AdamW, a learning-rate schedule and early stopping while fitting its integrated wound-analysis models.[26] These are training and selection components, distinct from the subsequent task-specific evaluation. Section 6.16 develops the framework and Section 8.7 develops model-selection roles.

6.13.4 Reproducible inference

Algorithm: Classification inference

Inputs: an eligible image, permitted metadata, and the frozen inference configuration.

Outputs: K logits and probabilities, the declared decision or abstention, and input-quality/ver- sion flags. No reference label is an input to prediction.

1. Load the selected checkpoint, class order, input transformations, calibration parameters, and rejection rules. Select evaluation mode.
2. Validate image decoding, channel order, dimensions, metadata availability, and any ROI- extraction output. Apply the documented fallback for invalid or empty regions.
3. Apply deterministic preprocessing. Run the forward pass without gradient storage and retain raw logits.
4. If specified, apply calibrated temperature and convert logits to softmax or sigmoid probabilities according to the task.
5. Apply the fixed decision rule, including multilabel thresholds or abstention. Do not infer a new threshold from this case’s reference label.
6. Return the permitted outputs with class meanings, probability vector, missing-input flags, and pipeline version. Treat illustrative attention maps as auxiliary visualizations, not independent diagnoses.

6.14 Temporal models: Informer and FEDformer

The classification pipelines above assign a label to an available image or record. This section considers a different proposed task: forecasting from an ordered history of wound observations. We first state when temporal modeling is appropriate, then examine Informer’s query selection and FEDformer’s trend and frequency processing. A worked temporal example reconnects those mechanisms to measurement, timing, and simple forecasting baselines.

6.14.1 When temporal models are appropriate

Informer and FEDformer address long-sequence forecasting, not static wound-image classification.[294, 295] They become relevant only when a study has re-peated, temporally ordered measurements and a defined forecast target. An example is predicting future calibrated wound area from a history of area, image embed

dings, and available clinical covariates. This is a proposed research application here, not a verified wound result of either original paper.

Let visits occur at times t± < — < tL and let u^ E R[9] contain available measurements. A forecasting model maps an observed history to future targets:

Here U1:L E RLxg stores input measurements, m1:L E {0,1}LXQ marks their availability, and t1:L records visit times. The output and reference arrays have shape F x qy, where qy is the number of forecast targets. Omit an origin from this loss when no future target is observed. F is the forecast horizon in time steps, j indexes target variables, and r^g marks observed future reference values. State the time unit and target normalization. For area measured in cm[2], an unnormalized squared-error term has units cm[4]. Irregular visits cannot be treated as equally spaced days without a resampling policy. Interpolation, missingness indicators, and time gaps must use only information available at the forecast origin.

Forecasting differs from assigning a current wound type. An etiological label may remain constant while area changes; successful area forecasting does not validate classification. Short clinical histories may favor persistence, linear trends, or simpler recurrent models over long-sequence architectures. Include these baselines before adding a complex temporal component.

6.14.2 Informer: query selection

Informer approximates attention by identifying query rows whose score distributions deviate strongly from uniform, and uses sampled scores to avoid evaluating every candidate row in full. It also reduces sequence length between encoder layers and predicts a forecast horizon through a decoder.[294] Letsij = Qikj/Vdk for LK keys. The query sparsity measure is

Illustrations are not included in the reading sample

The second quantity is a full-key max-minus-mean approximation; the efficient implementation estimates selectivity from sampled keys. These must not be conflated. In the authors’ released code, if ^i is the sampled multiset, the selection score uses maxje§. qf kj — L^[1] £J€<§. qf kj. The sampled sum is divided by the full key count, not by |^i|. It is consequently not the ordinary sample mean. The code ranks these unscaled scores and scales the selected full attention rows afterward; common positive scaling does not change that ranking.[296] The relationship to divergence follows by comparing a uniform key distribution with the softmax distribution: KL(B^Ai) = Mj — log LK. This identifies nonuniform query rows; it is not simply keeping the largest keys globally.

For constructed score rows (0,0,0) and (0,0, log4), the exact measures are log 3 ^ 1.0986 and log 6 — log 4/3 ^ 1.3297. The second row is more selective, with probabilities (1/6,1/6,4/6). Selecting u query rows for full attention, with u proportional to log LQ , reduces the evaluated query-key pairs. Approximate selection can miss useful rows, so it is an accuracy-computation tradeoff rather than an exact identity.

The attention output still has one row per query. Initialize unselected rows with the mean value vector for the unmasked encoder case; replace selected rows with their full softmax-weighted value combinations. The released masked selfattention path instead initializes context by a cumulative sum of values and applies a causal mask to the selected rows.[296] These defaults are approximations, not learned attention distributions for every unselected query. For three scalar values (2,4,6), the unmasked default is 4 at each unselected row; a selected row with weights (1/6,1/6,4/6) returns 5. Query selection has not itself removed any output positions.

The distilling stage applies a temporal convolution, nonlinearity, and pooling to shorten intermediate representations. This “distilling” is sequence downsampling, not DeiT’s teacher distillation. A decoder receives known history and placeholders for the forecast horizon together with permitted temporal information. Future target values must remain unavailable. Figure 6.21 shows these information boundaries.

6.14.3 FEDformer: trend and frequency components

FEDformer combines seasonal-trend decomposition with frequency-domain processing, including Fourier and wavelet variants.[295] To understand the decomposition, let u E RLxg and define a moving-average trend T = MAku/i for a specified window and boundary policy; the residual is S = u — T .A mixture of moving-average experts can combine several window sizes with learned normalized weights. The residual is called seasonal in this model family, but a wound trajectory is not necessarily periodic.

For one real-valued channel, the discrete Fourier transform is

Illustrations are not included in the reading sample

The symbol i is the imaginary unit. A frequency-enhanced block selects modes, applies learned transformations across feature channels in that representation, and returns to the time domain. The paper studies random mode selection; it should not be described as invariably retaining only low frequencies. Preserve conjugate symmetry, or use an appropriate real-transform implementation, to reconstruct real signals. Wavelet variants use multiresolution basis functions instead of the same Fourier-mode operation.

To make channel mixing concrete, let Q = SWQ E RLxd, with Wo E R«xd, and transform each channel over time to obtain Q. For a selected mode set X and

complex weights Rabk, a same-width teaching block is

Illustrations are not included in the reading sample

Here a and b index input and output channels; k indexes frequency, not a clinical class. This unpacks the mode-wise channel contraction in the original Fourier block.[295] The real-valued output assumes conjugate-paired modes and weights, with real weights at the zero and, when present, Nyquist frequencies, or an equivalent real-transform convention. For one channel, identity projection, and the sequence below, retaining modes 1 and 3 with weight 1/2 halves its amplitude. The block mixes frequency features; the full encoder, decoder, decomposition, and training objective are still required for forecasting.

For the original teaching sequence S = (1,0, —1,0), the transform is (0,2,0,2) under Equation 6.34. Keeping the conjugate pair at indices 1 and 3 reconstructs the sequence exactly; keeping only the zero-frequency term gives all zeros. This explains why indiscriminate removal of nonzero modes can erase change. It is not a forecast or a trained FEDformer output. Fourier transforms also have a computational cost; a linear dependence of selected-mode interactions under fixed mode budgets should not be restated as universal measured linear-time execution of the entire pipeline.

A frequency block alone does not specify the forecast. In FEDformer’s full flow, first embed the history and decompose representations into trend and residual components. Encoder layers process the residual through frequency-enhanced operations and feed-forward/decomposition steps. Initialize the decoder from a known historical segment and placeholders for the future: residual placeholders contain no future observations, while trend initialization uses information from the known history. Decoder self-processing and encoder-decoder frequency interactions update the residual; trend contributions accumulate separately. Add the final

Illustrations are not included in the reading sample

Figure 6.21. Original bounded comparison of Informer and FEDformer mechanisms. The history and future targets are separated explicitly. Query selection and frequency processing illustrate proposed longitudinal extensions, not established wound-study results.

projected residual and trend to obtain the prediction horizon.[295] Fourier crossattention is a separate interaction between decoder queries and encoder keys/values, not just applying Equation 6.35 twice. A reproducible implementation must specify the Fourier or wavelet variant, selected mode indices, padding, and decomposition kernels.

6.14.4 Worked temporal example

For a proposed area-forecasting study, first convert each photograph into a calibrated area estimate using the assumptions in Chapter 5; carry measurement uncertainty forward. Group windows by patient, establish forecast origins, and record visit gaps. Fit normalization and resampling on training histories. Compare last-observation persistence anda simple trend against a recurrent model and, only if sequence length justifies it, Informer or FEDformer. For each origin, expose only past observations and covariates genuinely known at that time. Evaluate errors by horizon and patient, including cases with missing future measurements.

As a simple check, areas (10,8,6) cm[2] observed at equal weekly intervals give a last-value forecast of 6 cm[2] and a linear-trend forecast of 4 cm[2] for the next week. If the observed target is 5 cm[2], both have absolute error 1 cm[2]. This synthetic example demonstrates why a complex model must beat meaningful simple baselines. It supplies no clinical healing law, and an unconstrained linear forecast would eventually become physically impossible.

6.15 Evaluation, uncertainty, and failure analysis

The model and inference procedure are now defined; their outputs must be compared with references on the intended evaluation cases. We begin with confusion matrices and aggregation, then distinguish ranking, probability calibration, and uncertainty. Failure review completes the analysis by reconnecting errors to the inputs and study conditions. These steps provide the framework for interpreting the published evidence in the next section.

6.15.1 Confusion matrices and aggregation

Let C^ count observations whose reference class is i and predicted class is j. Rows are reference labels and columns predictions throughout this chapter. For class fc,

define FFk = F., = CfcJ, and FFk = £^k '. Then

Illustrations are not included in the reading sample

Accuracy is £kCkk/%. Macro-Fl averages the class-specific F-^k; balanced accuracy averages recalls. Weighted-F1 weights class-specific F1 by reference support. The F1 of macro-averaged precision and recall is generally not macro-F1. In single-label multiclass evaluation with all classes included, micro-precision, micro-recall, and micro-F1 coincide with accuracy.

Consider the synthetic matrix

Illustrations are not included in the reading sample

Each class has ten reference examples. Accuracy and balanced accuracy are both 31/40 = 0.775. The four class F1 scores are 16/21, 12/18, 18/22, and 16/19, giving macro-F1 approximately 0.7722. They differ despite equal reference counts because predicted counts differ. Figure 6.22 displays this matrix alongside an independent calibration example.

If a class has no reference positives, its recall is undefined; if no positives are predicted, precision is undefined. Report a prespecified convention and the affected supports. Returning zero can be useful in a software summary but is not the same as observing zero sensitivity. Do not silently omit difficult classes or compare macro averages computed over different class sets. Multilabel confusion counts are computed separately per endpoint; exact-match accuracy is a different, stricter measure.

6.15.2 Ranking, calibration, and uncertainty

For one class versus the rest, FXfc = n — FFfc — FFfc — FXfc and false-positive rate is FFfc/(FFfc + 7'V.,: when negatives exist. ROC curves plot sensitivity against this false-positive rate as a score threshold changes; precision-recall curves plot precision against recall at those same threshold decisions. Precision-recall curves emphasize positive predictive performance and depend on prevalence. In multiclass problems, state the one-versus-rest construction and macro or micro aggregation. A ranking score such as AUC does not establish calibration, and a high negative-class prevalence can make accuracy appear strong without useful positive detection.

For multiclass probabilities, the class-summed Brier score is n-[1]£Z£J^- 9zfc)[2].[332] A class-mean rescaling is this score divided by K; identify it explic-itly if used. Temperature scaling uses p = softmax(t/r) with T > 0 fitted on development data. Fit the positive temperature by minimizing cross-entropy on the calibration subset while holding model weights fixed; optimizing log T is one way to enforce positivity. A common temperature preserves the argmax but changes confidence. It can improve calibration on the evaluated distribution without guaranteeing calibration after a domain shift.[44]

For bins Bb of prediction confidence, an expected calibration error estimate is

Illustrations are not included in the reading sample

Its value depends on the binning scheme and sample size. In a constructed 20- image example, ten predictions have mean confidence 0.6 and accuracy 0.5, and ten have mean confidence 0.9 and accuracy 0.8. ECE is 0.1. This calculation says the two groups are overconfident by ten percentage points; it does not identify which individual predictions are wrong.

For this top-label definition, confidence is the largest class probability. The bin accuracy acc(Bb) is the fraction of correct argmax decisions in bin b, and conf(Bb) is their mean confidence. The count n includes all evaluated predictions; \Bb| is the bin count. Empty bins contribute nothing, but an entirely empty evaluation set is invalid.

To estimate uncertainty with repeated photographs, resample patients and include all their retained observations in each bootstrap sample. For model comparisons, use the same resampled patients for both models. State whether the target metric weights photographs, wounds, or patients equally; these are different estimands. Confidence intervals from a small number of training seeds describe a different variation source from patient-level sampling uncertainty. CLAIM emphasizes transparent reporting of evaluation and uncertainty; the resampling unit must match the study structure.[20]

For a concrete patient bootstrap, start with G unique held-out patients, draw G patient identifiers with replacement, concatenate their complete prediction/reference groups with their sampled multiplicities, and recompute the metric. Repeat the draw to form a sampling distribution, then use the declared interval construction.

Illustrations are not included in the reading sample

Figure 6.22. Original synthetic confusion matrix and reliability plot. The diagonal in the reliability plot denotes equal accuracy and confidence. These are synthetic teaching values, not measured wound-model performance.

A patient drawn twice contributes twice; deduplicating the resampled identifiers would defeat the bootstrap. Use the same draw for both models when computing paired differences. If rare classes disappear in a replicate, apply and report the prespecified undefined-metric policy. This procedure estimates variation under the chosen empirical patient population; it does not establish performance in an unseen hospital.

If the system abstains, report coverage (the fraction receiving a decision), accuracy or other metrics among decided cases, and the dispositions of all remaining cases. An apparently improved accuracy obtained by excluding difficult inputs must be interpreted together with the reduced coverage. Distinguish a model’s abstention from an image rejected by a predefined eligibility rule.

Wound application. The TransUNet-GradCAM study assessed ranking, pixel calibration and uncertainty for foot-ulcer masks rather than relying only on a single overlap score.[43] These analyses address different properties of the spatial predictions. Section 5.16 develops their interpretation and the study’s reporting qualifications.

Illustrations are not included in the reading sample

Figure 6.23. Original schematic failure scenarios: acquisition variation, shortcut cues, crop error, and missing metadata. The panels describe hypotheses for testing, not observed failure rates.

6.15.3 Failure review and interpretation

Inspect errors by class, patient, site, acquisition device, lighting, skin tone where appropriately recorded, wound size, occlusion, and metadata availability. A model may rely on dressings, rulers, body location, or dataset-specific backgrounds. External testing should apply the frozen pipeline to a genuinely separate target population with compatible labels. Tuning on that target population changes the experiment into adaptation and must be reported as such.

Attention weights display one internal mixing operation, not proof of a causal explanation. Alternative attention patterns can sometimes yield similar predictions, and the connection between attention and feature importance depends on the model and analysis.[297] Gradient-based maps also require checks for implementation, target selection, and robustness. Use them to formulate and investigate hypotheses, with controlled perturbations and error review. A convincing heatmap does not establish correct diagnosis or clinical benefit.

Figure 6.23 illustrates possible failure mechanisms using simple original drawings. Each panel suggests an experiment: remove a ruler, alter acquisition conditions within plausible limits, compare full image with ROI, or withhold metadata. Such tests must preserve label meaning; a destructive edit that removes the wound cannot establish invariance to irrelevant context.

Illustrations are not included in the reading sample

Figure 6.24. Published binary-classification errors with PG defined as positive. Birkner et al. (2022), Figure 4, clinical columns 1 and 3; creator-supplied Fig4_2col.jpg, Mendeley Data version 1, CC BY 4.0.[181, 290] Exact clinical crops are recomposed with new reference/pre- diction boxes. True diagnostic groups and incorrect-CNN markers imply the opposite predicted class in this binary task: UC-to-PG is FP, PG-to-UC is FN. These labels concern PG versus leg ulcer, not infection or SCARWID.

Figure 6.24 adds two observed CNN errors to those hypothetical failure mechanisms. Birkner and colleagues' source Figure 4 places clinical column 1 in the UC reference group and column 3 in the PG group, marking both CNN decisions incorrect. Because the task has exactly two classes, these markers imply a PG prediction for the UC case and a UC prediction for the PG case.[181, 290] These are image-only CNN examples; no model-written caption, retrieval neighbor or infection diagnosis is assigned to them.

Using the row-reference, column-prediction convention of Equation 6.37, source column 1 enters the UC row and PG column (FP), whereas column 3 enters the PG row and UC column (FN). Here PG is mapped to the positive class and UC to the negative class; the binary definitions in Equation 2.5 apply after that explicit mapping. The first error enters specificity's denominator, TN + FP, and the second enters sensitivity's denominator, TP + FN. Sensitivity is positiveclass recall in Equation 6.36. These selected cases explain the counts; they cannot estimate a population error rate. In retrieval or caption-assisted systems, the same reference-comparison principle applies, but an attractive explanation cannot replace an independently supported target label.

Algorithm: Evaluation and failure analysis

Inputs: retained predictions and reference labels for the locked evaluation manifest, patient groups where available, and prespecified metric/uncertainty rules.

Outputs: confusion counts, per-class and aggregate metrics, uncertainty estimates, exclusions, abstentions, and failure analyses. Preserve undefined values and their reasons instead of converting them silently to successful scores.

1. Load the locked manifest and selected inference pipeline. Produce one retained prediction record per eligible observation, including failures and abstentions.
2. Verify class order, reference-label availability, patient grouping, and output shapes. Reject NaN probabilities and incompatible label dictionaries.
3. Compute the complete confusion matrix, per-class support and metrics, prespecified aggregate scores, and ROC/PR analyses where defined.
4. Assess calibration using the declared definitions and bins. Report undefined metrics and absent classes explicitly.
5. Resample patients for uncertainty and paired comparisons; preserve within-patient records. Separate this uncertainty from variation over training seeds.
6. Review representative correct and incorrect cases by prespecified subgroups and failure mechanisms. Evaluate external data without retuning unless adaptation is the stated experiment.
7. Publish split rules, exclusions, preprocessing, pretraining, model selection, cost measurements, and limitations sufficient to interpret the result.

6.16 Evidence from wound studies

We now apply that framework to published wound studies involving Transformer and hybrid methods. The subsections first establish the tasks and protocols, then examine classification, multimodal, segmentation, and tissue evidence before a unified-model case study. The final discussion identifies what stronger comparisons would require. Read each result with its target and evaluation setting when relating it to a proposed classifier.

6.16.1 Tasks, protocols, and reported scores

The selected evidence published in 2026 and earlier includes wound-type classification, infection assessment, tissue analysis, segmentation, and unified systems. Coverage is selective. These are not interchangeable endpoints. A four-class wholeimage accuracy, a binary infection score, and a pixelwise Dice coefficient answer different questions even when all three methods contain attention. Tables 6.7 and 6.8 therefore organize studies by task and evidence boundary rather than ranking their headline numbers.

A useful evidence record includes dataset release, population, patient and image counts where reported, label definitions, partition unit, crop policy, pretraining, metadata access, selection procedure, metric aggregation, and uncertainty. An omitted patient count remains unreported; it must not be estimated by counting images. The following study discussions identify unresolved protocol or interpretation limits where they affect a comparison. Numerical claims are omitted when their evaluation setting or aggregation cannot be established; the architectural contribution can still be discussed without treating incomplete reporting as stronger evidence.

6.16.2 Classification and multimodal studies

MCTFWC reports full-image and ROI experiments with several class combinations and a parallel CNN-Transformer design. Its methods describe repeated images from some patients, both a percentage split and cross-validation, without clearly establishing patient-separated testing. Its architecture and ablations motivate fusion research, but do not justify a universal superiority claim.[164]

Mousa and colleagues’ image/location preprint evaluates a wavelet-enhanced ViT and metadata fusion with optimization variants. Its Table 12 does not show a uniform benefit from adding location: the unoptimized image-plus-location condition is below the image-only wavelet condition, while optimized configurations differ.[275] The conclusion should therefore concern the tested configuration and selection procedure, not “metadata always improves classification.” The later Swin-and-Transformer publication is a related record and must be cited as its own version rather than silently substituting its authors or results.[283]

WoundNet-Ensemble describes fusion of ResNet, DINOv2, and Swin outputs and reports near-perfect performance on a six-category image collection. The available preprint does not establish a patient-separated external evaluation or a prospective deployment assessment. Its longitudinal example also cannot establish clinical utility of a monitoring system by itself.[298] Its relevance here is the ensemble strategy and the questions required to evaluate such a result, rather than a numerical target that other datasets must match.

Table 6.7. Wound-classification evidence, organized by the question tested. Performance numbers are withheld where their interpretation cannot support a fair comparison.

Illustrations are not included in the reading sample

6.16.3 Segmentation and tissue evidence

A wound pipeline can ask where the wound lies, which tissue appears in an ex-tracted region, or which pixels belong to each tissue class. Localization returns a region such as a box; tissue classification returns a label for an image or patch; segmentation returns spatial labels. These outputs can prepare inputs or supply auxiliary supervision for a wound-type classifier, but their evaluation targets remain different. The studies below help us reason about these stages, rather than supply interchangeable scores for one classification problem.

For example, a hypothetical photograph may first pass through a detector, which supplies a candidate wound box. The extracted patch then enters a tissue classifier. An incorrect or missed box affects the complete pipeline even if the tissue classifier works well on correctly selected patches. A segmenter would answer the more spatially detailed question of where tissue labels occur within the region.

YOLO meets CCViT implements a detector-to-classifier sequence: YOLOv8n localizes wounds and extracts patches, then an ELU-enabled convolutional tok- enizer and compact convolutional Transformer perform tissue classification.[302] The convolutional stage prepares local patch features for the Transformer, connecting the study to Section 6.9. Its tissue target and localization result inform region preparation and tissue analysis; they do not directly establish performance for the chapter’s four-way etiological classifier. Any claimed deployment advantage also requires device measurements beyond an operation count. WoundFormer studies multiclass tissue segmentation with multiscale spatial feature fusion. Its independent DFUTissue evaluation also illustrates that a method’s advantage can depend on dataset and augmentation condition.[303]

Chapter 5 examined the TransUNet-GradCAM ablation in detail. The hybrid loss, rather than every added architectural component, produced the significant indomain Dice improvement reported in that study.[43] This distinction matters when importing a segmentation backbone into a classifier: a successful training objective does not prove that the Transformer component alone caused the improvement. Table 6.8. Supporting tissue, segmentation, and multitask evidence. These studies inform pipeline design but are not ranked as wound-type classifiers.

Study Relevant contribution Boundary of the evidence

YOLO meets CCViT Detector followed by compact convo-lutional Transformer tissue classifica- tion.[302] Tissue labels and localization differ from whole-image etiological la- bels.[302]

Postoperative tissue Published wound/tissue-overlay pair Qualitative spatial output; the ex-

pipeline (2026) with threshold 0.5; Figure 6.17.[291] ample supplies neither a reference mask nor a whole-image classifica-tion result. Segmentation backbone not specified.

WoundFormer (preprint) Spatially preserving multiscale decoder for tissue segmentation.[303] Dataset-specific training and tissue taxonomies; an independent bench-mark is not necessarily zero-shot ex-ternal transfer.[303]

TransUNet-GradCAM Hybrid wound segmentation with loss and architecture ablations.[43] The significant loss result must be separated from nonsignificant archi-tectural additions; the detailed proto-col selects validation thresholds per seed.[43]

Cross-dataset DFU bench- Comparison of CNN and Transformer The tested models and sources do not

mark (preprint) segmentation under dataset shift.[304] establish a universal architecture-family ranking.[304]

WoundAmbit Segmentation benchmarks, general-ization, and measurement integra- tion.[305] Segmentation quality and calibrated area measurement remain separate from wound-type classifica- tion.[305]

Harmonic hybrid Trans- Multicolor-space wound segmentation Domain-specific segmentation evi-

former with additional skin-tone and expert-rating analysis.[306] dence; clinical classification and fair performance across all populations are not established by this experi- ment.[306]

Study Relevant contribution Boundary of the evidence

WILLIE (2026) Unified classification, segmentation, and mask-derived localization with pretrained representations.[26] Classification and dense outputs use different evaluation sets; no prospective clinical validation is re- ported.[26]

6.16.4 WILLIE: a unified model case study

WILLIE’s published proceedings version combines pretrained representations with classification and segmentation heads, deriving localization from predicted masks. Its model scales differ in backbones and capacity. The classification protocol holds out 234 AZH images while using a combined 1,080-image development pool; segmentation is evaluated on the 400-image FUSeg validation release. These are separate task evaluations, not three measurements from one fully annotated held-out patient cohort.[26]

Its information flow can be unpacked without importing uncertain performance numbers. Backbone features at several scales are projected to a common width and combined through a weighted feature pyramid. Task queries attend to pyramid features and combine the scale-specific responses with learned weights. Classification pools features and combines expert outputs through a learned router; the paper’s dense mixture uses all experts with normalized weights rather than selecting a single expert. The segmentation path reconstructs a spatial mask using a U-shaped decoder.[26]

WILLIE’s wound-type-conditioned modulation uses a penultimate classification feature z E RR, not the hard predicted class or the final class-logit vector. For a decoder grid F) E ^hixwixci, its feature-wise affine modulation is

Illustrations are not included in the reading sample

Each projection has shape ct x dz; each bias and output has ct entries. Scale and offset broadcast over the two spatial indices r, s. This exposes classification-related features to the decoder while retaining spatial features.[26] For a teaching channel

Illustrations are not included in the reading sample

Figure 6.25. Original conceptual explanation of shared wound-analysis outputs, informed by WILLIE.[26] Penultimate classification features condition the decoder through channelwise scale and offset; final class logits are a separate output; connected mask regions can supply localization boxes. The diagram is not an exact implementation or a new experiment.

with values (1,3), scale 2 and offset —1 produce (1,5). The same coefficients apply at both positions; they do not create a separate per-pixel class label. Thresholding the final mask and finding connected regions then supplies localization boxes, with threshold and component-filtering settings part of the inference pipeline.

The useful lesson is architectural and experimental: feature sharing and mask- derived localization can be tested together, but their effects require task-specific baselines and compatible data. The paper does not report prospective clinical validation. Its aggregate and per-class classification summaries also require reconciliation before they can support a numerical comparison. Their averaging conventions and evaluated cases must be established together; this chapter therefore does not rank the reported classification scores against other studies.[26] Figure 6.25 therefore illustrates the information flow without reproducing an uncertain performance chart.

6.16.5 Requirements for stronger evidence

An architectural benefit requires a controlled ablation with the same data access, input resolution, pretraining policy, training budget, and selection rule. General-ization requires a separate target source with compatible reference labels. Clinical effectiveness requires outcomes and a study design that evaluate actual use, not only retrospective discrimination. Larger datasets, additional metadata, or newer pretraining are possible improvements, but each changes the evidence needed to attribute a result. These distinctions provide the basis for the research protocol below.

6.17 Reproducible study design

The evidence review provides concrete questions for a new study. This section turns those questions into a reproducible comparison: define the main experiment and its comparison arms, isolate mechanisms through ablations, verify the implementation, and retain the records needed to interpret the result. The subsections connect those stages so that an apparent improvement can be traced to a declared experimental change.

6.17.1 Questions and comparison arms

Consider a proposed study of pressure, diabetes-related foot, venous, and surgical wound classification. The primary question is whether a Transformer or hybrid improves patient-separated macro-F1 over a well-tuned CNN under matched information access. Secondary questions concern calibration, per-class recall, sensitivity to crop selection, and inference cost. This is a teaching design, not an executed clinical experiment.

Use four comparison arms: a pretrained CNN with a classification head; a ViT with the same endpoint; a hierarchical Transformer such as Swin; and a dimensionally specified CNN-Transformer fusion model. Add frozen DINO features with a linear head as a representation baseline if the study’s compute and pretraining policy allow it. The architecture papers define mechanisms; they do not supply a wound-specific winner.[164, 249, 250, 278]

Keep the class dictionary, patient split, primary input condition, allowed metadata, and evaluation code common. Match optimization search budgets rather than forcing every architecture to use an unsuitable learning rate. Report pretrained data and parameter counts because equal fine-tuning epochs do not imply equal prior compute. If one model needs higher resolution, report that as an additional condition with its cost rather than hiding it in the main comparison.

6.17.2 Ablations and mechanisms

For a hybrid, compare each branch alone, simple concatenation, projected addition, and the proposed attention fusion. For segmentation assistance, compare full images, predicted crops, and an explicitly labeled reference-mask crop diagnostic. For multimodal classification, compare image-only, metadata-only, fused, and missingmetadata conditions. Each comparison answers a specific question; combining all changes at once cannot identify the contribution of any one component.

Prespecify a small set of primary comparisons and report uncertainty for their differences. Use paired predictions on the same held-out patients. Inspect whether an aggregate gain conceals poorer performance for a clinically important class or acquisition subgroup. Treat subgroup analyses as exploratory when sample sizes or multiplicity prevent strong conclusions. CLAIM provides a reporting framework for these study decisions and limitations.[20]

6.17.3 Implementation checks

Verify a small deterministic attention example, including row sums, masks, and gradients. Confirm image/patch divisibility, window partition and inverse reconstruction, and padding behavior. Trace feature dimensions through every fusion operation. Check that a frozen backbone receives no parameter updates and that intended trainable layers do. Ensure training and evaluation modes do not accidentally alter preprocessing or use test statistics.

On a tiny training-only subset, check whether the model can reduce loss and whether deliberately permuted labels remove meaningful validation behavior. Such checks diagnose a pipeline; they do not constitute clinical evidence. Save raw logits, labels, identifiers, and failure flags so metrics can be recomputed independently. Avoid retaining only a rounded summary score or a plotted confusion matrix.

6.17.4 Reproducibility and reporting

The study record should contain dataset version and access conditions, inclu- sion/exclusion flow, reference-label procedures, split manifests or reproducible group assignments, preprocessing, architecture specification, checkpoint origin, loss reduction, optimizer, seeds, stopping rule, calibration, and evaluation code. Record hardware, precision, batch size, image resolution, latency measurement procedure, and all auxiliary costs. Preserve negative findings and failed runs under a declared policy.[20]

A reproducibility package is not evidence that its experiments have been rerun. Distinguish supplied algorithms and worked teaching calculations from the results reported by cited studies. An implementation derived from the pseudocode needs its own tests, data governance, and empirical evaluation.

6.18 Chapter review

The chapter has followed how observations become representations, how representations exchange information, and how a declared decision is evaluated. The wound examples connect recurrent state updates, attention weights, CNN feature grids, predicted crops, and retrieved support images to that common pathway. This review starts with a minimal experiment and retains the worked exercises for its technical checks. When comparing approaches, identify what changed: the architecture, the supervision, the selected image region, or the information supplied at prediction time. Research questions and a cross-chapter guide then connect those choices to the book’s other classifier families.

6.18.1 Choosing a minimal experiment

Table 6.9 is an original research guide. Its suggested comparisons are hypotheses to test, not clinical recommendations or claims of measured superiority. Begin with the endpoint and data structure; add architectural complexity only when it addresses a defined limitation and can be evaluated.

Table 6.9. Wound-classification choices organized by available information and research con-straints. Each proposed advantage requires a controlled experiment.

Illustrations are not included in the reading sample

Illustrative research choice. Suppose downsampling wound photographs re-moves small tissue cues, but global attention at the original resolution exceeds available memory. Compare a declared windowed model with the global-attention baseline at a resolution both can process, then test the windowed model at higher resolution as a separate experiment. Keep pretraining access and adaptation budgets explicit. Report per-class recall, peak memory, and measured latency. This separates evidence about the attention mechanism from evidence about retaining more image detail; neither experiment alone establishes clinical usefulness.

6.18.2 Review exercises

Attempt all twelve questions before consulting the worked solutions in Section 6.18.3. The solutions use the same numbering.

1. Target. A diabetes-related foot ulcer also has a clinician-assigned infection label. Must these compete in a two-class softmax?
2. Patches. A 224 x 224 RGB image uses 16 x 16 patches. How many tokens enter a ViT with one class token?
3. Heads. Width 192 is divided into three equal heads. What is each head’s width, and what is concatenated width?
4. Attention. Scores (0, log3) weight values (2,0) and (0,4). What is the output?
5. GRU. Does a zero gate preactivation imply no update?
6. Windows. How many 4x4 windows fit an 8x8 token grid, and how many scores does one head form?
7. Fusion. Can 14 x 14 x 256 and 14 x 14 x 192 features be added directly?
8. Loss. For true-class probability 0.6, compare cross-entropy with focal loss at 7 = 2, a = 1.
9. Missing labels. A batch has image labels but no segmentation masks. What happens to Equation 6.27?
10. Forecasting. Areas 10, 8, and 6 cm[2] are measured weekly. Is predicting 4 cm[2] a Transformer result?
11. Metrics. Can macro-F1 differ from accuracy when class supports are equal?
12. Evidence. Does a higher Dice from a 3D MRI model demonstrate better wound-photo classification?

6.18.3 Worked solutions

These solutions correspond to Questions 1-12 in Section 6.18.2. The numerical values are teaching calculations, not measured wound-model results.

1. Target. No. They concern different endpoints and can coexist. Define separate outputs or a suitable multilabel formulation with observed-label masks.
2. Patches. 14[2] + 1 = 197. Each flattened patch has 16[2] x 3 = 768 values before projection.
3. Heads. 64 and 192. An output projection is still a learned operation, even when it preserves width.
4. Attention. (0.5, 3). Masking the second key changes it to (2,0).
5. GRU. No; its sigmoid is 0.5. Whether a large update gate favors old or candidate state depends on the stated convention.
6. Windows. Four windows and 4 x 16[2] = 1024 scores. This excludes all other network operations.
7. Fusion. No. Concatenation gives width 448; addition requires a common projected width.
8. Loss. Approximately 0.5108 and 0.08173. The smaller numerical value does not itself mean better predictions.
9. Missing labels. Omit the segmentation term for that batch. Do not create empty masks or divide by zero.
10. Forecasting. No. It is a simple constructed linear extrapolation that supplies a baseline, not a clinical law.
11. Metrics. Yes. Equation 6.37 gives accuracy 0.775 and macro-F1 about 0.7722 because predicted class counts differ.
12. Evidence. No. Modality, dimensionality, target, and evaluation differ. It can motivate an architectural hypothesis, not establish that result.

6.18.4 Research questions from evidence

Several bounded questions follow from the worked pathways: does a hybrid improve on its individual branches under matched pretraining and adaptation budgets; how do missed regions and context margins change full-pipeline classification; does unlabelled development-image pretraining help beyond an off-the-shelf frozen representation; and does a prompted model improve on voting over exactly the same retrieved support examples? Further questions concern location shortcuts, missing metadata, calibration, and whether class-conditioned segmentation helps when labels are sparse. These are proposed experiments, not outcomes demonstrated by the teaching examples. DINOv3 and retrieved-example multimodal models add representation and adaptation options whose value requires controlled wound-specific evaluation.[110, 281]

6.18.5 Cross-chapter classification guide

Table 6.10 joins the book’s method families through a common question: what representation, decision rule, and additional information should a wound classifier use? The entries synthesize the mechanisms already developed in the cited chapters. Segmentation assistance and metadata fusion are additions to a pipeline, rather than mutually exclusive alternatives to CNNs, capsules, or Transformers. The reported wound studies remain in their task-specific evidence tables.

Table 6.10. Across-chapter guide to wound-classification pipelines. The final two rows are additions that can accompany several classifier families.

Illustrations are not included in the reading sample

Illustrative study across families. Suppose a team must choose a wound-type classifier with few labeled patients. Compare explicit descriptors with an SVM, a frozen learned embedding with the same head, a fine-tuned CNN, and a declared Transformer alternative. Keep the target and test patients fixed, and account for pretraining and tuning resources. The comparison asks which complete pipeline fits the available data and deployment budget. Investigate segmentation assistance or metadata only afterward with matched controls; adding either changes the information available, not just the classifier family.

The evaluation definitions in Section 2.5 apply across these pipelines. A fair report identifies the target, reference annotations, data access, partitions, model-selection procedure, and uncertainty before interpreting a difference. Architecturespecific mechanisms motivate a comparison; independent testing determines whether they help the intended wound task.[20]

6.18.6 Chapter summary

Recurrence carries a learned summary across ordered observations; gates control its update, while attention retrieves weighted combinations of available representations. Equation (6.8) and Figure 6.5 connect this retrieval to Transformer tokens. A wound-visit history has clinical time; the patches of one photograph have spatial positions. Pretraining supplies learning signals, and downstream labels define the classification task.

Compact and CNN-Transformer designs combine feature processing in different layouts. The worked feature-grid and crop examples show why token dimensions, coordinate correspondence, retained context, and selection failures matter. A tissue overlay supplies spatial predictions; it does not by itself provide a reference mask or a whole-image diagnosis. Retrieved-example prompting changes prediction-time context, whereas fine-tuning changes parameters.

Tables 6.9 and 6.10 connect these choices to controlled experiments. Preserve independent patients, explicit reference labels, and matched information access when testing an added component. Chapter 7 develops metadata, retrieval, and language-model interfaces with the same distinction between a plausible mechanism and demonstrated wound-task benefit.

Chapter 7

Multimodal and Reasoning Models

7.1 Multimodal representations and decisions

Two wound photographs can look similar while the recorded clinical circumstances suggest different classification questions. A useful extension of an image classifier must therefore explain both what extra information it receives and how that information can change a defined decision. Building on the image representations in Chapter 6, this section distinguishes measured-input fusion, vision-language interfaces, and reasoning procedures. The notation and two recurring wound problems introduced below provide a common route through the chapter’s preparation, modeling, and evaluation steps.

Three routes deserve separate treatment. A fusion model combines represen-tations of measured inputs. A vision-language model (VLM) connects visual representations with language, through aligned embeddings or a language decoder. A reasoning system adds intermediate model statements, learned post-training behavior, or explicit consistency checks. These routes can overlap: a retrieved wound example may enter a VLM prompt, and that VLM may have been adapted using teacher-model explanations. Recent wound studies illustrate each route, but use different targets, cohorts, and information sources.[25, 40, 50, 51, 110]

Figure 7.1 provides the reading route. The image encoder is inherited from Chapters 4 and 6; optional segmentation comes from Chapter 5. Nearest-neighbor support selection extends Chapter 3. Reference standards, partitions, losses, and metrics retain their definitions from Chapters 1 and 2. We therefore develop the new interactions in detail without deriving convolution, softmax, or the confusion matrix again.

Illustrations are not included in the reading sample

Figure 7.1. From an image representation to a multimodal classification experiment. Solid arrows carry information available to the deployed system; the reference label enters evaluation separately. The additional information joins the image representation before a class decision; its contribution requires separate controls. Original conceptual diagram; no patient data or measured results.

The final arrows in Figure 7.1 are as important as the model boxes. A plausi-ble rationale is an output to examine, not an alternative reference standard. An image-only control tests what the photograph already supports. A metadata-only or retrieval-only control tests whether the expensive visual-language component adds anything beyond simpler decisions.

By the end of this chapter, the reader should be able to construct paired records, implement four fusion mechanisms, distinguish embedding classification from decoded labels, assemble a retrieval context, specify supervised and reasoning adaptation, and evaluate missing-input and explanation failures. The recipes use small tensors to make the computations reproducible. Their numbers are synthetic teaching examples, not wound-study results. This chapter discusses selected developments published in 2026 and earlier; coverage is selective, and a publication year does not identify the version of the model evaluated.

7.1.1 Notation and tensor conventions

Following a wound record through several models requires a stable vocabulary for observations, representations, predictions, and reference labels. A photograph, a recorded site, and a model explanation occupy different roles even when one system processes all three. The conventions below make those roles and their tensor dimensions explicit, so that later equations can be read as stages of the same classification pathway.

Table 7.1 extends the common conventions in Section 1.10. A single feature vector is a column vector unless it is explicitly stored as a row in a token or batch matrix. Code uses batch-first arrays; an image batch has shape B x 3 x H x W. Multiplication by a learned matrix in an equation may consequently appear as multiplication by its transpose in code.

Table 7.1. Notation guide for Chapter 7.

Illustrations are not included in the reading sample

Letters reused in the literature are disambiguated locally. In particular, a model’s rationale is written orat, leaving r^ for missingness. Temperature for class-score calibration is Tcal; decoding temperature and contrastive temperature have different functions.

7.1.2 Running examples

A running example lets us follow what happens to the same wound record as the method changes, rather than meeting a new clinical problem at every equation. The first task distinguishes pressure ulcer (PU) from incontinence-associated dermatitis (IAD). A pressure ulcer is an injury to skin or underlying tissue caused by pressure, often combined with shear; it commonly occurs over a bony prominence. IAD is skin irritation and damage caused by contact with urine, stool, or both in a person with incontinence.[15, 307]

These conditions can have similar visible presentations, while their causes differ. This makes the distinction a useful example of why a photograph may be considered alongside recorded location, mobility, or continence information, as in the published multimodal PU/IAD study.[50] PU and IAD can coexist in a patient, so their use here as two mutually exclusive output labels is a restriction of the teaching classifier, not a claim of clinical exclusivity.[308] A real study must specify how mixed or uncertain cases are annotated and handled.

The synthetic record P17/W2/V1 means patient P17, wound W2, at visit V1. It contains one photograph, the site sacrum, a duration of six days, and an unavailable second numerical field. We will pair and encode these observations in Section 7.3, then combine their representations in Section 7.4. The second task asks a separate question: does a wound have the study-defined infection label? Its synthetic query is Q1, with the ordered labels no infection followed by infection; infection is the positive class. A pressure ulcer can have either infection status; a PU/IAD reference never supplies an infection answer. These identifiers and values are arithmetic fixtures, not clinical cases. Published applications retain their own labels and reference procedures.

Follow the PU/IAD record through encoding, fusion, one gradient update, and missing-input inference. Follow Q1 through image-text similarity, support selection, candidate-label scoring, adaptation, and reward optimization. Short vectors replace large encoder outputs only to expose the arithmetic. They do not claim to extract meaningful wound features from a real photograph. The deployment version must replace these fixtures with the specified encoder and checkpoint preprocessing, while retaining the same dimensional and data-access checks.

The record identifiers connect the tasks, not the coordinate systems of different encoders. When a later Q1 calculation supplies a new vector or a restricted response distribution, it defines that calculation’s synthetic representation explicitly; it is not an additional measurement from one clinical case. Q1 has no supplied reference during retrieval or inference. A reference class is introduced only when a later calculation explicitly demonstrates training or evaluation.

Read each technique in two passes. First establish what information reaches the class decision and what is learned. Then work through its numerical example and executable recipe. Advanced gradient subsections explain how the new component learns; they reuse the chain rule and classification loss from Chapter 2. The purpose is to make an implementation inspectable, rather than to introduce another unrelated classification problem.

7.2 Targets and available information

The PU/IAD and infection examples illustrate why the target must be fixed before an additional input is chosen. Location or a note may be relevant to one decision yet answer a different question, or contain information recorded only after the assessment. This section first defines the prediction target, then separates collected observations from model-written descriptions, and finally states the inference contract. That contract determines which parts of the running records may enter preparation and modeling.

7.2.1 Defining the prediction target

Before deciding how to combine a wound photograph with other information, state exactly what one prediction means. Distinguishing PU from IAD concerns the type of lesion, whereas Q1 concerns infection status; these labels are not alternative

names for one endpoint. Defining the target and prediction unit first prevents later architectures from being compared on different clinical questions.

A photograph can receive a wound-type label, an infection-status label, and a severity category without these being interchangeable. A type classifier may dis-tinguish pressure, venous, arterial, and diabetes-related wounds under its dataset’s rules. An infection classifier uses a separate annotation procedure. A severity classifier must name its staging system and categories. For example, the 2025 pressure-ulcer (PU) and incontinence-associated dermatitis (IAD) study separates the binary distinction from fine-grained categories within each condition. Its pressure-ulcer and dermatitis categories are not one universal severity scale.[50]

Specify the prediction unit before defining the model: one image, one wound visit, or one patient episode. If several photographs represent one visit, state whether they are combined before prediction or aggregated afterward. A study based on visual expert agreement estimates agreement with that reference. It does not automatically establish infection confirmed by diagnostic testing. Clinical infection assessment can require signs and symptoms that are not recoverable from a photograph.[25, 248]

For mutually exclusive classes, let .'fobs contain only the available inputs. The classification problem is

Illustrations are not included in the reading sample

Here ai = (aI,aM,aT,au) records availability of image, metadata, text, and additional imaging. In the main setting aI = 1: this remains wound image classification. A system that permits image absence needs a separately evaluated fallback; it must not silently report that fallback’s behavior as image-based performance. A multilabel endpoint instead uses one binary output per label, as described in Chapter 6.

Equation (7.1) states a conditional prediction, not a causal claim. Recording location might help distinguish classes in one cohort because of meaningful anatomy, biased recruitment, or both. The model cannot decide which explanation is correct merely by increasing the weight on the location feature. This motivates the intervention-style tests in Section 7.10.

7.2.2 Collected text and model-written captions

Once the target is fixed, the next question is where each proposed input came from. A pre-assessment wound note may contain observations absent from the photograph, while a model-written caption restates a model’s interpretation of that photograph. This distinction explains both why language can help a classifier and why it can also introduce unsupported statements or an answer copied from the annotation.

Figure 7.2 separates information by its origin. A recorded temperature is a measurement with a unit and acquisition time. A clinician’s note is independently collected only if it was actually available before the target decision. A caption produced by a model from X, is a transformation p = g^ (XJ, not a new patient measurement. Its usefulness may come from the captioning model’s pretrained knowledge or from making image features easier for a downstream model to use. It cannot create an unobserved odor, pain report, or test result.

Illustrations are not included in the reading sample

Figure 7.2. Input provenance and the classification boundary. Teal denotes acquired information, amber denotes model-written text, and rose denotes the reference used for evaluation. A model- written caption depends on the photograph and a pretrained model. The reference label is excluded from the query’s inference inputs. Original schematic.

SCARWID uses model-written wound captions to support retrieval. Its caption training and test-time captioning must be distinguished: the target test label must never be supplied to the captioner. Figure 6.19 shows its computational contract using an independently sourced clinical photograph. The reported same-query comparison is discussed there in prose; here we extend the computation and its controls.[25]

An equally important distinction concerns text prepared during annotation. If a note contains “stage IV” and stage IV is the target, image-text fusion may merely copy an answer. Even less explicit descriptions can encode the label definition. Retain a timestamp, author role, source, and redaction policy for every text field. A text-only baseline and a label-term removal test help quantify this issue; removal rules must be fixed using development data. The purpose is to test the actual deployment information, not to remove clinically relevant observations arbitrarily.

7.2.3 Inference contract

A model can only be evaluated meaningfully when its permitted information and output are fixed in advance. For the running wound examples, this means deciding which photograph and clinical fields are available, how absent inputs are handled, and what counts as a valid class response. The inference contract gathers these decisions into the specification that data preparation and every later classifier must follow.

A practical contract names the allowed modalities, target vocabulary, prepro-cessing, model checkpoint, decision threshold, and invalid-output rule. For a hypothetical infection study, the contract might permit one photograph, anatom-ical site, and a pre-assessment temperature, while excluding the clinician’s final infection assessment. If temperature is missing, the mask changes and the fallback is evaluated. The system returns one of the prespecified classes or a separately recorded abstention. This contract will be reused in all three implementation pathways.

7.3 Multimodal data preparation

The running record is still a set of observations, not yet a valid model input. A photograph of P17’s sacral wound must be linked to that wound and visit, and its duration must retain its unit before it becomes a number in a tensor. Following the inference contract, this section establishes patient-wound-visit pairing, encodes the fields, distinguishes missingness from augmentation, and assembles batches. These steps turn the clinical question into the paired inputs required by the fusion models.

7.3.1 Patient, wound, and visit pairing

A wound photograph and a clinical measurement are useful together only when they describe the intended wound episode. Patient P17 may have several wounds and repeated visits, so a shared patient name alone cannot establish that two files belong together. Begin preparation by defining the record key and timing rules; the following partitioning step then keeps related observations from crossing into the final test set.

Joining photographs and notes by filename alone is unsafe when a patient has several wounds or visits. Use a record key {gi,wi,vi) for patient, wound, and visit, together with modality-specific timestamps. Specify the admissible time difference for a sensor pair. A later note or a post-treatment measurement cannot be substituted for an earlier missing input without changing the prediction question. The reporting principles in CLAIM require the population, acquisition, reference standard, and partitioning to be documented.[20]

Figure 7.3 shows the order of operations. Assign patient groups to fitting, tuning, and final testing before creating crops, captions for task-specific training, or augmented copies. The support index is also fitted data: it may contain development cases but must exclude the test patient’s images and labels. Check duplicates across public collections, not only within a single folder.

In a hypothetical record, patient P17 has a sacral wound at visits V1 and V2 and a separate ankle wound at V2. All three observations belong to the same

Illustrations are not included in the reading sample

Figure 7.3. Pair first, split by patient, and fit preprocessing only within the fitting partition. Descendants of an image retain its patient and partition identifiers. The held-out stream receives the frozen transformations and index. Original workflow; the record identifiers are synthetic.

patient partition. The thermal frame must match the wound and visit, not simply P17. If the research question is prospective change, later visits also require a temporal restriction. This illustrates why more images do not necessarily mean more independent patients.

7.3.2 Categorical encoding

After pairing, recorded fields must become numerical inputs without losing their meaning. For P17/W2/V1, sacrum is a category and six days is a measured du-ration; treating both as arbitrary integers would impose relationships that were never observed. The encoding below therefore separates category lookup, numerical standardization, and field-availability indicators before joining them into one metadata vector.

Let categorical field j have Cg observed categories. Reserve category 0 for missing or unknown values, with a documented policy if these need separate treatment. A learned embedding table Ej E R^C7'+[1]^xd?' maps code cig to eig = Eg [cig,:]. A one-hot vector is a valid simpler baseline. Integer codes such as heel=1 and sacrum=2 do not establish an anatomical distance or a time sequence. Arbitrary binary body-location bits likewise do not justify recurrent temporal modeling.

For numerical field xij, define an observation indicator rij and training-only mean p3 and standard deviation Sj. A finite encoded value and its mask are

Illustrations are not included in the reading sample

The positive constant S protects a constant field from division by zero. The dimension is q = ^ dj +2P for J categorical and P numerical fields. Store units before standardization. In code, replace a missing value before subtraction; multiplying a NaN by zero does not produce a valid zero.

Figure 7.4 works through one record. For P17/W2/V1, use a two-dimensional sacrum embedding (0.3, -0.1), observed duration six days, training mean four days, and standard deviation two days; the standardized duration is 1. A second missing numerical field becomes 0 with mask 0. Thus m = (0.3, -0.1,1,0,1,0) has width six. All values are invented for arithmetic; neither the duration nor the embedding defines a clinical decision rule.

The 2025 pressure-ulcer/IAD study used categorical clinical variables and mode imputation. Equation (7.2) is an independently specified teaching baseline with explicit masks, not a reconstruction of that paper’s implementation. The distinction matters when missingness itself is informative or differs between hospitals.[50]

Wound application. Anisuzzaman and colleagues represented anatomical wound location with one-hot vectors before processing it in a location-classification branch.[14] This supplies the classifier with recorded site information alongside the photograph while avoiding a numerical ordering of anatomical categories. It is a concrete use of categorical encoding, not a new visual measurement. Section 7.4 follows the image-location pathway, and Section 8.10 connects paired inputs to experiments.

7.3.3 Missing modalities and augmentation

In a wound service, one visit may have a photograph and complete notes, another may lack duration, and a third may have no usable auxiliary record at all. The model must distinguish a missing field within a present modality from the absence of the whole modality. Simulated removal during fitting explores reliance on inputs, whereas augmentation changes an available observation to create a permitted training variant. Both belong in preparation because they must preserve the wound target, record pairing, and physical meaning of each modality.

An entire absent modality requires a modality mask at, whereas a missing field within a present metadata record requires rt. Train and evaluate both situations deliberately. One teaching option randomly removes an otherwise available metadata branch during fitting, with a prespecified probability, and supplies the corresponding mask. Such simulated removal tests robustness to the imposed pattern; it does not reproduce all real missingness mechanisms. If missing records are concentrated in more severe cases, random removal alone is inadequate.

Color changes, crops, and geometric transforms must preserve the target and each modality’s meaning. Apply the same spatial transformation to registered images and masks. Do not apply arbitrary RGB color jitter to a radiometric temperature map. Do not obtain a new caption from the model after augmentation while accidentally retaining a label-bearing annotation as input. Every derived sample retains the parent record key. The recipe in Section 7.11 makes these checks explicit.

7.3.4 From records to batches

The preceding rules now meet in the same record introduced in Section 7.1.2. We convert P17’s site and duration into finite features, then distinguish that present- but-incomplete record from a wholly absent metadata branch. Following both conditions into a batch makes the input expected by the next section’s fusion head concrete.

For the PU/IAD record, let the training vocabulary map sacrum to category 2 and let its current embedding be (.3, —.1). The duration statistics, fitted using observed fitting records only, are four days and two days. Thus six days becomes (6 — 4)/2 = 1. The second numerical field is unavailable and receives value 0 and observation mask 0. In the order category, numerical values, numerical masks, Equation (7.2) gives m = (.3,—.1,1,0,1,0), with whole-record availability UM = 1. The embedding table is learned if the metadata encoder is trained; the category vocabulary and standardization statistics are stored preprocessing state.

If the entire metadata record is unavailable, set UM = 0, categorical codes to the reserved missing code, numerical fillers to zero, and numerical observation masks to zero. The branch output is multiplied by UM after encoding. This is stronger than filling the input with zeros: a biased neural layer can produce a nonzero output from zero input. A present record with a missing duration retains UM = 1 but changes that field’s observation mask. Unknown and missing categories may share a code only if the declared task permits that loss of distinction.

Figure 7.5 follows the record through both policies. It also shows the fitting statistics traveling with the deployed model. A test-time category cannot be ap-pended to an embedding table without changing the checkpoint; map it to the stored unknown code and report its frequency.

Table 7.2 defines the interfaces used by the recipes. The encoder can return pooled features or spatial tokens; those outputs are not interchangeable. Metadata fields become tokens only when a fusion method requires them. For field j, a teaching token is TMj = Fjej + + efield, where Fj maps that field’s value encoding to the shared width and efield identifies its meaning. Two equal numbers

Illustrations are not included in the reading sample

Figure 7.5. The recurring synthetic PU/IAD record becomes finite metadata and availability tensors. The photograph remains present when metadata disappears. Training-only statistics and the category map are reused at inference; the reference class enters the loss or evaluation, never the feature vector. Original numerical workflow.

from different fields must not become indistinguishable merely because their values match.

Table 7.2. Tensor interfaces for the worked pathways.

Illustrations are not included in the reading sample

For a batch of two records with metadata width six, M has shape 2x6, aM has shape 2x1, and reference labels have shape (2,). Do not broadcast a length-two mask along the feature axis by accident. The metadata contract is checked before a model call: units agree, missing values are finite fillers, IDs are audit fields, and each photograph belongs to the same wound and visit as its auxiliary inputs.

7.4 Image-metadata classification

P17’s photograph and encoded clinical fields are now paired and ready for a classifier. The remaining choice is where their information should meet: as joined features, combined class predictions, a learned mixture, or interacting tokens. This section compares those four routes under one experimental protocol and follows their computations into decisions and updates. Its closing evidence discussion asks what the published wound applications establish about those choices.

7.4.1 Shared experimental protocol

To find out whether clinical context helps distinguish wound classes, the comparison must give each method the same underlying evidence. Otherwise a stronger image encoder or a different patient split can be mistaken for a benefit of fusion. The shared protocol below fixes those conditions and establishes the separate image and metadata branches used throughout this section.

Let hT = fe(X") E Rdd be an image embedding and hM = p^(m) E xdM a metadata embedding. The image encoder may be a CNN or a Transformer; the metadata encoder can be a small multilayer perceptron. The architectural family does not determine the fusion rule. Image-location models and the 2025 pressure- ulcer/IAD study motivate comparing several rules under the same target and data access.[14, 50, 283]

Start with the same patient split, image resolution, pretrained checkpoint, and tuning budget. Fit an image-only head and a metadata-only head before combining them. Otherwise, a fused model’s improvement could be due to a stronger image encoder or label leakage in the clinical variables. The following equations specify transparent teaching implementations; they are not claims that every cited study used these exact dimensions or missingness rules.

Figure 7.6 compares where information meets. Concatenation joins features. Late fusion joins class distributions. Gating learns a mixture of projected features. Cross-attention connects sets of tokens. Moving the fusion point changes the computation and the controls needed to interpret it.

7.4.2 Concatenation and training objective

The simplest fusion question is whether a head can use the photograph’s repre-sentation and the recorded wound context together. For PU/IAD, joining image features with encoded site and duration provides a transparent first test of that idea. Concatenation is introduced first because its feature widths, missing-input behavior, and supervised learning objective can all be inspected directly.

If the image is always present and metadata availability is aM G {0,1}, construct

Illustrations are not included in the reading sample

The metadata encoder receives finite values from Equation (7.2); multiplying its output by aM removes its contribution when the entire record is absent. The final mask lets the head distinguish absence from a genuinely zero embedding. A nonlinear head can replace the linear map if its additional capacity is controlled in the comparison.

For synthetic h/ = (1,2), hM = (3), and uM = 1, concatenation produces (1, 2,3,1). With two class-weight rows (1,0,0,0) and (0,0,1,0), zero biases give logits (1, 3) and second-class probability 0.881. Removing metadata produces (1, 2,0,0), logits (1,0), and second-class probability 0.269. This demonstrates the operation and the possibility of a changed decision; it provides no evidence that either decision is clinically correct.

Train the head and any unfrozen encoders with the supervised objective

Illustrations are not included in the reading sample

Here 0train includes only trainable parameters. In a frozen-encoder baseline, only the metadata encoder and head are fitted. Class weighting or sampling changes this objective and must be specified using training counts. At inference, apply the stored encoders and head once; no reference label enters the computation. Concatenation is easy to inspect, but its flexibility can also exploit acquisition-site or documentation shortcuts.

7.4.3 Worked fusion-head update

A fusion diagram becomes more informative when we can see how a reference label changes its weights. Continue with P17’s synthetic PU/IAD record and update only the classification head, keeping the encoders fixed. This isolates the learning step from feature extraction and prepares the later comparison with the same record when its metadata is unavailable.

Use the recurring PU/IAD record, ordering PU first and IAD second. To expose the computation, take synthetic image features h/ = (1,0)T and a metadata encoder that selects the standardized duration, giving hM = 1. Then h = (1,0,1,1)T.

Freeze both encoders for this step, omit biases, set regularization to zero, and initialize

Illustrations are not included in the reading sample

For synthetic reference PU, the loss is — log(.5) = .693147. The reference is used now because this is a training step. At test time only 7, p, and the declared decision rule are computed. Ties follow the stored class-order rule, not a rule chosen after seeing the reference.

Let ey be the one-hot reference. Applying the earlier softmax-cross-entropy derivative to this head gives

Illustrations are not included in the reading sample

The two gradient rows are (—.5,0, —.5, —.5) and (.5,0, .5, .5). With p = .1, the updated rows are (1.05,0, .05, .05) and (—.05,1, .95, —.05). On the same fitting record the logits become (1.15, .85), PU probability becomes .574443, and loss becomes .554355. The reduction checks the direction of this small update; it is not a generalization result.

Now remove metadata at inference, keeping the updated weights fixed. The input becomes (1,0,0,0) and logits become (1.05, —.05), giving PU probability .750260. The larger score does not mean missing information improved diagnosis. It reveals the behavior of these particular weights under a different input pattern. Training with representative missingness and evaluating that pattern are therefore necessary. Figure 7.7 separates the reference-dependent update from deployment. When the metadata encoder is trainable, the head gradient continues through its active output coordinates. Frozen image parameters must have no optimizer updates. If class weights are introduced, write their normalization explicitly: multiplying a

Illustrations are not included in the reading sample

Figure 7.7. Synthetic PU/IAD forward and learning paths. Solid arrows compute a class distribution; dashed arrows carry the loss gradient during fitting. One head update raises the fitting-record PU score from .500 to .574. The metadata-absent inference score is a separate input condition, not evidence of improved classification.

rare class’s loss by a weight changes the gradient magnitude, and weighted loss reduction need not improve calibration. Select such settings using the declared validation metric and report the unweighted test outcomes.

Wound application. Anisuzzaman and colleagues concatenated image-branch and location-branch features before dense layers predicted wound categories.[14] Joining the branches makes appearance and recorded anatomy jointly available to the decision head; image-only and location-only comparisons are needed to test what their combination adds. This published application motivates the fusion operation, while the numerical update above remains a separate teaching construction. Section 8.10 connects the pathway to a paired-input experiment.

7.4.4 Late fusion of predictions

Sometimes an image branch and a clinical-data branch already produce predictions over the same wound labels. Late fusion combines those predictions instead of training a joint feature representation, making it a useful comparison when the branches can be developed separately. Its essential questions are how their scores

are weighted, whether class order agrees, and how the mixture changes when one branch is absent.

Suppose separately trained branches produce distributionsp(Lp(M) ^ ^K over the same ordered labels. Nonnegative weights wT,wM give

Illustrations are not included in the reading sample

Train each branch with its own classification loss; choose any fusion weight on validation data. The denominator renormalizes after a branch is removed. An all-missing case is rejected before this calculation. Combining logits instead is a different method and should not be described as probability averaging.

For synthetic infection probabilities 0.7 and 0.2 with weights 0.6 and 0.4, the fused probability is 0.6(0.7) + 0.4(0.2) = 0.50. With missing metadata, renormalization yields 0.7, not 0.42. A threshold rule must say how equality at 0.5 is handled. The usefulness of late fusion depends on complementary errors and on branch-score behavior; averaging two normalized distributions does not ensure calibration. A 2026 pressure-injury study included equal-weight image-text probability fusion as one comparator.[309]

Why averaging logits gives another classifier. For binary branches with positive-class probabilities pl5pM, their log-odds are ZI = log[pI/(l — pI)] and ZM = log[pM/(l — PM)] . Weighted logit fusion returns CT(WI/I + wM/M) when the weights sum to one. For pI = .9,pM = .6,wI = wM = .5, probability averaging gives .75, while logit averaging gives approximately .786061. The latter takes a weighted geometric mean of odds before converting back to a probability. Neither convention is universally preferable. For PU/IAD, align the two branches’ class ordering, tune the same declared fusion rule on validation patients, and apply its missing-branch renormalization unchanged at test time.

Wound application. Wang and colleagues evaluated late fusion for pressure-

injury assessment by averaging probabilities from separately modeled image and

clinical-text branches.[309] The combination occurs after each branch has produced its task prediction, so it tests a different interaction from feature concatenation. Its value depends on the branch errors and score behavior rather than on averaging alone. Section 8.10 connects modality-specific and combined predictions to experimental comparison.

7.4.5 Learned gates and fallback

A fixed mixture cannot vary its balance between image appearance and clinical context across cases. A learned gate offers a way to test such variation: for a PU/IAD record, it mixes projected branch features before the class head. The construction below also specifies an image-only fallback, while keeping the gate’s numerical role distinct from a clinical judgment about which observation is reliable.

Project both branches into width d: uI = Pjhj and uM = PMhM, where PI G Rdxdi and PM G RdxdM. A vector gate and fused representation are

Illustrations are not included in the reading sample

Wg has shape d x (2d +1) and 9 G (0,1)d .A scalar gate is a restricted variant. The explicit fallback ensures h = uI when metadata is absent. Learn the projections, gate, and classifier jointly with Equation (7.4), while declaring whether the image backbone is frozen.

For uI = (2,0), uM = (0, 2), and 9 = (0.75,0.25), the result is (1.5,1.5). A gate value describes an arithmetic mixture in the learned coordinate system. It is not a causal attribution or a calibrated probability that a modality is reliable. For example, changing the projection scales can change the gate’s interpretation. Test whether the gated model improves over concatenation and over a fixed mixture; do not infer that learning a gate must help.

7.4.6 Worked gate update

The gate has introduced another set of trainable weights, so we next ask what signal teaches it to change the mixture. In the synthetic PU/IAD example, the classification loss favors some coordinates from one branch and others from the second. Tracing that gradient explains both how the gate learns and why identical branch features or an absent branch can remove its learning signal.

Write the pre-sigmoid gate vector as vg = Wgxg + bg, with xg = [uz;uM;aM]. Let ¿data denote the classification loss without the parameter penalty in Equation (7.4), and let 5h = dFdata/dh. Holding the two projected inputs fixed when differentiating the gate path yields

Illustrations are not included in the reading sample

For the full objective, add the direct penalty gradients 2AWg and 2Abg when those respective parameters are included in the penalty. The branch difference determines whether moving toward the image representation raises or lowers the data loss. The sigmoid derivative limits the response when g is near zero or one. A missing record makes this gate-path gradient zero because the fallback bypasses the gate. The image path still receives the gradient through the classifier; its backbone changes only if it is declared trainable.

Continue the synthetic UZ = (2,0), UM = (0,2) example. Set A = 0 for this step. Use g = (.75, .25), identity class head, and PU reference in the first coordinate. The fused vector is (1.5,1.5), so f = (-.5, .5). Equation (7.9) gives dg = (-.1875, -.1875). For a bias-only gate update with learning rate .1, both biases increase by .01875. The first gate moves toward the image’s positive first coordinate; the second moves away from the metadata’s second coordinate. The resulting loss decreases to approximately .68614. This illustrates learned task preference, not measured modality reliability.

A scalar gate shares one value across all coordinates, reducing parameters but preventing this coordinate-specific mixture. A vector gate has d(2d + 1) + d parameters before the projection and class-head counts. If UZ = UM, the gate data- loss gradient is zero even with available metadata: changing the mixture cannot change the representation. Monitor gate distributions and compare a fixed mixture to distinguish useful learned routing from saturation or redundant branches.

Wound application. Patel and colleagues used an adaptive gated MLP to incorporate anatomical location in a wound-image classifier.[160] The location branch supplies clinical context, while the gate provides a learned interaction with visual features instead of a fixed combination. This motivates testing whether a case-dependent mixture adds value over simpler fusion; a gate weight is not itself evidence that the clinical field is trustworthy. Section 8.10 connects the application to matched-input experiments.

7.4.7 Cross-attention and meaningful keys

A pooled image vector can be combined with clinical context, but it no longer exposes separate image regions to that interaction. Cross-attention instead lets one set of tokens select information from another, for example image patches interacting with distinct recorded wound fields. The following construction identifies the queries, keys, and values explicitly so that its weights have a defined computational meaning before any wound interpretation is attempted.

The row-token convention from Equation (6.8) is retained. Let image tokens be TT G yNixd and metadata-field tokens be TM G yNMxd. Each metadata token includes a field identity as well as its encoded value. Taking image queries and metadata keys/values yields

Illustrations are not included in the reading sample

The projections have shapes dxdk, dxdk, dx dv, and dv xd. Thus A is NIxNM, O is NI x dv, and the residual is dimensionally valid. M contains 0 for usable keys and x for absent keys. If every metadata key is absent, bypass attention

and set 7} = 7}; a row of only —w values does not define a softmax. Pool 7} and classify, or use a declared classification token.

Reversing query and key roles asks a different question: metadata queries then select image patches. Use patch tokens if spatial selection is intended. If an encoder is pooled down to one key, its softmax weight is always 1. Calling that operation “attention over wound regions” would be misleading. Multihead attention repeats the projections in several subspaces and concatenates their outputs, following Chapter 6; its training objective remains the classification loss.

Figure 7.8 connects a numerical score matrix to its output. For already-scaled scores S = [ log[3] log3 ] and value rows (2,0) and (0,4),

Illustrations are not included in the reading sample

Each output row combines values using one row of A. Masking the second key changes both rows to (2,0). These tokens and values are synthetic; the weights are not observed wound explanations.

Illustrations are not included in the reading sample

Figure 7.8. A two-query, two-key attention calculation. Row normalization converts the scaled scores into weights, and matrix multiplication combines value rows. The numbers match Equa-tion (7.11); the lower note shows the missing-key result. Original numerical teaching figure.

7.4.8 Worked classification from tokens

An attention matrix is an intermediate result; a wound classifier still needs a

class decision and a learning objective. This walkthrough therefore continues the

previous token example through projection, residual addition, pooling, and the PU/IAD head. Keeping the numerical inputs fixed also reveals what changes when one or all metadata keys disappear.

The score matrix in Equation (7.11) can be computed explicitly. Set NT = NM = d = dk = dv = 2, Tk = TM = I2, and

Illustrations are not included in the reading sample

The metadata rows stand for two distinct encoded fields, including their identities; they are synthetic basis vectors, not sacrum or duration embeddings estimated from patients. The projections give Q = I2, KM = y/2 log(3)I2, and VM = WV. Their scaled product is log(3)I2. Row-wise exponentiation gives (3,1) or (1, 3), so division by four produces the .75/.25 weights. Multiplying by VM recovers the existing output matrix.

Add the residual, mean-pool across image queries, and use an identity two-class head:

With PU first, the output is (.268941, .731059) and the synthetic PU-reference loss is 1.313262. Attention has produced a well-defined but incorrect class in this constructed example. Correct dimensions and normalized weights do not ensure an appropriate learned representation. Figure 7.9 makes every intermediate visible.

Mask the second metadata key and the weights become (1,0) for each query. The attention output rows are both (2,0); residual pooling gives (2.5, .5) and PU probability .880797. With both fields absent, bypass the update: pooling I2 gives

Illustrations are not included in the reading sample

Figure 7.9. Full synthetic attention computation, including learned projections, residual, pooling, and class decision. Each matrix corresponds to Equations (7.12)-(7.13). PU and IAD are output names in this teaching fixture; attention weights are not clinical explanations.

(.5, .5) and probability .5. These three conditions use identical weights. Report them as different availability conditions, not as three independently tuned systems.

Training backpropagates from the pooled representation to the output projection, value vectors, and softmax scores. For one attention row a and upstream derivative da, its score derivative is

Illustrations are not included in the reading sample

This is the softmax Jacobian applied without constructing a full Jacobian matrix. Masked keys receive zero probability and no score-path gradient. For an entirely missing branch the explicit bypass supplies a zero update, avoiding an undefined softmax. Finite padded values are still required by the implementation.

With Ha heads, head j produces O3 G ^Nixdv; concatenate to NI x Hadv and use Wo G ^Hadvxd. The score arrays require HaNINM entries per example. Increasing image resolution or the number of metadata tokens therefore changes computational cost. Hold the available token information and encoder quality fixed when attributing a difference to fusion alone.

Wound application. The SCARWID preprint used cross-attention between wound images and model-written captions to produce features for infection re- trieval.[25] Its role is to allow image and caption representations to interact before searching for labeled neighbors; the later neighbor decision supplies the class. This connects an attention operation to a wound endpoint without treating its weights as a diagnosis or its caption as a new patient observation. Section 7.7 develops the support-set decision and training objective.

7.4.9 Interpreting published multimodal results

The four fusion mechanisms are now computationally defined, but a published comparison supplies a different kind of evidence. Its result belongs to its own wound target, data collection, training access, and partitioning procedure. Reading those conditions alongside the worked mechanisms helps us identify which architectural conclusions are supported and which would require a new matched experiment.

The pressure-ulcer/IAD study compares image encoders and fusion mechanisms under a common clinical task. That supports using it as a concrete fusion example. It does not justify exporting one ranking to all wound classes or claiming that crossattention is always preferable. Its reported 80:20 split and five-fold development procedure also require scrutiny of patient grouping and model-selection access before generalization is inferred.[50]

The supplied draft additionally describes Xception with a Gaussian Mixture Recurrent Neural Network (GMRNN). The corresponding author preprint proposes image-location fusion, but the stated Gaussian/recurrent formulation does not fully specify an independently reproducible training computation. A location encoding alone does not establish a temporal sequence. We therefore retain the study as a source-audit case and use the explicitly dimensioned models above for implementation teaching. Their equations should not be attributed to GMRNN, and the source’s performance claims should not be treated as independently reproduced results.[143]

7.5 Additional imaging modalities

Recorded clinical fields are one source of information beyond a photograph; a second sensor can measure a different physical signal. For a wound photographed in visible light and infrared, however, the two images need not share coordinates, timing, or valid coverage. This section follows that problem from signal identity and geometric alignment to sampling, published multisensor examples, and experiment design. The aim is to understand when a sensor contributes an additional measurement and how preprocessing errors can reach the final decision.

7.5.1 Measured signals and geometric alignment

Before combining two wound images, establish whether they are different views of appearance or measurements of different physical quantities. A photograph and a thermal frame, for example, require different interpretation and may only partly cover the same tissue. Signal identity and geometric correspondence therefore come before choosing a fusion architecture.

An additional imaging modality changes what is measured. A red-green-blue (RGB) photograph records visible appearance; a thermal camera supplies temperature-related measurements under its acquisition and calibration condi-tions; depth imaging supplies geometry. B-mode ultrasound and Tissue Doppler Imaging (TDI) provide a different acquisition route examined in burn classification by AURA. Sensor identity, physical units, field of view, acquisition timing, and registration uncertainty must accompany these inputs.[51, 291]

For a planar teaching approximation, corresponding coordinates obey a homog- raphy M E IR[3]x[3]:

Illustrations are not included in the reading sample

Homogeneous coordinate uy = (x,^, 1)T maps into the sensor image; dehom divides the first two coordinates by the third. Interpolation supplies a sampled value, with an explicit out-of-field mask. A homography is not generally sufficient for a nonplanar wound, viewpoint parallax, probe compression, or changing tissue.

It is a stated approximation, not the undocumented registration method of a cited study.

Figure 7.10 distinguishes aligning locations from fusing decisions. Pixelwise alignment is necessary for a model that concatenates corresponding pixels, but separate global encoders can fuse features without asserting pixel correspondence. Even then, both acquisitions must refer to the same intended wound episode. A later thermal frame may contain a different clinical state.

Illustrations are not included in the reading sample

Figure 7.10. Two routes for additional imaging: registration before spatial fusion, or separate encoders before feature/decision fusion. Registration produces a validity mask as well as a transformed image. The burn ultrasound branch represents a distinct acquisition task, not an RGB-to-ultrasound conversion. Original schematic.

With two-dimensional translation by (2, —1), a synthetic RGB coordinate (10,8) maps to sensor coordinate (12,7). This tests coordinate direction and indexing, not clinical alignment. Before model fitting, examine landmark errors and unmatched regions in the actual paired data. A low geometric error is useful preprocessing evidence; classification still requires its own labels and metrics.

7.5.2 Sampling registered sensor data

After locating the same wound in two sensor coordinate systems, the classifier still needs actual sensor values on its chosen grid. An RGB wound pixel may map

between thermal pixels, so its value must be interpolated; a location outside thermal coverage must instead remain invalid. This is why registration is followed by sampling and validity checks rather than simple array concatenation. The numerical example below follows a small coordinate change into a different synthetic class score.

Equation (7.15) is an output-to-input sampling map: for each RGB-grid location, ask where to read the sensor. A transform estimated in the opposite direction must be inverted first. Pixel coordinates and normalized sampler coordinates are different interfaces. For a width-1H image and an align-corners sampler, pixel coordinate x maps to 2x/(H — 1) — 1; a different corner convention requires a different mapping. Record the convention rather than compensating for a half-pixel offset by trial and error.

For sensor coordinate (x, y) = (xo + a, yo + f) with 0 < a, fi < 1, bilinear interpolation is '—'

Illustrations are not included in the reading sample

Here U1o is the next horizontal pixel, not the next array row. For a synthetic grid [32 35] in degrees Celsius, sampling at (.25, .5) gives weights (.375, .125, .375, .125) and 32 degrees. Changing the horizontal coordinate to .75 gives 34 degrees. This two-degree difference is an interpolation fixture, not an infection cutoff. Figure 7.11 displays the coordinate and validity questions together.

Let rr (x, J) indicate that the required interpolation neighborhood is valid. Standardize usable sensor values with fitting statistics and provide rr as an additional channel or a pooling mask. A simple masked pooled feature is

Illustrations are not included in the reading sample

The feature map Fr comes from a sensor-specific encoder. If no usable location remains, set the whole-sensor availability to zero and invoke the declared fallback.

Sensor grid

Illustrations are not included in the reading sample

Figure 7.11. Synthetic sensor sampling and misalignment. The same four temperature values produce 32 or 34 degrees under different horizontal coordinates. An out-of-field location is marked invalid, not interpreted as a zero-degree measurement. This numerical illustration does not establish a clinical temperature threshold.

For a tiny infection teaching head, use image score contribution .2 and sensor contribution A(U — 33). The two valid samples give positive-class logits .1 and .3 against negative logit zero, hence probabilities .524979 and .574443. At a prespecified synthetic threshold .55 the decision changes. This shows how geometric error can reach classification; it supplies no clinical rule.

The corresponding experiment perturbs registration on the same held-out pa-tients, with the classifier and threshold frozen, and reports both class errors and usable-overlap coverage. Do not retrain separately on each test perturbation and call the resulting curve deployment robustness. A zero-filled invalid region may create a shortcut; test the validity-mask policy and whether missing sensors concentrate in particular wound classes.

Wound application. Ranade and colleagues combined electro-optical wound imagery with infrared information in a postoperative knee-wound assessment pipeline.[291] Optical landmarks are transferred into thermal space so that the additional signal can be associated with the intended anatomical region. This illustrates why correspondence matters before interpreting a sensor contribution; the interpolation calculation above is an independent teaching example. Section 6.11 connects spatial outputs to subsequent assessment.

7.5.3 Evidence from multisensor studies

The sampling example explains a possible mechanism, but published wound studies determine what was actually acquired and evaluated. We now distinguish a postoperative optical-infrared pipeline from a burn-ultrasound assessment system, because their signals, timing, reference standards, and outputs differ. This prevents the phrase multimodal imaging from obscuring different clinical tasks.

Ranade and colleagues describe an electro-optical (EO) and infrared (IR) postoperative pipeline with deterministic transfer of optical landmarks into thermal space. Its thermal classifier uses patient-grouped five-fold assessment for knees imaged on postoperative day 14 or later. The study also contains segmentation and exploratory image-level VLM tasks. These components should not be merged into a single “multimodal accuracy.” The tissue-mask example in Figure 6.17 shows spatial output, not proof that adding the mask improves a downstream infection classifier.[291]

AURA supplies a separate example: paired B-mode and TDI frames support burn-depth classification and a distinct binary surgical-decision task. Its dataset contains 29 patients; 130 frames from 15 subjects are held out from a total of 324 selected frames. Histopathology is available for five cases, with surgeon consensus used otherwise. The paper also discusses bedside photographs that are not temporally aligned with the ultrasound frames. These details limit any interpretation as a general synchronized RGB-ultrasound classifier.[51]

Depth-assisted measurement is conceptually relevant, but a surface-depth es-timate is not a wound-type label. Before including a depth study as multimodal classification evidence, verify whether depth was physically measured, inferred from RGB, or merely mentioned as future work. If U = d^(X) is inferred from the same photograph, it is a model-derived representation with its own errors. It must be compared with the same image encoder and pretraining access, rather than counted as independently acquired patient information.

7.5.4 Multisensor experiment design

These studies suggest a practical question for a new wound experiment: does the added measurement improve the specified decision once acquisition and alignment failures are included? Begin with each sensor alone before testing their combination. The design below carries the preparation rules into matched classification comparisons and records the cost of obtaining usable pairs.

Begin with modality-specific preprocessing and one encoder per sensor. Project their pooled embeddings to compatible widths, apply Equation (7.3) or (7.8), and train against a defined image/visit-level class. Compare RGB-only, sensor-only, fused, and realistically misregistered inputs. Keep patient grouping and acquisitionday restrictions fixed. Report the cost and failure rate of obtaining the additional measurement. A method that improves classification on complete paired records may still be impractical if a large or systematically different group lacks usable sensor data.

7.6 Vision-language wound classifiers

An additional sensor measures another signal; language can instead describe a wound, name a class, or carry recorded clinical observations. Those roles lead to two different classifiers: one compares image and text representations, while another decodes or scores an answer sequence. This section follows both routes from their interfaces and training objectives to a clinical image-text example. At each stage, the question is how the language reaches a defined wound label.

7.6.1 Language model interfaces

A request to classify a wound using language does not yet specify the computation. One system may compare the photograph with fixed class descriptions, whereas another may decode the words that name a class. Distinguishing these interfaces first explains why their scores, output checks, and later calibration procedures cannot be treated as interchangeable.

A VLM does not necessarily write prose. Contrastive models such as CLIP learn compatible image and text embeddings; a class decision follows by comparing the image with class descriptions. Generative VLMs instead condition a language decoder on visual representations and a prompt. Both interfaces can produce a wound class, but their scores, training objectives, and failure modes differ. CLIP’s original evidence concerns broad image-text transfer, not clinical validation of wound labels.[52]

Figure 7.12 keeps the two routes separate. A contrastive classifier can return a fixed K-dimensional score vector. A decoder returns tokens, which must be parsed or scored against an allowed label set. Neither route should silently turn an out-of-vocabulary response into the negative class. This is particularly important when calculating specificity: an invalid answer is an output failure, not evidence of a true negative.

Illustrations are not included in the reading sample

Figure 7.12. Embedding-based and generative VLM classification. Class descriptions define text prototypes in the upper route. The lower route uses visual tokens and a prompt to decode a constrained class response, optionally accompanied by a rationale. Reference labels are used only for training or evaluation. Original explanatory diagram.

7.6.2 Contrastive alignment and class descriptions

For the embedding route, the central problem is to place wound images and their paired descriptions in a space where comparison is meaningful. A contrastive objective teaches correspondence during fitting; class descriptions can then provide candidate representations at inference. The equations below separate these stages so that a similarity score is not mistaken for an independently established clinical probability.

For a batch of B paired photographs and texts, normalize image embeddings vi = fl{Xi)/\\fl{Xi)\\2 and text embeddings u% = Mti)/\\fM\\2, eachof width d. With temperature r > 0, the similarity matrix is Sig = vjuj/r. A symmetric contrastive objective is

Illustrations are not included in the reading sample

The first term identifies the paired text for each image; the second identifies the paired image for each text. This is the alignment principle used by CLIP, written in the chapter’s notation.[52]

The assumed positive is the recorded pair, not every clinically similar image in the batch. If multiple captions describe the same wound or several images share a clinically equivalent label, treating all other pairs as negatives can create falsenegative training pairs. A multi-positive objective requires an explicit positive set, target weighting, and reduction rule. Some formulations retain the same candidate denominator and average log-probabilities across positives, as in supervised contrastive learning;[310] others change the aggregation. State the chosen loss rather than implying it. Split patients before constructing the pairs, and record whether a text was collected, model-written, or derived from an annotation.

At inference, let ¿k be a fixed description of class k. Normalize its text repre-sentation to uk. Class logits and a decision are

Illustrations are not included in the reading sample

For multiple descriptions per class, average their embeddings and renormalize, stating the exact templates. Choose prompts and any learned temperature on development data. A word such as “infected” is not an adequate operational reference standard by itself; the label vocabulary must match the study’s annotation rule.

Figure 7.13 shows the small-matrix calculation. For synthetic v = (1,0), prototypes ux = (1,0) and u2 = (0,1), and r = 0.5, logits are (2,0) and prob-abilities are approximately (0.881,0.119). The winning class is determined by angular similarity. The number 0.881 is a model score normalized across the chosen descriptions, not a clinically validated infection probability.

Illustrations are not included in the reading sample

7.6.3 Worked alignment and classification

The contrastive objective becomes clearer when both directions of pairing are calculated, rather than only the final winning class. A small fitting batch shows

how an image selects its recorded description and how that description selects its image. We then return to infection query Q1 to distinguish learning the shared space from using fixed class prototypes within it.

Class-prototype inference does not by itself explain how the shared space is learned. Consider two synthetic fitting images with normalized embeddings ux = (1,0) and r2 = (0,1), and paired text embeddings u1 = (1,0) and u2 = (.6, .8). With temperature .5, the complete score matrix is

Illustrations are not included in the reading sample

The first two numbers are image-to-text negative log-probabilities of diagonal pairs. For example, image 1 assigns its paired text probability e[2]/(e[2] + e[1],[2]) = .689974, giving loss .371101. The second two numbers normalize each text column over images, giving probabilities .880797 and .598688 for the correct images. Each normalization asks a different retrieval question; averaging only the row losses would omit half the stated objective. Figure 7.14 shows both directions.

Let Prow and Pcol be the two normalized matrices. Differentiation with respect to a score gives

Illustrations are not included in the reading sample

This gradient passes through the dot products, the temperature scaling, and the normalization of encoder outputs. For nonzero raw embedding h and v = h/||h||2, the normalization Jacobian is (I — vvT)/||h||2. Thus changing an embedding’s magnitude alone cannot arbitrarily increase its normalized similarity. Reject zeronorm embeddings before retrieval or classification instead of silently treating a zero vector as a meaningful direction. Very small norms also warrant checking encoder behavior and numerical precision.

At inference for Q1, fix two infection class descriptions in the order no infection, infection, encode them once, normalize them, and compute Equation (7.19). If the two prototypes in a separate synthetic fixture are (1,0) and (0,1) and the query is (.6, .8), logits at temperature .5 are (1.2,1.6) and infection probability is .598688. The label is infection by argmax. No training-pair caption or held-out reference is required for this computation.

The batch objective assumes one positive pair per row and column. Two photographs of the same wound or interchangeable descriptions can violate that assumption even after leakage-safe splitting. The diagonal loss still repels the off-diagonal pair. A multi-positive objective is a different target distribution and requires an explicit definition; do not silently change diagonal labels to clinical classes. Record whether you are learning instance correspondence, class separation, or both. Classdescription templates, learned temperature, and encoder adaptation must be selected without test-label access. The formulation follows CLIP; these wound fixtures and derivatives are independently constructed teaching calculations.[52]

Wound application. The small-VLM wound-classification preprint used a pre-trained CLIP image encoder to retrieve relevant labeled wound examples.[110] Similarity in the frozen representation selects which cases will be available to the downstream classifier. The application uses the representation for wound retrieval; it does not demonstrate that the contrastive image-text loss was trained on that cohort. Section 8.10 connects retrieved examples to classification experiments.

7.6.4 Decoded labels and sequence likelihood

A generative wound classifier must turn a stream of vocabulary tokens into one permitted class. This requires an answer convention as well as a model: infection and no infection may occupy different token sequences, and an explanation may mention both. Candidate likelihoods and exact parsing provide explicit ways to connect language output to the fixed prediction target.

For a generative VLM, the context c contains the allowed image inputs, in-structions, and any support examples. If class k is represented by token sequence ^k = (^ki ,---,^kLk), its conditional log-likelihood is

Illustrations are not included in the reading sample

The allowed candidates and termination token policy must be fixed. Different label lengths, tokenizations, and synonyms can change Sk. Length-normalizing the sum is a possible scoring convention, but it no longer equals the sequence log-likelihood above. Short symbolic codes may reduce some formatting differences, although their token IDs and prior preferences still require checking.

For two one-token class codes with conditional probabilities 0.3 and 0.1, renormalization over those codes gives (0.75,0.25). The other 0.6 of the vocabulary’s mass is excluded. This calculation explains why qk is conditional on the candidate set and why its calibration must be tested. A model response stating “90% confident” is neither this calculation nor a calibrated probability.

There are two implementation choices. In constrained decoding, restrict the output grammar or allowed token paths and parse the result. In candidate scoring, compute Equation (7.22) for every allowed label. Some hosted interfaces provide neither reliable token scores nor decoding constraints. In that case, use an exact parser, record invalid responses, and report hard-label performance without inventing a probability vector. Keep rationale decoding outside the label parser so that an infection term in an explanation cannot overwrite the final answer.

7.6.5 Image input to language decoders

Decoding a wound label also requires the language decoder to receive the photograph in a representation it can process. A visual encoder’s features and a decoder’s text embeddings may have different widths and token organization, so a connector or merger bridges that interface. The following teaching construction exposes this bridge before distinguishing it from the checkpoint-specific architecture used in a published wound system.

A generative model needs a representation in the language model’s hidden width, not just an arbitrary image feature appended to a text string. Let a vision encoder return ZI G ^Nixdv. A simple teaching connector maps rows to width d^:

Illustrations are not included in the reading sample

Place the projected visual tokens at the model’s designated image positions and combine them with prompt embeddings of the same width. The causal language decoder produces one vocabulary-logit vector for each predicted position. Its processor determines image resizing, patch merging, special tokens, position IDs, and attention masks. A generic concatenation formula does not replace those checkpoint-specific conventions.

Qwen3-VL, the base family used by Infection-Reasoner, has a vision encoder, a vision-language merger, and a language model. Its merger compresses a spatial 2x2 group of visual features into one token through a two-layer MLP. It also supplies merged features from multiple vision layers to early language layers through DeepStack. These documented details distinguish it from the rowwise teaching connector in Equation (7.23); neither connector should be claimed to implement every VLM.[311]

For a dimension-only example, a synthetic 4x4 visual grid with width two contains 16 rows. Grouping each 2x2 neighborhood concatenates four rows into width eight, leaving four groups. A merger into language width six yields a 4x6 array. Three prompt tokens of width six and one subsequently decoded answer token then occupy different positions in the same hidden-width interface. These counts illustrate grouping; they are not the actual Qwen3-VL checkpoint dimensions. Figure 7.15 connects this interface to the answer position.

Illustrations are not included in the reading sample

Figure 7.15. A synthetic vision-to-language interface. Sixteen two-dimensional visual features become four groups of width eight and then four language-width-six tokens. Prompt and answer positions are distinct. The diagram teaches the interface; Qwen3-VL’s additional multi-level visual injection is described separately and is not reproduced by this small connector.

In label-only inference, decode a permitted class code and its terminator. In rationale-first inference, the answer is conditioned on decoded rationale tokens as well as the image and prompt. Those are different inference procedures. Scoring class labels directly after the prompt does not marginalize over every possible rationale. Compare their classification results and decoding budgets explicitly rather than mixing their confidence values.

Wound application. The SCARWID preprint fine-tuned Wound-BLIP to write

descriptions from wound photographs and used those captions in infection classifi-

cation.[25] A language decoder therefore supplies a representation of the image’s

interpreted content for the later image-caption retrieval stage. This is why de-coder conditioning and caption provenance matter: a fluent description may still repeat an image interpretation error. Section 7.7 develops its downstream role, and Section 8.10 connects it to experiments.

7.6.6 Worked multi-token scoring

The one-token score example hides a practical issue: wound labels need not tokenize to equally long answers. We now follow two complete candidate paths, including their terminal tokens, to see how the scoring convention affects the infection decision. This calculation explains why tokenization and length normalization belong in the stored inference contract.

Assume a fixed tokenizer gives the no-infection candidate three tokens including the end-of-sequence token, and the infection candidate two including that token. For a synthetic example, the teacher-forced conditional probabilities along the two candidate paths are (.6, .5, .8) and (.4, .9). The products are .24 and .36; their loglikelihoods are approximately —1.427116 and —1.021651. Normalizing over the two complete paths gives (.4, .6), so the candidate-scoring rule returns infection.

The terminal probability matters: omitting it scores a prefix rather than the stated complete answer. The paths must be mutually exclusive under the declared tok- enization and termination rule. Token probabilities along one path are conditioned on that path’s preceding tokens; they cannot be copied from a single unconstrained decoded sequence that followed a different prefix.

Here teacher-forced scoring means supplying a candidate’s prescribed prefix when calculating the probability of its next token. It does not mean calling a teacher model or showing the query’s reference label to the classifier. Each permitted candidate is evaluated under the same image and prompt context.

Length normalization changes this result. Dividing the two log-likelihoods by three and two gives —.475705 and —.510826, reversing their ranking. It is a possible selection score but no longer the log-probability of a complete sequence. Use a validation-selected convention and retain the unnormalized scores for auditing.

Short codes can simplify output handling, but check their actual tokenization and do not assume equal token lengths from equal character lengths.

Candidate normalization conditions on the allowed answer set. In the example the two paths account for .60 total mass, leaving .40 for other completions. Renormalizing does not prove that those other completions were valid labels or that the resulting .60 is a calibrated infection probability. A hard-label interface without path likelihoods supports parsing and classification metrics, not this calculation. In Recipe 5, score each fixed candidate with the same visual context and exclude prompt and padding positions from its answer score.

7.6.7 Clinical image-text case study

A clinical image-text study brings the two language interfaces back to an actual wound-assessment problem. The important questions are which observations the text supplies, which components are adapted, and whether the reported output is a stage, another class, or a model recommendation. The example below illustrates those distinctions before retrieval introduces labeled prior cases as another source of context.

Wang and colleagues’ 2026 pressure-injury (PI) study compares image-only, text-only, encoder fusion, and image-language combinations. Its final model combines ResNet-50 with DeepSeek-R1-Distill-Qwen-1.5B. The study contains six- class staging and debridement classification alongside tasks that produce dressing recommendations; language similarity scores for the latter are not staging accuracy. Methods reports 2105 deduplicated public images, whereas Results Section 4.1 reports 1952 public cases, a difference of 153. Whether exclusions, counting units, or dataset stages explain this difference is unresolved. The private cohort contains 391 cases. Its validation performance informed final-model selection, so an untouched external test of the selected model is not established.[309]

This study is useful for understanding modality controls and external-cohort evaluation. Its annotation-time descriptions also motivate checking what equivalent text would be available during deployment. Model names containing “reasoning” do not establish that a study tested the causal benefit of reasoning steps. Such a claim needs an appropriate rationale or reasoning ablation, not merely a comparison between differently sized pretrained systems.

7.7 Retrieval and in-context classification

A wound classifier can also consult labeled examples selected for the current photograph. Retrieval determines which earlier cases are available, while a vote or a VLM determines how their labels contribute to the query’s decision. This section builds the support index, introduces diversity-aware selection, examines caption-assisted representation learning, and follows a complete selection into an in-context prompt. Keeping selection and classification separate makes their individual contributions testable.

7.7.1 The retrieval index

For Q1, retrieving a similar wound is useful only if that case belongs to an allowed support pool and its label answers the same question. The index stores this relationship between representations, records, and labels. Establishing that contract first allows us to compare a direct neighbor vote with a later VLM that receives the same cases.

Retrieval first selects relevant development cases and then either votes directly or supplies demonstrations to a VLM. Let S = {(Xj,yj,Vj)} be a permitted support pool with normalized embeddings. For a query embedding vq, cosine similarity is s(q, j) = vqvg. Reuse the nearest-neighbor principle from Chapter 3, but retain the index version, encoder checkpoint, normalization, and patient exclusions as part of the model specification.

A weighted retrieval-only classifier is

Illustrations are not included in the reading sample

This teaching rule uses positive softmax weights; uniform voting is obtained by equal weights. It is not a claim that SCARWID uses this exact weighting: SCAR- WID uses a learned image-caption embedding and five-neighbor classification in its documented system.[25]

Suppose three synthetic similarities are (0.9,0.8,0.3) and the corresponding classes are (A, B, B). With rR = 1, class A receives about 0.408 and class B about 0.592, so B wins despite the closest single neighbor being A. The nearest image and the neighborhood decision answer different questions. A VLM must be compared with the same selected support set before an improvement can be credited to its use of context.

Wound application. The SCARWID preprint retrieved neighboring image-caption embeddings from a labeled support set to classify query-wound infection status.[25] The learned representation determines distance, and the retrieved cases supply labels for the later neighbor decision. This makes the support set part of the classifier, so its eligibility and label definition matter alongside encoder quality. Section 8.10 connects indexing and retrieval to an experiment interface.

7.7.2 Diversity-aware support selection

The nearest retrieved wound images may show almost the same appearance or acquisition pattern, using much of a small prompt on redundant examples. A selection method can instead trade some query similarity for less repetition. Maximal marginal relevance makes that trade-off explicit, providing a context-selection rule whose effect can be compared with ordinary nearest neighbors.

Nearest neighbors may repeat one acquisition pattern or nearly duplicate one wound. Maximal marginal relevance (MMR) trades similarity to the query against

redundancy among selected cases. After selecting the closest initial case, choose the next index by

Illustrations are not included in the reading sample

Cq is a candidate pool larger than the final context of k examples. At A = 1, relevance alone determines the next item. At smaller values, redundant cases are penalized. MMR originated in information retrieval; the 2026 wound ICL study applies it to a CLIP-based candidate pool.[110, 312]

For a synthetic calculation with A = 0.7, candidate A has query similarity 0.9 and redundancy 0.95, giving 0.345. Candidate B has similarity 0.8 and redundancy 0.3, giving 0.470. B is chosen next. This does not ensure balanced clinical classes or causal relevance: a diverse set can still be wrong for the query. Audit label distribution, patient duplication, and retrieval mistakes rather than using geometric diversity as a clinical quality score.

Figure 7.16 follows the query through the index, support selection, prompt assembly, and final answer. Labels accompany support cases because those cases are development data. The query’s reference label remains outside the prompt.

Before completing the MMR walkthrough, we examine how a model-written caption and a learned distance can change the candidate neighborhood itself. The later context-selection example then returns to this same relevance-redundancy rule with fixed synthetic embeddings. Representation learning and support selection are separate stages even when they appear in one retrieval system.

7.7.3 Caption-assisted retrieval and SCARWID

Retrieval depends on what the embedding represents, not only on the search rule. A model-written wound description can alter that representation and therefore change which labeled neighbors Q1 receives. SCARWID illustrates this route: language assists the neighborhood used for infection classification, rather than supplying an independently collected clinical measurement.

Illustrations are not included in the reading sample

Figure 7.16. Retrieval-assisted wound classification. A frozen encoder searches an allowed support index; k selected image-label pairs enter the VLM context before the unlabeled query. A matched nearest-neighbor vote uses exactly those pairs. The diagram is conceptual; no displayed record represents a real patient’s observed result.

SCARWID supplies an example of language used as a representation aid. Its documented 224-by-224 image input feeds a captioning component, while image and text features interact through cross-attention to form a 256-dimensional retrieval representation. The system uses five retrieved neighbors for its decision. Figure 6.19 illustrates this computational contract with an independent clinical photograph; it does not display the study's query, supports or model outputs.[25]

In the source paper's same-query example, image-only retrieval predicts no infection, whereas the image-caption route predicts infection, matching the ref-erence annotation. This demonstrates a changed neighborhood, not that captions always help; the source also reports misclassifications in its Figure 11.[25] Figures 6.24 and 7.28 provide independent image-only CNN errors for the general reference-comparison lesson. They are not SCARWID outputs or evidence of a caption-specific failure mechanism. A model-written caption can repeat a misleading visual impression, so inspect the complete retrieval and decision record rather than assuming that extra text corrects an error.

7.7.4 Neighborhood learning with triplet loss

If nearby support labels are to guide infection classification, the representation can be trained to bring selected positive pairs closer than negative pairs. Triplet learning provides such a relative-distance objective and is used in SCARWID’s image-caption route. The worked update below explains how that neighborhood is learned before the frozen representation is used for retrieval.

SCARWID trains its image-text fusion representation using triplets and then assigns a query the modal label of its nearest support examples. The squared- distance margin objective is documented in its Equation 5; its inference uses Euclidean distances and five neighbors. This is distinct from both CLIP’s batch correspondence loss and the softmax-weighted teaching vote above.[25]

Let ea,ep,en G RdF be anchor, positive, and negative fused representations. A positive follows the training sampler’s same-label relation; it must not be assumed to be the same patient. The loss for one triplet is

Illustrations are not included in the reading sample

Use d = 1 when illustrating the source’s reported margin. In a synthetic two-dimensional example, set ea = (0,0), ep = (1,0), and en = (.5,0). The squared distances are 1 and .25; the loss is 1.75. The negative is closer than the positive, so the margin is violated. When the hinge argument is strictly positive, the derivatives are

Illustrations are not included in the reading sample

They are (—1,0), (2,0), and (—1,0) in this example. Updating the three independent embedding variables with learning rate .1 gives (.1,0), (.8,0), and (.6,0); the new loss is .49 — .25 + 1 = 1.24. An actual encoder shares parameters across the examples, so its update follows the sum of these derivatives through the fusion network rather than independently moving stored embeddings. At a negative hinge argument the gradient is zero; at exactly zero, state the implementation’s subgradient convention and avoid using that kink for finite-difference tests.

Figure 7.17 contrasts active and inactive triplets. Replacing the negative with (2,0) gives 1 — 4 + 1 = —2 and zero loss. A batch of only such easy triplets supplies no learning signal. Sampling or mining triplets therefore changes which

comparisons train the representation. Keep mining inside fitting patients and declare any hard-negative policy; it is not a free performance improvement.

Illustrations are not included in the reading sample

Figure 7.17. Synthetic triplet learning and the downstream retrieval rule. The active triplet has loss 1.75; moving its embeddings along the negative gradients lowers the toy loss to 1.24. An easy negative gives zero loss. Support labels enter a later five-neighbor vote; they are not inferred from the plotted geometry alone.

For a complete synthetic inference example, let Q1’s representation be (0,0) and let seven support distances be .1, .2, .3, .4, .5, .6, .7, with labels infection, no infection, infection, infection, no infection, no infection, no infection. Sorting selects the first five; infection wins by three votes to two. The nearest support alone gives infection here, but the remaining supports determine the majority. With odd k = 5 and two valid classes, a label tie cannot occur; distance ties still require deterministic index ordering. In a multiclass task, specify label-tie handling even for odd k.

Squared Euclidean and Euclidean distances rank finite embeddings identically. Cosine and Euclidean rankings agree only under the relevant normalization: for unit vectors, ||u — u||2 = 2 — 2//'r. Do not silently normalize a published learned representation or substitute cosine distance and claim the exact source method. Save the encoder, captioner, preprocessing, distance convention, and support index together. Recompute all support embeddings after any encoder update.

Wound application. The SCARWID preprint optimized triplet loss for wound image-caption embeddings before using neighboring labeled examples for in-fection classification.[25] The loss trains relative distances to support the later neighborhood decision, rather than decoding the class directly. This explains why the fitting sampler and frozen inference distance convention must both be recorded. Section 2.11 develops the underlying objective, and Section 8.10 connects it to the experimental workflow.

7.7.5 MMR context selection

The earlier MMR rule now needs to produce a complete, ordered context for Q1. With a small support budget, choosing several nearly duplicate wound examples can displace a less redundant case even when all are relevant. This walkthrough applies the relevance-redundancy trade-off one selection at a time, then compares the resulting supports and votes with nearest-neighbor selection. The aim is to expose how context changes the available evidence, without presuming that diversity improves correctness.

Take Q1’s normalized query as (1,0) and five unit support vectors at angles 20,22,30, —40, 80 degrees, called A-E. Their infection labels are respectively 1, 0, 0, 1, 0. These angles and labels are synthetic, unrelated to the published SCARWID photographs. Set A = .7 and select three supports. A is closest because it has the largest query cosine, approximately .9397.

At the second selection, B has relevance .9272 and redundancy cos(2°) = .9994, giving MMR score .3492. D has relevance .7660 and redundancy cos(60°) = .5, giving .3862. C scores .3108 and E scores —.0284, so D is selected. At the third selection, redundancy is the maximum similarity to either A or D. B again scores .3492 and wins over C and E. The final ordered context is A, D, B. Nearest-neighbor selection instead gives A, B, C.

Figure 7.18 displays these iterations and the labels entering the prompt. The vote on A, D, B predicts infection by two to one; the vote on A, B, C predicts no infection by two to one. No reference label for Q1 has been specified, so neither outcome is called correct. The example proves that selection can change a decision, not that diversity is beneficial.

Illustrations are not included in the reading sample

Figure 7.18. Synthetic MMR selection for Q1 at A = .7. The diversity penalty changes the three-case context and its majority label. Support images and labels belong to the development pool; the query reference is absent. The downstream VLM prediction is deliberately unspecified because no model was run.

The prompt assembly now has a concrete order: task and allowed labels, A with label 1, D with label 1, B with label 0, and finally the unlabeled Q1 image. The inference call must return one permitted class or an invalid result. Test the VLM against the vote on exactly A, D, B; comparing it only with the A, B, C vote confounds support selection and model behavior. Log truncation, image-token counts, and prompt order. MMR operates on a candidate set already filtered for prohibited patients and duplicate images. It cannot repair an index that contains the test query or its augmented sibling.

Wound application. The small-VLM wound-classification preprint used maxi-mal marginal relevance to rerank retrieved wound supports before adding them to a model prompt.[110] With a limited context, the relevance-redundancy trade-off can change which examples occupy the available positions. MMR selects that context; it does not directly predict the wound label or guarantee clinical class balance. Section 8.10 connects support selection to a retrieval-assisted experiment.

7.7.6 In-context learning with small VLMs

Once the support cases are selected, a VLM can receive their images and labels as demonstrations before the unlabeled wound query. In-context learning here means conditioning the prediction on these examples within the prompt, without updating model weights. This makes it useful to investigate when task-specific weight adaptation is limited, but it still requires labeled supports and a pretrained model. The study below tests this route and motivates comparison with a vote over the identical selected cases.

The 2026 wound ICL preprint evaluates eleven models from the Qwen 3.5, Ministral 3, and Gemma 4 families. Its frozen CLIP ViT-B/32 retriever produces 512-dimensional embeddings; MMRuses A = 0.7. The comparison includes zeroshot, random support, nearest-neighbor, and MMR-selected contexts, with matched retrieval-only controls. Thinking is disabled in the reported model runs, so these experiments must not be described as evidence for explicit reasoning traces.[110]

The study removes mirrored duplicates before splitting its Kaggle collection, then uses 1219 support images and 250 evaluation images. Its Medetec experiment uses 470 support and 90 evaluation images. These are image-level public-collection splits; the reported procedure does not establish a patient-independent prospective clinical test. “Without task-specific fine-tuning” also does not mean without labels: the retrieved demonstrations carry labels, and the retriever and VLM carry pretraining knowledge.[110]

The main implementation lesson is to evaluate support selection and the downstream model jointly. Fix the label vocabulary, order rule, image resolution, context budget, and invalid-response policy. Increase k only within the model’s image/to- ken limits, recording both image tokens and text tokens. If a context is truncated, support count alone no longer describes the information received. A larger model or longer context incurs costs that should be compared against the retrieval-only baseline, not hidden behind an accuracy score.

Wound application. The small-VLM author preprint compared zero-shot prompts with random and retrieval-selected wound examples for category classifi- cation.[110] The labeled demonstrations make task examples available at prediction time while model weights remain fixed. That role motivates comparing the VLM with a vote over the same selected cases, so support quality and use of context are not confused. Section 8.10 connects the application to retrieval and prediction interfaces.

7.8 Adapting wound classifiers

The previous section changed the examples supplied at inference while leaving model weights fixed. A wound task may instead require learning from development records, for example to fit its label vocabulary or response format. This section compares adaptation choices, develops low-rank updates, and examines the provenance and token alignment of supervised targets. These distinctions prepare the next section’s question of what additional behavior a reasoning objective actually teaches.

7.8.1 Frozen, adapted, and retrieval-only baselines

Before adapting a model to PU/IAD or infection labels, establish what can already be achieved with fixed representations and permitted support cases. A trained head, a changed support pool, and an updated backbone use labels and computation differently. These baselines make the later low-rank and reasoning comparisons interpretable by identifying exactly which component was allowed to learn.

A frozen representation with a fitted linear head updates the head only. Supervised fine-tuning (SFT) updates selected or all encoder/decoder weights. Parameterefficient adaptation restricts the update to additional or low-rank parameters. Retrieval-only changes the support pool without updating the classifier weights. These are different uses of labels and compute; compare them with explicit accounting for pretrained checkpoints, index construction, tuning, and inference.

Figure 7.19 separates these choices. A good first experiment holds the image encoder fixed and changes only the head or fusion rule. A later experiment can unfreeze the backbone. This sequence reduces confounding: if the data, encoder, prompts, and tuning strategy all change together, a gain cannot be assigned to one mechanism.

Illustrations are not included in the reading sample

Figure 7.19. Which components change during adaptation. Gray marks frozen components; teal includes trainable components and their outputs. Amber marks retrieved context. Low-rank adaptation adds a learned update to the frozen base; both contribute to the computation. Original diagram.

7.8.2 Low-rank updates and their cost

Adapting a pretrained system to wound terminology and labels need not require updating every base weight. Low-rank adaptation tests whether a restricted learned correction to selected linear maps is sufficient, reducing the number of trainable parameters while retaining the frozen model in the computation. In the pressureinjury image-text study discussed above, Wang and colleagues used LoRA in the study’s text-only language-model experiments processing clinical wound de- scriptions.[309] The factorization below explains that update mechanism and its parameter count; it does not equate a smaller trainable fraction with the same proportional reduction in total memory.

For a frozen linear map Wo G Rdoxdi, low-rank adaptation (LoRA) learns AL G ^rLxdi and BL G ^doxrL:

Illustrations are not included in the reading sample

This count concerns one adapted matrix, excluding biases and any other trainable modules. The original dodi weights remain stored. One common initialization sets BL = 0 and initializes AL randomly, so the initial update is zero without setting

both factors to zero. The LoRA paper develops this parameterization; it is a general adaptation technique, not wound-specific validation.[313]

For a 1024 x 1024 matrix and rank eight, the update has 16,384 trainable parameters versus 1,048,576 base weights: 1.5625% as many. The total training-memory ratio is not 1.5625%, because activations, frozen weights, optimizer states for other modules, and implementation overhead remain. Name the adapted projections, rank, scale, dropout, precision, and whether the image projector is also trained.

A synthetic rank-one example makes the product explicit. Let Wo be the 2x2 identity, AL = (1,0), BL = (0,1)T, QL = rL = 1, and h = (2,3)T. Then ALh = 2, BLALh= (0,2)T, and HA (2,5)T. The update is restricted in rank, but its effect depends on both input and learned factors.

7.8.3 Worked LoRA updates

A parameter count alone does not show how low-rank adaptation learns a wound label. The next calculation uses the synthetic infection head to trace the gradients into both factors while the base matrix remains fixed. Two explicit steps also explain why the usual zero initialization of one factor can preserve the initial model output without preventing learning.

Set cL = QL/rL and let dz be the derivative of classification loss with respect to z = (Ho + cLBLAL)h. Treating Ho and h as frozen gives

Illustrations are not included in the reading sample

The shapes are do xrL and rL xd(, matching their factors. With BL = 0, the initial AL gradient is zero, but the BL gradient can be nonzero because ALh is nonzero. After BL changes, both factors can learn. Setting both factors to zero would make both gradients zero. This consequence follows directly from the documented LoRA parameterization and initialization.[313]

For the infection fixture, let Ho = I2, h = (2,1), AL = (1,0), BL = (0,0)T, cL = 1, and reference infection in the second coordinate. Use plain gradient descent with learning rate .1 to make the updates visible. Initial log- 459

its (2,1) give loss 1.313262. The first gradients are V, = (0,0) and VB = (1.462117,—1.462117)T. After the first step, BL = (-.146212, ,146212)T while AL stays (1,0).

The next forward pass yields (1.707577,1.292423) and loss .922115. Now V, = (—.352267,—.176133) and VB = (1.204646,—1.204646)T. The second update gives AL = (1.035227, .017613) and BL = (—.266676, .266676)T. The resulting logits are (1.443162,1.556838), so the toy class decision changes to infection. This is two optimization steps on one synthetic vector; it demonstrates learning mechanics, not task adaptation performance.

Figure 7.20 separates frozen storage, trainable factors, and the deployment calculation. With dropout disabled and the same arithmetic precision, precomputing ^merged = ^o + CLBLAL gives the same linear output as the two-branch computation. This equivalence does not imply that all quantized or dynamically adapted implementations merge without additional numerical effects. Compare outputs within a declared tolerance.

Illustrations are not included in the reading sample

Figure 7.20. LoRA learning in the synthetic infection head. The first step changes the zero- initialized second factor; the next step changes both. The base matrix stays fixed. Merging the final low-rank update into that matrix preserves this example’s inference output.

In a real VLM, identify the actual projection modules before inserting factors. Query/value projections, attention output maps, feed-forward maps, the visual merger, and the image encoder are distinct choices with different parameter counts. Sum rL(dj + do) over the selected matrices, include any other trained biases or modules, and list the optimizer parameters explicitly. Do not infer memory from

trainable-parameter percentage alone: frozen weights, intermediate activations, sequence length, and optimizer state still affect memory. The linear-head example teaches the factor gradients; the checkpoint recipe must name the modules it actually adapts.

Wound application. Wang and colleagues used LoRA for their text-only language-model experiments on pressure-injury assessment from clinical descriptions and task prompts.[309] Their reported adapters target query and value attention projections, with rank eight and scale 16. This is a concrete wound application of restricting the trainable update while retaining pretrained weights; it does not validate the synthetic infection-head steps or establish an equivalent total-memory reduction. Section 8.11 connects efficient adaptation to a training contract.

7.8.4 Label and rationale provenance

Choosing trainable parameters leaves another decision unresolved: what response should the wound model learn to reproduce? A reference infection label, ateacher’s predicted label, and a teacher-model explanation have different evidence status even when serialized together. The supervised objective below therefore identifies both the origin of its targets and the token positions that contribute to learning.

Let oz be the target response sequence. It may contain a reference class, a teacher prediction, a rationale, or a combination. An explicit token mask bit G {0,1} identifies supervised target positions:

Illustrations are not included in the reading sample

Prompt, image placeholder, and padding positions receive mask zero in this teaching implementation. Label-only adaptation supervises the label response. Rationaleplus-label adaptation supervises both, with the rationale’s provenance recorded. A sequence-summed loss and a token-averaged loss weight examples of different lengths differently; the denominator above is an explicit implementation choice.

With target-token probabilities (0.8,0.5,0.9) and mask (1,0,1), the mean neg-ative log-likelihood is —(log 0.8 + log 0.9)/2 « 0.164. The masked target con-tributes no direct position-local loss; its context representation may still influence later supervised predictions. For an autoregressive decoder, logits at position t — 1 predict the target at position t; code must shift predictions and labels consistently. A mask without this shift can train the wrong task while producing a finite loss.

Teacher output ^ must remain distinct from reference ^. If a teacher is wrong, copying its rationale and answer teaches that error. If a known reference label is used to guide rationale decoding, record that fact and keep the resulting text in the training partition. Do not attach a corrected label to a contradictory teacher rationale without review. A practical adaptation study compares reference-label- only supervision, teacher-label supervision, and rationale-plus-label supervision before claiming that rationales add value.

7.8.5 Token alignment and masked losses

A plausible wound response template can still train the wrong task if its targets are aligned with the wrong logits. Autoregressive prediction uses preceding positions to predict the next token, while image, prompt, and padding positions have distinct roles. The following sequence makes those roles visible and explains why excluding a direct target loss does not remove a position’s influence on later predictions.

Table 7.3 uses conceptual tokens, not a particular checkpoint’s vocabulary. The visual placeholders stand for the processor’s image-token region. A rationale token precedes the final class, so the answer prediction is conditioned on it. The last padding token must never become a supervised answer.

Table 7.3. Causal target alignment in a synthetic infection response.

Illustrations are not included in the reading sample

With target probabilities .8, .5, .9 at the three supervised positions, the loss is [— log(.8) — log(.5) — log(.9)]/3 = .340550. Label-only adaptation uses its own response template; if a rationale is retained as context but not supervised, that is not equivalent to removing the rationale from inference. The training and deployment templates must agree about which preceding tokens are supplied or decoded.

Loss masking and attention masking serve different purposes. A position ex-cluded from direct supervision may still influence later supervised tokens through attention. It therefore need not have zero gradient in its hidden representation or input embedding. What is zero is its direct, position-local cross-entropy contribution. Figure 7.21 distinguishes these paths. Padding is additionally excluded by the model’s attention mask according to its interface.

Illustrations are not included in the reading sample

Figure 7.21. Supervised targets are shifted by one position. Prompt and visual positions have no direct target loss but can influence later predictions. Dashed arrows denote indirect gradient paths through contextual computation; the loss mask is not an attention mask. Original teaching sequence.

Unequal response lengths change example weighting. If one example has one supervised token with loss 2, and another has three supervised tokens each with loss .2, global token averaging gives (2 + .6)/4 = .65. Averaging each example’s mean gives (2 + .2)/2 = 1.1, while averaging sequence sums gives (2 + .6)/2 = 1.3. State the chosen reduction. For distributed training, the numerator and valid-token count must represent the intended global average; averaging worker-local means can weight small and large token batches differently.

For rationale-plus-answer adaptation, a long rationale can dominate a token- averaged loss. A separately weighted answer objective is a possible new training design, but it requires declared weights and its own ablation. The default recipe here keeps the explicitly defined token-average objective. Reference classes, teacher classes, and teacher rationales retain separate provenance fields even when they are serialized into one target response. If a teacher answer conflicts with a known reference, do not quietly change the answer while retaining an incompatible rationale.

The source Infection-Reasoner implementation performs full-parameter supervised distillation, rather than LoRA, in its first stage. Its student learns teachermodel rationale and answer sequences before label-reward post-training. Equation (7.30) supplies an explicit masking recipe; its token-average normalization is a teaching convention, while the paper writes a sequence-summed objective.[40]

Wound application. The Infection-Reasoner preprint supervised a student VLM using teacher-model wound rationales and infection answers before reward train- ing.[40] Those sequences teach response behavior, which makes the distinction between a model answer and an independent reference central to the adaptation loss. The full-parameter source procedure remains distinct from the low-rank teaching alternative. Section 7.9 develops the stages, and Section 8.11 connects them to experiments.

7.9 Reasoning models for classification

A wound infection classifier may return the correct label while inventing a symptom in its explanation, or describe visible features accurately and still choose the wrong class. This motivates studying intermediate assessment as well as the final answer. Building on supervised adaptation, this section examines transferred teacher rationales, class-reward optimization, and explicit checks for contradictory hypotheses.

Worked updates explain what each mechanism learns or checks; the closing tests ask whether it improves the defined wound task under matched information and computation.

7.9.1 Reasoning objectives

The term reasoning needs an operational meaning before it can support a comparison between wound classifiers. For Q1, an intermediate description, a proposed hypothesis, and a consistency check are different operations with different possible failures. We first identify those outputs and their intended role, then use a published infection system to connect the learning stages to deployment.

In this chapter, a reasoning classifier produces a class together with an inter-mediate or accompanying account of its decision, or uses explicit intermediate operations before classification. These operations can include model-proposed hypotheses, retrieved examples, or consistency checks. Their value is an empirical question. A longer explanation can be wrong, and a correct class can be reached through an unsupported explanation. The evaluation must therefore preserve two outputs: the final class and the claims made about the input.

Infection-Reasoner offers a recent wound-specific example. It uses Qwen3-VL- 4B-Thinking as a student, GPT-5.1 as a teacher, supervised reasoning distillation, and then Group Relative Policy Optimization (GRPO). The author preprint reports a small held-out infection study and separately examines rationale grounding. These are preliminary results on a defined cohort, not evidence that reasoning models generally establish infection from photographs.[40]

Figure 7.22 separates training from inference. Teacher-model answers can supervise a student, but the teacher is not called at deployment in this distilled route. A held-out reference label appears only in evaluation. If a different pipeline queries a teacher or retrieves cases during inference, its latency and information access must be counted separately.

Illustrations are not included in the reading sample

Figure 7.22. Reasoning distillation and its inference boundary. Teacher predictions y and model rationales form training targets; they are not clinical reference labels. A reference-labeled set supports the later reward stage. Original method diagram based on the documented two-stage design in [40]; no source photographs or rationales are reproduced.

7.9.2 Supervised reasoning distillation

A smaller wound model may be taught to reproduce a teacher’s explanation and answer before it is optimized against reference labels. This can transfer response behavior, but the teacher’s interpretation remains model-supplied supervision rather than a new clinical observation. The distillation pathway below follows the origin of those targets and separates its fitting pool from the later reward and test sets.

Let 'Jfl- = {.VJ be an unlabeled fitting pool. A teacher produces (orrat ,yi) from each image under a fixed prompt. A student then predicts the target sequence with the supervised loss in Equation (7.30). This objective transfers the teacher’s response behavior, including possible errors. It does not convert unlabeled photographs into independently verified clinical evidence.

The Infection-Reasoner preprint describes 155 original images expanded to 620 distillation examples. Its label-reward stage starts from 22 images, 11 in each class, expanded to 440 examples. The held-out UMass set contains 56 images, 28 infected and 28 uninfected, excluded from both training stages. Augmented examples must not be counted as independent patients, and the small source sets limit what can be concluded about generalization.[40]

The paper’s infected reward-training cases come from public clinical sources, while the uninfected cases come from the non-test UMass collection.[40] This creates a possible association between source appearance and label that a model could exploit. Exclusion of test images is necessary, but is not by itself evidence that all patient overlap or source shortcuts have been eliminated. A teaching implementation should retain source and patient identifiers for auditing without exposing them as predictive inputs.

Wound application. The Infection-Reasoner preprint transferred GPT-5.1- produced wound rationales and answers into a smaller vision-language student before reinforcement-learning post-training.[40] This first stage uses a teacher’s responses to shape how the student processes an infection question; it does not acquire new clinical reference annotations. Its usefulness therefore requires com-parison with label-only supervision and review of teacher errors. Section 8.11 connects the reported sequence to adaptation and evaluation.

7.9.3 GRPO updates

Supervised distillation encourages the student to imitate a response; a class reward instead favors sampled answers that match the known fitting label. For an infection query, several sampled responses may receive different rewards even though they came from the same wound image. GRPO turns that within-query comparison into an update, making the reward definition, clipping rule, and reference policy central to understanding what is learned.

GRPO compares several sampled responses to the same query and avoids fitting a separate value model. The original method is developed in DeepSeekMath; the following sequence-level expression follows the wound preprint’s displayed formulation. It should not be conflated with every token-level implementation carrying the GRPO name.[40, 314]

For a labeled input (X, y{, draw G responses og ~ rold (• | X) with the old policy held fixed during the update. The wound study uses a binary answer-matching reward:

Illustrations are not included in the reading sample

An unparseable answer receives zero. The paper does not add a separate format reward in this second stage. For the numerical teaching calculation, sR is the population standard deviation within the group and S > 0 is a stability constant. The displayed source equation omits this constant; specifying it here is an implementation safeguard, not an additional published reward component. An all-equal group has zero advantages under this convention.

In these policy equations, conditioning on X abbreviates the wound photograph under the fixed task prompt. Any additional permitted metadata or retrieved context must also be included in the actual model input and held consistent across the compared policies. The reference class y supplies a fitting reward; it is not part of the deployed query context.

With sequence probability ratio pg = ryog | X)/rold(og | X), maximize

Illustrations are not included in the reading sample

Here DKL is Kullback-Leibler (KL) divergence, e > 0 limits the clipped surrogate, P > 0 weights regularization, and Rref is the fixed distilled checkpoint in the cited wound system. Minimizing — J gives the corresponding loss. The unclipped and clipped terms must be compared after multiplication by the signed advantage; clipping the reward itself is a different operation.

Compute a sequence ratio using log probabilities,

Illustrations are not included in the reading sample

Long sequences can make full-response ratios numerically extreme. Practical token-level surrogates and sampled KL estimates must state their masking, length normalization, sampling distribution, and estimator. The small-tensor recipe below verifies Equation (7.32)’s arithmetic; it is not a full reproduction of a specific training library’s policy update.

Figure 7.23 shows a group with rewards (1,0,1,0). The mean is 0.5 and population standard deviation 0.5, giving advantages approximately (1,-1,1,-1). With ratios (1.3,0.9,1.0,1.2) and e = 0.2, the four surrogate terms are (1.2, -0.9,1.0, -1.2), whose mean is 0.025 before the KL penalty. The first positive improvement is clipped; the adverse change for a negative-advantage response is not made artificially harmless.

Illustrations are not included in the reading sample

Figure 7.23. A synthetic GRPO response group. Four sampled answers receive class-match rewards; group normalization produces signed advantages, and the clipped surrogate determines the policy-update contribution. The reference label is available in training only. Numbers illustrate Equations (7.31)-(7.32); they are not a wound experiment.

Infection-Reasoner reports a group size of 16, KL coefficient 0.5, and rollout temperature 0.6. These are source settings, not default prescriptions for a new cohort. Its second-stage reward verifies the final class, not each rationale claim.

Consequently, a plausible but unsupported description can accompany a rewarded answer. Evaluate label accuracy and explanation grounding separately, and compare distillation-only, reward-only, and combined adaptation under the same data budget.[40]

7.9.4 Worked regularized policy update

The response-group example explains which answers are favored, but regularization also affects the update. We now restrict the synthetic infection task to four complete responses so that the entire probability distribution and its divergence from a reference can be calculated exactly. This bounded calculation connects the displayed objective to a full gradient step before approximations for real language models are discussed.

The earlier response-group calculation stops before regularization. A finite teaching policy makes the missing computation exact. For a fixed synthetic infectionpositive Q1, allow four complete responses: (ra,I), (ra,N), (rb,Z), and (rb,N), where ra ,rb are abstract rationale codes, I means infection, and N means no infection. The codes contain no clinical assertions. All paths terminate after the answer. This restricted response set is a toy optimization model, not the output space of Infection-Reasoner.

Freeze both the old sampling policy and reference at uniform probabilities (.25, .25, .25, .25) for this step. They happen to have equal values but different roles: the old policy defines the sampling denominator, whereas the reference defines regularization. Let current complete-response probabilities be p = (.32, .18, .12, .38). This is also a valid two-stage autoregressive distribution: rationale probabilities are (.5, .5), and conditional infection probabilities are .64 after ra and .24 after rb.

Consider one possible old-policy group containing each response once. Rewards are (1,0,1,0), giving advantages (1,—1,1,—1) when the stabilizer is ignored at displayed precision. Ratios are (1.28, .72, .48,1.52). With clipping width .2, the signed surrogate contributions are (1.2, —.8, .48, —1.52), averaging to —.16. The

first correct response is clipped because its probability already increased beyond the upper bound. The second, incorrect response is clipped at the lower bound; multiplying by a negative advantage is why its term is —.8, not —.72.

For a finite complete-response set Q, the exact regularizer is

Illustrations are not included in the reading sample

The sum includes all four possible responses, not only the successful answers. It is .090898 in this example. With ^ = .5, J = —.16 — .5(.090898) = —.205449, and the minimized loss — J is .205449. Swapping the KL arguments gives another quantity; replacing this exact sum with one sampled log-ratio also changes the estimator.

Parameterize the four probabilities as p = softmax(^). Initialize the logits with the elementwise logarithm of the current probability vector. For the fixed group and exact KL above, differentiating the full minimized objective gives

Illustrations are not included in the reading sample

The combined mass on correct answers rises from .44 to .447434. Because softmax couples all outcomes and clipping suppresses some direct derivatives, an individual incorrect response can still gain mass. Inspect the full distribution rather than assuming every response changes monotonically in the reward direction. Figure 7.24 traces this calculation.

The exact KL is nonnegative and becomes zero when the current and reference distributions match. Equal rewards make the stabilized group advantages zero, but a nonzero KL term can still update the model. Detach the sampled rewards, advantages, and old-policy log-probabilities from differentiation. Do not detach current log-probabilities: they carry the training signal. The reference has no optimizer parameters even though its values participate in the loss.

This finite model supports exhaustive checks, analytical gradients, automatic differentiation, and finite differences away from clipping boundaries. A language 471

Illustrations are not included in the reading sample

Figure 7.24. One complete synthetic sequence-level policy update. A frozen old policy supplies responses and ratio denominators; a frozen reference supplies the exact KL regularizer. Current logits alone are updated. The correct-answer mass increases slightly in this toy group; no woundmodel training or clinical performance is represented.

model has an enormous response space, so this enumeration is not a practical complete-sequence KL computation for a real VLM. Its role is to explain what is being regularized before introducing a sampled or token-level approximation.

7.9.5 Sequence-level and token-level GRPO

Real wound explanations contain many tokens, so the unit at which a policy update is computed matters. Clipping one probability ratio for a complete explanation and answer can behave differently from clipping each token’s ratio. The comparison below explains that difference and identifies the additional conventions needed to connect the teaching update to a practical post-training implementation.

For an autoregressive response, Equation (7.33) multiplies token ratios by summing their logarithms. If the two token ratios are 1.1 and 1.1, the sequence ratio is 1.21. Sequence clipping at 1.2 therefore activates although neither token ratio exceeds 1.2. Averaging separately clipped token terms is not algebraically equivalent to clipping the complete-response ratio.

DeepSeekMath writes a token-level objective with a mean over each response’s valid tokens. For an outcome reward, the same group advantage can be assigned to

each token of that response. Writing pgt for the token ratio and dgt for the chosen token KL estimate, its structure is

Illustrations are not included in the reading sample

This is a separately labeled formulation, not a replacement silently inserted into the wound paper’s sequence-level equation. Its per-response token mean weights response lengths differently from summing tokens or averaging all tokens globally. Prompt and padding positions are excluded; the termination policy determines which response tokens are included.[40, 314]

The DeepSeekMath paper gives the nonnegative sampled expression d = exp(A) — △ — 1, with △ = log zref(ot | c) — log ^0(ot | c). Under samples from the current conditional policy and common support, its expectation equals BKL (fl’flll^’ref): the expectation of exp(^) is one, and the remaining log-ratio sup-plies the divergence. When samples are retained from an older policy, that equality cannot be asserted without accounting for the sampling distribution. State the actual estimator and update regime rather than labeling every token penalty an exact KL.[314]

For a reproducible post-training recipe, specify the rollout policy snapshot, group size, temperature, maximum response length, parser, reward, standard-deviation convention, ratio granularity, clipping width, KL estimator, length reduction, and number of optimization passes per group. Record when old-policy statistics are refreshed. The source wound paper documents part of this contract and links its implementation lineage; undocumented details remain unknown unless verified in the exact source code version. The book’s finite-response recipe deliberately specifies every one of its own operations without claiming a full reproduction.

Wound application. The Infection-Reasoner preprint used GRPO after super-vised distillation to refine wound infection classification with label-matching re- wards.[40] Several responses to a fitting query are compared through their out-comes, making the parsed final answer the rewarded property. This motivates stage comparisons and separate rationale review, since matching an infection label 473

does not verify every explanatory claim. Section 8.11 connects response rewards, training boundaries, and evaluation.

7.9.6 Limits of class rewards

Matching the infection label is only one property of a model response. A class-only reward can treat two correct answers equally even if one explanation contains an unsupported wound observation. Returning to the finite-response example makes this limitation explicit and motivates the separate explanation-grounding evaluation later in the chapter.

Both (ra,I) and (rb,I) receive reward one in the example. If one code repre-sented an unsupported explanation, the class-only reward would not distinguish it. Supervised rationale targets can transfer useful wording or reasoning behavior, but can also transfer teacher errors. A second, separately defined grounding outcome is therefore needed in evaluation. Do not reinterpret the class-reward objective as supervision of every clinical premise.

At inference the optimized student receives the allowed image and context, decodes a response under the frozen output template, and returns a parsed class. It does not receive the reward label, the old policy, or the reference policy. A rationale-first answer uses the decoded rationale as context; a label-only baseline changes that computation and should be compared at a declared decoding budget. This distinction connects the training mathematics to the final wound-classification decision, rather than treating post-training loss reduction as the endpoint.

7.9.7 Bounded symbolic reasoning

A different problem arises when a burn-assessment system produces hypotheses that cannot all be true under its stated rules. Before using them to guide classification, an explicit checker can identify a contradiction and return it for review. Here bounded means a restricted logical vocabulary, a fixed limit on refinement, and an unresolved outcome when justified repair is unavailable. The AURA application motivates this consistency step; neither satisfiability nor a successful repair proves that the original imaging description is grounded or clinically valid.

AURA takes a different route. It constructs hypotheses from imaging descriptions and clinical context, expresses premises in first-order logic, and uses a satisfiability modulo theories (SMT) solver to detect contradictions. Refined hypotheses guide downstream VLM classification of burn ultrasound inputs. The method uses symbolic consistency as an intermediate check, not as an independent measurement of tissue state.[51]

Figure 7.25 makes this boundary explicit. Consider an original teaching example with Boolean variables D for a deep-injury hypothesis, S for a superficial-injury hypothesis, and E for an asserted image cue. Suppose a toy rule set is

Illustrations are not included in the reading sample

The set is inconsistent: E implies D, which implies S, while S is also asserted. A solver can expose this contradiction. Removing S makes the set satisfiable, but does not prove that E was visible or that the rule E > D is clinically valid. These symbols are a logic exercise, not burn-diagnosis criteria.

Illustrations are not included in the reading sample

Figure 7.25. A bounded consistency loop inspired by AURA. A solver checks the compatibility of stated premises; image grounding and clinical validity require separate evidence. The example uses invented Boolean propositions from Equation (7.38), not patient observations or clinical rules. Original diagram.

For implementation, use a restricted predicate vocabulary, a fixed maximum number of refinement rounds, and a documented action when contradictions persist. Unknown visual evidence should remain unknown rather than being converted to false. Do not execute arbitrary model-written code to validate a rule; translate an allowed logical representation into a solver input. Keep the solver’s result, the premises, and the final class in the audit trail.

AURA’s paper also describes combining a VLM class score with a logical-support score, and discusses majority aggregation over completions. Its support-score mapping is described at a high level rather than as a complete calibrated probability model. Reproducing the source requires those implementation details. Equation (7.38) therefore teaches the consistency operation independently instead of filling in missing clinical scoring rules and attributing them to AURA.[51]

7.9.8 Consistency checks and unresolved outcomes

Detecting a contradiction is not the same as knowing which wound-related assertion should be changed. The toy rule set therefore needs an evidence-aware response to both inconsistent and insufficiently grounded premises. This continuation implements the restricted check, limits revision attempts, and retains unresolved cases instead of selecting whichever repair produces a preferred class.

The Boolean example in Equation (7.38) can be implemented without accepting arbitrary model-written programs. Admit only predicates E,D,S, implication, negation, and conjunction. Enumerate the eight truth assignments, or translate that fixed grammar to a solver. The four premises together have no satisfying assignment. Removing the asserted S leaves the single assignment E = 1, D = 1, S = 0 under these toy rules.

That repair is logically sufficient but not automatically authorized by evidence. Attach an origin and grounding flag to each assertion: measured or reviewed evidence, model-proposed hypothesis, or unknown. Set a maximum of two review rounds in this teaching procedure. First return the conflicting premises for review; then accept only an explicitly justified revision. If no justified revision arrives, return unresolved. Do not remove whichever premise makes the desired class easiest to obtain.

A satisfiable set with unknown grounding also remains unresolved for the final classification. A grounded, consistent toy set can return a hypothesis code to the classifier, but the classifier’s mapping to clinical classes still requires validation. Log the original set, contradiction, proposed revision, justification, final solver state, and final class or unresolved status. Unknown evidence is not Boolean false. The solver tests the internal compatibility of supplied assertions; it does not inspect a wound or establish a diagnostic criterion. This bounded example explains one operation used in AURA without inventing its undocumented support-score mapping.[51]

Wound application. AURA combined VLMs with first-order logical consistency checks for burn assessment using B-mode ultrasound and tissue Doppler inputs.[51] The checker examines compatibility among stated premises before they guide the downstream decision; it does not measure burn depth or establish the truth of an image description. This is a wound application of checking hypotheses, distinct from learning a class-reward policy. Section 7.5 explains the measured modalities, while Section 8.11 connects reasoning outputs to evaluation.

7.9.9 Testing reasoning claims

The preceding mechanisms add learning stages or inference operations, but those additions do not by themselves establish a better wound classifier. Testing a reasoning claim requires identifying what would happen with the same inputs and model when the intermediate procedure is removed. The controls below connect the mechanisms to class performance, explanation support, and the extra computation needed to obtain them.

Compare the same model and inputs with and without the intermediate procedure. Hold the label vocabulary, retrieval context, resolution, sampling budget, and tuning access fixed where possible. If self-consistency samples several answers, compare against a baseline with an equivalent inference budget. If the system calls an external model or solver, count the calls and failure rates. An architecture diagram establishes the proposed mechanism; only these controlled comparisons can support a claim that reasoning improves wound classification.

7.10 Evaluating multimodal and reasoning models

A complete wound system now has an input contract, a model pathway, and a decision rule, but its benefit remains to be measured. Evaluation must distinguish useful extra information from a stronger encoder, supported explanations from correct labels, and selective success from whole-population performance. This section proceeds through matched ablations, calibration and deferral, a prediction ledger, explanation review, published evidence, and external testing. Together these steps determine what can be concluded about an added modality or reasoning procedure.

7.10.1 Targeted ablations

A higher wound-classification score can result from several changes made at once. To identify the contribution of clinical fields, captions, retrieved cases, or reasoning, compare systems that differ in the component under study while preserving the relevant data access. The ablations below translate the chapter’s architectural choices into explicit experimental questions.

The metrics in Section 2.5 remain the foundation: per-class confusion counts, sensitivity and specificity for a defined positive class, macro-averaging for multiclass tasks, and calibration when probabilities are used. Segmentation overlap and model-text similarity answer other questions. A rationale score cannot replace classification performance, and a good mask does not establish a correct wound class.[20, 21]

Table 7.4 specifies controls for a hypothetical wound study. Each row changes one main factor while preserving the test cases. A shuffled-input condition is a

stress test, not a clinically plausible deployment mode. Its purpose is to reveal dependence on the additional information; its results must be interpreted alongside realistic missingness and external-site tests.

Table 7.4. Matched tests for additional information and reasoning. These are proposed experi-mental controls, not published numerical results.

Illustrations are not included in the reading sample

For a hypothetical clinic with incomplete mobility records, a small fusion gain on complete records may be less useful than stable image-only performance across all patients. Report both the complete-case comparison and the performance/coverage of the actual missing-input policy. If excluded patients differ systematically, a complete-case result estimates a different population. This interpretation follows from the sampling and inference contract, rather than from a preferred architecture.

7.10.2 Calibration and abstention

A wound classifier may rank its chosen class above the alternatives while assigning that choice an unreliable confidence score. Calibration asks whether the scores agree with observed outcomes; abstention adds a policy for deferring cases rather than forcing a label. For infection assessment, rejecting uncertain cases also changes which patients contribute to the reported error rate, so confidence must be examined alongside coverage and missed cases. The following definitions lead into a shared prediction ledger that makes these selection effects visible.

Temperature scaling adjusts fixed logits using validation data:

Illustrations are not included in the reading sample

It preserves the argmax for positive T but changes confidence. Evaluate it on untouched test data using the reliability and probability-error measures already defined in Equations (2.12) and (2.13). Temperature scaling is a documented calibration method, not a guarantee of calibration under a new hospital’s distribution.[44]

For logits (2,0), Tcal = 1 gives first-class probability 0.881; Tcal = 2 gives 0.731. The predicted class is unchanged. A hard-label-only interface cannot support this procedure without additional score access. Likewise, language such as “high confidence” must not be substituted for calibrated logits.

Define an acceptance indicator 5z = 1 [maxfe pgl > 7] for a threshold chosen on validation data. Coverage and error among accepted cases are

Illustrations are not included in the reading sample

If no case is accepted, risk is undefined, not zero. This is a descriptive selective-prediction calculation: report rejection reasons, class-specific coverage, and how a deferred case is handled. For five synthetic confidence values (.95, .85, .75, .65, .55) with correctness (1,0,1,0,1) and 7 = .7, coverage is 3/5 and accepted-case error is 1/3. A lower coverage can hide difficult infected cases, so selective performance must accompany full-population results.

7.4.3 3 Prediction ledgers and selection effects

Aggregate scores can hide whether a multimodal wound classifier fails mainly

when clinical fields are absent. A case-by-case ledger keeps references, predictions,

input availability, and acceptance decisions together without treating them as the

same quantity. The invented infection cases below show how an apparent completerecord gain can coexist with worse overall performance and selective rejection of an entire input group.

Table 7.5 contains eight invented infection cases, each from a different synthetic patient. The image-only classifier and the fused classifier use the same cases. Fused probabilities are fixed illustrative outputs, not predictions from patient photographs. The threshold for both binary class decisions is .5, with equality assigned to infection.

Table 7.5. Synthetic infection ledger for matched evaluation.

Illustrations are not included in the reading sample

On complete records the fused classifier gets four of four correct versus three of four for the image-only baseline. Across all eight, it gets five correct versus six for the baseline. For the fused system, TP = 2, FN = 2, TN = 3, FP = 1: sensitivity is .5 and specificity .75. These counts and measures use the definitions in Subsections 2.5.3-2.5.4. The complete-case gain and whole-population loss are both true statements about this fixture; reporting only the former hides the failure of its missing-input policy.

At confidence threshold .75, where confidence is the larger of the two class probabilities, only the first four cases are accepted. Coverage becomes .5 and accepted-case error zero, while all four missing-metadata cases are rejected. Fig-ure 7.26 connects these quantities. Zero selective error is not a replacement for the full-population result or the need to handle deferred cases.

Calibration changes the acceptance calculation. If a temperature of two had been selected on separate validation data, a binary score .9 would become .75 and .8 would become two-thirds. The class argmax would stay unchanged, but the .75

Illustrations are not included in the reading sample

Figure 7.26. The synthetic ledger gives a complete-case improvement but worse overall classi-fication. Rejecting all missing-metadata cases produces zero accepted-case error at only half coverage. Classification and rationale review remain separate; none of these numbers describes a clinical experiment.

acceptance threshold would retain only cases 1 and 4, reducing coverage to .25. This is a hypothetical fixed temperature, not one fitted on this ledger. In a real study, jointly specify the calibration fit and threshold selection before final testing and calculate all metrics from the resulting frozen scores.

For paired uncertainty intervals, resample the same patients for both methods and recompute their metric difference. If several visits belong to one patient, take those visits together in a resampled group. For this small teaching ledger a numerical confidence interval would add little evidence; the point is to preserve pairing and population definition. Report complete-case, missing-input, and overall comparisons with their respective denominators.

For a separate invented rationale example, suppose case 1 is correctly classified but contains three evaluable claims, only two of which are supported. Its class contributes a true positive, while its supported-claim fraction is 2/3. Case 2 might contain no evaluable claims, giving zero claim coverage and an undefined supported fraction under the teaching convention. Do not turn that silence into perfect explanation quality. The counts demonstrate evaluation bookkeeping, not a clinical judgment about any displayed photograph.

7.10.4 Evaluating explanation quality

The prediction ledger answers whether the wound label matched its reference, but it cannot establish that a model explanation was supported. An infection-positive prediction might still invent a test result or an unobserved symptom. A separate claim-review procedure therefore examines what the model said about the wound and how those assertions are grounded.

Figure 7.27 crosses class correctness with rationale correctness. A correct infection label with an invented symptom occupies a different cell from a correct label with supported visual claims. Reviewers should assess image grounding, clinical appropriateness, omissions, and contradictions under a prespecified rubric, blinded to the comparison condition when feasible.

Illustrations are not included in the reading sample

Figure 7.27. Classification correctness and rationale quality are separate axes. A correct class does not validate every statement, and an accurate visible description need not justify the final class. The four cells are conceptual categories, not observed counts. Use the confusion matrix for class errors and a separate claim-review protocol for explanations.

One transparent teaching score counts Ci evaluable explicit claims and Si supported claims, reporting SijCi only when Ci > 0, together with coverage and the number of unverifiable claims. Do not reward silence as perfect grounding. The Infection-Reasoner source uses a related judge-based agreement procedure with its own zero-coverage convention and multiple VLM judges. Its human review is restricted to 34 cases on which the expert agrees with the reference infection label; this selected subset is not the entire 56-image test set.[40]

Automatic judges may share errors with the response model or disagree about what is visible. Report the exact judge version, prompt, rubric, and evaluation date, alongside an independently reviewed sample. A text-similarity score against one reference rationale measures wording overlap, not necessarily factual correctness. The 2026 general wound-assessment study evaluated 2024 model versions and combined several assessment dimensions; such results must not be presented as current-model classification accuracy.[315]

Wound application. The Infection-Reasoner preprint evaluated wound-classification rationales with language-model judges and wound-expert review in addition to checking final infection labels.[40] The additional review asks whether claims about the wound are supported, a question that class-match accuracy cannot answer. Its selected expert-reviewed subset and judge-specific conventions retain the limitations stated above. Section 8.8 connects recorded predictions and failure review to evaluation beyond a category score.

7.10.5 Published failure case

Failure review is easiest to interpret when the target, reference group, and reported model decision are all known. The published wound photograph below supplies such a reference-comparison example, even though its classifier is an image-only CNN and its endpoint differs from infection. Keeping that distinction explicit lets us practice error accounting without attributing an unseen multimodal or reasoning failure to the image.

Figure 7.28 isolates a second leg-ulcer false positive from Birkner and colleagues' binary PG/UC validation examples. The source's Figure 4 groups clinical column 2 as UC and marks the CNN decision incorrect; the two-class task therefore implies a PG prediction.[181, 290] This is an image-only CNN baseline example, included to make the evaluation convention visible. It is not presented as a SCARWID, captioning or multimodal-language-model result.

Illustrations are not included in the reading sample

Figure 7.28. A published CNN false positive with PG as the positive class. Birkner et al. (2022), Figure 4, clinical column 2; creator-supplied Fig4_2col.jpg, Mendeley Data version 1, DOI 10.17632/mzwv687gzn.1, CC BY 4.0.[181, 290] The exact clinical crop is retained and the evaluation layout is new. The UC diagnostic group and incorrect-CNN marker imply PG in the source's binary task. No probability, model-written caption, infection label or unseen support item is reconstructed.

For this example, map PG to the positive class and UC to the negative class before applying Equation (2.5). The error increases FP and contributes to lower specificity and positive predictive value for PG detection; it does not measure infection-detection performance. Neither the photograph nor an explanatory map establishes why the CNN failed. The paired FP/FN examples in Figure 6.24 apply the same class mapping. A useful failure analysis records input quality, missing information, selected supports when applicable, output validity and reference uncertainty before assigning a cause.

7.10.6 Study evidence and its limits

The wound studies encountered across the chapter address different targets with different information and reference procedures. Their results help explain appli-cations of the techniques, but cannot be compared as if they were scores on one common benchmark. The evidence table gathers each study’s task and limitations so that a proposed new experiment can be grounded in the appropriate precedent.

Table 7.6 records study-specific evidence separately from the capability com-parison at the chapter end. Numerical values are retained only with their task and partition. They should not be sorted into a league table: their class vocabularies, populations, pretraining, and reference standards differ. Model versions refer to the tested systems, not to an assertion that those systems are the newest available releases.

Table 7.6. Primary wound-study evidence and boundaries. Source-specific results are not directly comparable across rows.

Illustrations are not included in the reading sample

For the ICL and Infection-Reasoner preprints, the consulted 2026 versions are identified by the version-specific references.[40, 110] AURA’s 2026 publication tested model families including GPT-4o and Gemini 1.5/2.0, rather than unspecified future versions. Its percentages are retained as published, without reconstructing patient-level counts from the frame inventory.[51] The pressure-injury article and its updated publisher file are from 2026; the consulted source is retained in the evidence register.[309] Where the experiment timing or patient-level split cannot be verified, the register retains that uncertainty instead of substituting the publication year.

7.10.7 Costs and external testing

An added modality or reasoning step must remain useful when its acquisition burden, processing cost, and failures are counted. A new hospital may also supply different wound appearances or lack a clinical field that was usually present during development. Cost reporting and external testing therefore complete the evaluation story by testing the actual inference contract beyond the original complete-record setting.

Report encoder time, captioning, index search, prompt construction, decoding, optional solver calls, peak memory, and invalid-output rate separately. A frozen model can still be expensive at inference. Record image dimensions, decoderoutput token limits, support count, precision, hardware, batch size, and whether the model was already loaded. Paired patient-level resampling is appropriate when several visits belong to one patient; the same patient samples must be used for both methods in a comparison.

External testing should preserve the intended information contract while changing the institution, device, or time period of interest. If a new site lacks a clinical field, evaluate the actual missing-input policy there. If a model is retuned on the external site’s labels, name the adaptation and reserve another test partition. These distinctions extend the development/test separation in Chapter 2; they are essential to deciding whether additional modalities or reasoning help beyond the original collection.[20]

7.11 Implementation recipes

The preceding sections explained individual computations; the next task is to assemble them into a complete wound-classification study. Seven recipes carry a record from leakage-aware preparation through fusion or retrieval, optional adaptation, and output evaluation. Three walkthroughs then reconnect those recipes to PU/IAD classification, infection retrieval, and reward learning. The Python/PyTorch fragments implement small tensor operations; calls requiring a selected pretrained model or dataset remain explicitly marked pseudocode. No pretrained model is trained or evaluated for this book.

Reading the code notation. Assignment uses =; == and != compare values. Square brackets index a sequence, tensor or dictionary: row['patient'] retrieves the named field, whereas names[i+l:] selects the remaining names after position i. Braces construct dictionaries or sets; a for inside them is a comprehension that constructs entries from the records. The in, not and and keywords test membership, negate a condition and combine conditions. Comma-separated assignment unpacks returned values. On tensors, *, /, + and - act elementwise with compatible broadcasting; @ instead contracts matrix dimensions. A trailing underscore in a PyTorch method such as normal_O marks an in-place modification. Chapter 8, under Reading operators in the code, supplies the shared axis, masking and gradient guide.

Load the code definitions before calling helpers that refer to later definitions. Use floating-point feature tensors on a common device; choose float32 or float64 intentionally and record the numerical precision. Match each stated shape and mask type. These fragments demonstrate the declared operations, with selected input checks; they do not validate every possible data error or supply a complete pretrained-model interface.

7.11.1 Recipe 1: pairing without leakage

Every later recipe assumes that the photograph and auxiliary inputs belong to the correct wound episode. For P17/W2/V1, that means pairing the image with the sacral-wound observations from visit V1 and retaining patient P17’s partition. This first recipe produces the manifest and stored preprocessing state that make the downstream computations interpretable.

Inputs and outputs. Begin with patient, wound, visit, timestamp, modality paths, field units, and reference-label provenance. Declare the prediction unit: here one row represents one wound at one visit, with its eligible modalities. Several rows may therefore belong to one patient. Produce a manifest, a frozen label map, and patient-grouped fitting/tuning/test partitions. Keep identifiers in the audit rather than feeding them to the classifier.

Procedure. Resolve conflicting record keys and repeated files first. Assign patients to partitions, then create crops and training augmentation. Fit category vocabularies, imputation, standardization, and any task-trained captioner only on the fitting partition. Build the retrieval pool from the permitted development records. Validate label balance at the patient level without moving test cases in response to model results. This recipe has no trainable model or loss of its own; it defines the data access for all later objectives.

Illustrations are not included in the reading sample

At inference, join only modalities available at the declared decision time and apply the stored transformations. Failure checks include missing patient identifiers, duplicate images across sources, post-outcome notes, mismatched wound sites, and descendants assigned to a different split. The assertion checks identifiers supplied to it; it cannot prove that two unknown identifiers belong to different people. Such uncertainty belongs in the study report.

The support filter retains the first eligible copy of each image hash and excludes prohibited patients. Hashes and patient identities must be constructed before this step; matching different files that depict the same wound may need additional duplicate review. A smaller filtered pool must still satisfy the requested support count. Group-based splitting assigns records through group identifiers; it does not establish their identity or remove duplicates automatically.[316] Check image hashes across partitions as well as within the support pool.

Executable numerical preprocessing. The next function operates on numerical fields after their units have been checked. It takes arrays of shape B x P and fitting statistics of shape P, returns standardized values followed by field masks, and rejects an observed nonfinite value. The category vocabulary and embedding lookup are separate. The caller stores the statistics and never recomputes them from a test batch. import torch.

Illustrations are not included in the reading sample

For duration six days with fitting mean four and standard deviation two, this returns standardized value one and observation mask one. For missing duration it returns zero and zero even if the raw placeholder was NaN. A zero fitting standard deviation is floored to 10-[8]; a constant observed field equal to its mean still becomes zero with mask one. A new value outside that constant fitting range can become very large and needs a prespecified constant-field policy. Negative or nonfinite statistics are rejected. Distinguish genuinely missing measurements from parsing errors before calling the function. Duplicate-file and patient checks remain necessary; a successful normalization cannot establish correct record linkage.

7.11.2 Recipe 2: image-metadata classification

With paired, finite inputs prepared, we can implement the simplest joint wound classifier. This recipe combines frozen image features with a learned metadata branch, following the PU/IAD pathway from Section 7.4. Its fitting and prediction helpers make the separation between reference-dependent learning and reference- free inference explicit.

Inputs and shapes. Use image embeddings HT G ^Bxdi from a fixed encoder, finite encoded metadata M G RBxQ from Equation (7.2), whole-record mask aM G {0, l}Bxl, and labels of shape (B,). The output is B x K logits.

Trainable components. The fragment trains a metadata network and classi-fication head. Keep the image encoder frozen for the initial baseline; unfreezing it is a separately reported experiment. Use cross-entropy on logits and select hy-perparameters using a prespecified validation metric such as macro-Fl. Save the metadata vocabulary and numerical statistics with the checkpoint.

How to use the result. The metadata network produces dM features; its wholerecord mask zeros that branch when absent. Concatenating dz image features, dM metadata features, and one availability flag gives the head width dz + dM + l. Supply a binary numerical mask of shape B x l, on the same device and with the same floating dtype as the features. Field masks inside M distinguish individual missing measurements. The published PU/IAD study motivates image-metadata fusion; this small frozen-encoder head is an independently specified teaching baseline, not a reproduction of that architecture or its accuracy.[50, 317] import torch, from torch import nn import torch.nn.functional as F class FusionHeadCnn.Mod.ule):

def init (self, di, q, dm, classes):

super(). init ()

self.meta = nn.SequentialC nn.LinearCq, dm), nn.ReLUO) self.head = nn.Linear(di + dm + 1, classes) def forward(self, hi, meta, available): hm = self.meta(meta) * available Joint = torch.cat([hi, hm, available], dim=-1) return self.head(Joint)

One fitting step clears gradients, computes logits, evaluates F.cross_entropy on logits and labels, backpropagates, and updates only the declared parameters. At inference, switch to evaluation mode, disable gradients, obtain probabilities, and apply the frozen decision rule. Check that absent metadata does not change logits when its finite filler values are altered. Compare with image-only and metadata- only heads, and test a batch containing no metadata. An all-zero feature vector without a mask is not a valid missingness policy.

A complete fitting and prediction step. The optimizer must contain exactly the declared trainable parameters. This helper performs one supervised update; it receives detached image embeddings when the image encoder is frozen. The second function is the corresponding inference path. Reference labels appear only in the fitting function.

Illustrations are not included in the reading sample

In the full image pipeline, obtain embeddings under the encoder’s evaluation mode and without gradients when it is frozen. Cache them only if preprocessing is deterministic; cached features cannot reproduce image augmentations that were never encoded. Choose the checkpoint using validation patients, then save the head, metadata encoder, category embedding state, statistics, and class order together. Equation (7.6) gives a deterministic worked head calculation with its own stated inputs.

Here @torch.no_grad() is a Python decorator attached to the following function: calling predict_fusion runs its body without recording gradients. This use of the prefix @ differs from the infix matrix product q @ k. The separate eval() call selects evaluation behaviour in modules such as dropout and batch normalization.

7.11.3 Recipe 3: gates and cross-attention

The concatenation head provides a baseline against which more selective fusion can be tested. A gate mixes projected wound representations, whereas cross-attention combines usable key/value tokens for each query. This recipe exposes their masks and fallback behavior so that incomplete clinical records do not produce an undefined update or a silent change in the intended computation.

Inputs and outputs. For gating, provide projected branch batches Ui,UM of shape B x d and mask B x 1. For attention, provide queries B x NI x dk, keys B x NM x dk, values B x NM x dv, and a Boolean key-availability mask B x NM . The attention output has shape B x NI x dv.

Illustrations are not included in the reading sample

The gate accepts Boolean or binary numerical availability and converts it before arithmetic. An absent metadata branch forces g = 1, returning the image representation. Its learned coefficient is a mixture weight, not a confidence estimate. Attention instead normalizes query-key similarities over usable keys and returns a weighted sum of values, following scaled dot-product attention.[318] Here True means usable; this convention is the reverse of PyTorch’s MultiheadAttention padding mask.

The attention function requires at least one allocated key position and finite queries, keys, and values, including padding. For a record with no actual keys, it temporarily enables one position to avoid an undefined softmax and then zeros the update. A residual image path therefore remains unchanged. Zero allocated positions are rejected explicitly. Learn the projection and gate layers under Equation (7.4); the functions themselves create no additional trainable parameters.

In this code, q @ k.transpose(-2, -1) multiplies the query and transposed key matrices within each batch, producing B x Nt x NM scores; a @ v returns B x Nt x dv features. Negative axis indices count from the final axis. The exponent ** 0.5 takes a square root. For Boolean tensors, ~ negates each flag and 1 = updates selected flags with logical OR. Indexing with None inserts a singleton axis so the key mask can broadcast across queries. Filling forbidden scores with float('-inf') makes their softmax weights zero, provided at least one finite score remains.

Validate the worked matrix in Equation (7.11), row sums for nonempty masks, and invariance to changes in masked key/value positions. Check that gradients are finite and absent-branch updates are zero. At inference use the same masks and bypass behavior. Reject a comparison that gives attention patch tokens while giving its baseline a weaker image encoder without disclosing the difference.

7.11.4 Recipe 4: prototypes and support indexing

A frozen wound representation can support either comparison with class descriptions or retrieval of labeled prior cases. Both require a consistent embedding space, but their stored candidates and decision rules differ. This recipe implements the shared normalization and selection operations while keeping any prior representation learning separate from index construction and inference.

Inputs and outputs. Use permitted support images, their labels, a frozen imagetext encoder, and class descriptions. Preprocessing must follow that checkpoint.

Encode images and texts once, normalize along the feature dimension, and save the support embeddings of shape ns x d with patient IDs and labels. A query batch produces B x K prototype logits or B x ns similarities.

Choose the decision route. For class-description classification, texts has shape K x d: each row is the embedding of a fixed class description, as in CLIP’s classifier construction.[52] For case retrieval, the candidates are labeled supportimage embeddings. Nearest-neighbor voting predicts from their labels; MMR only chooses a relevant, less redundant subset for a later vote or VLM.[312] It does not itself return a class. Call mmr once per query vector of shape (d,) with a pool of shape ns x d; use unit_vectors, defined below, before running these helpers. def prototype_logits(images, texts, temperature):

Illustrations are not included in the reading sample

The pool passed to MMR is the previously retrieved candidate pool, with forbidden patients removed. Unit normalization makes each dot product a cosine similarity; positive temperature rescales prototype logits without changing their class order. MMR first chooses the most relevant candidate, then subtracts a redundancy penalty at each step. Keep the pool in a recorded order so equal maxima resolve to its first index. A fixed index has no new training loss. If the encoders are adapted using Equation (7.18), rebuild the entire index after adaptation; mixing old and new embedding spaces is invalid. Choose candidate-pool size, context count, and temperature using validation data. At inference, log selected support IDs and scores without exposing the query reference label. Check zero-norm embeddings, duplicate supports, class-order consistency, and index/checkpoint mismatch.

Train a representation before freezing the index. The following functions operate on paired raw embeddings of shape B x dR or triplet embeddings of that shape. Their objectives have different supervision and must not be combined without an explicit coefficient and study design. A zero-norm representation is rejected. An inactive triplet contributes zero loss.

Illustrations are not included in the reading sample

Use exactly paired batches for the alignment loss and a documented fitting- only sampler for triplets. The chapter’s MMR function chooses supports after an embedding space is fixed; it is not a substitute for either learning objective. Before calling it, remove prohibited patient IDs and duplicate support records, and verify that at least the requested number of eligible candidates remains. Resolve equal scores by stable index order. Changing the index or encoder invalidates cached query similarities.

7.11.5 Recipe 5: constrained-label VLM inference

Selected wound examples become useful to a generative classifier only after they are placed in a valid model context and its response is interpreted consistently. This recipe joins the support-selection pathway to the label interface introduced in Section 7.6. It distinguishes exact parsing of decoded labels from candidate scoring when token likelihoods are actually available.

Inputs and outputs. The query photograph, selected support image-label pairs, allowed vocabulary, and frozen VLM/processor produce one class or an invalid/abstained result. This is inference, with no gradient update and no training objective. The image processor determines visual-token shapes; do not assume every model uses a fixed 224-by-224 input.

Model-dependent pseudocode. Construct a message containing the task definition, each selected support image and its label, then the unlabeled query image. Use the model’s documented image placeholders and chat template. Apply grammar- constrained decoding if supported; otherwise request one label and parse exactly. Store checkpoint, prompt hash, support IDs, image-token count, output tokens, and elapsed time. These operations depend on the chosen interface and are not executed by the generic tensor snippets.

The model’s processor prepares both image inputs and the chat template. Decode only the newly decoded answer when the decoder returns the prompt as well; passing a full conversation to the strict parser would reject an otherwise valid answer.[319] The allowed dictionary maps exact label strings to saved class indices; no valid label may map to None. For example, {'Infection': 1} accepts ' Infection ' after trimming, but rejects 'Maybe infection'.

Illustrations are not included in the reading sample

Use a distinct parser for a structured answer field when rationales are permitted. Do not search the entire response for any occurrence of a class word. Choose prompts, context ordering, and token limits on development data. Compare zeroshot, random support, nearest-neighbor support, MMR support, and a vote on the identical selected cases. Check that the last query was not truncated, no support is the query itself, and all displayed labels follow the same target definition. Report invalid responses before any retry policy; retries change cost and potentially performance.

Candidate scoring from aligned answer log-probabilities. This computation receives the selected token log-probabilities from separately teacher-forced can-didate paths, with shape K x Lmax. The Boolean mask includes the candidate’s terminal token and excludes prompt and padding. Each candidate needs at least one selected token and every selected log-probability must be finite; a selected x is outside this helper’s input contract and is rejected, rather than silently normalized. Unselected padding may contain nonfinite placeholders. It returns summed sequence scores and their candidate-set normalization, not calibrated clinical probabilities.

Illustrations are not included in the reading sample

if not torch.isfiniteCtoken_logp[answer_mask]).allC): raise ValueErrorC'Invalid answer likelihood') score = torch.where(answer_mask, token_logp, torch.zeros_like(token_logp)).sum(-l) return score, score.softmax(-l)

The model-dependent part builds one compatible image/prompt context per candidate, applies the documented chat template, runs a causal forward pass, and gathers the probability of each next candidate token. It must use the same image processing and prompt across candidates. For Q1, the two synthetic paths with products .24 and .36 return candidate probabilities .4 and .6. A separate decodedlabel route calls the decoder and exact parser; it does not fabricate these scores when the interface lacks log-probability access.

7.11.6 Recipe 6: adaptation and post-training

When the study changes model weights, it must also specify which wound responses teach those changes and where the labels came from. This recipe connects masked supervised targets, low-rank factors, and the bounded reward calculation to their declared trainable parameters. It retains the separation between executable teaching arithmetic and the model-dependent rollout machinery required for an actual VLM.

Inputs and outputs. Supervised adaptation uses image/prompt contexts and target responses, with the source of every label and rationale recorded. It returns an adapted checkpoint. The following loss expects logits B x L x V and target IDs B x L, where V is vocabulary size and unsupervised positions have value —100.

Choose the learning stage. Supervised adaptation predicts declared target tokens, with the mean loss taken over unmasked next-token targets.[317] LoRA restricts which parameters receive updates; it is not a different target or loss.[313] Reward learning instead samples responses and uses relative rewards within each prompt’s group. The finite-response loss below is a complete teaching calculation, distinct from DeepSeekMath’s token-level GRPO and Infection-Reasoner’s displayed sequence-level objective. The latter used full-parameter supervised adaptation in its first stage.[40, 314] def masked_causal_loss(logits, targets):

Illustrations are not included in the reading sample

Declare whether all weights or selected LoRA factors are trained. For the latter, Equation (7.28) gives the factor shapes and count. The fragment supplies the supervised loss and GRPO arithmetic, not a complete rollout trainer. A full post-training implementation additionally needs a frozen reference, old-policy log probabilities, response masks, a declared ratio/KL estimator, optimizer updates, and checkpoint selection. Invalid parsed answers receive the documented reward; do not silently discard them.

Use a separate labeled fitting pool for class rewards and reserve validation patients for selection. Check that teacher predictions are not stored under the reference-label field, prompt tokens are masked, causal targets are shifted, old- policy statistics are detached, and all-equal reward groups remain finite. At infer-ence, only the resulting student and its declared inputs are required for the distilled route. Measure it with the same parser and class vocabulary used in the baselines. Rationale review remains separate from reward computation.

The helper shifts targets once: the logit at position t predicts the target at t + 1. Do not shift again if a selected model’s built-in loss already performs that alignment. Ignoring a prompt’s direct target does not remove its contextual influence on supervised answer tokens. Teacher outputs are supervision with recorded provenance, not independent clinical reference labels.

An executable low-rank layer. This layer exposes the parameters in Equation (7.28). The base weight is a buffer and never enters the optimizer; only the two factors are parameters. For the worked two-step example, overwrite the initialized first factor with (1,0), use rank one, scale one, and plain gradient descent. In an actual VLM, replace only the explicitly selected linear modules and preserve their bias policy. class LowRan.kLinear(nn.Module):

Illustrations are not included in the reading sample

The backslash at the end of the low-rank layer’s return line continues the same Python expression on the next line; it is not division. The merged update self.b @ self.a multiplies the two low-rank factors before adding them to the frozen base matrix.

A complete finite-response policy loss. The next function implements the ex-plicitly bounded example in Equation (7.34). Its logits enumerate every allowed response. The sampled indices can repeat, as real rollout samples can. Old and reference probabilities must cover the whole finite response set and be positive. A complete training step samples indices from the frozen old distribution, parses their answers for rewards, clears gradients, evaluates this loss, backpropagates, and updates current logits only.

Illustrations are not included in the reading sample

This is executable because the response space has only four members. For actual VLM training, decoding, response masks, old-policy token likelihoods, the selected token/sequence objective, reference likelihoods, and the stated estimator must replace finite enumeration. Those model-dependent operations remain pseudocode here. The book checks the toy gradient and a full optimizer step without claiming that a pretrained reasoning model was trained.

7.11.7 Recipe 7: output and cost evaluation

The final recipe collects outputs from any of the chapter’s wound-classification routes into one evaluation record. Missing inputs, invalid model answers, calibrated scores, and intentional deferral must remain distinguishable if their denominators are to be interpreted. The calculation below follows the coverage-and-risk definitions before adding the cost and explanation records needed for a complete comparison.

Inputs and outputs. Collect patient IDs, reference classes, predictions, optional scores, missing-input flags, invalid-output flags, rationales, and timings. Produce per-class metrics, uncertainty intervals, calibration summaries where available, coverage/error curves, rationale-review results, and cost tables. No parameters are fitted on the final test set.

Illustrations are not included in the reading sample

Fit any calibration parameter and rejection threshold on validation data, then freeze them. For confidence intervals, resample patients rather than individual photographs when repeated observations exist. Record performance separately for complete records, real missingness patterns, and prespecified external cohorts. Time preprocessing, retrieval, decoding, and optional reasoning calls separately after declaring warm-up and hardware conditions. Failure checks include undefined denominators, empty accepted sets, invalid responses counted as negative predictions, and rationale scores reported only on favorable selected cases.

Read the two denominators. For this helper, supply finite normalized class probabilities, one valid reference index per row, and a fixed threshold in [0,1]. Coverage divides accepted cases by all supplied cases; accepted-case risk divides accepted errors by accepted cases. A nonempty batch with no accepted cases returns (0, None); an empty dataset is rejected because even coverage has no denominator. In a VLM study, keep invalid outputs in the full prediction ledger and report their rate separately; this probability helper alone does not account for them. Count intentional abstentions separately from parser failures and review rationale claims even when the class is correct.

Calibration and the prediction ledger. Fit a positive temperature on validation logits, not on test predictions. One implementation parameterizes it as T = exp(t) and optimizes t with the validation negative log-likelihood in Equation (7.39). Keep model logits fixed during that fit. Temperature scaling changes confidence without changing the largest-logit class; its effectiveness on another population must still be measured.[44] Select a coverage or sensitivity operating point on validation patients, freeze both temperature and threshold, and apply them to the final ledger. A hard-label interface is evaluated without this calibration stage.

The eight-case worked ledger produces image-only accuracy 6/8, fused accuracy 5/8, and four accepted cases at confidence .75 before the illustrative temperature adjustment. Record per-case validity and absence separately: an unavailable metadata branch is an input condition, an invalid decoded label is an output failure, and abstention is a decision policy. Combining these into one generic missing flag makes the reported denominators impossible to interpret. Export the reference and prediction columns separately from any model rationale and its review result.

7.11.8 Three worked pathways

The recipes can now be assembled around three different wound-study questions. One asks whether recorded context improves a type classifier; another asks what retrieved examples contribute to infection classification; the third asks what changes through adaptation and rewards. The overview below identifies their shared preparation and evaluation steps before the separate walkthroughs follow each route.

Figure 7.29 assembles the recipes. The first pathway is the minimal multimodal experiment: paired records, image embeddings, encoded metadata, a fusion head, and a fixed class decision. Its principal evidence question is whether additional recorded variables improve over image-only and metadata-only controls.

Illustrations are not included in the reading sample

Figure 7.29. Three complete teaching pathways. Shared data preparation and evaluation surround different model computations. The middle pathway performs retrieval at inference; the bottom pathway uses teacher and reward information during training, then deploys the adapted student. Original synthesis of the seven recipes.

The second pathway freezes an image-text encoder, builds a patient-excluded support index, selects examples, and performs constrained-label VLM inference. Its key comparison is the VLM versus a vote on the identical supports, with context length and decoding cost recorded. It can be implemented without task-specific weight updates, but still requires labeled supports and pretrained models.

The third pathway first adapts a student using declared label/rationale targets, then optionally applies class-reward post-training. It deploys the student with a fixed output parser and a separately evaluated abstention policy. Compare label-only adaptation, distillation-only, reward-only, and combined stages. Teacher-model inference and rollout costs belong to the training account; model explanations require their own grounding review. These pathways specify study designs and tensor computations for a reader implementation.

7.11.9 Walkthrough A: PU/IAD classification

This walkthrough brings the earlier preparation and fusion steps together for one wound-type decision. The synthetic record P17/W2/V1, introduced in Section 7.1.2, denotes patient P17, wound W2, at visit V1: it contains a photograph, the anatomical site sacrum, a duration of six days, and one unavailable numerical field. Its classifier returns either pressure ulcer (PU) or incontinence-associated dermatitis (IAD) under the two-label teaching task; infection status is a separate question. Follow the same record from its stored observations to encoded inputs, a class prediction, and a matched evaluation.

Start with P17/W2/V1 and the fixed class order PU, IAD. Recipe 1 maps sacrum to the stored category code, standardizes six days to one, and emits finite fields plus masks. The frozen image encoder produces a pooled vector. For the numerical walkthrough its substitute is (1,0) and the metadata substitute is the encoded duration. The concatenated width is four including availability. Equation (7.5) gives the initial logits and Equation (7.6) gives the complete first update.

In a dataset implementation, repeat fitting steps over fitting patients and calculate validation macro-F1 with the saved class order. Fit image-only and metadata-only controls with the same permitted records. Select the head/fusion settings before opening the final test outcomes. Store preprocessing, masks, encoder identity, weights, and decision policy as one inference specification. For the same synthetic image with absent metadata, Recipe 2’s predictor receives the zero branch and mask zero; its .750260 PU score is recorded as a missing-input result, not compared with an invented clinical diagnosis.

Replacing concatenation with gating or attention changes the fusion module and its trainable parameters. Preserve the input information and image encoder. Attention requires field tokens and image tokens as specified in Table 7.2; feeding pooled features to one method and spatial features to another changes more than the fusion rule. This pathway finishes with a class prediction and a matched evaluation, not with a diagram of two connected encoders.

7.11.10 Walkthrough B: infection retrieval

The second walkthrough follows infection query Q1 into a neighborhood of permitted labeled wound examples. It separates learning an image-caption representation from selecting supports and from asking a VLM to use those supports. This distinction lets the resulting study test retrieval and classification without attributing a context-selection change to the language model itself.

Begin with Q1 and a support manifest restricted to permitted development patients. Choose one representation route before index construction: frozen con-trastive embeddings, or a separately trained image-caption fusion representation. In the latter route, train triplet loss on fitting-only triplets, then freeze the encoder and compute every support embedding. A SCARWID-style five-neighbor decision uses its distance and vote convention; the MMR/context route is a separate study design.

For the complete MMR fixture, Recipe 4 selects A, D, B using the fixed unit embeddings and A = .7. The matched vote predicts infection. Recipe 5 assembles those same support labels and images before Q1, applies a fixed allowed vocabulary, and either scores complete answer candidates or parses decoded output. The candidate-likelihood fixture returns .6 for infection; it is a numerical illustration separate from an actual VLM response to the support images. No VLM result is claimed for the synthetic MMR context.

For a real study, store support IDs, checkpoint, processor, prompt, truncation status, output, and elapsed time. Compare zero-shot, nearest-context, MMR- context, and matched-support voting using unchanged test patients. The query reference enters Recipe 7 only after inference. If the interface rejects a prompt or returns an invalid label, retain that failure in the output ledger instead of silently retrying until a favorable answer appears.

7.11.11 Walkthrough C: adaptation and reward learning

The third pathway changes student weights before the wound query reaches deployment. It connects target provenance and causal alignment to supervised adaptation, then adds the optional class-reward stage with its own labeled fitting pool. Following training resources separately from inference inputs explains what the deployed student requires and which comparisons can test the benefit of each stage.

Separate an unlabeled teacher-supervision pool from the reference-labeled re-ward pool and the held-out evaluation patients. Store teacher answer and rationale under their own fields. Serialize the permitted training targets, apply the causal alignment in Table 7.3, and optimize the declared masked loss. In the low-rank teaching alternative, Recipe 6 updates only its factors; the documented Infection- Reasoner first stage instead uses full-parameter adaptation. Neither choice is inferred from the other.

Initialize the reward stage from the selected supervised checkpoint. Freeze a reference copy, snapshot the old sampling policy, sample a response group, parse each answer, and compute class-match rewards. The finite four-response fixture specifies the whole computation: reward normalization, sequence ratios, clipping, exact KL, minimized loss, and one step produce the probability vector shown in Figure 7.24. A real language-model implementation must explicitly supply the token/sequence variant and KL approximation; this toy trainer does not stand in for those missing source details.

Deploy the resulting student with its stored template and decoding settings. Teacher, reward reference labels, old policy, and reference policy are training re-sources, not inference inputs. Evaluate the parsed class against the wound reference and review rationale claims separately. Compare label-only adaptation, rationaleplus-label adaptation, reward-only, and the combined stages while accounting for teacher and rollout costs. The eight-case evaluation fixture shows why a headline complete-case gain is insufficient. Each stage ends in a checkable computation or a declared model-dependent call.

7.12 Chapter review

The chapter has followed a wound decision from its available observations to a model output and an evaluation record. This review first connects that route to a choice of classification approach, then provides separate exercise questions and worked solutions, followed by research questions and a summary. Use the comparison to choose a justified next experiment and the exercises to check its underlying computations. The goal is to explain why a component belongs in the wound pathway as well as how it operates.

The running examples give this review two anchors. P17/W2/V1 follows a photograph, sacral site, six-day duration, and one missing field into a PU/IAD decision; the two output labels restrict the teaching task even though the conditions can coexist clinically. Q1 follows a separate infection question through representations, support selection, candidate scoring, and explicitly identified training calculations. As explained in Section 7.1.2, a shared identifier does not make vectors from different teaching encoders interchangeable or turn any synthetic value into a patient observation.

7.12.1 Choosing a classification approach

Choosing a method begins with the wound target and the information that can actually be collected at assessment. The comparison below therefore organizes approaches by their role, requirements, and the question each added component should answer. Use it to select a testable next step rather than to infer a universal accuracy ranking from model complexity.

Table 7.7 summarizes mechanisms and requirements. Potential advantages describe what a method can test, not a universal ordering of accuracy. The studyspecific numerical evidence remains in Table 7.6. Several rows can be combined, but every addition changes the information or computation that the comparison must account for.

Table 7.7. Wound-focused comparison of multimodal and reasoning approaches.

Illustrations are not included in the reading sample

Illustrative choice. Suppose a wound service has photographs, reliably recorded anatomical sites, and few infection labels. Start with image-only and imagesite baselines, then assess a frozen retrieval method using only permitted support patients. A reasoning model becomes a justified next experiment when the team can audit teacher targets, fund adaptation or repeated decoding, and independently review explanations. The choice depends on available information and verifiable outcomes; a newer model name alone does not resolve missing labels, source bias, or external validity.

7.12.2 Review exercises

Attempt all 24 questions before consulting the worked solutions in Section 7.12.3. The questions revisit the chapter’s inputs, fusion operations, language interfaces, and evaluation boundaries; the solutions use the same numbering.

1. Missing fields. A numerical field has training mean 10 and standard deviation 2. Encode an observed value 14 and a missing value.
2. Concatenation width. Let dT = 512, dM = 32, and include one whole-modality indicator. How many features enter the head, and how many weights and biases does a four-class linear head contain?
3. Late fusion. Fuse infection scores 0.8 and 0.3 with weights 0.7 and 0.3. Then remove metadata. Use probability averaging, renormalizing over available branches. What are the complete-input and image-only scores?
4. Attention shapes. Use 16 image queries, five metadata keys, dfc = 8, and d(, = 12. Give the score, attention-weight, and output shapes. What output-projection shape is needed for a residual of width 32?
5. Single-key attention. With image regions as queries and one metadata key, can the attention update select different metadata content for different regions?
6. MMR. At A = .7, compare relevance/redundancy pairs (.9, .95) and (.8, .3). Which candidate is selected by the stated MMR rule?
7. LoRA count. Adapt a 768 x 768 matrix at rank four. How many trainable factor parameters are added, and are the base weights still stored?
8. Reward group. All four sampled answers receive reward 1. What are the centered rewards and stabilized advantages? Can the regularization term still contribute an update?
9. Sequence scores. Two allowed one-token labels have probabilities .2 and .3, with remaining mass on other tokens. Normalize over the two candidates. Does this establish a calibrated clinical probability?
10. Reference leakage. A model-written training caption uses a known label. Can the test captioner receive it?
11. Correct class, wrong rationale. An infection-positive case is classified cor-rectly but its rationale invents a test result. How should classification correctness and explanation support be recorded separately?
12. Empty coverage. A rejection threshold accepts no cases. How should coverage and accepted-case risk be reported?
13. Head update. Explain why the first row of the PU/IAD head increases on active features in the fitting example.
14. Gate gradient. Set /// = //.v with available metadata. What is the gate-path gradient, and can the class head still learn?
15. Attention to class. Remove both metadata keys in the full numerical attention example. What pooled representation and class probabilities remain under the declared bypass?
16. Triplet step. For (0,0), (1,0), (.5,0), calculate the anchor gradient. The vectors are the anchor, positive, and negative, respectively, under the squared- distance triplet objective.
17. First LoRA step. For AIT = BA, initialize A nonzero and B = 0 as in the worked example. Why does A initially have zero gradient?
18. Candidate lengths. Compare products .24 and .36 for lengths three and two. Which wins under complete-sequence likelihood, and which wins under mean log-probability per token?
19. Masked context. Can an unsupervised prompt embedding receive a gradient?
20. Clipping granularity. Two token ratios are both 1.1. Use a positive fixed advantage and clipping interval [0.8,1.2] for both token-level and sequencelevel surrogates. Does sequence-level clipping activate, and do the individual token ratios activate their own clipping?
21. Regularized loss. Combine surrogate —.16, KL .090898, and fl = .5. State both the maximized objective and the minimized loss.
22. Missing-input population. Compare the two systems in Table 7.5. Contrast complete-record accuracy with accuracy over all eight records.
23. Solver repair. A model-proposed premise can be removed to make a set satisfiable, but no evidence justifies the removal. What should the bounded teaching procedure return?
24. Retrieval attribution. A VLM uses A,D,B and is compared only with a vote on A,B,C. Which changes are confounded, and which matched comparison is missing?

7.12.3 Worked solutions

These solutions correspond to Questions 1-24 in Section 7.12.2. Their numerical values are teaching calculations, and their interpretation retains the distinction between a worked operation and evidence of wound-model performance.

1. Missing fields. The observed pair is standardized value 2 with mask 1; the missing pair is value 0 with mask 0. A genuine observed value 10 has value 0 with mask 1.
2. Concatenation width. The head receives 545 features; a four-class linear head has 4(545) + 4 = 2184 parameters including biases.
3. Late fusion. The complete score is 0.65; renormalization gives 0.8 with image only.
4. Attention shapes. Scores and weights are 16 x 5; output is 16 x 12. A residual into width 32 needs a 12 x 32 output projection.
5. Single-key attention. No. Softmax over the single metadata key equals 1 for every query, so every query receives the same value vector before the residual connection. There is no competition among metadata keys; query-dependent key selection requires more than one usable key.
6. MMR. Scores are .345 and .470; the second candidate is selected despite its lower query similarity.
7. LoRA count. 4(768 + 768) = 6144 factor parameters, excluding biases; the 589,824 base weights are still stored.
8. Reward group. Centered rewards and stabilized advantages are zero. The class-reward surrogate supplies no within-group preference; a regularization term may still contribute.
9. Sequence scores. Candidate-set normalization gives .4 and .6. It is not evi-dence that the second class has calibrated 60% clinical probability.
10. Reference leakage. No. Training supervision and test-time inputs are different; the held-out query label remains outside the inference path.
11. Correct class, wrong rationale. It is a true positive for classification and an unsupported-claim failure for explanation evaluation.
12. Empty coverage. Coverage is zero and accepted-case risk is undefined. Reporting zero error would misrepresent a system that made no accepted decisions.
13. Head update. p — ey = (—.5, .5); subtracting the first negative gradient raises PU logits along A The updated same-record loss is .554355. This checks fitting, not generalization.
14. Gate gradient. Equation (7.9) is zero because the branch difference is zero. The class head can still learn, but changing the mixture cannot change this representation.
15. Attention to class. Bypass attention, mean-pool I2 to (.5, .5), and obtain equal class probabilities. Applying softmax to two negative infinities is not the fallback.
16. Triplet step. 2(en — ep) = (—1,0). All three independent-vector updates at step size .1 lower the toy loss from 1.75 to 1.24; a shared encoder instead receives their combined parameter gradient.
17. First LoRA step. Its gradient contains the zero-initialized second factor. The second factor can update because the first is nonzero; the following step can update both.
18. Candidate lengths. Sequence scoring selects .36; average log-probabilities are approximately —.476 and —.511, reversing the ranking. Declare which rule is used.
19. Masked context. Yes, through its effect on later supervised predictions. Its own masked direct target loss is zero; that does not remove contextual computation.
20. Clipping granularity. The sequence ratio is 1.1[2] = 1.21, so the positive-advantage sequence surrogate selects the clipped ratio 1.2. Neither token ratio is individually clipped. For a negative advantage the minimum can instead select the unclipped upper-tail ratio; the sign matters.
21. Regularized loss. Maximized objective is —.205449; the minimized loss is .205449. Reversing the loss sign would optimize the wrong direction.
22. Missing-input population. Fusion improves complete-case accuracy from 3/4 to 4/4 but reduces overall accuracy from 6/8 to 5/8. The population and denominator explain the apparent contradiction.
23. Solver repair. Return unresolved under the bounded teaching procedure. Satisfiability does not authorize an evidence change.
24. Retrieval attribution. Support selection and decision mechanism both changed. Add a vote on A,D,B to isolate the VLM contribution.

7.12.4 Research questions

The worked calculations settle arithmetic questions, while the clinical usefulness of an added component remains an empirical question. The prompts below turn the chapter’s information, learning, and evaluation choices into research questions with identifiable controls. Each needs a specified wound endpoint and reference standard before a new study can answer it.

Which additional variables remain useful after patient-independent and externalsite testing? Can retrieval support improve a VLM beyond a matched embeddingspace vote when context and compute are controlled? Does rationale supervision improve classification after teacher errors and label access are held fixed? Which missing-input patterns cause selective rejection to disadvantage a class or patient group? Can a bounded consistency checker detect consequential contradictions without introducing unsupported clinical premises? Each question requires a defined wound endpoint, appropriate reference standard, and controls that isolate the proposed contribution.

7.12.5 Chapter summary

The chapter’s central pathway begins with a wound question and the information

available when that question must be answered. Paired records, patient-level

partitions, units, and missingness indicators determine whether combining inputs is

meaningful. Encoded observations then reach a class decision through the fusion rules in Equations (7.3)-(7.10); the token walkthrough carries attention all the way to that decision.

Vision-language models support class-description matching, decoded labels, and retrieval-based contexts. The head, triplet, and low-rank examples connect losses to parameter updates. Policy optimization, distillation, and symbolic checks add mechanisms, but none makes a model explanation an independent reference standard. Figure 7.27 therefore separates classification correctness from rationale quality.

The preparation and evaluation steps remain part of each pathway. Distinguish an absent field from an absent modality, preserve pairing during augmentation, and sample registered sensor values only where coverage is valid. MMR changes which support cases enter a prompt; in-context learning uses those cases without updating weights, whereas LoRA changes selected low-rank factors. A symbolic check tests the compatibility of supplied premises, while calibration and abstention govern score interpretation and acceptance. These mechanisms require different controls: a matched-support vote, declared trainable parameters, grounded-premise review, or coverage alongside whole-population error, as appropriate.

Recent wound studies provide useful implementations and published examples, while small cohorts, differing labels, incomplete specifications, and limited external testing constrain their conclusions. The seven recipes assemble these ideas into reproducible experiments without implying new clinical validation. Chapter 8 turns this foundation into a hands-on workflow: preparing data, fitting baselines, selecting a complete inference policy, testing it, and interpreting failures before advancing to multimodal or reasoning experiments.

Chapter 8

Hands-on Wound Classification

8.1 From models to experiments

Chapters 7 and the preceding chapters explain why a representation, loss, fusion rule, or reasoning procedure might help wound classification. Here the student must make those components operate together. The outcome is a saved predictor, a defensible test report, and enough evidence for another reader to reproduce the decisions. The principal task is four-class wound-type classification. Infection classification is a separate extension with different labels and reference standards; a surgical wound is not necessarily an infected wound.

This chapter develops dataset preparation, feature-based classification, neural training, tuning, testing, individual-image inference and binary segmentation through worked examples, selected Python listings and pseudocode. The short listings explain individual computations; Section 8.13 supplies the complete, selfcontained core and mask programs inside the book. The advanced experiment outlines specify model-dependent steps for the capstone. Advanced pathways additionally require an appropriate model, processor and authorized data. Neither a code listing nor a successful tensor test is evidence of clinical performance.

8.1.1 Pipeline walkthrough progression

Work through three passes. First assemble and execute the complete in-book classifier in Subsections 8.13.1-8.13.2, following Sections 8.3-8.8 for its data, fitting and reporting decisions. Check the resulting artifacts against the specified protocol. Next change one development decision, such as image resolution, using only training and tuning data. Finally design an independent capstone with a new, appropriately separated test cohort. Once you have examined a test set’s outcomes, repeated optimization against them cannot constitute a fresh blinded evaluation.

Choose a practical route. The required core route is four-class AZH classifica-tion: prepare the manifest, inspect one batch, run the feature and CNN baselines, freeze selection, and produce the test ledger. Its stopping point is a verified reload plus a report explaining the failures. The optional mask route requires only the core’s tensor and training knowledge and ends with synthetic mask scores and coordinate checks; it establishes no crop-classification benefit. The advanced route chooses one recipe from Sections 8.10-8.12; it additionally requires the stated paired data, a pinned model/processor and a declared compute budget. Its deliverable is either an executed controlled study or an explicitly unexecuted adapter plan. Students need not complete every extension. The operator guide below and dataset catalogue are references to consult as needed rather than additional programming assignments.

By the end, the student should be able to explain every field in a prediction record, detect leakage, verify a weight update, select a checkpoint without con-sulting test outcomes, distinguish calibration from discrimination, and interpret failures. Figure 8.1 locates these responsibilities. Its one-way testing branch is an experimental rule rather than a software permission mechanism: a local script cannot prevent its owner from reading a file.

The distinction follows the book’s evaluation roadmap and CLAIM’s reporting terminology: specify training, model-selection or tuning data, and internal or external testing instead of leaving “validation” ambiguous.[20] In this chapter, validation means the tuning stage unless explicitly qualified.

Illustrations are not included in the reading sample

Figure 8.1. The chapter’s experiment lifecycle. Training updates model parameters; tuning selects a configuration; testing evaluates the frozen predictor. Reference labels enter the loss or evaluator, not the deployed predictor. Original instructional diagram.

8.1.2 Notation and evidence status

Table 8.1 connects the mathematics to saved objects. Earlier chapters define crossentropy, confusion matrices, sensitivity, specificity, Dice, attention, and low-rank adaptation; this chapter concentrates on their execution and interpretation.

Table 8.1. Local notation and implementation objects.

Illustrations are not included in the reading sample

Reading operators in the code. The listings use Python/PyTorch notation. This guide also applies to the tensor snippets in Chapter 7. Shapes and the selected axis determine an operation’s meaning; another Python object type can interpret the same symbol differently.

Illustrations are not included in the reading sample

This chapter provides implementation recipes, explicitly synthetic worked examples, and proposed extensions. Published study findings retain their citations. Compute and report results only after executing a declared experiment on the appropriate authorized inputs; the recipes and conceptual examples do not supply a new empirical evaluation.

8.2 Dataset selection

Dataset names, image counts, annotation types, and access conditions require independent checking. Table 8.2 provides a source-specific guide. A binary wound mask identifies pixels, not wound etiology, infection, or severity. A collection containing only ulcer images cannot supply a negative infection class merely because some masks are small.

Table 8.2. Dataset guide. Counts are attributed to the stated sources and do not describe interchangeable cohorts. Confirm the version and access conditions for your experiment.

Illustrations are not included in the reading sample

8.2.1 Dataset cards and leaderboards

Dataset links and access. Use these source pages with Table 8.2. A publication DOI supplies study and access information; it is not a promise of a public dataset download. Access can change. Confirm the current release, annotation scope and terms, and record the exact version used in your experiment.

AZH classification. Author repository: https://github.com/uwm-bigdata/wound-classification-using-images-and-locations. Its dataset directory contains training/test archives; use the pinned dataset revision identified in this chapter when implementing the specified recipe. This supports the four wound-type labels and body-map context, but missing patient identifiers still limit independence claims.[263]

AZH segmentation. Original study and data-availability route: https://do i.org/10.1038/s41598-020-78799-w. Consult its access conditions for the 1,109-image segmentation cohort. The classification archives must not be assumed to contain this cohort or its masks.[35]

FUSeg. Organizer/research-group repository: https://github.com/uwm-big data/wound-segmentation. Follow the organizers’ instructions in the Foot Ulcer Segmentation Challenge data directory. Match each image to its released mask; do not supply hidden test annotations from an unrelated compilation.[28, 262]

DFUC2022. Official segmentation challenge: https://dfu-challenge.g ithub.io/dfuc2022.html. Use its dataset-application link and challenge document. If the application destination is unavailable, consult the named or-ganizers on the official page for the current procedure. Reaching a challenge page does not establish dataset access; obtain authorization before planning a data-dependent exercise.[321]

DFUC2021. Official infection/ischaemia classification challenge: https://dfu-challenge.github.io/dfuc2021.html. Use the application route for this edition when it is available, or request current instructions from the organizers identified on the official page. Confirm access before planning a data-dependent exercise. Its patch labels and protocol differ from DFUC2022 masks and the AZH wound-type task.[264, 265]

WTS and STANDUP. Primary publication: https://doi.org/10.1007/s10278-025-01386-w. Use the corresponding-author/data-availability informa-tion to establish access to the specific images and annotation fields. Confirm access to the particular release before selecting either collection for an experi-ment.^?]

Medetec. Original stock-image collection: https://www.medetec.co.uk/files/medetec-image-databases.html. Use it to trace upstream photographs appearing in derived collections. Stock pictures are not automatically a harmonized challenge split or shared segmentation reference. Check the applicable use conditions.[261]

leoscode compilation. Uploader card: https://www.kaggle.com/datasets/leoscode/wound-segmentation-images. This secondary compilation mixes parent collections and additional masks. Check its version, upstream rights, annotation provenance and overlap; download availability does not validate labels.[322]

yasinpratomo collection. Uploader card: https://www.kaggle.com/datasets/yasinpratomo/wound-dataset. The unresolved class-count/category and provenance issues in Table 8.2 remain. Linking this card does not endorse label quality or grant commercial-photo reproduction rights.[323]

WILLIE benchmark. Author dataset card and code: https://huggingface.co/datasets/QianGroup/willie-benchmark and https://github.com/Qian-Group-HRI/Willie. Use task-specific manifests for classification, segmentation or localization. Read the mixed source terms; the code licence does not replace image-source licences. Follow the authors’ preparation instructions when automatic loading cannot reconcile the different manifest schemas.[26]

Incomplete dataset reporting. A generic Roboflow collection was mentioned without a unique owner/project, version, task, annotation export or licence. It is excluded from Table 8.2, the access choices above and the worked pipeline. Until those details can be established, it illustrates incomplete reporting rather than an identified dataset; neither a substitute URL nor a sample count can be justified.

For an initial capstone, choose one endpoint: AZH for the provided wound-type walkthrough, FUSeg/DFUC2022 for a separately designed mask experiment, or DFUC2021 for infection/ischaemia classification. Check upstream overlap, grouping and access conditions. Dataset access and commercial-book image reproduction are separate permissions. For each candidate record the endpoint, population, capture conditions, annotators, reference procedure, image transformations, patient/wound/visit identifiers, split unit, counts by class, version, access route, and rights. Write “not reported” where appropriate. Record the exact owner, release, and annotation scope. Table 8.2 and the access guide above state sourcespecific limitations. A missing project identity, annotation description or access route remains unresolved; a similarly named collection is not a substitute.

The leoscode card reports 374 Medetec, 1,210 FUSeg, and 1,176 WSNet images. It also describes additional uploader masks, including masks for FUSeg test images, and reserves 552 specialist-labeled FUSeg images for testing. Those choices define a new compilation protocol, not a continuation of the official challenge.[322] A model pretrained on that compilation cannot then claim an unseen FUSeg evaluation without tracing overlap.

Dataset access and permission to reproduce photographs in a commercial book are separate questions. Use the documented access routes to obtain authorized

inputs. When constructing a local input-to-output gallery, pair each permitted photograph with the output produced from that exact image. Published case panels in earlier chapters retain their source credits. A displayed prediction must remain paired with the actual input image used to produce it.

8.2.2 AZH teaching target

The author repository describes specialist labels, acquisition with an iPad and camera, and wound-region crops. It acknowledges that some patients contribute more than one image.[263] Therefore call these files published input crops, not raw camera frames. Fix the output order before training:

Illustrations are not included in the reading sample

These are release categories. The exercise predicts the supplied wound-type label; it does not diagnose diabetes from a photograph. Exclude normal and background files before counting the four-class cohort. Keep their exclusion explicit instead of reporting the larger archive size as the classification sample size.

Wound application. Anisuzzaman and colleagues defined wound-category ex-periments using clinical photographs paired with anatomical-location informa- tion.[14] Their application illustrates why a dataset must supply the inputs and labels required by the intended task. Sections 4.1 and 7.3 develop category definitions and paired wound records.

8.3 Manifests and data partitions

Before fitting either baseline, establish exactly which records enter each stage of the experiment. The subsections first identify the environment and saved artifacts, then describe duplicate detection and correction, and finally define training, tuning, and test roles. Together, these steps connect dataset provenance to the partition manifest that later training and evaluation will use.

8.3.1 Environment and artifacts

Use an isolated Python environment with compatible PyTorch, NumPy, and Pillow versions. Record the actual imported versions, decoder, and seeds for your implementation; deterministic CPU operations do not guarantee identical numbers across different hardware or library releases. The complete listings in Section 8.13.1 save the environment and preprocessing choices. The following pseudocode summarizes the experiment lifecycle; each operation is a step to implement using the methods and listings developed in this chapter: TRAIN, TUNE, TEST = audited_partitions initialize_model_and_optimizer() for epoch, in range(12):

update_weights(TRAIN)

loss = evaluate_without_updates(TUNE) retain_checkpoint_if_loss_improves(loss) model = restore_selected_checkpoint() temperature, threshold = select_policy(model, TUNE) freeze(model, temperature, threshold) predictions = infer(TEST.images, model, temperature, threshold) report = compare_with_references(predictions, TEST.labels)

Reading the experiment outline. The inputs are audited training, tuning and test partitions. The function names express pseudocode contracts: weight updates use training batches, whereas tuning evaluation leaves model state unchanged. Checkpoint retention uses the lowest tuning loss, choosing the earliest epoch in a tie. Policy selection fits the temperature and acceptance threshold on tuning data. Freezing those choices precedes inference on test images; reference labels enter only the final comparison. The outputs are fixed predictions and an evaluation report. The loop illustrates a 12-epoch development budget, not a guarantee of useful clinical performance.

The implementation recipe takes Train.zip and Test.zip from the author repository at revision e7dd90dell3dcbd39665f2bd0e5613adeffff5fa. The exact dataset directory is https://github.com/uwm-bigdata/wound-classification-using-images-and-locations/tree/e7dd90de113dcbd39665f2 bd0e5613adeffff5fa/dataset.[263] In your implementation, keep authorized source archives, prepared manifests, checkpoints and reports in clearly separated locations. Preserve earlier outputs instead of silently overwriting them. Aprediction ledger and a local gallery should identify the actual input used for each output. Single-image inference receives an image and the frozen model configuration; it does not receive a reference label.

Save a manifest row with a sample ID, relative image path, integer label, par-tition, decoded-pixel hash, file hash, and patient/wound/visit identifiers when documented. A filename prefix is not a verified patient identifier. The prepara-tion stage normalizes archive paths and ignores AppleDouble resource-fork files beginning with ._; counting them as JPEGs would inflate the dataset.

8.3.2 Duplicate detection and correction

Compare decoded RGB pixels and dimensions across the candidate partitions before fitting. If a training image duplicates a retained test image, exclude the training copy and record the reason. Keep all known same-patient or same-wound observations together where identifiers permit. A filename prefix is not evidence of patient identity.

After applying the declared exclusions, enumerate class counts in training, tuning, and testing. Choose the development split before training and save the exact sample membership. Counts and a seed alone do not determine a manifest: Section 8.13.1 specifies archive order, random-generator type, per-class shuffling, rounding, and CSV serialization. Hash the manifest you create and retain it with the configuration.

Exact hashing does not detect differently cropped photographs, nearby visits, or the same patient photographed from another angle. Document those limita-tions rather than interpreting the absence of exact duplicates as proof of patient independence.

For a new cohort, assign all records sharing a patient to one partition before augmentation, cropping, feature selection, or learned normalization. If several wounds or visits belong to that patient, keep them together. Report site and time separation when external testing is intended. This implements the independence concerns in CLAIM; it cannot retroactively establish missing provenance.[20]

8.3.3 Training, validation, and test roles

Training estimates weights and fitted preprocessing statistics. Tuning selects epochs, hyperparameters, thresholds, and calibration. Testing estimates the behavior of the resulting fixed system. A useful formal contract is

Illustrations are not included in the reading sample

The set A must be recorded. Tuning is itself a form of fitting; a large search can overfit a small tuning set. For small grouped cohorts, use grouped cross-validation within development data, fit every transformation inside each training fold, and reserve the outer test cohort. The core recipe specifies one split for an inspectable first exercise; a single split is not statistically sufficient for every research question.[324]

8.4 Image preprocessing and batching

The manifest identifies the source records; preprocessing now determines the arrays supplied to the model. We first follow the deterministic image-to-tensor transformation used at inference. We then distinguish training augmentation and the checks needed to preserve labels and spatial correspondence. This separation makes it possible to reproduce a prediction and inspect whether the intended image content reached the classifier.

8.4.1 Deterministic inference transforms

Decode the image, apply its orientation metadata, convert to RGB, use bilinear interpolation to preserve aspect ratio while resizing into a 64 x 64 square, add centered black padding, scale bytes to [0,1], and transpose height-width-channel order to channel-height-width. For batch size B, the network receives X G IRBx[3]x[64]x[64] and integer targets y G {0,1, 2, 3}B. The model outputs logits, so the

cross-entropy function receives neither one-hot targets nor a prematurely applied softmax.

The padding is part of the baseline specification and may itself carry source cues. It is not an anatomically meaningful background. A subsequent development experiment can compare padding and another justified crop policy, but it must hold the split and evaluation rule fixed. The low resolution makes this CPU exercise inexpensive and discards clinically relevant detail; it is not a recommended clinical acquisition resolution.

Figure 8.2 makes the geometry and target relationship explicit. A 120 x 80 synthetic rectangle becomes a 64 x 43 content region with padding; rounding is handled by Pillow. Its class ID remains unchanged. A mask, if available for another task, must receive the same spatial transform with nearest-neighbor interpolation.

Illustrations are not included in the reading sample

Figure 8.2. Image preprocessing and batch assembly. The colored rectangle is synthetic geometry, not a wound or a model prediction. RGB denotes red, green, and blue channels; integer class IDs remain separate from image pixels.

An input-to-output gallery should display the actual local crop and enlarged processed input beside the recorded prediction. Inspect whether borders, orientation, color channels, or resizing changed the relevant content. An enlargement shows the array supplied to the model; it does not restore information lost at 64 x 64.

8.4.2 Training augmentation and unit tests

The example applies a horizontal flip with probability .5 only during training.

Whether reflection preserves a label depends on the task: this four-class exercise does not use laterality metadata. An image-location system with explicit left/right information would need a consistent transformation or would disable the flip. Validation and testing use the same deterministic inference transform. The official PyTorch tutorial also separates stochastic training transforms from evaluation transforms.[325]

Before training, inspect one batch and assert finite floating-point pixels, the expected shape, and legal targets. Test the label mapping with a known manifest row. Reject an image-mask pair with unequal dimensions rather than resizing both independently and assuming alignment. In a segmentation loader, sample a random spatial transformation once and apply it to both image and mask. For intensity changes, alter the image only. A mismatch can produce a decreasing loss while teaching the wrong correspondence.

Checkpoint before proceeding. Deliver the manifest, class counts, duplicate report, split-unit statement, and a local batch gallery. Explain which preprocessing quantities were learned from training data. The baseline RGB scaling uses the fixed constant 255; the classical feature standardizer introduced next estimates its mean and standard deviation from training records only.

Wound application. Wang and colleagues resized wound inputs and augmented training photographs while developing their foot-ulcer segmenter.[35] These operations supported a published mask-prediction task; the checks above verify the book’s worked example separately. Section 5.5 develops the segmentation workflow; Section 5.10 discusses the lightweight wound segmenter.

8.5 Establishing baselines

With records and input transformations fixed, we can establish reference predictors for the experiment. The first subsection builds a complete nearest-neighbor baseline from explicit image descriptors; the second considers replacing those descriptors with a learned representation. Comparing these pathways introduces the distinction

between choosing a representation and fitting the final decision rule before we train the small CNN.

8.5.1 Feature-based nearest-neighbor baseline

Chapter 3’s nearest-neighbor classifier becomes a complete experiment once the feature transform, scaling, support set, distance, neighborhood size, and tie rule are fixed. The feature-baseline recipe extracts 12 features: the mean and population standard deviation of each RGB channel, followed by the mean absolute horizontal and vertical difference in each channel. These are crude appearance descriptors, not validated clinical measurements.

Illustrations are not included in the reading sample

For example, dR averages |^R)U)V+I — ^R,U,J over valid horizontal neighbor pairs. Standardize each coordinate with training-only mean ftr and standard deviation gtr, replacing a near-zero denominator by 10-[6]. Use population standard deviation across the training-image feature rows, and store both vectors with the support features. Compute all descriptors on the processed 64 x 64 RGB arrays, including black padding; do not switch to unprocessed crops for this baseline. The complete implementation appears in Section 8.13.1. This avoids allowing the distribution of test images to influence feature scaling.[324]

Calculate Euclidean distance to every training support, choose the k smallest distances, and count labels. Ties in distance follow the saved support ordering; ties in vote select the first class in Equation (8.1). Include tests for these conventions in your implementation. Search k G {1,3, 5, 9} using tuning macro-F1, with the first candidate winning an exact tie. Freeze the selected k before testing.

A synthetic query with neighbors D, V, D, P, V has votes (.4, .2,0, .4) and is assigned D by this rule. Those fractions describe the neighborhood, not necessarily calibrated clinical probabilities. If the true class receives zero votes, its mathematical negative log-likelihood is infinite. If a finite diagnostic uses a 10-[12] probability floor, state that convention rather than describing it as the exact unsmoothed likelihood.

Wound application. The small-VLM wound-classification preprint evaluated a similarity-weighted nearest-neighbor control alongside retrieval-assisted language models.[110] That control tested how much the retrieved labels alone could explain classification. Section 7.7 develops the comparison; the baseline above uses its own declared features and split.

8.5.2 Learned representations

A second baseline can replace /(x) by a frozen image encoder and retain the same nearest-neighbor or linear-head decision. Freeze the checkpoint identity, input processor, pooling layer, feature normalization, and support IDs. If an encoder was trained using this wound cohort, its training exposure must be reported. Freezing its weights during the final exercise does not erase that exposure.

To isolate the classifier head, extract training and tuning embeddings using evaluation mode and no gradient tracking. Fit only the head on training embeddings, select regularization on tuning embeddings, and compute test embeddings once selection is fixed. Keep the encoder in evaluation mode even when the head is trained; frozen parameters alone do not stop batch-normalization running statistics from changing. The distinction between a fixed feature extractor and fine-tuning follows the PyTorch transfer-learning example.[325]

Illustrations are not included in the reading sample

Reading the frozen-encoder code. The inputs are images and integer class la-bels; the intended trainable object is the head. The evalO call fixes encoder behaviour, while requires_grad_(False) disables parameter gradients. The torch.no_grad() context prevents a gradient graph for the batch-by-feature embedding h. The head maps h to one logit per class. Cross-entropy compares those logits with targets. Clearing gradients, backpropagating and stepping the head optimizer change only the head when the optimizer contains only head parameters. The output is an updated head, not evidence of clinical accuracy.

This is a generic interface sketch: an actual encoder may return spatial tokens or a structured object rather than a pooled tensor. Select and document the pooling operation instead of relying on an accidental tensor flattening. The small CNN described here has a directly usable 64-dimensional encoder; using that encoder after its training is a learned-feature extension, not independent pretraining evidence.

Wound application. The small-VLM wound-classification preprint compared head-only transfer and full fine-tuning of pretrained image encoders as supervised baselines.[110] These models supplied a comparison with retrieval-based classification. Sections 4.3 and 7.8 develop adaptation choices and their distinct training requirements.

8.6 Training a wound classifier

We now turn the prepared image batches into updates of a small wound classifier. The first subsection defines the architecture, dimensions, and loss; the next specifies optimization and the state retained in a checkpoint. Learning checks then examine whether the update and reload pathways operate as intended. This establishes the training procedure before a final checkpoint and inference policy are selected.

8.6.1 Architecture, dimensions, and objective

The reference network is intentionally small: three padded 3x3 convolutions with 16, 32, and 64 output channels; rectified linear units; 2x2 max-pooling after the first two convolutions; global average pooling; and a four-class linear head. Its 23,844 parameters are initialized randomly. The spatial sequence is 64 > 32 > 16, followed by pooling to one value per channel. It is a training exercise rather than a proposed state-of-the-art wound architecture.

For image i, the encoder produces h G R[64] and the head produces z^ = Whi + b, where W G R[4]x[64]. The training objective is

Illustrations are not included in the reading sample

Use the stable cross-entropy implementation on logits. Softmax is needed later for probabilities, not before this loss. For a synthetic single example with logits (0,0,0,0) and target D, the probabilities are all .25, the loss is log 4 = 1.386294, and the logit gradient is (—.75, .25, .25, .25). If h = (1,0,..., 0), the first column of the head receives that gradient; all other columns receive zero from this example. This local check connects the Chapter 4 backpropagation equations to an observable parameter update.

Illustrations are not included in the reading sample

Figure 8.3. Forward and update paths in the training example. The gradient path exists during training. Evaluation switches module behavior and disables gradient recording; the evaluator can still use held-out labels to calculate metrics. Original diagram.

The following listing shows the essential batch update. Define the model, optimizer and training batches using the preceding architecture and data specifications before applying it: model.trainO optimizer.zero_grad(set_to_none=True) logits = model(images) loss = cross_entropy(logits, labels) assert torch.isfinite(loss) loss.backwardO optimizer.stepO

Reading the batch-update code. The inputs are a training batch, targets, model and optimizer. The trainO call enables training behaviour; it does not calculate gradients. The zero_grad(set_to_none=True) call clears earlier gradients. The forward call returns logits, cross-entropy constructs a scalar loss, and the finite- value assertion rejects an invalid loss before updating. Backpropagation computes gradients by the chain rule; the optimizer step changes its registered parameters. This is one update: an outer loop supplies batches and epochs, and separate tuning selects the checkpoint. Deliberate gradient accumulation would require a different, explicitly weighted update schedule.

Zero gradients before each intended update; otherwise successive batches ac-cumulate gradients. If accumulation is intentional, divide or weight losses con-sistently, specify the effective batch size, and update after the declared number of microbatches. The reference implementation omits accumulation, mixed precision, a scheduler, and pretrained weights; add any such mechanism as an explicit development choice.

8.6.2 Optimization and checkpoint contents

The core recipe specifies AdamW, learning rate .003, weight decay .0001, batch size 32, 12 epochs, seed 812, and two CPU threads as initial implementation settings. All parameters are trainable. The last partial batch contributes proportionally to its number of images when calculating mean epoch loss; averaging batch means without their sizes would overweight a small final batch.

At each epoch, evaluate the tuning partition with deterministic preprocessing. Save the checkpoint with the lowest tuning cross-entropy, choosing the earliest epoch in a tie. The best.pt file contains weights, epoch, and configuration. The last.pt file additionally stores optimizer and Torch random-number state. This provides the essential state for an epoch-boundary continuation in this single-worker example; a general restart also requires every relevant random generator, sampler, scheduler, mixed-precision scaler, and distributed state. This epoch-boundary procedure does not establish mid-batch replay.

The saved configuration includes class order, image size, scaling, padding, augmentation, seed, optimizer settings, versions, parameter count, and manifest hash. An inference program must restore these decisions as well as weights. A checkpoint with four output units is not self-describing: permuting the class names can silently change every reported diagnosis without changing any tensor dimensions.

Wound application. Wang and colleagues used Adam for foot-ulcer segmen-tation; WILLIE used AdamW and early stopping for integrated wound analy- sis.[26, 35] These are study-specific training choices, not results of the book’s worked example. Sections 5.5 and 6.13 develop their spatial and Transformer-based settings.

8.6.3 Learning sanity checks

Before using real data, overfit a tiny batch and verify that the loss falls sharply. Check that intended parameters receive finite gradients and that frozen param-eters do not. Save and reload a model, then compare predictions on the same tensor. Evaluate a batch and confirm that model state did not change. The callable preflight in Section 8.13.5 performs these checks on two invented images before any wound-data fit. Run its setup session first and retain preflight.json. Passing that diagnostic establishes that the update path works, not that the model can distinguish all wound classes.

If a run produces NaNs, inspect pixels and logits before changing the opti-mizer. If the training loss cannot decrease on a tiny batch, inspect label alignment, loss arguments, gradient flow, and update calls. If tiny-batch learning works but full-cohort performance remains weak, examine resolution, class imbalance, augmentation, initialization, and the information available in the images. A weak result should not automatically be blamed on a coding error.

8.7 Validation and inference selection

Training produces candidate model states; the experiment still needs a rule for selecting the predictor used at test time. We first select and freeze the checkpoint and policy, then examine probability calibration and rejection. The final subsection explains the limits of reusing one tuning set for several choices. These decisions must be complete before interpreting the held-out test results.

8.7.1 Checkpoint and policy selection

The reference selection file freezes the checkpoint hash, manifest hash, nearest-neighbor artifact hash, temperature, and rejection threshold. Before testing, verify those artifact hashes and refuse changed configurations or an existing test report. These guards make accidental changes visible; they are not a substitute for a predeclared experimental protocol.

Cross-entropy assesses probabilities assigned to reference labels, whereas macro-F1 assesses hard decisions with equal class weighting. The checkpoint preferred by one criterion need not be preferred by the other. For a capstone prioritizing balanced wound-type recognition, predeclare macro-F1 or a task-justified cost criterion and select accordingly. Do not change the declared selection criterion after inspecting which choice makes the test result look favorable.

8.7.2 Temperature calibration and rejection

Chapter 2 introduced calibration; here it becomes a saved inference operation. For fixed selected logits, temperature scaling produces

Illustrations are not included in the reading sample

The finite grid is an instructional implementation of temperature selection, not the continuous optimizer used in every calibration study. Positive temperature preserves the ranking of logits and therefore cannot repair this model’s wrong argmax labels.[44] Save the temperature selected using tuning data before evaluating the test set.

Define acceptance by u = 1[maxcpc(xJ > r]. For N > 0 tuning cases, admit a threshold only if its accepted count is at least [N/2], equivalently 2^ u > N. Search r G {0, .4, .6, .8, .9} for the highest accepted accuracy among these policies, breaking ties toward the smaller threshold. With N = 109, at least 55 cases must be accepted; 54 cases are insufficient. The candidate r = 0 accepts every case; if selected, it provides no rejection. In a selective experiment, report coverage by class as well as overall: a half-coverage constraint alone can reject every case of a minority class. Rejection returns an explicit abstention under the saved output contract; a retained highest-scoring class remains an audit candidate rather than an accepted decision. Keep the threshold fixed during testing.

On a synthetic four-case ledger, suppose confidence values are (.90, .80, .55, .40) and correctness indicators are (1,0,1,0). At r = .6, coverage is 2/4 and accepted accuracy is 1/2. At r = .95, coverage is zero and accepted accuracy is undefined, not 100%. Specify how rejected cases are handled and report their class distribution. A high accepted accuracy with very low or unequal coverage can be misleading.

Wound application. The TransUNet-GradCAM study examined calibration and uncertainty for foot-ulcer segmentation.[43] This supplies a wound application of probability evaluation, rather than evidence for the exact temperature grid or rejection policy above. Sections 2.5.8 and 5.14 develop the corresponding evaluation concepts.

8.7.3 Limits of a single tuning set

The core recipe assigns epoch, calibration, neighbor-count, and threshold selection to the tuning partition. Reusing the same partition for several choices can make the selected tuning estimates optimistic. A stronger experiment can reserve a separate calibration subset or use nested grouped cross-validation, always fitting transformations inside the relevant training fold. Describe the tradeoff: additional partitions reduce the number of examples available to each fit. There is no universally correct 80:20 ratio independent of cohort size, grouping, and endpoint.

For transfer learning, add a development-only comparison between a frozen encoder and fine-tuning. Give the encoder a declared learning rate, retain or change normalization intentionally, and monitor both trainable parameter count and memory. For imbalanced targets, compare unweighted loss, class-weighted loss, or sampling as separate choices. Do not simultaneously oversample and apply inverse-frequency weights without explaining the compounded change to the effective objective. Keep all such decisions out of the final test loop.

The expanded comparison in Section 4.3 also includes partial adaptation and labelled-patient learning curves. Section 4.5 explains how supervised and self-supervised initializations can be compared without admitting evaluation patients into pretraining. Keep these initialization and adaptation choices explicit when extending the practical baseline.

8.8 Testing and error analysis

With the checkpoint and decision policy frozen, we can examine the predictions on the held-out records. The following subsections construct a prediction ledger, interpret test outputs, assess uncertainty and paired comparisons, and inspect individual inputs and outputs. This sequence connects aggregate scores back to the saved decisions and failure cases that produced them.

8.8.1 Prediction ledger

Testing loads the selected checkpoint and its preprocessing contract, switches to evaluation mode, and executes inference without gradient recording. It writes one row per test image: sample ID, reference class, predicted class, acceptance flag, and four probabilities in the fixed class order. Reference labels are used by the evaluator after prediction; the deployed infer function never receives them.

model.evalO

with. torch.inference_mode(): logits = model(images) probabilities = (logits / temperature).softmax(l) prediction = probabilities.argmax(l) accepted = probabilities.max(l).values >= threshold

Reading the inference code. The inputs are a fixed model, images, and a tem-perature and threshold selected on tuning data. Evaluation mode controls module behaviour; the inference context disables gradient recording and related overhead. Division by a positive temperature rescales logits. The softmax(l) call normalizes across classes. The argmax(l) call returns the winning class index; max(l).values >= threshold compares each largest probability with the acceptance cutoff and returns a Boolean mask. The outputs are probability vectors, class indices and acceptance flags. References enter later metric calculations, never this prediction path.

Store failed decodes, invalid outputs, timeouts, and rejected cases explicitly in a general system. Do not silently remove difficult cases from the denominator. Check that each selected file decodes and each classifier returns a valid four-component vector; retain failures in the report. A generative classifier needs the stricter parsing protocol in Section 8.10.

8.8.2 Interpreting test outputs

Construct a confusion matrix from your held-out prediction ledger, with reference classes in rows and predictions in columns, using Equation (8.1). The diagonal sum gives the accuracy numerator. Report class counts, recall, precision, and macro-Fl alongside accuracy so that concentration on one common class is visible. Compare the feature baseline and CNN under the same partition and decision rules; a result from one small network does not establish a general ranking of classical and neural methods.

Report the class-summed Brier score and negative log-likelihood under their declared conventions. Probability quality and hard-decision quality answer different questions, so their rankings can disagree. Zero-vote reference classes give infinite unsmoothed negative log-likelihood; label a probability-floor diagnostic explicitly.

Section 4.10.2 explains why high overall accuracy can coexist with zero recall for a rare finding. Use the class counts of your own cohort instead of transferring a synthetic example’s prevalence to it. Section 4.10 connects error counts to confidence, explanations, and controlled failure investigation.

If training and tuning diagnostics indicate collapsed predictions, inspect resolution, capacity, class weighting, and initialization within the development protocol. Once test outcomes have been examined, further modeling choices require a new holdout or a clearly reported repeated-development study. Preserve the earlier result and explain the test exposure.

8.8.3 Uncertainty and paired comparisons

To estimate sampling uncertainty, resample held-out evaluation units with replacement, recompute the metric for each draw, and report the percentile convention and random seed. The complete implementation in Section 8.13.1 uses 2,000 image-level resamples and the .025/.975 quantiles with NumPy’s default linear interpolation as a recipe. An image bootstrap is conditional on the evaluated image collection; unknown within-patient correlation prevents interpreting its interval as a patient-level interval. When patient IDs exist, resample patients and include all their records. For a paired model comparison, use the same resampled units for both models and calculate their metric difference within each draw.

Report performance by class and by documented site, device, or subgroup when support is sufficient. An absent class has undefined recall. Return a missing value rather than manufacturing zero or one when a metric denominator is empty. Metrics Reloaded motivates choosing metrics according to the task and its failure costs; segmentation overlap, classification discrimination, calibration, and clinical benefit remain separate endpoints.[21]

Wound application. The TransUNet-GradCAM study reported variation across repeated training seeds when evaluating foot-ulcer segmentation.[43] This addresses training variability alongside mask accuracy; it differs from resampling a fixed prediction ledger. Sections 2.5.10 and 5.16 develop those uncertainty sources and the wound study.

8.8.4 Inspecting inputs and outputs

After testing, construct a gallery that displays the published input crop, the exact processed 64x64 array enlarged for viewing, the saved prediction, and a separately labeled reference. For the illustrative selection rule, take the first three correct cases and first three errors in manifest order, making the choice explicit. The gallery is for qualitative diagnosis, not an estimate of prevalence or performance.

Figure 8.4 illustrates the fields to include in an input-to-output gallery without redistributing dataset photographs. In your implementation, pair the source crop and transformed input from the same sample with the prediction produced by your saved model; join the reference by sample ID afterward. The diagram’s hypothetical scores (.10, .15, .05, .70) predict V; an illustrative S reference places the case in row S, column V of a confusion matrix. This synthetic vector is not assigned to a photograph.

Illustrations are not included in the reading sample

Figure 8.4. Reading a local input-to-output case. Boxes specify the gallery fields; no clinical photograph is substituted. The illustrative probability vector and S reference are synthetic. The reference enters only the evaluation branch.

Inspect false predictions for acquisition artifacts, insufficient resolution, ambiguous labels, and missing context. Do not decide that an error is a mislabeled image merely because the model sounds convincing. Reference revision requires the documented annotation process and a recorded adjudication, not model agreement alone.

Wound application. Birkner and colleagues used Grad-CAM to examine a classifier separating pyoderma gangrenosum from venous ulcers.[181] This is a published wound use of visual attribution, alongside prediction evaluation. Sections 4.10 and 7.10 develop interpretation and the distinction between attribution and clinical explanation.

8.9 Segmentation-assisted classification

The classifier above processes its declared image input directly. We now examine a separate pathway in which a predicted mask defines a crop before classification. The subsections first explain a mask-prediction example, then convert masks to image regions, and finally specify a matched classification experiment. Keep the synthetic segmentation checks distinct from the real-cohort evidence that such a combined pipeline would require.

8.9.1 Mask-prediction walkthrough

The complete code in Section 8.13.3 defines the binary segmentation example and its synthetic generator. It uses a small encoder-decoder with a skip connection, binary mask loading, paired augmentation, training, tuning-based checkpoint and threshold selection, and testing. Its manifest requires sample ID, image path, mask path, partition, and patient ID when known. A mask uses values 0 and 1 or 0 and 255; tissue-index maps require a different multiclass loader and loss. Reject unexpected intermediate grayscale values instead of interpreting them as additional tissue classes.

Construct independent synthetic rectangle image-mask pairs to exercise the pipeline. The following pseudocode shows the data flow:

Illustrations are not included in the reading sample

Reading the segmentation outline. Independently sampled training, tuning and test examples pair each geometric image with its known rectangle mask. The function names describe operations to implement: update parameters on training pairs, retain a checkpoint using tuning loss, and choose the mask threshold on tuning pairs. After the model and threshold are frozen, only test images enter prediction; test masks enter the overlap evaluator. Expected outputs are selected parameters, binary prediction masks and a test report. This verifies the pipeline logic on synthetic geometry. A clinical extension needs its own authorized image-mask manifest, grouping information and held-out evaluation partitions.

Construct the training, tuning, and testing rectangle pairs independently, retaining the sampling settings for each partition. These geometric examples exercise the mask pipeline; they are not simulated patients or evidence of wound-segmentation accuracy. A clinical extension requires a locally prepared, authorized image-mask manifest. FUSeg’s data-access route can support planning a separate exercise, but declare the available annotations and an independent test subset without assuming access to organizer-held test masks.[262]

The model returns Z G ^Bxix64x64. A pixelwise binary cross-entropy trains the mask predictor; a threshold selected on tuning masks converts sigmoid outputs to M. The code evaluates image-averaged Dice and intersection over union. Its explicit both-empty convention assigns one when both masks are empty and separately reports the number of empty references. Other conventions are possible; changing them changes the reported metric.

8.9.2 From masks to crops

For nonempty M, take the minimum and maximum foreground coordinates, expand by a fixed margin, clamp to image boundaries, and crop. If the mask is empty, use a declared fallback; the declared fallback in this example is the full image. A reference mask is available for evaluation but cannot replace the predicted mask in a deployable inference path. Figure 8.5 makes this boundary visible.

Illustrations are not included in the reading sample

Figure 8.5. Segmentation-assisted classification and its oracle control. The deployment branch uses a predicted mask and an explicit empty-mask fallback. A reference-mask crop is a separately labeled oracle experiment. Original diagram; it reports no classification gain.

For a synthetic 8x8 mask whose positive rows are 2-3 and columns 3-4 under zero-based indexing, the no-margin crop box is (3,2, 5,4) in Pillow’s left, upper, right-exclusive, lower-exclusive convention. Adding two pixels gives (1,0, 7,6). Coordinate order matters: swapping row and column can cut away the wound while still producing a valid image tensor.

The segmentation exercise resizes image and mask together to 64 x 64, using bilinear and nearest-neighbor interpolation respectively. A production crop must map coordinates back to the original image consistently, accounting for any padding or registration. The core classifier’s aspect-preserving padding and this mask example’s square resize are different transforms; record the difference and do not silently mix coordinate systems. For a worked padded mapping, a 120 x 80 original has a 64 x 43 resized content region with actual content box (0,10,64,53) in the padded tensor. A predicted box (16,18,48, 34) with no extra margin maps to

original coordinates by subtracting the padding and using scales 64/120 and 43/80. Rounding minima down, exclusive maxima up and clamping gives (30,14, 90,45). Integer resize rounding makes the two actual scales slightly different. The executable original_box helper in Section 8.13.4 implements this convention and handles empty or padding-only masks.

Wound application. Anisuzzaman and colleagues localized wound regions be-fore preparing images for their wound-category classifiers.[14] This provides a published region-selection application without establishing that the book mask- to-crop pipeline reproduces their detector. Sections 6.11 and 4.1 develop spatial preprocessing and classification targets.

8.9.3 Matched classification experiment

Use a dataset that contains both classification labels and valid mask supervision, or obtain those annotations. Do not join unrelated AZH classification and seg-mentation images by a similar filename. Compare full image, predicted crop, and reference-mask oracle crop on identical held-out records. Each classifier must be trained on its corresponding training representation. If the crop generator is learned on the same cohort, construct training crops out of fold to reduce the mismatch between memorized training masks and unseen test masks. An independently trained segmenter still requires an overlap audit.

Freeze the segmenter’s weights, threshold, crop margin, minimum crop size, and empty-mask fallback using development data. Report mask metrics and downstream classification metrics separately, including the number of fallback cases. Better Dice alone does not establish better wound classification: a crop may remove useful anatomical context or accentuate an artifact. Chapter 5’s architectures supply alternative mask predictors; this chapter supplies the experimental control needed to evaluate their contribution.

Student deliverable. Submit an aligned image/mask preview, a loss curve, a

mask-score table with its aggregation convention, and a classification study design

with all three input branches. Use the resulting synthetic outputs to inspect loading, updates, selection, testing, and crop coordinates. A real-cohort study is required to assess wound segmentation or any classification benefit from cropping.

8.10 Multimodal experiment interfaces

Chapter 7 derives fusion, image-text matching, retrieval, and adaptation. The following recipes specify how to organize a runnable study around those mechanisms. They are model-dependent pseudocode, not a claim that the book trained a large vision-language model. Functions such as processor and generate must be bound to a pinned implementation. Keep the endpoint fixed throughout an experiment: the core AZH task uses four wound types; the infection extension uses its own permitted labels and reference procedure.

8.10.1 Recipe A: image and collected metadata

Inputs and schema. Each record contains image ID, grouping IDs, class label, collected fields, field-observation masks, and modality-availability flags. A model- written caption is stored in a separate field with its captioning-model version and input provenance. In the AZH location release, location codes refer to a custom body map; treating their numeric IDs as ordered anatomical distances is unjustified. Use the documented codebook and categorical embeddings, reserving unknown and missing entries.[14, 263]

Fit numerical means and standard deviations on observed training values only. For field j and observation indicator mi3, store

Illustrations are not included in the reading sample

Replacing missing values before arithmetic avoids propagating NaNs through a later multiplication by zero. Preserve this ordering in your implementation. A true observed value equal to the mean has value zero with mask one; a missing field has value zero with mask zero. If an entire numeric field is unobserved in training, save mean zero, scale one and an inactive flag, and force that field missing at inference even if a value later appears. It becomes usable only after a newly developed model is fitted. Reject nonfinite observed values. Section 8.13.4 implements these cases without learning statistics from tuning or test records.

Training contract. Let the image encoder return Bxdk and the metadata encoder return B x dM. A concatenation head receives B x (dj + dM + 1) if a wholemodality flag is appended. The following pseudocode fixes which records and parameters may influence the fit:

Illustrations are not included in the reading sample

Reading Recipe A. The inputs are grouped records with images, collected fields, observation masks, availability flags and class targets. Patient splitting precedes all fitting. Stored training statistics convert fields to finite metadata inputs. Two encoders return batch-aligned feature matrices. Here * available is elementwise multiplication: a batch-by-one availability flag broadcasts across each metadata row, making the absent branch zero. Concatenation joins image features, metadata features and the flag along the feature axis; the head returns class logits. Cross-entropy and the update fit declared parameters. Tuning selects a configuration; freezing makes weights, statistics, vocabulary and decision policy one saved predictor.

Broadcast availability as B x 1, and construct finite metadata inputs before evaluating its encoder. For a gated variant, replace concatenation with the Chapter 7 gate and force the missing branch to its stated fallback. For cross-attention, preserve field tokens and field-identity embeddings; mask missing keys before softmax and bypass an all-missing key set. Pooling every field into a single key removes competition among fields and does not implement field selection.

Inference and controls. Apply the stored encoders and mappings without fitting anything. Compare image-only, metadata-only, and fusion models using identical permissible records. Test missing fields, whole-modality absence, rare categories, and deliberately permuted metadata. Permutation is a diagnostic, not a realistic deployment condition. If only complete cases are evaluated, report how many cases were excluded and why. A metadata shortcut can improve an internal score while failing on a different clinic; external testing must examine that possibility rather than assuming fusion is beneficial.

Wound application. Brehmer and colleagues combined wound photographs with categorical patient information and compared concatenation, gating and crossattention for pressure-ulcer and dermatitis classification.[50] This is a collected- metadata application. Section 7.4 develops fusion operations, while Section 7.3 develops the required paired records.

8.10.2 Recipe B: image-text class matching

Choose a contrastive model only if its image and text encoders produce compatible embeddings. A general autoregressive vision-language model does not automatically expose CLIP-style class-prototype scores. For a contrastive route, fix the checkpoint, prompt templates, image processor, embedding dimensions, normalization, and temperature. Chapter 7 supplies the similarity and contrastive-loss equations.[52]

Illustrations are not included in the reading sample

Reading Recipe B and the @ operator. The inputs are fixed class descriptions and a query image. Text vectors are computed once in the declared class order. The image vector occupies the same embedding space. The @ operator performs matrix multiplication: a 1 x d image vector times the transpose of a C x d text matrix returns 1xC dot products. Unit-length vectors make these cosine similarities. The .T operation swaps the two text-matrix axes; division by a positive temperature rescales scores. The argmax operation finds the winning index, and indexing class_order converts it to the corresponding label. Saved scores and model revision make the decision traceable. No optimizer or query reference appears in this loop.

If several descriptions represent one class, specify whether their normalized embeddings or their scores are averaged. Select templates only on development data and retain all candidate templates in the audit. Reject zero-norm embeddings before normalization. A zero-shot result means no target-task fitting under the declared protocol; it does not prove that the checkpoint’s pretraining corpus excluded the test images.

8.10.3 Recipe C: retrieval-assisted classification

Figure 8.6 shows the full separation between support labels, the query image, and the held-out query reference. This distinction is easy to lose when image IDs, captions, and labels are stored in one table.

Build the index from permitted training records only. If a metric-learning model is fitted, use only training pairs or triplets; a retrieval-only study instead freezes the representation. For model-written captions, record captioning-model version, decoding settings, and whether training labels were available during captioning. Test captions must not receive the held-out answer. SCARWID’s model-caption and five-neighbor protocol is a specific study design; the maximal marginal relevance (MMR) route below is a separate teaching alternative.[25]

Illustrations are not included in the reading sample

Figure 8.6. Permitted support retrieval and constrained classification. Only training support labels enter the context. Query reference labels enter scoring after inference. The identical support IDs also feed a voting baseline, isolating the contribution of the language model. Original diagram.

Illustrations are not included in the reading sample

freeze retrieval, prompt, decoding and parser settings repeat fixed inference on TEST; retain every failure

Reading Recipe C. The support bank contains permitted training images and known support labels; the query reference is excluded. Assertions reject repeated identifiers and forbidden groups before a frozen encoder builds the index. Similarity search finds candidates; maximal marginal relevance selects a smaller diverse context. Only those support images and labels enter the VLM prompt. The comparison vote uses exactly the same supports, isolating what the VLM adds beyond retrieval. Tuning fixes retrieval, context size, diversity, prompt, decoding and parsing. Fixed test inference then retains all failures. Outputs include the raw/parsed answer and support record; a parsing failure is not silently counted as a correct diagnosis.

In MMR selection, normalize vectors, reject repeated support IDs and zero vectors, and select distinct supports. Semantic near duplicates still require provenance review. Enforce a context budget in image tokens and text tokens, not only a count of examples. If the budget is exceeded, apply the predetermined truncation policy to supports; never truncate away the allowed-label instruction or silently change the query image processor.

A concrete output contract. For the label-only pathway, require a JSON object with exactly one key, label, whose value belongs to the fixed class set. For a binary infection experiment, {"label":"infection"} is valid only if “infection” is an allowed label; explanatory prose outside the object is invalid under this parser. Reject an unknown label, a list, duplicate keys, or additional keys. This label-only schema is distinct from the rationale schema in Section 8.11; Section 8.13.4 supplies both parsers. An inference record must state which parser applies. Score parsing failures explicitly. If one format-only retry is permitted, apply it uniformly, log its cost, and do not reveal the correct answer in the retry.

A useful synthetic interface test submits one legal JSON answer, one misspelled label, one explanatory paragraph, and one answer with an extra field. Only the first should pass. Candidate-label likelihood scoring is another valid design, but its tokenization, end-of-sequence policy, and length normalization must match the Chapter 7 definition. A model response stating “90% confident” is not a calibrated probability vector.

What to save. Record the query ID, support IDs and distances, prompt tem-plate hash, model-written caption, model revision, processor revision, decoding parameters, raw response, parsed label, retry status, elapsed time, token counts when available, and eventual evaluation reference. These records let the student distinguish retrieval failure, output-format failure, and a wrong class despite valid formatting. They also make hidden teacher and inference costs visible.

Wound application. The small-VLM preprint retrieved labeled wound images using nearest neighbors, optionally reranked them with MMR, and supplied the examples to a multimodal prompt.[110] This is a documented category-classification application of the recipe. Section 7.7 develops the support selection and retrieval- only controls.

8.11 Reasoning-model adaptation and evaluation

The multimodal interfaces above can be evaluated with frozen models. We now specify what changes when a model is adapted to produce a class, optionally with a rationale. The discussion begins with the classification contract, then separates supervised low-rank adaptation from class-reward post-training. The closing subsection considers resources and research scope, while retaining separate evaluation of the class and its explanation.

8.11.1 Classification contract

Use the same held-out endpoint and records as a direct-label baseline. Define whether the system emits only a label, a label plus rationale, or an intermediate structured observation record. Use exactly {"label":"diabetic"} for the label-only AZH contract. The separate rationale contract requires exactly label and a nonempty string rationale, for example {"label":"diabetic","rationale":"Visible finding."}. Both examples illustrate structure, not a diagnosis of an image. Reject prose outside JSON, repeated keys, unknown labels and extra fields. Save the parser identity and use the same schema during supervised target construction, decoding, reward parsing and evaluation. For a rationale response, class reward reads only the valid parsed label; grounding is evaluated separately. The earlier label-only parser must not be reused unchanged for rationale output. Explanations are outputs to assess, not additional reference evidence. Figure 8.7 separates teacher supervision, student fitting, optional reward optimization, and deployment. Infection-Reasoner motivates these stages, while Chapter 7 explains their mathematics and the differences between sequence-level and token-level policy objectives.[40, 314]

Illustrations are not included in the reading sample

Figure 8.7. Reasoning adaptation and inference. Training labels may supervise teacher/student targets and rewards. The deployed student receives the query inputs without its reference label. Classification and rationale quality are evaluated separately. Original conceptual diagram, not a reproduction of a wound study’s experiments.

8.11.2 Recipe D: supervised LoRA adaptation

Begin with a pinned model and processor whose image placeholders and chat template are documented. Low-rank adaptation (LoRA) changes selected weight matrices using the factorization derived in Chapter 7; log the targeted modules, rank, scale, dropout, and trainable parameter count. Merely loading a model with an adapter library does not prove that the intended layers are updated.[311, 313]

Teacher-model rationales must carry teacher identity, prompt, label access, decoding settings, and review status. Keep the reference class distinct from a teacher-predicted class. If a teacher answer disagrees with the reference, use a declared exclusion, adjudication, or label-only policy rather than silently replacing the reference. The following procedure is an implementation specification, not a wound-paper reproduction:

Illustrations are not included in the reading sample

Reading Recipe D. Each training record supplies an image and an independent reference label. A permitted teacher rationale is reviewed before being combined with that label; it does not replace the reference. The processor turns the record image, prompt and target into a multimodal sequence. Copying token IDs creates targets. Indexed assignment of IGNORE removes prompt, image-placeholder and padding positions from direct target loss, while the assertion requires an answer token to remain. The student returns next-token logits; causal loss aligns predictions and targets exactly once. Updating changes only the selected LoRA parameters. Tuning chooses the adapter and decoding policy; deployment omits the target and reference.

Some training APIs shift internally. Applying an additional manual shift in that case teaches the wrong next-token alignment. For an explicit one-shift implementation, accept logits and unshifted labels, then compare logits[:, :-l] with labels[:, l:]. Use synthetic targets to check which output positions receive direct loss gradients. A masked prompt position has no direct target term, but its representation can still influence later supervised tokens.

Count supervised tokens and report whether losses are averaged over tokens or sequences. With token averaging, a long rationale contributes more terms than a short label. If the objective is class prediction, compare label-only adaptation with rationale-plus-label adaptation under controlled label access and compute. Reject examples whose truncation removes the final answer; never train a truncated sequence and pretend its class target was retained.

At inference, load the frozen base revision and selected adapter, use the same processor, enforce the fixed output schema, and record both class and rationale.

Verify merged and unmerged adapter outputs on a small tensor or permitted ex-ample when merging is supported. Use synthetic cases to check these interfaces; a full multimodal adapter run still requires model-specific memory planning and execution.

Wound application. Wang and colleagues used LoRA on attention projections of text-language models for pressure-injury assessment from clinical informa- tion.[309] This supplies a wound-related efficient-adaptation example; it is separate from the book recipe’s chosen model and response contract. Section 7.8 develops low-rank updates and supervised targets.

8.11.3 Recipe E: class-reward post-training

Group relative policy optimization (GRPO) requires three distinct policies: the current trainable policy, the old policy that sampled the response group, and a fixed reference policy for regularization. A reference label supplies a classification reward during training; it is absent from test-time inference. Choose the objective variant before implementation. Infection-Reasoner’s documented sequence formulation must not be silently replaced by DeepSeekMath’s token formulation.[40, 314] reference = frozen_copy(supervised_student) current = trainable_copy(supervised_student) for update_round in fixed_training_budget:

Illustrations are not included in the reading sample

Reading Recipe E. The supervised student supplies a fixed reference policy and a trainable current policy. A detached old-policy snapshot samples response groups for training queries. Strict parsing maps responses to allowed labels or invalid outcomes; known training references determine rewards. Group normalization compares responses to the same query. Old/reference log probabilities remain detached constants, while current log probabilities retain their gradient path. The declared GRPO loss combines these with advantages and response masks; its minimized sign, clipping and regularization must match the chosen objective. The update changes only current-policy trainable parameters. Its output is an adapted policy, not validation that model explanations are grounded.

Specify group size, temperature, response limit, invalid-answer reward, advantage normalization, clipping interval, regularization coefficient, number of updates per sampled group, and response-token masks. The old policy stays fixed for the updates using its samples; recomputing “old” log probabilities from already- updated weights changes the importance ratios. The reference policy remains fixed across rounds. Padding and prompt tokens must not accidentally acquire response rewards.

For a synthetic group with rewards (1,0,1,0), population mean and standard deviation are .5 and .5, giving advantages (1,—1,1,—1) before the numerical stabilizer. An equal-reward group has zero normalized advantages; a regularization term may still produce a gradient. Check positive and negative advantages around clipping boundaries, zero variance, unequal response lengths, detached old/reference parameters, and the minimized-loss sign. The Chapter 7 finite-response calculation provides an exact small-model KL check; it does not specify an undocumented wound-model implementation.

Class reward alone cannot verify whether the rationale invents observations or uses invalid reasoning. Keep a separate rationale evaluation set with an explicit scoring rubric. For example, a correct infection label accompanied by a fabricated test value is correct for the class endpoint and fails evidence grounding. A plausible rationale with a wrong class is still a classification error. Prefer blinded expert review for clinically substantive judgments; automated judges are fallible and need their own validation.

Wound application. The Infection-Reasoner preprint applied supervised reasoning distillation followed by GRPO to a wound infection-classification model.[40] Its reward used agreement with reference infection labels. Section 7.9 develops the reported stages; the recipe above remains a separately specified experimental implementation.

8.11.4 Resources and research scope

Tier one uses frozen inference with a small, permitted support set and strict output parsing. Tier two adds supervised adapters with a documented memory budget. Tier three adds reward optimization, which requires repeated response sampling, old/reference policy handling, and substantially more compute. Students can complete a rigorous project at tier one by comparing direct labels, retrieval plus voting, and retrieval plus a VLM on identical cases. No reward-optimization run is necessary to demonstrate competent benchmark design.

If symbolic consistency checking is added, restrict it to declared observations and rules. Separate measured facts, uncertain model inferences, and clinical as-sumptions. An inconsistent premise set triggers a bounded repair or an unresolved output; logical satisfiability is not clinical truth. Preserve all revisions in the ledger and compare class accuracy, abstention, and rationale errors before and after the checker. This extends Chapter 7’s bounded example without claiming that a solver can certify a wound diagnosis.

Advanced readiness record. The core and synthetic mask sessions are complete programs. Recipes A-E are design capstones with reusable tensor components; they become executed model studies only after their data and model interfaces are bound. Before beginning an advanced run, submit the following record:

1. Identify the endpoint, authorized paired records, reference procedure and grouping unit. State which inputs exist at inference.
2. Pin model and processor revisions. Name the actual embedding output or decoding method, image transform, prompt/chat template, allowed labels and parser. For retrieval, pin support membership and the context budget.
3. Declare frozen and trainable modules, optimization and selection settings, and the expected outputs. Recipe D additionally needs adapter targets, rank, scale, token masks and one-shift verification. Recipe E additionally needs the objective variant, old/reference policies, rollout limits and response masks.
4. Specify the device, precision, estimated weight/activation/optimizer memory and a small executable smoke run. Record a measured peak when execution is available; an estimate alone does not demonstrate fit.
5. Save one permitted input-to-output trace, parser-failure cases, cost measure-ments and unresolved interfaces. An unresolved interface means the deliverable remains a plan; report no empirical score for it.

This record is an implementation gate, not a requirement that every student train a reasoning model. A rigorous core experiment or a clearly labelled advanced design can satisfy its stated assignment. Selecting a real model does not itself establish that its processor, target construction or memory use is correct.

8.12 Benchmark selection

The advanced pathways require an evaluation task as well as a model interface. This section first distinguishes wound benchmarks from broader medical reasoning resources, then gives a reproducible evaluation procedure for a permitted wound dataset. Follow the target, reference, partition, and output rules: these determine which comparisons a benchmark result can support.

8.12.1 Wound benchmarks and general medical context

A benchmark is a task specification, a data/version boundary, and an evaluation protocol. A paper’s private cohort, a public image folder, and a leaderboard are not interchangeable. Table 8.3 distinguishes resources that can guide wound classification from broader medical reasoning tests. It avoids combining their scores into a ranking because the targets, reference procedures, and denominators differ.

Table 8.3. Benchmark and study-protocol roles for the advanced recipes.

Illustrations are not included in the reading sample

An explicit infection extension. Preserve DFUC2021’s four-class task for an official four-class comparison. For a separately declared binary infection exer-cise, map infection and both infection/ischaemia to infection; map control and ischaemia-only to no_infection, meaning no infection under the source annotation procedure. Do not describe the latter class as healthy skin or absence of all pathology. Unlabeled or uncertain cases have no binary target until adjudicated under the declared reference procedure; exclude them with recorded counts or use a separately specified uncertainty endpoint. Freeze this mapping before partitioning and retain the original categories in the ledger so that infection performance by ischaemia status can be examined. This derived binary exercise is not the official four-class leaderboard task.[264, 265]

SurgWound’s journal version describes 686 social-media wound images, eight surgeon-annotated attributes, and 480/69/137 training/tuning/test images. Its WoundQwen pipeline predicts five characteristics, combines these with known location for risk/urgency prediction, and then produces a report.[326] Treat the image as the grouping unit for multiple question rows; the source does not establish patient-independent partitioning. Infection risk is not interchangeable with infection confirmed by diagnostic testing. Preserve the release’s uncertainty handling rather than silently turning uncertain attributes into absent findings.

The official code and dataset card provide implementation entry points, but their terms differ from the article’s licence: the article is CC BY-NC-ND 4.0, the dataset card identifies CC BY-SA 4.0, and the repository documents code licences.[326, 328, 329] This chapter uses original conceptual diagrams, not adapted article panels. Check image provenance and applicable terms before redistributing benchmark material.

MedXpertQA comprises 4,460 questions across 17 specialties and 11 body systems, with text and multimodal subsets.[327] Its results may motivate selecting a candidate model, but they cannot substitute for a wound-specific test. Likewise, report-text overlap measures cannot be relabeled as wound-classification accuracy or evidence that a model’s clinical recommendation is safe.

8.12.2 Reproducible benchmark evaluation

The following is an original harness specification applicable to a permitted wound dataset. It is deliberately more precise than “ask the model whether the wound is infected.”

1. Freeze the dataset revision, image IDs, target attribute, allowed labels, ref-erence procedure, split unit, and any exclusions. If one image has seven questions, retain the same split for all seven.
2. Freeze model/processor revisions, input resolution, crop policy, prompt templates, support pool, decoding settings, maximum tokens, retry policy, and timeout behavior. Record evaluation date for changing hosted models.
3. Evaluate an image-only baseline, a metadata-only baseline where meaningful, and the proposed multimodal system. Keep image and reference populations identical. Declare which observed fields are supplied at inference.
4. If intermediate attributes are used, predict them without the held-out target or reference attributes. A separate oracle run may use reference attributes, but label it as such and do not report it as deployable performance.
5. Save every response and parse it using the predeclared mapping. Count invalid outputs and missing predictions. Calculate per-class and aggregate classification metrics with explicit denominators.
6. Review a documented rationale sample independently of correctness, or report precisely how any correctness-based sampling restricts interpretation. Measure unsupported observations, contradictions, relevance, and agreement among reviewers.
7. Report latency distribution, decoder-output tokens, model size, memory, support-index cost, and teacher/adaptation costs separately. A short final answer can conceal a large inference budget.

Figure 8.8 prevents three different evaluation questions from collapsing into a single score. A classifier may be correct while its explanation is unsupported; a well-grounded explanation may accompany an incorrect class; either system may be too costly for the intended workflow.

Illustrations are not included in the reading sample

Figure 8.8. Three separate benchmark reports: classification, rationale quality, and computational cost. The conceptual matrix is not an observed clinical result. Each report retains its own units and denominators.

For a synthetic ten-case reasoning exercise, suppose eight labels are correct, six rationales pass the grounding rubric, and five cases satisfy both. Report label accuracy 8/10, rationale pass rate 6/10, and joint success 5/10 rather than assuming the two sets coincide. If only correctly classified cases were reviewed, the rationale rate would answer a conditional question. The exact denominator must accompany it.

Wound application. WILLIE evaluated wound classification, segmentation and mask-derived localization using task-specific datasets and metrics.[26] This illustrates why a wound benchmark must identify its output and reference standard before comparing scores. Sections 6.16 and 2.5.9 develop the framework and its spatial evaluation.

8.13 Self-contained pipeline walkthroughs

The following executable Python blocks supply the complete core classifier and the optional synthetic mask example. They require only Python, PyTorch, NumPy and Pillow; no separate book-code download or hidden helper module is needed. Assemble the numbered code blocks, in order, into one local file of your own named wound_lab.py. Each block contains the imports/constants or a complete function/class. A long block may continue on the next page: retain indentation across that page break, omit the printed headings, and leave blank lines blank. The numbered blocks define functions; the separate session listings show when to call them. All paths below are local paths chosen by the student.

8.13.1 Environment, data preparation and classification functions

Use compatible Python, PyTorch, NumPy, and Pillow versions in an isolated environment, and record the versions actually imported. Install a CPU PyTorch build for the core CPU recipe, or explicitly document a different execution environment.

Save the decoder and preprocessing settings alongside the model configuration. No plotting or model-adapter library is required for the core or mask programs.

A concrete Windows CPU setup. The following example chooses Python 3.13, PyTorch 2.9.1, NumPy 2.2.6 and Pillow 12.0.0. It pins an instructional environment rather than requiring the newest releases. Install Python 3.13 first and make its python command available. Check that python —version reports 3.13 before continuing. In PowerShell, create a new working folder and enter it, then run these commands. The environment has its own Python executable; calling it directly avoids an activation-policy dependency. Python documents this use of virtual environments, and PyTorch publishes the version-specific CPU installation route.[333, 334]

Illustrations are not included in the reading sample

The backtick continues a PowerShell command onto its next line; it is not Python syntax. On Linux or macOS, use python3.13 -m venv .venv and the resulting .venv/bin/python; follow PyTorch’s instructions forthat operating system. A CPU recipe does not require CUDA. Record the actual imported versions if a different installation is used.

Save the assembled definitions as wound_lab.py inside wound_course. Save each session you choose to run as another local file in the same folder, for example run_core.py. Launch it there with A.venv\Scripts\python.exe run_core.py. Relative paths such as lab and authorized_archives are resolved from this working folder. Do not paste printed headings or PowerShell commands into the Python module.

Before obtaining external data, save and run this Python session after assembling all numbered definitions, including the later preflight and reporting helpers:

Illustrations are not included in the reading sample

Expect a two-by-three tensor shape and a sharply lower two-image loss. The reload difference should be zero, and the report should contain passed=True. A failure stops the session. Investigate it before using wound data. The exact loss is environment dependent; these checks concern updates, finite gradients, evaluation state and serialization, not wound accuracy. A second call needs a new output folder because existing evidence is preserved.

First obtain the authorized Train.zip and Test.zip archives from the pinned AZH directory in Section 8.3. Place them together in a local folder. The preparation function checks the specified archive identities, reads test records first in sorted archive-name order, removes exact decoded-pixel duplicate copies, and then processes training records. A single NumPy default_rng(812) shuffles development indices within D, P, S, and V, in that order. Each tuning count is max(1, round(.2*n)); Python’s round uses ties to even. The final CSV retains source-record order rather than shuffle order.

Calculate and save the checksum of the manifest you create. For a repeat exe-cution, compare sample membership and ordering as well as archive-file, decodedpixel, and manifest hashes. Decoding and serialization are part of the specified input pipeline, so record their versions and conventions. Investigate a mismatch before interpreting a difference in model scores; do not edit outputs to match an expected result.

The classifier uses bilinear, aspect-preserving ImageOps.pad, RGB conversion after EXIF orientation, black centered padding, fixed division by 255, and channelfirst tensors. All 12 descriptors are measured on this processed array, including padding. Both RGB deviations and the across-training-image feature standardizer use population standard deviations. A tiny standardizer scale is clamped to 10-[6]. Parameter initialization uses PyTorch’s module defaults after the stored seed. The checkpoint stores Pillow’s version as well as the other library versions.

Code block 1.

Illustrations are not included in the reading sample

Code block 2.

Illustrations are not included in the reading sample

Code block 3.

Illustrations are not included in the reading sample

Code block 4.

Illustrations are not included in the reading sample

Code block 5.

Illustrations are not included in the reading sample

Code block 6.

Illustrations are not included in the reading sample

Code block 7.

Illustrations are not included in the reading sample

Code block 8.

Illustrations are not included in the reading sample

Code block 9.

Illustrations are not included in the reading sample

Illustrations are not included in the reading sample

Code block 11.

Illustrations are not included in the reading sample

Code block 12.

Illustrations are not included in the reading sample

Code block 13.

Illustrations are not included in the reading sample

Code block 14.

Illustrations are not included in the reading sample

Code block 15.

Illustrations are not included in the reading sample

Code block 16.

Illustrations are not included in the reading sample

Code block 17.

Illustrations are not included in the reading sample

Code block 18.

Illustrations are not included in the reading sample

Code block 19.

Illustrations are not included in the reading sample

8.13.2 A complete classification session

After assembling all definitions and passing the data-free preflight above, run the following session in the same Python process, or import the functions from your locally assembled file. Change only the archive folder before the first run. Fresh output folders are required. Calls are separated so that the test report is produced only after selection is frozen. from wound_lab import * home = PathC'lab") prepare(Path("authorized_arehives"), home / "data") manifest = home / "data" / "manifest.esv" elass_gallery(manifest, home / "bateh_preview.png") run_dir = home / "elassifier" train(manifest, run_dir) tune(manifest, run_dir) test(manifest, run_dir) elassifieation_report(manifest, run_dir) print(infer(manifest, run_dir,

home / "data/images/Test/D/l05_0.Jpg"))

Preparation should report the counts and exclusions found in your input release. Training writes config.json, history.json, best.pt, and last.pt. Tuning writes the neighbor artifact and selection.json; testing writes predictions.csv and test_metrics.json. The latter includes an imagebootstrap accuracy interval using seed 813, 2,000 resamples of the actual test-set size, and the .025/.975 quantiles withNumPy’s default linear interpolation. The same resampled indices also give a paired accuracy-difference interval, defined as

CNN minus k-NN. This image-level interval does not account for unknown patient clustering or training-seed variability. The report adds class support, precision, recall, F1, coverage and accepted accuracy; empty denominators become missing values. The reporting call saves a class table, a loss plot and the first three cor- rect/first three incorrect cases in manifest order. These are diagnostic selections, not a representative sample. The test guard prevents accidental overwrite; it cannot prevent deliberate test reuse.

A ledger row keeps sample_id, reference, prediction, accepted, followed by the four named probabilities. Join its reference for scoring after inference. Figure 8.4 supplies a synthetic field-reading example; obtain actual scores by running your saved predictor on the corresponding permitted image. For a rejected input, retain scores and the highest-scoring class for inspection but return decision="abstain"; a class candidate is not an accepted output. Compare reloaded predictions numerically under the same environment rather than requiring identical checkpoint serialization bytes.

8.13.3 Complete optional mask walkthrough

Append the next numbered blocks to the same file. They define the paired loader, the eight-channel skip path and sixteen-channel low-resolution path, and an image- averaged mask evaluator. Training uses Adam at .003, batch size eight, five epochs, seed 812 and two CPU threads; the earliest minimum tuning BCE selects the checkpoint. From {.3, .5, .7}, the greatest tuning mean Dice selects a sigmoid threshold, with the first (smallest) threshold winning an exact tie. Training alone uses paired horizontal flips with probability .5. Both-empty mask pairs contribute one to Dice/IoU and are counted explicitly. Synthetic sampling uses an independent NumPy seed of eight. This is an executable geometry exercise; it asserts no clinical result.

Code block 20.

Illustrations are not included in the reading sample

Code block 21.

Illustrations are not included in the reading sample

Code block 22.

Illustrations are not included in the reading sample

Code block 23.

Illustrations are not included in the reading sample

Code block 24.

Illustrations are not included in the reading sample

Code block 25.

Illustrations are not included in the reading sample

Code block 26.

Illustrations are not included in the reading sample

The optional session creates 24/6/6 independent rectangle pairs and saves its current measured mask scores. Do not substitute those numbers for a wound-data evaluation or for the earlier debugging record. from wound_lab import * synthetic(Path("lab/rectangles")) mask_manifest = Path("lab/rectangles/manifest.csv") mask_run("train", mask_manifest, Path("lab/masks")) mask_run("test", mask_manifest, Path("lab/masks")) mask_report(mask_manifest, Path("lab/masks")) print(json.loads(Path("lab/masks/test.json").read_textO))

8.13.4 Output, metadata and coordinate contracts

Append these final definitions. The parser uses an explicit switch between label- only and label-plus-rationale outputs and rejects duplicate JSON keys. Schema acceptance only checks structure; it does not verify that a rationale is grounded. The numeric-field fitter stores an activity flag for every field. A field never observed in training is assigned mean zero and scale one, and is forced missing even if it appears at inference; it can be introduced only in a newly developed model. Observed nonfinite values are rejected. Fit and save these statistics once on training data, then reuse them.

The coordinate helper accepts the original (W, H) and the actual transformed content rectangle (I, t, r, b), not an assumed ideal scale. It uses separate horizon- tal/vertical ratios after integer resize rounding, rounds crop minima down and exclusive maxima up, and clamps to the original image. It first excludes foreground pixels in padding, then computes the bounding box and margin. If no foreground remains within the content rectangle, it uses the full-image fallback. For an unpadded square resize, content is (0,0,64,64).

Code block 27.

Illustrations are not included in the reading sample

Code block 28.

Illustrations are not included in the reading sample

Code block 29.

Illustrations are not included in the reading sample

Code block 31.

Illustrations are not included in the reading sample

Code block 32.

Illustrations are not included in the reading sample

The following synthetic checks finish the assembly exercise. The first response passes only the label-only parser; the second passes only the rationale parser. A response with prose outside JSON, an unknown label, a repeated key, or an extra field fails its declared contract. Recipe E must parse the contract actually returned before extracting parsed["label"] for class reward; an invalid response receives the predeclared invalid-output reward. The rationale is logged and assessed separately.

from wound_lab import * a = '{"label":"diabetic"}' b = '{"label":"diabetic","rationale":"Visible finding."}' assert parse_output(a, CLASSES) is not None assert parse_output(b, CLASSES) is None assert parse_output(b, CLASSES, True) is not None v = torch.tensor([[float("nan"), l4.]]) obs = torch.tensor([[False, True]]) mean, std, active = fit_fields(v, obs) u = encode_fields(v, obs, mean, std, active) assert torch.isfinite(u).all() and not active[0] m = torch.zeros(64, 64, dtype=torch.bool) m[l8:34, l6:48] = True assert original_box(m, (l20, 80), (0, l0, 64, 53), 0) == ( 30, l4, 90, 45)

z = torch.zeros(l, 5, 7, requires_grad=True)

y = torch.tensor([[-l00, -l00, -l00, 3, 4]]) causal_loss(z, y).backward() assert z.grad[:, :2].abs().sum() == 0 assert z.grad[:, 2:4].abs().sum() > 0 assert z.grad[:, 4:].abs().sum() == 0

These interface checks exercise concrete computation. Recipes D and E still require a pinned multimodal model, processor, adapter configuration and declared policy objective; the chapter does not claim that these small tests execute a largemodel adaptation or reward-training experiment.

8.13.5 Preflight, visual reports and controlled development

Append the following definitions to the same module before running any ses-sion. preflight uses two invented images and writes its checks. loss_plot renders saved losses with Pillow, so the programs still need no plotting library. class_gallery first creates a four-class training preview; with a saved test ledger it instead displays up to three correct cases and three errors. Each row keeps the source crop, enlarged processed pixels and saved prediction together, with the reference separately named. It does not rerun a classifier or alter a label. classification_report exports per-class metrics and the classifier gallery; mask_report displays aligned inputs, references and frozen predicted masks, plus the saved loss curve. A synthetic mask gallery remains evidence about geometry only.

development_trial compares learning rates .003 and .001 with the same seed, data, architecture, 12-epoch budget and earliest-minimum-tuning-loss checkpoint rule. It changes one development choice. It records tuning class counts and scores, then chooses the smaller tuning negative log-likelihood, preferring the first trial in an exact tie. It never loads test images for inference or calculates a test score. A trial that still predicts one class is a documented failed hypothesis, not a reason to conceal the run. development_fixture supplies explicitly invented probability tables for practising that interpretation.

Code block 33.

Illustrations are not included in the reading sample

Code block 34.

Illustrations are not included in the reading sample

Code block 35.

Illustrations are not included in the reading sample

Code block 36.

Illustrations are not included in the reading sample

Code block 37.

Illustrations are not included in the reading sample

Code block 38.

Illustrations are not included in the reading sample

Code block 39.

Illustrations are not included in the reading sample

Run a bounded follow-up. Predeclare this two-rate comparison before a first test if it is part of the planned experiment. Its two fresh subfolders each retain their own history and selected checkpoint: from wound_lab import * manifest = Path("lab/data/manifest.csv")

decision = development_trial(manifest, Path("lab/development")) print(decision["selected"], decision["rule"])

print(development_fixture())

Read decision.json alongside both loss plots. Record whether the selected trial improves the declared tuning objective, whether all classes receive predictions and which classes remain weak. There is no promised benefit from a smaller learning rate. To use the selected trial in a still-blinded planned study, call tune, test and classification_report on that trial’s folder after freezing the comparison. If the earlier core test was already inspected, this follow-up is test-exposed development: the same test cannot supply a fresh independent success claim. Preserve the original report and obtain a new appropriate holdout for such a claim. This follows the training-only fitting and model-selection boundaries discussed earlier.[20, 324]

Worked diagnosis with invented tuning outputs. The fixture uses two refer-ences per class in D, P, S, V order. The reference probabilities are (.2, .2, .2, .4) for every row, so all eight predictions are V. The alternative assigns probability .7 to its candidate and .1 to each other class, with candidates D, D, P, V, S, V, V, V. It 592

has six correct rows. The resulting accuracy changes from .25 to .75, macro-F1 from .10 to .75 and mean negative log-likelihood from approximately 1.4362 to .8432. Under the declared minimum-loss rule the alternative is selected. Its two errors remain P-to-V and S-to-V, so the student must still report those class-specific failures. These constructed arrays illustrate how to read a decision record; they do not simulate an optimizer or demonstrate that changing the learning rate produces these improvements.

Completing the workflow, diagnosing a failure and demonstrating class dis-crimination are separate outcomes. A valid failure investigation can complete the first pipeline exercise. Useful discrimination needs held-out class evidence under the stated protocol. Temperature scaling adjusts probabilities while preserving the largest-logit class, so it cannot repair a collapsed argmax predictor.[44]

8.14 Debugging, reproduction, and capstone

After implementing a pathway, the next task is to distinguish an execution problem from a limitation of the model or experiment. We begin with diagnostic checks, then establish what must be reproduced before a modification is interpreted. The final subsection turns these requirements into a capstone brief and grading criteria, connecting a proposed research question to reviewable experimental evidence.

8.14.1 Failure diagnosis

Table 8.4 connects symptoms to tests that can distinguish implementation errors from modeling limitations. The goal is to obtain discriminating evidence before changing several components at once.

Table 8.4. Debugging checks for wound-classification experiments.

Illustrations are not included in the reading sample

8.14.2 Reproduction before modification

A reproducible implementation should retain its partition manifest, preprocessing specification, source code, configuration, training history, selected checkpoint, decision policy and held-out prediction ledger. Record the software environment and the exact dataset revision alongside these artifacts. Clear local output names should identify the stage that produced each file and prevent accidental mixing of experiments.

Begin with the data-free setup and callable preflight in Section 8.13.1, then run the synthetic interface checks in Section 8.13.4, before obtaining external data. The numbered blocks in Section 8.13 contain all core and mask helpers, so no separate reader-code package is required. Next prepare the pinned AZH release, inspect duplicates, and record the resulting class counts, exclusions, and partition membership. Train and tune in a fresh run folder. Confirm that loading the selected checkpoint produces the same predictions under the recorded environment; exact byte equality of checkpoint files is not required because serialization metadata can differ. Compare numerical outputs and configuration instead. For a reproducibility check, repeat the pipeline on the same authorized inputs and compare the history, selection and test predictions under the recorded environment.

If a different environment produces different results, preserve both reports and diagnose the difference rather than editing the expected values. Log CPU/GPU, numerical precision, software versions, thread counts, seed policy, and prepro- 594

cessing. Recomputing a printed example and reproducing a model run answer different questions. State which inputs, computations and outputs each check actually examined.

8.14.3 Capstone brief and grading

Define a wound-type or infection endpoint and its reference standard. Choose one main scientific question: whether a frozen representation improves a classical baseline, whether predicted crops improve classification, whether metadata helps under missingness, whether retrieval improves a constrained VLM beyond identicalsupport voting, or whether rationale supervision improves the label outcome. Do not combine all five into an uninterpretable comparison.

Submit a data card and partition manifest; a frozen experiment specification; executable core code or a precise advanced-model adapter; training and tuning records; a held-out prediction ledger; task-appropriate metrics with uncertainty; a failure gallery; a cost report; and a limitations statement. For an advanced pseudocode project, also provide a small synthetic interface test and a model-specific execution plan identifying unresolved APIs and memory requirements. Do not label an unexecuted plan as an empirical result.

Assess the work on five equally visible dimensions: data/provenance correct-ness, executable computation, evaluation validity, interpretation of failures, and reproducibility. A high score with leakage fails evaluation validity. A modest score with a transparent protocol and useful diagnosis can demonstrate strong research competence. Additional model complexity must answer the stated question and receive a matched baseline. For the required core, assess workflow completion and failure diagnosis explicitly; finishing a run does not certify useful discrimination. The supplied report functions produce the requested class table, loss curves and galleries. A new cohort, a different metric interval or a new visualization is an additional implementation task with its own declared conventions.

A complete stopping rule. Stop when the declared development budget is ex-hausted, the final policy is frozen, the test report is written, and the reproducibility artifacts are complete. After that point, newly discovered implementation errors require an explicitly versioned correction and an explanation of test exposure. Newly proposed modeling ideas belong to a subsequent experiment rather than a silent replacement of the reported run.

8.15 Chapter review

This review brings the chapter’s experiment pathways back to the evidence each can produce. A comparison table organizes their roles and requirements, followed by worked exercises on data counts, updates, selection, inference, and interpretation. The research questions and closing summary then identify what remains to be tested when moving from the teaching examples to a new wound-analysis study.

8.15.1 Comparing experimental evidence

Table 8.5 compares practical pathways in the context of wound image classification. Its advantages are conditional methodological expectations, not rankings inferred from incomparable published scores. Each pathway requires execution with an appropriate model, dataset, and evaluation protocol before its performance can be reported.

Table 8.5. Wound-focused comparison of practical experiment pathways.

Illustrations are not included in the reading sample

Illustrative research choice. Suppose a team has wound-type images with re-liable class labels but no patient identifiers or masks. It can build a transparent teaching baseline and audit exact duplicates, while clearly limiting its generaliza-tion claims. It cannot justify a segmentation experiment by borrowing masks from unrelated files. If paired metadata later becomes available, the next comparison should preserve the image cohort and add missing-input tests. A reasoning model becomes relevant only when its input contract, output labels, evaluation procedure, and computational budget are specified.

8.15.2 Review exercises

Attempt all 18 questions before consulting the worked solutions in Section 8.15.3. The questions revisit data preparation, learning, selection, inference and interpretation; the solutions use the same numbering. All numerical inputs below are hypothetical teaching examples.

1. Count the cohort. In a hypothetical inventory, 150 wound-image files and 50 background files are available. Two wound-image files are duplicate copies of retained test images; all other wound-image files are unique. Keep 40 unique wound images for testing and reserve one quarter of the remaining development records for tuning. How many records enter each stage?
2. Independence. No exact cross-split duplicates remain. Can the report say “patient-independent?
3. Gradient check. Four logits are zero and the target has zero-based class index 2 (the third class). Use one-example, unweighted cross-entropy with natural logarithms. Calculate the loss and its gradient with respect to the four logits.
4. Batch weighting. Two batches contain 32 and four images with mean losses 1 and 2. What is the sample-weighted mean loss over all 36 images?
5. Checkpoint selection. Epoch A has tuning loss 1.1 and macro-F1 .4; B has loss 1.2 and macro-F1 .6. Which epoch does a predeclared minimum-tuning-loss policy select? Which would a predeclared maximum-macro-F1 policy select?
6. Collapse. A four-class test contains at least one reference example of every class, including 62 venous examples out of 184 images. A model predicts venous for all images. Calculate accuracy, the four class recalls and macro-F1 averaged over all four classes. Does the model distinguish the four classes?
7. Calibration. Divide logits (2,1,0, —1) by T = 2. Give the scaled logits and explain what happens to the class ranking and probability concentration.
8. Selective reporting. A system accepts 20 of 100 cases and classifies 19 cor-rectly among those accepted cases. What are accepted accuracy and coverage, and which rejected cases must remain visible in the report?
9. Feature leakage. Under the chapter’s held-out evaluation protocol, a stan-dardizer is fitted on all records before the train/test split. What is wrong, and how should the pipeline be corrected?
10. Crop coordinates. Using zero-based row and column indices, positive pix-els occupy rows 2-3 and columns 3-4 of an 8x8 grid. Give boxes as (xmin Admin >xmaxAdmax) with exclusive upper bounds: first without a margin, then with a two-pixel margin clamped to the image boundaries.
11. Missing metadata. A duration field has training mean 10 and standard deviation 2; its observed value is 14. Give the standardized-value/observation-mask pair when observed and when unavailable.
12. Retrieval control. A VLM uses three diverse supports but voting uses the five nearest supports. What additional baseline is needed to isolate the decision mechanism?
13. Strict parsing. The declared output contract permits exactly one JSON object containing the allowed label field. The model emits an explanation outside that object followed by the label. How should this response be scored, and when may a retry be used?
14. Causal alignment. Only token positions 3 and 4 are supervised in a zero- indexed five-token sequence. With exactly one causal shift, which logit positions have direct target-loss terms?
15. Reward versus explanation. A correct infection label accompanies an in-vented test result. How should class reward and rationale grounding be as-sessed?
16. Benchmark grouping. One wound image appears in seven question-answer rows. How should those rows be partitioned, and what is their relationship to patient counts?
17. Oracle attributes. A risk classifier receives reference erythema and exudate annotations at testing, although its intended deployment pipeline does not collect those fields. How should the experiment be labelled and compared?
18. Evidence status. A synthetic rectangle segmenter passes the chapter’s pipeline tests. What evidence does this provide, and which wound-analysis claims remain untested?

8.15.3 Worked solutions

These solutions correspond to Questions 1-18 in Section 8.15.2. Each calculation uses the inputs and conventions stated in its question. The methodological answers retain the distinction between a checked teaching procedure and evidence of woundmodel performance.

1. Count the cohort. Excluding the two duplicate copies leaves 150 — 2 = 148 unique wound images. Development contains 148 — 40 = 108 images, of which 108/4 = 27 are tuning and 108 — 27 = 81 are training. The test set contains 40 images. Background files do not enter this four-class denominator.
2. Independence. No. Different photographs from the same patient can have different pixels. Verified grouping identifiers or equivalent source evidence are required; exact-image separation alone cannot establish patient separation.
3. Gradient check. The probabilities are (.25, .25, .25, .25) and the loss is log 4 « 1.386294. Subtracting the one-hot target from the probability vector gives the logit gradient (.25, .25, —.75, .25). A batch-mean loss additionally divides each example’s contribution by the batch size.
4. Batch weighting. The epoch mean is (32-1+4-2)/36 = (32+8)/36 = 1.1111 to four decimal places. Averaging the two batch means equally gives 1.5 and overweights the smaller batch.
5. Checkpoint selection. The minimum-loss policy selects A; the maximum- macro-F1 policy selects B. Both are coherent development criteria when declared for their respective experiments. Do not retrospectively replace the stated criterion because another choice gives a more favorable test result.
6. Collapse. Accuracy is 62/184 = .3370 to four decimal places. Venous recall is one and the other recalls are zero. Venous F1 is 2(62)/(184 + 62) = 124/246; each other class has F1 zero. Therefore macro-F1 is (124/246)/4 « .1260. The model makes no distinctions among the four classes; its accuracy comes entirely from the venous cases.
7. Calibration. The scaled logits are (1, .5,0, —.5). The class ranking is un-changed, while the softmax probabilities become less concentrated. Positive temperature scaling cannot change this example’s argmax prediction or repair an argmax error. A softer probability vector alone does not establish improved calibration.
8. Selective reporting. Accepted accuracy is 19/20 = .95 and coverage is 20/100 = .20. Report the 80 rejected cases and their class distribution. These numbers do not establish .95 accuracy on all 100 cases; the denominator for accepted accuracy is 20.
9. Feature leakage. Test-distribution information influenced the fitted transfor-mation. Refit using training rows only, then transform tuning and test records with those stored statistics. The original result is contaminated under this protocol and must be reported or corrected accordingly.
10. Crop coordinates. The right-exclusive crop box without a margin is (3,2, 5,4): its width and height are both two pixels. A two-pixel margin gives (1,0,7,6), with width and height six pixels. The coordinates are in x, y order, not row,column order.
11. Missing metadata. When observed, (14 — 10)/2 = 2, so encode (2,1) for value and mask. If unavailable, encode (0,0) after finite imputation. Multiplying NaN by zero does not provide finite imputation.
12. Retrieval control. Add a voting baseline using the identical three supports supplied to the VLM. Keep the query cases and label definitions fixed. Otherwise support selection and decision mechanism both change, so the comparison cannot isolate the VLM contribution.
13. Strict parsing. Record an invalid response under that strict parser. Do not extract a favorable label by searching the surrounding prose. Any format-only retry policy must have been fixed on development data, applied uniformly and logged without revealing the reference answer.
14. Causal alignment. Logits at positions 2 and 3 predict the supervised targets at positions 3 and 4. Position 4 has no following target in this sequence; the direct target terms for logit positions 0 and 1 are masked. Earlier contextual representations can still influence later supervised predictions.
15. Reward versus explanation. Class reward may be positive because the parsed label agrees with the reference; rationale grounding fails because the test observation was invented. A reward based only on class agreement does not verify the claimed observation.
16. Benchmark grouping. Assign the image and all seven questions to one partition. Seven rows are not seven independent patients. When patient identifiers are available, also keep all images and visits from the same patient together.
17. Oracle attributes. Label it an oracle-input experiment. Compare it with the pipeline using predicted attributes and report propagation of their errors. If a different deployment genuinely collects those fields at decision time, declare that separate input contract and its acquisition requirements; do not silently treat reference-only fields as available.
18. Evidence status. The result supports the tested mask-pipeline computations on synthetic geometry. It does not measure wound segmentation or down-stream classification performance. Those endpoints require appropriate wound records, reference annotations, separated evaluation data and their own experiments.

8.15.4 Research questions

How much of a classifier’s apparent performance survives patient-, site-, and timeseparated testing? Does a stronger frozen representation improve the small-data baseline without adding test exposure? When do predicted crops remove useful anatomical context? Which missing metadata patterns harm minority classes? Can retrieved examples improve constrained classification beyond matched voting at comparable cost? Does rationale supervision change class accuracy when teacher label access and inference budget are controlled? Each question requires an experiment with a fixed endpoint and an explicit reference procedure.

8.15.5 Chapter summary

A wound classifier becomes a reproducible experiment when its data, preprocessing, training, selection, and inference decisions are recorded together. The manifest and partition audit precede fitting; Equation (8.2) separates training, tuning, and final testing. The worked pipeline examples connect image batches to gradients, checkpoints, calibrated scores, and a prediction ledger. Inspect the confusion matrix produced by your experiment alongside its loss history; successful execution and decreasing loss do not by themselves establish useful classification.

Segmentation can support predicted crops, while multimodal retrieval and reasoning require additional input contracts, supervision provenance, and output checks. Their evaluation must preserve the distinction between class correctness, explanation grounding, and computational cost, as Figure 8.8 shows. Unknown patient grouping limits the generalization questions a study can answer; synthetic tests and proposed advanced pathways carry narrower evidence claims.

Glossary

Definitions summarize the use of these terms in this book. A method’s local assumptions and metric conventions remain authoritative.

2.5D processing

Neighboring slices supplied as channels, often predicting the central slice.

abrasion

A skin injury caused by scraping or friction, involving loss of epidermis and sometimes injury to the dermis.

accuracy

The fraction of evaluated observations assigned the correct class under a specified protocol.

activation function

A function applied to a preactivation to form a unit or layer output.

activation memory

Storage for intermediate feature tensors, separate from parameter storage.

acute wound

Recent injury progressing through an expected healing response.

agent

Decision maker in reinforcement learning.

anchor example

Reference example in a triplet.

angular margin

A separation term defined in angle space, as in the additive angular margin of ArcFace.

anisotropy

Different physical sampling along different axes.

area under the ROC curve

A ranking measure obtained from the ROC curve; it does not establish calibration or choose an operating threshold.

arterial ulcer

An ulcer associated with tissue ischemia from inadequate arterial blood supply; establishing the vascular cause requires clinical assessment.

artificial intelligence

The field concerned with computational systems that perform tasks involving learning, inference, perception or decision making.

atrous spatial pyramid pooling

Parallel context branches at different dilation rates.

attention gate

A learned mechanism that scales input features by data-dependent coefficients to control their contribution to later computation.

average precision

A recall-weighted precision summary; interpolation, matching and averaging conventions must be specified.

average symmetric surface distance

A symmetric average of directional boundary distances with specified sampling and weighting.

avulsion

Tissue partially or completely torn away.

backpropagation

Reverse accumulation of derivatives through a computational graph to calculate parameter gradients.

balanced accuracy

Mean recall across the specified classes; binary balanced accuracy averages sensitivity and specificity.

batch normalization

Normalization using minibatch statistics during training and a specified inference-statistics policy.

bias

An additive model parameter in an affine transformation; distinct from statistical bias.

Brier score

Mean squared probability error; binary and class-summed multiclass definitions differ.

Byzantine fault

Arbitrary participant behavior under a specified fault model.

calibrated area

Pixel count converted with a valid physical scale and geometric assumptions.

calibration

Agreement between predicted probabilities and observed frequencies under the stated definition.

candidate-set normalization

Renormalization over explicitly allowed complete answer paths; not automatic calibration.

capsule network

Vector or matrix feature groups with a specified routing/aggregation rule.

capsule vote

Parent-specific transformed representation; not itself a probability.

causal mask

Excludes information from future sequence positions.

cell state

LSTM state distinct from the exposed hidden state.

center cropping

Remove edges to align spatial extents; maintain coordinate correspondence.

centroid

Arithmetic mean for squared Euclidean k-means.

channel attention

Feature reweighting along the channel dimension; in the channel gates used here, a weight for each channel is broadcast over spatial positions.

chronic wound

Inadequate progression toward healing; no single universal time cutoff.

class imbalance

Unequal class frequencies; not limited to binary tasks.

class token

A learned token used to aggregate information for classification; it is not a reference class label.

classification

Prediction of a category or label set for a specified observation unit.

closed injury

An injury in which the overlying skin remains intact even though underlying tissues may be damaged.

conditional latent variable

A latent variable whose distribution depends on conditioning inputs; training may also condition on annotations.

constrained-label inference

Model responses restricted to or strictly parsed against a predefined class vocabulary.

contrastive image-text alignment

Training paired image and text representations using a declared positive/negative scheme.

contrastive loss

A loss encouraging a stated relationship between matched and unmatched representations; pair and reduction conventions vary.

contusion

Bruising after blunt injury.

convergence

Approach of a specified sequence, such as parameter iterates or objective values, to a defined limit. Numerical tolerance rules assess approximate convergence; an arbitrary stopping rule does not establish convergence, and convergence need not imply a global optimum.

convolution

An operation combining a signal with a reversed kernel; many CNN libraries implement cross-correlation instead.

convolutional neural network

A neural network using spatially shared convolutional or cross-correlation filters.

cosine similarity

For nonzero vectors x and y, the normalized dot product xTy/(||x||2 ||y^2), equal to the cosine of the angle between them.

coupling coefficient

For dynamic routing, normalized across candidate parents for each child.

covariance matrix

Matrix of second central moments; not its determinant.

cross-attention

Queries and keys/values originate from different representations.

cross-correlation

In the real-valued CNN convention used here, sliding weighted summation with the kernel’s spatial indices unreversed, for example

Illustrations are not included in the reading sample

decision tree

Recursive feature-space partition.

deep learning

Learning using multiple layers of representation, usually within a neural network.

deep supervision

Auxiliary losses applied to intermediate output heads.

depthwise separable convolution

Separate within-channel spatial filtering and pointwise channel mixing.

dermis

The connective-tissue layer of skin beneath the epidermis and above the subcutaneous tissue, containing blood vessels, nerves and skin appendages.

development data

Training plus model-selection data; the final test is excluded. Calibration uses a specified held-out or nested development procedure.

diabetic foot ulcer

An ulcer of the foot in a person with diabetes; neuropathy, perfusion and other clinical factors require separate assessment.

Dice score

An overlap measure equal to twice the intersection divided by the summed set sizes, with an empty-set convention.

diffusion denoising

A learned reverse process that progressively removes modeled noise from a noisy representation; in the segmentation example here, it produces an image- conditioned mask. This operation alone does not provide clinical evidence.

direct target loss

Position-local supervised term, distinct from indirect gradients through contextual computation.

discount factor

The factor controlling the contribution of future rewards to a discounted return.

domain adaptation

Adaptation across data distributions with the task specified.

dropout

Random masking during training, with a stated scaling convention; ordinarily disabled at inference.

dynamic routing

Per-example iterative coupling updates; distinct from optimization of learned weights.

embedded selection

Selection occurs within model fitting.

embedding space

Learned representation space.

empty mask

No foreground; loss and metric conventions require explicit handling.

epidermis

Outer layer of skin.

epoch

One pass through the training dataset; usually several minibatch updates.

equivariance

Input transformation induces a specified representation transformation.

eschar

Necrotic tissue forming an adherent covering that is often dry, firm or leathery and may obscure the wound bed; it is distinct from a healed scar.

evaluation unit

The observation counted in evaluation, such as a patient, wound, image, pixel or object.

evidence lower bound

A variational lower bound on the marginal log likelihood; in a conditional model, on logp(Y | A'i. The ordinary negative ELBO has unit KL weight; a different ^ changes the objective.

expectation-maximization

An iterative latent-variable estimation method alternating an E-step that computes posterior expectations under current parameters and an M-step that maximizes the expected complete-data log likelihood; generalized EM only requires an increase.

exponential moving average

A recursive average mt = pmt—1 + (1 — p)xt, with fixed 0 < p < 1, giving older observations geometrically decreasing weights; here it averages student parameters to update the teacher.

external testing

Evaluation of a frozen model and inference procedure on data collected separately from, and not used in, model development, for example at another institution. State the source differences and any patient overlap checks.

F1 score

2TP/(2TP+FP+FN), the harmonic-mean combination of precision and recall when defined.

feature extraction

Construct descriptors from images or regions.

feature map

In a CNN, a spatial array of activations produced by a filter or layer. In kernel methods, a mapping ^(x) from inputs into a feature space; the intended meaning is determined by context.

feature selection

Retention of a subset of candidate descriptors; data-dependent choices are fitted within training folds.

federated averaging

Federated parameter aggregation with specified client participation and weighting, commonly based on local sample counts.

federated learning

Collaborative model training across data holders that retain raw training data locally and exchange permitted learning information, such as model updates; privacy depends on the stated protocol and threat model.

filter

A collection of coefficients applied across spatial neighborhoods in a convolutional layer.

filter method

A feature-selection method using a screening or ranking criterion independent of fitting and evaluating the chosen final predictor, such as variance, correlation or mutual information.

fine-tuning

Update pretrained parameters under a stated data and optimization protocol.

focal loss

A loss that modulates contributions according to difficulty; focal cross-entropy and focal Tversky use different base terms.

forecast horizon

Future target interval with specified time units and information cutoff.

forget gate

Continuous LSTM scaling of previous cell content.

format failure

Model response that violates the predeclared parser or allowed-label set.

forward propagation

Compute activations and output.

frozen feature extraction

Train the head without updating encoder parameters; layer mode is a separate choice.

frozen inference policy

The complete inference procedure fixed before final testing, including preprocessing, checkpoint, label mapping, calibration, parsing or abstention rules, and decision thresholds.

full-scale fusion

Resize features from multiple resolutions and combine their channels.

Gaussian mixture model

Weighted sum of Gaussian component densities.

generalized Dice

An overlap objective using class-volume-dependent weights, with explicit absent-class handling.

gradient descent

An iterative minimization method that updates parameters by 0t+1 0,

%VL(0t), with a specified positive learning rate %.

granulation tissue

New vascular connective tissue formed during repair; appearance alone is insufficient for a tissue diagnosis.

Group Relative Policy Optimization (GRPO)

Post-training using response-group relative rewards; specify ratio and regular-ization variant.

growth rate

New channels per layer in a dense block.

hard clustering

Assign one cluster per observation.

hard-example mining

Selection of training examples, pairs or triplets that are difficult for the current model under a declared criterion, such as high loss or a violated margin.

Hausdorff distance

For nonempty boundary sets A and B, H(A, B) = max{h(A, B), h(B, A)}, where h(A, B) = supaeA inf^eB d(a, 0- State the coordinate system, distance units and empty-boundary convention.

hematoma

Localized collection of blood.

hidden layer

A network layer between the input and final output; its activations may still be inspected.

horizontal federated learning

Compatible feature schemas across different samples.

incision

Cut; surgical incision when context specifies.

independently recurrent network

Elementwise recurrence within a layer; feed-forward interlayer connections mix neurons.

infection

Invasion and multiplication of microorganisms with a host response; distinct from contamination or colonization.

information leakage

Disclosure or inferability of private information through exchanged or released information, such as gradients, activations or predictions; here the term concerns privacy leakage, distinct from contamination of training or evaluation by unavailable data.

input gate

Continuous LSTM scaling of candidate cell content.

instance segmentation

Assignment of a category and a separate pixel-level mask to each object instance, including separate instances of the same category.

inter-rater agreement

Agreement among independently obtained annotations.

interaction budget

Number/time of prompts or corrections included in evaluation.

intersection over union

For sets or regions A and B, |AnB|/|AUB|, also called Jaccard similarity.

State the evaluated regions and the convention when both sets are empty.

invariance

Output remains unchanged under a specified input transformation.

inverted bottleneck

Expansion from a narrow representation followed by projection back.

Jaccard similarity

Intersection divided by union; state the empty-set convention.

kernel

A spatial filter in a convolutional layer; kernel functions in SVMs have a different definition.

key

Projected representation compared with queries; shares source positions with values.

knowledge distillation

Teacher predictions or representations supervise a student; teacher access and cost matter.

label propagation

Graph-based transfer of known label information.

laceration

Tissue tear; distinguish a planned incision.

layer normalization

Normalization using statistics over specified feature dimensions within each example, usually followed by learned scale and shift; in the Transformer examples here, normalization is over the coordinates of each token.

learning rate

Positive step size under the stated update convention.

localization

Identify an object location, often a bounding box.

log loss

The negative logarithmic score assigned to the reference outcome, with stated clipping and logarithm conventions.

logit

Unnormalized real-valued class score before sigmoid or softmax.

loss function

A function measuring prediction error for specified observations; the full objective may add regularization.

low-rank adaptation (LoRA)

Frozen base weights plus trainable low-rank factors; base memory remains.

machine learning

Methods that fit predictive or descriptive models from data under a specified objective.

macro averaging

Equal weight to each specified case or class.

Mahalanobis distance

Distance induced by a positive-definite quadratic form; a singular positive- semidefinite form gives a pseudometric.

margin

A separation or tolerance quantity defined by a classifier or loss, such as an SVM or triplet margin.

Markov decision process

A sequential decision model with states, actions, transitions and rewards satisfying a stated Markov assumption.

masked-image pretraining

Reconstruct hidden image content; downstream targets may differ.

max pooling

Local maximum operation.

maximal marginal relevance (MMR)

Retrieval rule balancing query relevance and redundancy; diversity is not clinical correctness.

metric learning

Learning geometry or distances in a representation.

micro averaging

Pool counts before computing the metric.

minibatch

A subset of training observations used to estimate an update within an optimization step.

Minkowski distance

Distance defined by the p-norm of coordinate differences for p at least one.

modality availability mask

Binary indicator of observed input modalities; individual feature masks remain separate.

model-written caption

Text produced by a model from an image; not independently collected clinical information.

momentum

An optimization mechanism that accumulates a weighted history of gradient information; sign conventions vary.

multi-head attention

Several projected attention operations followed by concatenation and output projection.

multilabel classification

Several endpoints may be positive; target encoding determines the loss.

multilayer perceptron

A feed-forward neural network composed of affine transformations and nonlinear activations.

multimodal classification

Classification using an image and declared additional inputs; reference labels are outside inference.

multimodal fusion

Combining visual and other permitted information with missing-modality evaluation.

naive Bayes

A probabilistic classifier using conditional independence of features given the class.

nearest neighbor

The observation closest to a query under the chosen representation and distance.

necrotic tissue

Dead tissue; visual appearance is not a complete diagnosis.

negative example

In contrastive or triplet learning, an example designated nonmatching to an anchor under the stated pairing rule. In binary classification, an observation assigned the declared negative reference class.

negative predictive value

TN/(TN+FN), the fraction of negative predictions that match the reference.

negative transfer

Reuse worsens the defined target outcome against an appropriate baseline.

nested skip pathway

Intermediate feature processing along encoder-decoder skip connections.

neural network

A parameterized composition of computational units and layers that maps inputs to representations or outputs.

neuropathy

Nerve damage; loss of protective sensation may contribute to foot injury.

open wound

Disrupted skin barrier.

oracle crop

Crop derived from a reference mask; separate from deployable predicted-mask inference.

output stride

Spacing of output samples relative to the input grid.

overfitting

Training fit that does not generalize to new data.

overlapping-tile inference

Blend valid outputs in a common coordinate system before thresholding.

oversampling

Increase training representation of selected classes.

padding

Boundary extension; usually zero padding here.

padding mask

Excludes artificial input positions; all-masked rows need explicit handling.

paired transformation

Apply the same geometric transform to image and annotation.

panoptic segmentation

Joint semantic and instance-level scene interpretation.

parameter sharing

Same coefficients reused at multiple positions.

patch merging

Concatenate neighboring token features, normalize/project, and reduce the spatial grid.

patient-cluster bootstrap

Bootstrap resampling of patient groups with all associated observations, retaining pairing in model comparisons.

patient-level bootstrap

Resample patients with their associated observations.

patient-level separation

All observations from one patient remain in one evaluation partition.

patient-level split

No patient appears in more than one data partition.

perfusion

Blood delivery to tissue.

policy

Action distribution or decision rule.

policy gradient

Gradient of expected return.

pooling

Aggregation over a spatial neighborhood or token set; the reduction rule specifies the operation.

positional embedding

Spatial or sequential position information added or otherwise incorporated into a representation.

positive example

In contrastive or triplet learning, an example designated matching to an anchor under the stated pairing rule. In binary classification, an observation assigned the declared positive reference class.

precision / positive predictive value

TP/(TP+FP), the fraction of positive predictions that match the reference; it depends on prevalence.

prediction ledger

One row per evaluated input with saved output, status and separately joined reference.

preprocessing

Image preparation; distinct from feature extraction and selection.

pressure injury

Localized tissue damage associated with pressure or pressure combined with shear, often over a bony prominence.

privacy

Protection of information under a specified threat model; keeping data local alone does not establish it.

ProbSparse attention

Informer approximates informative query-row selection; not simply a global top-key rule.

projection shortcut

A transformation aligning dimensions before residual addition; its Jacobian replaces the identity shortcut in the backward path.

promptable segmentation

Mask conditioned on points, boxes, previous masks, or concepts.

puncture wound

Entry through the surface into deeper tissue.

pyoderma gangrenosum

An inflammatory neutrophilic skin disease that can produce ulcers and resemble other wound causes. PG is the positive class only in the explicitly identified PG/UC study examples; its diagnosis is not inferred from a photograph alone.

query

Projected representation that indexes an attention output row.

random forest

Ensemble of randomized trees.

rationale grounding

Support for explicit explanation claims in the available evidence; distinct from class accuracy.

reasoning distillation

Supervised transfer of teacher responses, including possible errors; teacher labels are not reference standards.

receiver operating characteristic

A curve of sensitivity against false-positive rate as the decision threshold varies.

receptive field

Input region contributing to a unit.

reference label

Assigned using a documented clinical/annotation standard, with uncertainty retained.

reference mask

A spatial annotation obtained under a stated protocol; it can contain uncertainty or disagreement.

reference standard

Comparison criterion or annotations used to evaluate a model; may itself have uncertainty.

regularization

Penalty or other constraint intended to control learning.

reinforcement learning

Learning to select actions through interaction and reward feedback in a sequential decision problem.

reset gate

GRU gating of recurrent candidate information; implementation placement varies.

response-level policy ratio

Probability of a complete response under current policy divided by frozen old- policy probability.

responsibility

Posterior component probability for one observation.

return

Discounted reward sum in the stated formulation.

reward

Environment feedback, distinct from cumulative return.

satisfiability modulo theories (SMT)

Checking whether a logical formula has a model satisfying a specified back-ground theory, such as arithmetic or arrays. Satisfiability does not establish that the supplied wound-related premises are clinically true.

score-map fusion

Align and add corresponding class-score channels.

seasonal-trend decomposition

Separation of a time series into trend and seasonal or residual components. In the chapter’s formulation, T = MAfc(u) and S = u — T; calling S seasonal does not establish periodic wound behavior.

segmentation

Assignment of spatial labels to image pixels or volume voxels.

selective prediction

Prediction with a declared abstention rule; report coverage and error among accepted cases.

selective scan

Input-dependent state updates; distinguish token order from physical time.

self-attention

Queries, keys and values originate from the same representation.

self-configuration

Selection of processing, training and inference settings from dataset properties, as in nnU-Net.

self-supervised learning

Learning with targets constructed from observed data; downstream wound claims still require task-specific reference labels and evaluation.

semantic segmentation

Category at each pixel; separate object identities are not required.

semi-supervised learning

Labeled and unlabeled examples used jointly.

sensitivity / recall

TP/(TP+FN), the fraction of reference positives recovered for a specified positive class.

separable self-attention

MobileViTv2 context reduction and broadcast modulation, not dense pairwise attention.

seroma

Collection of serous fluid.

shifted window

Changed attention neighborhoods with masks excluding artificial wraparound.

signed distance map

A field whose magnitude is distance to the nearest point on a specified boundary, with zero on the boundary and, under this book’s convention, negative values inside and positive values outside. State the spatial units and discrete-grid convention.

slack variable

Nonnegative allowance for margin violation.

slough

Devitalized material in a wound bed; color alone does not diagnose infection.

soft clustering

Assignment of graded membership values rather than a single hard cluster identity.

spatial attention

Weights varying over spatial positions.

spatial reduction

Reduce key/value positions while retaining query positions.

specificity

TN/(TN+FP), the fraction of reference negatives recovered.

spectral clustering

Cluster an embedding derived from a similarity graph.

split learning

Network split at a cut layer between parties.

state-space model

Hidden-state recurrence carries information along a sequence.

stride

The spatial displacement between successive filter or pooling positions.

subcutaneous tissue

Beneath the skin proper; also hypodermis.

supervised learning

Training uses input-target pairs.

support vector

Training observation with a nonzero dual coefficient.

teacher-student consistency

Compare aligned predictions; pseudo-target errors remain possible.

temperature scaling

Post-hoc probability calibration that divides logits by a common positive temperature T fitted on development data before applying sigmoid or softmax. It preserves the argmax class under the common-temperature multiclass rule.

test

Held-out evaluation under the stated protocol.

tokenization

Conversion of input into tokens. Text tokenization maps text to a sequence of discrete tokens or token IDs, which are then embedded; visual token construction converts image patches or feature groups into token representations.

Tomek link

Opposite-class mutual nearest-neighbor pair.

trajectory

State-action sequence; not a filesystem path in this context.

transfer learning

Reusing information or parameters learned on one task or domain for another.

transposed convolution

Transpose of a convolution operator; generally not its inverse.

triplet loss

A loss comparing anchor-positive and anchor-negative distances, usually with a specified margin.

tuning set

Separate data used for model selection; often called a validation set.

Tversky index

An overlap index with separately weighted false-positive and false-negative terms.

ulcus cruris

Leg ulcer. UC is the conventional-leg-ulcer reference group in the cited PG/UC study; the abbreviation does not establish a venous cause for every pictured case.

unannotated pixel

A pixel without an assigned reference label; its contribution is excluded by the declared validity mask.

undersampling

Reduce selected training observations or construct prototypes.

unit

A computational element that combines inputs and usually applies an activation function.

unsupervised learning

No target labels supplied for the objective.

update gate

A recurrent gating coefficient that blends prior and candidate state according to the stated GRU convention.

valid convolution

Convolution without boundary padding.

valid overlap mask

Indicator of usable registered sensor samples; not a class label.

validation

Data used for model selection or development checks under a declared protocol; separate from final testing.

value

Vector combined by attention weights; distinct from query/key scores.

variance reduction

A technique that reduces an estimator’s variability while preserving the required expectation or accounting for bias.

venous ulcer

An ulcer associated with venous disease, commonly in the lower-leg gaiter region; etiology requires clinical assessment.

vertical federated learning

Complementary features for overlapping samples.

vision-language merger

Projection and optional grouping of visual features into the language model hidden width.

voxel spacing

Physical distance represented along each volume axis.

weight

A coefficient in a model transformation; aggregation weights have a separate, locally defined role.

weighted cross-entropy

Cross-entropy with declared class or spatial weights and a specified normalization.

windowed attention

Interactions restricted to specified local token groups.

wound

Tissue disruption or injury; not limited to an open skin defect.

wound healing

The biological processes that repair injured tissue, including overlapping inflammatory, proliferative and remodeling phases.

wound-type classification

Classification of operational wound categories or etiologies; infection and tissue classification are distinct targets.

wrapper method

Evaluate subsets using a fitted predictor.

Notation

This guide consolidates the chapter registers without imposing one global meaning on reused symbols. Scope and dimensions matter: a temperature, trajectory and decision threshold may share a symbol in different methods. Read each equation’s local definition first.

Illustrations are not included in the reading sample

Input and target; number of observations. An input may be a vector or image; N also denotes input width in the dense-layer derivation.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Layer weights, bias, and activation. Dense-layer vectors are columns; weight dimensions specify input and output widths.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Parameters, example loss, objective. I also indexes layers locally; ¿data names the example loss in backpropagation.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Class count, local count, layer width, depth. K counts filters or clients in their respective sections; L counts hidden layers.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Probability, decision score, threshold. In evaluation, r is a cutoff; in reinforcement learning it denotes a trajectory.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Step size/margin, momentum/discount, stabilizer/tolerance. Also: a is the Byzantine fraction; 7 is batch-normalization scale. Ranges are method-specific.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

True/false positive/negative counts. Counts refer to a specified positive label and prediction unit.

Scope: Chapter 2, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Feature vector, label, observation count. An observation may be an image, region, or pixel; patient groups remain separate.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

SVM normal, offset, decision score. w E Rd; g(x) is not a probability.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

<A -

SVM penalty, slack, dual coefficient. C is a positive scalar here; it denotes a class count in other classifier formulas.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Neighbor count and cluster count. Lowercase k also names a kernel function when it has two input arguments.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Mixture mean, covariance, weight, responsibility. d, d x d, scalar, scalar; Table 3.2 gives the clustering procedure notation.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Objective/similarity and log likelihood. J is k-means loss or Jaccard similarity; I is mixture log likelihood, by context.

Scope: Chapter 3, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Hard-cluster index set, hard count, and effective mixture membership. nk = \Ck\ is an integer;

Nk = ^i rik may be noninteger. Each responsibility is in [0,1],

Scope: 3.6 (clustering procedures)

Illustrations are not included in the reading sample

Image, target, patient, site; image count. xn E ^HxWxC; repeated images can share gn.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Classes, input channels; feature-map dimensions. K and C have different roles; d is the embedding width after pooling.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Encoder function, spatial output, pooled embedding, logits, probabilities. FQ(X) E ^hxwxd;

z E Rd; q,p E RK in Equation (4.2).

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

A,b,t

Head weights, bias, one-hot target. K xd, K, K; t encodes the reference class.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

Input capsule, vote, output capsule. Vector dimensions are determined by the capsule layer and its vote transform.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Routing logit and coupling weight. bij is distinct from head bias b; couplings normalize over candidate outputs.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

M, r, Brier

Confusion matrix, cutoff/temperature, Brier score. Reference rows; r is a cutoff or positive contrastive temperature. Brier normalization is stated locally.

Scope: Chapter 4, opening notation guide; local equation definition is authoritative

X,H, W,C;Q

Input image, dimensions, pixel grid. X G ^HxWxC; C counts input channels.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

n,N- i,k,K

Image index/count; pixel index, class index/count. i G Q; images and pixels are different evaluation units.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

>i,>ik,M/

Binary/class target and annotation-validity mask. Loss notation: yi = Yi, m = Mi;

M = ^i m^ counts annotated pixels. Zero validity means unannotated.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Logit, probability, threshold, predicted mask. Yj = 1 [pi > r] for the binary case.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Encoder and decoder features. Skip operations require compatible spatial grids and specified channel dimensions.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

k, p, d, s, o

Kernel, padding, dilation, stride, output padding. Local convolution sizes; here p is padding, not a probability.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

A,B,e

Local overlap sums and smoothing constant. In Dice-loss derivations these are scalars; state-space A, B are matrices defined separately.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

gn ,sn

Patient and acquisition-source identifiers. Used to group and audit images; sn is not convolution stride.

Scope: Chapter 5, opening notation guide; local equation definition is authoritative

Yi,mi,^i; n

Image, optional metadata, reference class; image count. Xt G SHxWx; m, G Kq.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

T,N,d

Token matrix, local count, embedding width. T G RNxd in attention. ViT: N patches, N + 1 tokens; DeiT: N + 2 tokens.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

Q,K,V

Query, key, value matrices. N x dk, N x dk, N x dv for self-attention.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

S,A,O

Attention scores, weights, output. N x N, N x N, N x dv; A normalizes over keys.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

WQ,WK,WV

Learned projection matrices. d x dk, d x dk, d x dv in the row-token convention.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

Z,P,K

Classification logits, probabilities, class count. K is scalar in classification equations and a matrix in attention equations.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

b,dfc,dv; P

Head count, head widths; patch side length. Patch size is in pixels; embedding widths count features, not spatial positions.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

Illustrations are not included in the reading sample

Time index, final time; temperature. T names the token matrix in attention and final time in recurrence; r > 0 controls temperature.

Scope: Chapter 6, opening notation guide; local equation definition is authoritative

X,H, W,C,D

image or volume and height/width/channels/depth. H x W x C orDxHxWxC

Scope: 5.1, 5.6

Q,i,n, g, s

pixel grid; pixel; example; patient group; acquisition site. indices, except Omega is a set

Scope: 5.1

Illustrations are not included in the reading sample

Reference mask/target, class indicator, predicted class index. For binary loss, pj = Yj G {0, 1}.

For multiclass segmentation, Y^. G {0,1} with E^ Yj^ = 1, and pj = argmax^p^.

Scope: 5.1, 5.4

mz,Mz,M

Label validity and annotated-pixel count. For one image, m, = Mj G {0,1};

M = Ei m» > 0 is a scalar count in the losses, not a mask array.

Scope: 5.1, 5.4

0,Z,z,p,r

model parameters, logits, probabilities, decision threshold. Z and p have spatial output grid; tau scalar

Scope: 5.1

s,P,&

mean contour, PCA basis, shape coefficients. 2L; 2L x r; r

Scope: 5.2; P reused locally as projection elsewhere

Illustrations are not included in the reading sample

target-to-atlas transform, atlas labels, voting weights. coordinate map; class map; nonnegative scalar

Scope: 5.2

Illustrations are not included in the reading sample

Encoder/decoder features; convolution, downsampling, upsampling and decoder-processing operators. G¿,^,F,V^ denote the respective operators. Align spatial grids before channel concatenation.

Scope: 5.3 k, p, d, s, o kernel, padding, dilation, stride, output padding. axis-wise integer sizes; locally scoped Scope: 5.3

Illustrations are not included in the reading sample

Class weights and border-emphasis parameters. Wfc,wc(i) balance classes; ^,, sets border amplitude; > 0 is a spatial scale. ¿1 ,¿2 are distances to the first/second nearest object boundaries, in the same units as CT^ .

Scope: 5.4

A,F,e

Dice overlap sum, prediction+target volume, smoothing. nonnegative scalars; epsilon positive Scope: 5.4; not state-space A/B afc,Vfc

generalized-Dice weight and reference class volume. op = 1/Vj? only when V^ > 0

Scope: 5.4

Illustrations are not included in the reading sample

soft overlap counts and Tversky FP/FN weights. scalars with explicit coefficient convention Scope: 5.4

Illustrations are not included in the reading sample

focal parameters, Tversky exponent, class factor. " > 0; q = 1/"T with "T > 0

Scope: 5.4

jy-Xr-R

signed distance, objective weights, auxiliary-head count. distance units; nonnegative weights

Scope: 5.4

Illustrations are not included in the reading sample

EMA decay, teacher weights, transforms, accepted pixels. aligned visible grid; positive denominator

Scope: 5.5

atffPtfl

tile blending weight and probability. weight zero outside valid tile output

Scope: 5.5

physical voxel spacing. millimeters per voxel

Scope: 5.6

F-P-Hz-g-Co

residual transform/projection, dense layer, growth, initial channels. equal shapes for addition; widths sum for concatenation

Scope: 5.7

Illustrations are not included in the reading sample

recurrent feature, feedforward/recurrent kernels, steps. shared kernels across updates

Scope: 5.7

Illustrations are not included in the reading sample

nested features, resize/projection, common branch width. all branches align to target grid

Scope: 5.8

Illustrations are not included in the reading sample

skip, gate, projections, scalar head and gate coefficient. C_x; C_g; F x C_x; F x C_g; F; scalar

Scope: 5.9

P,N,d,Q,K,V,A

patch side, token count, width, queries/keys/values, attention matrix. Q,K:N x d_k; V:N x d_v; A:NxN

Scope: 5.11

A,B,C,D,h,u,N

continuous state matrices, state, input, step. nxn; nx 1; 1 xn; scalar; n; scalar; scalar

Scope: 5.12

A,B

discrete state/input operators. exact zero-order-hold integral or explicitly stated approximation Scope: 5.12

F,Bx,Bp,S,Mt

prompt, image/prompt features, quality score, sequence memory. model-specific feature dimensions; score is estimated

Scope: 5.13

Illustrations are not included in the reading sample

Latent vector, conditional prior, variational approximate posterior, segmentation likelihood, KL weight. z G R^; p^(z | X), q^(z | X, Y), p^(Y | X, z); f3 > 0. The posterior network sees Y during training; inference samples the prior.

Scope: 5.14

Illustrations are not included in the reading sample

Gaussian latent means and standard deviations. d-vectors; positive standard deviations

Scope: 5.14

Illustrations are not included in the reading sample

Noisy encoded mask, diffusion coefficients and Gaussian noise. G (0,1), «t = 1 — ^ and «t = n§=i X. Noise e ~ X(0,1) has the encoded-mask grid.

Scope: 5.14

J.RH’./’TJXDJ

predicted/reference sets, overlap counts, Dice, loU. counts on identical grid; ratios need empty-mask rule

Scope: 5.15

ax,aB,d,H,xssn

boundaries, closest-point distance, boundary metrics. pixels or calibrated physical units

Scope: 5.15

X /T

Illustrations are not included in the reading sample

Foreground-pixel count, physical scales and estimated projected planar areas. •v-,-s‘y are in mm/pixel; -d||||||2 = YwOinid'V"s'y. Numerical area values satisfy Acm2 = Amm2/100, since 1 cm[2] = 100 mm[2]. A valid constant planar scale is required.

Scope: 5.15

X,F, W,n,X,m,g

RGB image, pixel dimensions, sample/class counts, metadata, patient group. H x W x 3; metadata q-vector; identifiers are not automatic model inputs

Scope: 6.2

z,p,y, k*,r

Class logits/probabilities, encoded target, scalar true-class index and endpoint availability.

z, p G RX; y is one-hot or a binary multilabel X-vector. k* G {1,...,X} applies to single-label classification; r G {0,1}X marks observed multilabel endpoints.

Scope: 6.2, 6.13

UAXt^t

sequence input, hidden state, LSTM cell, concatenated input/state. d; r; r; d+r; row/column convention defined locally

Scope: 6.4

it,ft,°t,rt,zt

input/forget/output/reset/update gates. r-vectors in (0,1); large GRU update gate favors candidate here

Scope: 6.4

T,Q,K,V,N,d,dk,dv

tokens, queries, keys, values and widths. T:N x d; Q,K:N x d_k; V:N x d_v; K also denotes class count elsewhere

Scope: 6.5

S,A,O,M

attention scores, normalized weights, output, additive mask. N_q x N_k; N_q x N_k; N_q x d_v; N_q x N_k

Scope: 6.5

h,WQ,WK,Wv,Wo

head count and projection weights. per-head projections; output h*d_v x d; h is not hidden state here

Scope: 6.5

P,v,y,p,e

layer-normalization mean, variance, scale, shift, stabilizer. per-token scalar mean/variance; d-vector affine parameters

Scope: 6.5

F,N,L,Lpos,tcis

patch side/count, patch projection, positions, class token. N = (H/P)(W/P) patches;

projection 3P[2] x d; positions (N + 1) x d; class token 1 x d. Total sequence: N + 1 tokens, or N + 2 with the DeiT distillation token.

Scope: 6.6

T, A, qT,pT

distillation temperature, mixing weight, teacher/student distributions. tau positive; lambda in

[0,1]; K-vectors

Scope: 6.7

Pels ,Pdist ,yT,Cp,dS,eT,m

DeiT head probabilities and hard teacher label; DINO prototype count, student/teacher parameters and EMA coefficient. K-vectors; class index; prototype count; matching parameter arrays; 0 < m < 1

Scope: 6.7

M,FS,FT,G

Masked patch set, normalized student/teacher features, Gram matrix. M contains masked patch indices. Row-normalized FS G RNxds and FT G RNxdT give N x N Gram matrices; widths may differ, but patch positions must correspond.

Scope: 6.7; M is not additive attention mask here

Ht,Wt,M,rs

token grid, window side, spatial-reduction factor. integer token counts; divisibility/padding policy required

Scope: 6.8

Fc,Ft,Pc,Pt,G

CNN/Transformer feature grids, channel projections and fusion gate. Fc ■■ h x w x c;

Ft ■ h x w x d; Pc ■■ c x r; Ppdxr. Gate G has shape h x w x r, or h x w x 1 for a scalar spatial gate broadcast over channels.

Scope: 6.10

Ui.bi.A classification/mask availability and joint-loss weights. binary availability; nonnegative scalar weights; zero-denominator terms omitted

Scope: 6.11

l:-oc.L.P.rpl

Visit times, observations, history length, forecast horizon and future-reference availability.

U E R[9]; L,F count time steps. Indicator rjj G {0,1} equals one when future reference value Yjj is observed. State the visit-time unit.

Scope: 6.14

Mi. Mi,LQ,LK,Si

Exact query-sparsity score, full-key proxy, query/key counts and sampled-key multiset.

Illustrations are not included in the reading sample

M^, Mi are scalars per query; Si is the sampled multiset. The sampled-code sum uses denominator Lk ; query selection preserves output rows.

Scope: 6.14

z.fy.'W.Pf,

penultimate classification feature, decoder grid, channel scale and offset. d_z-vector; h_l x w_l x c_l; c_l-vectors broadcast over spatial axes

Scope: 6.16

T.S.S.i

trend, residual, Fourier coefficients, imaginary unit. signal units; complex coefficients;

/~ = —1, not observation index

Scope: 6.14

C,TP,FP,FN,Pk,Rk,Fi.k

confusion counts, class counts, precision, recall, F1. rows reference/columns prediction; zero denominators explicitly undefined

Scope: 6.15

Bb.ECE,r

confidence bins, calibration error, fitted temperature. sets; dimensionless error; positive scalar

Scope: 6.15

xi,yi,9i, yi

Input, reference label, patient ID, predicted label. Observation-level variables

Scope: 2.5 (evaluation foundations)

si,pi,T

Ranking score, positive-class probability, threshold. Score; probability in [0,1]; score threshold

Scope: 2.5 (evaluation foundations)

TP,TN,FP,FN

True/false positive/negative counts. Images, patients, pixels or objects: declare unit

Scope: 2.5 (evaluation foundations)

MlJ,K,nk,N

Reference-row/prediction-column counts, classes, class support, sample size. Counts

Scope: 2.5 (evaluation foundations)

K, Se,Sp

Prevalence, sensitivity and specificity. Fractions in [0,1]

Scope: 2.5 (evaluation foundations)

A,B,D,J

Predicted/reference foreground sets, Dice, IoU. Pixel sets and dimensionless overlap scores

Scope: 2.5 (evaluation foundations)

Bb,pb,yb

Probability bin and its mean probability/reference frequency. Group summaries

Scope: 2.5 (evaluation foundations)

Xi,mi,ti,Ui

Photograph, structured metadata, text, additional sensor input. A record may contain only some inputs.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative ai,ri

Modality and individual-feature availability. Binary vectors; 1 means observed.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

yi,yi,yi

Reference, system prediction, teacher prediction. Math: 1, ...,K. Binary fixtures: 0/1. Code: 0, ...,K — 1; save the label map.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

hI,hM\ dl,dM

Image and metadata embeddings; widths. hk E ^dI, hM E ^dM.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

TT,TM^ NT,NM,d

Image and metadata token matrices. Nj x d and NM * d; rows are tokens.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

K,Q,V

Keys, queries, values inside attention. Bold or matrix context distinguishes keys from scalar class count K.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

S,k,X

Training support pool, context size, selected support. k is not the number of target classes.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

^,o,L

Autoregressive model, output sequence, sequence length. ot denotes one decoder output token.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

G, Rg .A^

Response-group size, reward, normalized advantage. One response group per training query.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

Pg.E.fi

Policy ratio, clipping width, KL weight. Policy learning; ¡3 separately denotes a bilinear interpolation offset.

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

rL,aL

Low-rank update rank and scale. Distinct from missing-feature mask r..

Scope: Chapter 7, opening notation guide; local equation definition is authoritative

8h\dg

Classification gradient at fused representation; gate preactivation gradient. d-dimensional column vectors

Scope: Chapter 7, fusion learning

Kea,ep,en

Triplet margin; anchor, positive and negative embeddings. scalar; d_R-dimensional vectors

Scope: Chapter 7, metric learning

cr,de,dh

Projected visual tokens; decoder width; connector hidden width. N_I x d_ell; positive integer widths

Scope: Chapter 7, vision-language interface

vU’hU

Valid sensor-overlap mask; masked pooled sensor feature. binary spatial mask; feature vector

Scope: Chapter 7, sensor registration

U;€

Finite complete-response set; its trainable logits. four responses in the numerical fixture

Scope: Chapter 7, exact policy update

Dtr.Dtu ,D[e

Training, tuning, testing partitions. Disjoint manifest rows; group disjointness when identifiers exist

Scope: Chapter 8, practical notation guide; local equation definition is authoritative

N,y

Image batch and wound-type targets. B x 3 x 64 x 64; y E {0,1,2, 3}B in D, P, S, V order

Scope: Chapter 8, practical notation guide; local equation definition is authoritative

z,p

Class logits and probabilities. B x 4; class order D, P, S, V

Scope: Chapter 8, practical notation guide; local equation definition is authoritative

0,A

Learned parameters and selected settings. Weights; architecture, temperature, threshold, preprocessing

Scope: Chapter 8, practical notation guide; local equation definition is authoritative

T,T

Temperature and acceptance threshold. Positive scalar; threshold in [0,1]

Scope: Chapter 8, practical notation guide; local equation definition is authoritative -—-

M,M

Reference and predicted binary masks. B x 1 x H x W

Scope: Chapter 8, practical notation guide; local equation definition is authoritative ri,9i

Sample record and grouping identifier. CSV row; patient ID when documented

Scope: Chapter 8, practical notation guide; local equation definition is authoritative ai

Accepted-decision indicator. Boolean; never a reference class

Scope: Chapter 8, practical notation guide; local equation definition is authoritative

Bibliography

[1] Chandan K. Sen. Human Wounds and Its Burden: An Updated Compendium of Estimates. Advances in Wound Care, 8(2):39-48, 2019. doi: 10.1089/wound.2019.0946. URL https://doi.org/10.1089/wound.2019.0946.

[2] Chandan K. Sen. Human Wound and Its Burden: Updated 2020 Compendium of Estimates. Advances in Wound Care, 10(5):281-292, 2021. doi: 10.1089/wound.2021.0026. URL https://doi.org/10.1089/wound.2021.0026.

[3] Chandan K. Sen. Human Wound and Its Burden: Updated 2025 Compendium of Estimates. Advances in Wound Care, 14(9):429-438, 2025. doi: 10.1177/21621918251359554. URL https://doi.org/10.1177/21621918251359554.

[4] Shruti Chhabra, Naveen Chhabra, Avneet Kaur, and Niti Gupta. Wound Healing Concepts in Clinical Practice of OMFS. Journal of Maxillofacial and Oral Surgery, 16(4):403-423, 2017. doi: 10.1007/s12663-016-0880-z. URL https://doi.org/10.1007/s12663-016-0880-z.

[5] Marissa J. Carter, Joan DaVanzo, Randall Haught, Marcia Nusgart, Donna Cartwright, and Caroline E. Fife. Chronic wound prevalence and the associated cost of treatment in Medicare beneficiaries: changes between 2014 and 2019. Journal of Medical Economics, 26(1):894-901, 2023. doi: 10.1080/13696998.2023.2232256. URL https://doi.org/10.1080/13696998.2023.2232256.

[6] David G. Armstrong, Tze-Woei Tan, Andrew J. M. Boulton, and Sicco A. Bus. Diabetic Foot Ulcers: AReview. JAMA, 330(1):62-75, 2023. doi: 10.1001/jama.2023.10578. URL https://doi.org/10.1001/jama.2023.10578.

[7] Yungang Hu, Yaling Zhao, Huimin Wu, Guanqun Wan, Xiaolin Li, Qi Zeng, and Yuming Shen. Global Epidemiology, Burden, and Future Projections of Decubitus Ulcers: A Comprehensive Analysis From 1990 to 2050. Wound Repair and Regeneration, 33(3):e70048, 2025. doi: 10.1111/wrr.70048. URL https://doi.org/10.1111/wrr.70048.

[8] David G. Armstrong, Mark A. Swerdlow, Alexandria A. Armstrong, Michael S. Conte, William V. Padula, and Sicco A. Bus. Five year mortality and direct costs of care for people with diabetic foot complications are comparable to cancer. Journal of Foot and Ankle Research, 13(1):16, 2020. doi: 10.1186/s13047-020-00383-2. URL https://doi.org/10.1186/s13047-020-00383-2.

[9] Sean M. Nagle, Kaitlyn A. Stevens, and Steven C. Wilbraham. Wound Assessment. In StatPearls. StatPearls Publishing, 2023. URL https://www.ncbi.nlm.nih.gov/books/NBK482198/. Updated 2023.

[10] Hua Gao, Yang Li, Shaobin Jin, Wenli Zhai, Yanhua Gao, and Linzhe Pu. Epidemiological characteristics and factors affecting healing in unintentional pediatric wounds. Frontiers in Public Health, 12:1352176, 2024. doi: 10.3389/fpubh.2024.1352176. URL https://doi.org/10.3389/fpubh.2024.1352176.

[11] Adil H. Haider, J. Hunter Young, Mehreen Kisat, Cassandra V. Villegas, Valerie K. Scott, Karim S. Ladha, et al. Association Between Intentional Injury and Long-Term Survival After Trauma. Annals of Surgery, 259(5): 985-992,2014. doi: 10.1097/sla.0000000000000486. URL https://doi.org/10.1097/sla.0000000000000486.

[12] T.V Prakash, Ajay Chaudhary, Shyam Purushothaman, Smitha K.V., and Varada Arvind K. Epidermal Grafting for Chronic Complex Wounds in India: A Case Series. Cureus, 8:e516, 2016. doi: 10.7759/cureus.516. URL https://doi.org/10.7759/cureus.516.

[13] Precious O Idogun, Mindy C Ward, Yeshanew Teklie, Wilhelmine Wiese-Rometsch, and Joel Baker. Newly Diagnosed Idiopathic Thrombocytopenia Post COVID-19 Vaccine Administration. Cureus, 13: e14853,2021. doi: 10.7759/cureus.14853. URL https://doi.org/10.7759/cureus.14853.

[14] D. M. Anisuzzaman, Yash Patel, Behrouz Rostami, Jeffrey Niezgoda, Sandeep Gopalakrishnan, and Zeyun Yu. Multi-modal wound classification using wound image and location by deep neural network. Scientific Reports, 12(1):20057, 2022. doi: 10.1038/s41598-022-21813-0. URL https://doi.org/10.1038/s41598-022-21813-0.

[15] Joshua S. Mervis and Tania J. Phillips. Pressure Injuries. Merck Manual Professional Edition, 2026. URL https://www.merckmanuals.com/en-ca/professional/dermatolo gic-disorders/pressure-injury/pressure-injuries. Updated 2026; accessed 2026.

[16] National Institute for Health and Care Excellence. Surgical Site Infections: Prevention and Treatment. NICE guideline NG125, 2019. URL https://www.nice.org.uk/guidance/ng125.

[17] Ruyi Zhang, Dingcheng Tian, Dechao Xu, Wei Qian, and Yudong Yao. A Survey of Wound Image Analysis Using Deep Learning: Classification, Detection, and Segmentation. IEEE Access, 10:79502-79515, 2022. doi: 10.1109/access.2022.3194529. URL https://doi.org/10.1109/access.2022.3194529.

[18] Mai Dabas, Dafna Schwartz, Dimitri Beeckman, and Amit Gefen. Application of Artificial Intelligence Methodologies to Chronic Wound Care and Management: A Scoping Review. Advances in Wound Care, 12 (4):205-240, 2023. doi: 10.1089/wound.2021.0144. URL https://doi.org/10.1089/wound.2021.0144.

[19] Ovya Ganesan, Miranda Xiao Morris, Lifei Guo, and Dennis Orgill. A review of artificial intelligence in wound care. Artificial Intelligence Surgery, 4(4):364-75, 2024. doi: 10.20517/ais.2024.68. URL https://doi.org/10.20517/ais.2024.68.

[20] Ali S. Tejani, Michail E. Klontzas, Anthony A. Gatti, John T. Mongan, Linda Moy, Seong Ho Park, Charles E. Kahn, Jr., and CLAIM 2024 Update Panel. Checklist for Artificial Intelligence in Medical Imaging (CLAIM): 2024 Update. Radiology: Artificial Intelligence, 6(4):e240300, 2024. doi: 10.1148/ryai.240300. URL https://pubs.rsna.org/doi/10.1148/ryai.240300.

[21] Lena Maier-Hein, Annika Reinke, Patrick Godau, Minu D. Tizabi, Florian Buettner, Evangelia Christodoulou, et al. Metrics reloaded: recommendations for image analysis validation. Nature Methods, 21(2): 195-212,2024. doi: 10.1038/s41592-023-02151-z. URL https://doi.org/10.1038/s41592-023-02151-z.

[22] Annika Reinke, Minu D. Tizabi, Michael Baumgartner, Matthias Eisenmann, Doreen Heckmann-Nötzel, A. Emre Kavur, et al. Understanding metric-related pitfalls in image analysis validation. Nature Methods, 21(2):182-194, 2024. doi: 10.1038/s41592-023-02150-0. URL https://doi.org/10.1038/s41592-023-02150-0.

[23] Viknesh Sounderajah, Ahmad Guni, Xiaoxuan Liu, Gary S. Collins, Alan Karthikesalingam, Sheraz R. Markar, et al. The STARD-AI reporting guideline for diagnostic accuracy studies using artificial intelligence. Nature Medicine, 31(10):3283-3289, 2025. doi: 10.1038/s41591-025-03953-8. URL https://doi.org/10.1038/s41591-025-03953-8.

[24] Tom J Liu, Hanwei Wang, Mesakh Christian, Che-Wei Chang, Feipei Lai, and Hao-Chih Tai. Automatic segmentation and measurement of pressure injuries using deep learning models and a LiDAR camera. Scientific reports, 13(1):680, 2023. doi: 10.1038/s41598-022-26812-9. URL https://doi.org/10.1038/s41598-022-26812-9.

[25] Palawat Busaranuvong, Emmanuel Agu, Reza Saadati Fard, Deepak Kumar, Shefalika Gautam, Bengisu Tulu, and Diane Strong. Explainable, Multi-modal Wound Infection Classification from Images Augmented with Generated Captions. arXiv:2502.20277v1, 2025. URL https://arxiv.org/html/2502.20277v1. Author preprint, 2025; exact figure source, CC BY 4.0. Related journal record: DOI 10.1145/3793535 (2026), with revised author list.

[26] Gopi Trinadh Maddikunta and Peizhu Qian. WILLIE: A Unified Framework and Benchmark for Wound Classification, Segmentation, and Localization. In Machine Learning for Healthcare Conference, volume 340 of Proceedings of Machine Learning Research, pages 1243-1263. PMLR, 2026. URL https://proceedings.mlr.press/v340/maddikunta26a.html.

[27] Bill Cassidy, Neil D Reeves, Joseph M Pappachan, David Gillespie, Claire O’Shea, Satyan Rajbhandari, et al. The DFUC 2020 Dataset: Analysis Towards Diabetic Foot Ulcer Detection. touchREVIEWS in Endocrinology, 17(1):5-11, 2021. doi: 10.17925/ee.2021.17.1.5. URL https://doi.org/10.17925/ee.2021.17.U5.

[28] Chuanbo Wang, Amirreza Mahbod, Isabella Ellinger, Adrian Galdran, Sandeep Gopalakrishnan, Jeffrey Niezgoda, and Zeyun Yu. FUSeg: The Foot Ulcer Segmentation Challenge. Information, 15(3):140, 2024. doi: 10.3390/info15030140. URL https://doi.org/10.3390/infol5030140.

[29] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollar, and Ross Girshick. Masked Autoencoders Are Scalable Vision Learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16000-16009, 2022. URL https://openaccess.thecvf.com/content/CVPR2022/html/He_Masked_Autoencoders_Are _Scalable_Vision_Learners_CVPR_2022_paper.html.

[30] Nicola Rieke, Jonny Hancox, Wenqi Li, Fausto Milletarì, Holger R. Roth, Shadi Albarqouni, et al. The future of digital health with federated learning. npj Digital Medicine, 3(1):119, 2020. doi: 10.1038/s41746-020-00323-1. URL https://doi.org/10.1038/s41746-020-00323-1.

[31] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. URL https://www.deeplearningbook.org/.

[32] Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall, 3rd edition, 2010. ISBN 9780136042594. URL https://aima.cs.berkeley.edu/3rd-ed/.

[33] Pamela McCorduck. Machines Who Think: A Personal Inquiry into the History and Prospects of Artificial Intelligence. A K Peters, 25th anniversary edition, 2004. ISBN 9781568812052.

[34] Alan M. Turing. Computing Machinery and Intelligence. Mind, LIX(236): 433-460, 1950. doi: 10.1093/mind/lix.236.433. URL https://doi.org/10.1093/mind/lix.236.433.

[35] Chuanbo Wang, D M Anisuzzaman, Victor Williamson, Mrinal Kanti Dhar, Behrouz Rostami, Jeffrey Niezgoda, Sandeep Gopalakrishnan, and Zeyun Yu. Fully automatic wound segmentation with deep convolutional neural networks. Scientific reports, 10(1):21897, 2020. doi: 10.1038/s41598-020-78799-w. URL https://doi.org/10.1038/s41598-020-78799-w.

[36] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, 2nd edition, 2018. URL https: //mitpress.mit.edu/9780262039246/reinforcement-learning/.

[37] Francisco J. Veredas, Rafael M. Luque-Baena, Francisco J. Martin-Santos, Juan C. Morilla-Herrera, and Laura Morente. Wound image evaluation with machine learning. Neurocomputing, 164:112-122,2015. doi: 10.1016/j.neucom.2014.12.091. URL https://doi.Org/10.1016/j.neucom.2014.12.091.

[38] Rajat Raina, Alexis Battle, Honglak Lee, Benjamin Packer, and Andrew Y. Ng. Self-taught Learning: Transfer Learning from Unlabeled Data. In Proceedings of the 24th international conference on Machine learning, pages 759-766, 2007. doi: 10.1145/1273496.1273592. URL https://doi.org/10.1145/1273496.1273592.

[39] Nico Curti, Yuri Merli, Corrado Zengarini, Enrico Giampieri, Alessandra Merlotti, Daniele Dall’Olio, Emanuela Marcelli, Tommaso Bianchi, and Gastone Castellani. Effectiveness of semi-supervised active learning in automated wound image segmentation. International Journal of Molecular Sciences, 24(1):706, 2023. doi: 10.3390/ijms24010706. URL https://doi.org/10.3390/ijms24010706.

[40] Palawat Busaranuvong, Reza Saadati Fard, Emmanuel Agu, Deepak Kumar, Shefalika Gautam, Bengisu Tulu, Diane Strong, Giorgio Giatsidis, and Lorraine Loretz. Infection-reasoner: A compact vision-language model for wound infection classification with evidence-grounded clinical reasoning. Author preprint, arXiv:2604.19937v1, 2026. URL https://arxiv.org/abs/2604.19937vl. Exact version consulted; author list follows the PDF byline; accessed 2026.

[41] Takaya Saito and Marc Rehmsmeier. The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets. PLOS ONE, 10(3):e0118432, 2015. doi: 10.1371/journal.pone.0118432. URL https://doi.org/10.1371/journal.pone.0118432.

[42] scikit-learn developers. Average precision score: Non-interpolated average precision, . URLhttps://scikit-learn.org/stable/modules/gene rated/sklearn.metrics.average_precision_score.html. Official software documentation; accessed 2026.

[43] Akwasi Asare, Mary Sagoe, Justice Williams Asare, and Stephen E Moore. TransUNet-GradCAM: a hybrid transformer-U-Net with self-attention and explainable visualizations for foot ulcer segmentation. BMC Medical Imaging,26:474,2026. doi: 10.1186/s12880-026-02793-3. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC13621505/.

[44] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On Calibration of Modern Neural Networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1321-1330. PMLR, 2017. URL https://proceedings.mlr.press/v70/guo17a.html.

[45] Gary S Collins, Karel G M Moons, Paula Dhiman, Richard D Riley, Andrew L Beam, Ben Van Calster, et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ, 385:e078378, 2024. doi: 10.1136/bmj-2023-078378. URL https://doi.org/10.1136/bmj-2023-078378.

[46] Yang Jiang, Xingguo Nie, Hailong Feng, Guodong Wang, Xiugeng Li, Haijian Zhao, and Jian Li. Development and validation of a prediction model for infection in chronic nonhealing wounds: a two-center retrospective study with external validation. Frontiers in Public Health, 14: 1813347, 2026. doi: 10.3389/fpubh.2026.1813347. URL https://doi.org/10.3389/fpubh.2026.1813347.

[47] Frank Rosenblatt. The perceptron: A probabilistic model for information storage and organization in the brain. Psychological Review, 65(6): 386-408, 1958. doi: 10.1037/h0042519. URL https://doi.org/10.1037/h0042519.

[48] Marvin Minsky and Seymour Papert. Perceptrons: An Introduction to Computational Geometry. MIT Press, expanded edition, 1988. ISBN 9780262631112.

[49] Jeremy Watt, Reza Borhani, and Aggelos K. Katsaggelos. Machine Learning Refined: Foundations, Algorithms, and Applications. Cambridge University Press, 2nd edition, 2020. ISBN 9781108480727.

[50] Alexander Brehmer, Constantin Seibold, Jan Egger, Khalid Majjouti, Michaela Tapp-Herrenbrück, Hannah Pinnekamp, Vanessa Priester, Michael Aleithe, Uli Fischer, Bernadette Hosters, and Jens Kleesiek. Fine-grained classification of pressure ulcers and incontinence-associated dermatitis using multimodal deep learning: Algorithm development and validation study. JMIR AI, 4:e67356, 2025. doi: 10.2196/67356. URL https://doi.org/10.2196/67356.

[51] Md Masudur Rahman, Mohamed El Masry, Gayle Gordillo, and Juan Wachs. Automated unified reasoning with vision-language models for multi-modal burn assessment. Proceedings of the AAAI Conference on Artificial Intelligence, 40(47):40402-40408, 2026. doi: 10.1609/aaai.v40i47.41482. URL https://doi.org/10.1609/aaai.v40i47.41482.

[52] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning, volume 139, pages 8748-8763,2021. URL https://proceedings.mlr.press/v139/radford21a.html. Exact version consulted; accessed 2026.

[53] John Duchi, Elad Hazan, and Yoram Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12(61):2121-2159, 2011. URL https://jmlr.org/papers/v12/duchi11a.html.

[54] Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In International Conference on Learning Representations, 2015. URL https://arxiv.org/abs/1412.6980.

[55] Forest Agostinelli, Matthew Hoffman, Peter Sadowski, and Pierre Baldi. Learning Activation Functions to Improve Deep Neural Networks. Preprint, arXiv:1412.6830, 2014. URL https://arxiv.org/abs/1412.6830.

[56] Vincent Dumoulin and Francesco Visin. A guide to convolution arithmetic for deep learning. Preprint, arXiv:1603.07285, 2016. URL https://arxiv.org/abs/1603.07285.

[57] Matthew D. Zeiler and Rob Fergus. Stochastic Pooling for Regularization of Deep Convolutional Neural Networks. Preprint, arXiv:1301.3557, 2013. URL https://arxiv.org/abs/1301.3557.

[58] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(9): 1904-1916,2015. doi: 10.1109/tpami.2015.2389824. URL https://doi.org/10.1109/tpami.2015.2389824.

[59] Wanli Ouyang, Ping Luo, Xingyu Zeng, Shi Qiu, Yonglong Tian, Hongsheng Li, et al. DeepID-Net: multi-stage and deformable deep convolutional neural networks for object detection. Preprint, arXiv:1409.3505, 2014. URL https://arxiv.org/abs/1409.3505.

[60] Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 448-456. PMLR, 2015. URL https://proceedings.mlr.press/v37/ioffe15.html.

[61] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A Simple Way to Prevent Neural Networks from Overfitting. Journal of Machine Learning Research, 15(56): 1929-1958, 2014. URL https://jmlr.org/papers/v15/srivastava14a.html.

[62] Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How Does Batch Normalization Help Optimization? In Advances in Neural Information Processing Systems, volume 31, 2018. URL https://papers.nips.cc/paper_files/paper/2018/hash/90505 6c1ac1dad141560467e0a99e1cf-Abstract.html.

[63] Mahmut Kaya and Hasan §akir Bilge. Deep Metric Learning: A Survey. Symmetry, 11(9):1066, 2019. doi: 10.3390/sym11091066. URL https://doi.org/10.3390/symll091066.

[64] Florian Schroff, Dmitry Kalenichenko, and James Philbin. FaceNet: A Unified Embedding for Face Recognition and Clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 815-823,2015. URL https://openaccess.thecvf.com/content_cvpr_2015/html/Sch roff_FaceNet_A_Unified_2015_CVPR_paper.html.

[65] Alexander Hermans, Lucas Beyer, and Bastian Leibe. In Defense of the Triplet Loss for Person Re-Identification. Preprint, arXiv:1703.07737, 2017. URL https://arxiv.org/abs/1703.07737.

[66] Ben Harwood, Vijay Kumar B G, Gustavo Carneiro, Ian Reid, and Tom Drummond. Smart Mining for Deep Metric Learning. In IEEE International Conference on Computer Vision, pages 2821-2829, 2017. URL https://openaccess.thecvf.com/content_ICCV_2017/pape rs/Harwood_Smart_Mining_for_ICCV_2017_paper.pdf.

[67] Josefine Vilsboll Sundgaard, James Harte, Peter Bray, Soren Laugesen, Yosuke Kamide, Chiemi Tanaka, Rasmus R. Paulsen, and Anders Nymark Christensen. Deep metric learning for otitis media classification. Medical Image Analysis,71:102034,2021. doi: 10.1016/j.media.2021.102034. URL https://doi.org/10.1016/j.media.2021.102034.

[68] Anabik Pal, Zhiyun Xue, Brian Befano, Ana Cecilia Rodriguez, L. Rodney Long, Mark Schiffman, and Sameer Antani. Deep Metric Learning for Cervical Image Classification. IEEE Access, 9:53266-53275, 2021. doi: 10.1109/access.2021.3069346. URL https://doi.org/10.1109/access.2021.3069346.

[69] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality Reduction by Learning an Invariant Mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, volume 2, pages 1735-1742. IEEE, 2006. doi: 10.1109/CVPR.2006.100. URL https://doi.org/10.1109/CVPR.2006.100.

[70] Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a Similarity Metric Discriminatively, with Application to Face Verification. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), volume 1, pages 539-546, 2005. doi: 10.1109/cvpr.2005.202. URL https://doi.org/10.1109/cvpr.2005.202.

[71] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. SphereFace: Deep Hypersphere Embedding for Face Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 212-220, 2017. URL https://openaccess.thecvf.com/content_cvpr_2017/html/Liu _SphereFace_Deep_Hypersphere_CVPR_2017_paper.html.

[72] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. ArcFace: Additive Angular Margin Loss for Deep Face Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4690-4699, 2019. URL https://openaccess.thecvf.com/cont ent_CVPR_2019/html/Deng_ArcFace_Additive_Angular_Margin_ Loss_for_Deep_Face_Recognition_CVPR_2019_paper.html.

[73] Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. CosFace: Large Margin Cosine Loss for Deep Face Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5265-5274, 2018. URL https://openaccess.thecvf.com/content_cvpr_2018/html/Wan g_CosFace_Large_Margin_CVPR_2018_paper.html.

[74] H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Areas. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Artificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pages 1273-1282. PMLR, 2017. URL https://proceedings.mlr.press/v54/mcmahanl7a.html.

[75] Ittai Dayan, Holger R. Roth, Aoxiao Zhong, Ahmed Harouni, Amilcare Gentili, Anas Z. Abidin, et al. Federated learning for predicting clinical outcomes in patients with COVID-19. Nature Medicine, 27(10):1735-1743, 2021. doi: 10.1038/s41591-021-01506-3. URL https://doi.org/l0.l038/s4l59l-02l-0l506-3.

[76] Qiang Yang, Yang Liu, Tianjian Chen, and Yongxin Tong. Federated Machine Learning: Concept and Applications. ACM Transactions on Intelligent Systems and Technology, 10(2):1-19, 2019. doi: 10.1145/3298981. URLhttps://doi.org/l0.ll45/329898l.

[77] Peter Kairouz, H. Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, et al. Advances and Open Problems in Federated Learning. Foundations and Trends in Machine Learning, 14 (1-2):1-210, 2021. doi: 10.1561/2200000083. URL https://doi.org/l0.l56l/2200000083.

[78] Hankz Hankui Zhuo, Wenfeng Feng, Qian Xu, Qiang Yang, and Yufeng Lin. Federated Reinforcement Learning. Preprint, arXiv:1901.08277, 2019. URL https://arxiv.org/abs/l90l.08277vl.

[79] Jiaju Qi, Qihao Zhou, Lei Lei, and Kan Zheng. Federated Reinforcement Learning: Techniques, Applications, and Open Challenges. Preprint, arXiv:2108.11887, 2021. URL https://arxiv.org/abs/2l08.ll887vl.

[80] Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229-256, 1992. doi: 10.1007/bf00992696. URL https://doi.org/10.1007/bf00992696.

[81] J. Baxter and P L. Bartlett. Infinite-Horizon Policy-Gradient Estimation. Journal of Artificial Intelligence Research, 15:319-350,2001. doi: 10.1613/jair.806. URLhttps://doi.org/10.1613/jair.806.

[82] Rie Johnson and Tong Zhang. Accelerating Stochastic Gradient Descent Using Predictive Variance Reduction. In Advances in Neural Information Processing Systems, volume 26, pages 315-323, 2013. URL https://papers.nips.cc/paper_files/paper/2013/hash/ac1dd 209cbcc5e5d1c6e28598e8cbbe8-Abstract.html.

[83] Lihua Lei and Michael Jordan. Less than a Single Pass: Stochastically Controlled Stochastic Gradient. In Artificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pages 148-156. PMLR, 2017. URL https://proceedings.mlr.press/v54/lei17a.html.

[84] Matteo Papini, Damiano Binaghi, Giuseppe Canonaco, Matteo Pirotta, and Marcello Restelli. Stochastic Variance-Reduced Policy Gradient. In International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 4026-4035. PMLR, 2018. URL https://proceedings.mlr.press/v80/papini18a.html.

[85] Pan Xu, Felicia Gao, and Quanquan Gu. An Improved Convergence Analysis of Stochastic Variance-Reduced Policy Gradient. In Uncertainty in Artificial Intelligence, volume 115 of Proceedings of Machine Learning Research, pages 541-551. PMLR, 2020. URL https://proceedings.mlr.press/v115/xu20a.html.

[86] Flint Xiaofeng Fan, Yining Ma, Zhongxiang Dai, Wei Jing, Cheston Tan, and Bryan Kian Hsiang Low. Fault-Tolerant Federated Reinforcement Learning with Theoretical Guarantee. In Advances in Neural Information Processing Systems, volume 34, pages 1007-1021, 2021. URL https://papers.neurips.cc/paper/2021/file/080acdcce72c06 873a773c4311c2e464-Paper.pdf.

[87] Leslie Lamport, Robert Shostak, and Marshall Pease. The Byzantine Generals Problem. ACM Transactions on Programming Languages and Systems, 4(3):382-401, 1982. doi: 10.1145/357172.357176. URL https://doi.org/10.1145/357172.357176.

[88] Philip Jordan, Florian Grötschla, Flint Xiaofeng Fan, and Roger Wattenhofer. Decentralized Federated Policy Gradient with Byzantine Fault-Tolerance and Provably Fast Convergence. In Proceedings of the 23rd International Conference on Autonomous Agents and Multiagent Systems, pages 964-972. IFAAMAS, 2024. URL https: //aamas.csc.liv.ac.uk/Proceedings/aamas2024/pdfs/p964.pdf.

[89] Ligeng Zhu, Zhijian Liu, and Song Han. Deep Leakage from Gradients. In Advances in Neural Information Processing Systems, volume 32, 2019. URL https://papers.neurips.cc/paper_files/paper/2019/has h/60a6c4002cc7b29142def8871531281a-Abstract.html.

[90] Minghong Fang, Xiaoyu Cao, Jinyuan Jia, and Neil Zhenqiang Gong. Local Model Poisoning Attacks to Byzantine-Robust Federated Learning. In 29th USENIXSecurity Symposium, pages 1605-1622, 2020. URL https://www.usenix.org/conference/usenixsecurity20/prese ntation/fang.

[91] Hongyi Wang, Kartik Sreenivasan, Shashank Rajput, Harit Vishwakarma, Saurabh Agarwal, Jy-yong Sohn, Kangwook Lee, and Dimitris Papailiopoulos. Attack of the Tails: Yes, You Really Can Backdoor Federated Learning. In Advances in Neural Information Processing Systems, volume 33, pages 16070-16084, 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/ha sh/b8ffa41d4e492f0fad2fl3e29el762eb-Abstract.html.

[92] Praneeth Vepakomma, Otkrist Gupta, Tristan Swedish, and Ramesh Raskar. Split learning for health: Distributed deep learning without sharing raw patient data. Preprint, arXiv:1812.00564, 2018. URL https://arxiv.org/abs/1812.00564v1.

[93] Fawad Talat, Saqib Gul, Owais Gul, and Maria Khalid. Inferior vena cava atresia: A rare cause of recurrent deep venous thrombosis and infected venous ulcers. Cureus, 17(7):e87729, 2025. doi: 10.7759/cureus.87729. URL https://doi.org/10.7759/cureus.87729.

[94] Prince Odame, Maxwell Mawube Ahiamadzor, Nana Kwaku Baah Derkyi, Kofi Agyekum Boateng, Kelvin Sarfo-Acheampong, Eric Tutu Tchao, et al. Multi-Wound Classification: Exploring Image Enhancement and Deep Learning Techniques. Engineering Reports, 7(1):e70001, 2025. doi: 10.1002/eng2.70001. URL https://doi.org/10.1002/eng2.70001.

[95] Isabelle Guyon and André Elisseeff. An Introduction to Variable and Feature Selection. Journal of Machine Learning Research, 3:1157-1182, 2003. URLhttps://www.jmlr.org/papers/v3/guyon03a.html.

[96] scikit-learn developers. Permutation Feature Importance, 2026. URL https://scikit-learn.org/stable/modules/permutation_impo rtance.html. Online documentation, accessed 2026.

[97] imbalanced-learn developers. Under-sampling, 2026. URL https://imbalanced-learn.org/stable/under_sampling.html. Additional chapter: Common pitfalls and recommended practices, https://imbalanced-learn.org/stable/common_pitfalls.html. Online documentation, accessed 2026.

[98] N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P Kegelmeyer. SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research, 16:321-357,2002. doi: 10.1613/jair.953. URL https://doi.org/10.1613/jair.953.

[99] Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine Learning, 20(3):273-297, 1995. doi: 10.1007/bf00994018. URL https://doi.org/10.1007/bf00994018.

[100] Christopher M. Bishop. Pattern Recognition and Machine Learning. Springer New York, 2006. doi: 10.1007/978-0-387-45528-0. URL https://www.microsoft.com/en-us/research/publication/pat tern-recognition-machine-learning/.

[101] John C. Platt. Sequential Minimal Optimization: A Fast Algorithm for Training Support Vector Machines. Technical Report MSR-TR-98-14, Microsoft Research, 1998. URL https://www.microsoft.com/en-us/ research/publication/sequential-minimal-optimization-a-f ast-algorithm-for-training-support-vector-machines/.

[102] Rashmi Mukherjee, Dhiraj Dhane Manohar, Dev Kumar Das, Arun Achar, Analava Mitra, and Chandan Chakraborty. Automated Tissue Classification Framework for Reproducible Chronic Wound Assessment. BioMed Research International,2014:1-9,2014. doi: 10.1155/2014/851582. URL https://doi.org/10.1155/2014/851582.

[103] T. Cover and P Hart. Nearest neighbor pattern classification. IEEE Transactions on Information Theory, 13(1):21-27, 1967. doi: 10.1109/tit.1967.1053964. URL https://doi.org/10.1109/tit.1967.1053964.

[104] scikit-learn developers. Nearest Neighbors, 2026. URL https://scikit-learn.org/stable/modules/neighbors.html. Online documentation, accessed 2026.

[105] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer New York, 2nd edition, 2009. doi: 10.1007/978-0-387-84858-7. URL https://doi.org/10.1007/978-0-387-84858-7.

[106] Jie Song, Yuan Gao, Pengbin Yin, Yi Li, Yang Li, Jie Zhang, et al. The Random Forest Model Has the Best Accuracy Among the Four Pressure Ulcer Prediction Models Using Machine Learning Algorithms. Risk Management and Healthcare Policy, Volume 14:1175-1187,2021. doi: 10.2147/rmhp.s297838. URL https://doi.org/10.2147/rmhp.s297838.

[107] Leo Breiman. Random Forests. Machine Learning, 45(1):5-32, 2001. doi: 10.1023/a:1010933404324. URL https://doi.org/10.1023/a:1010933404324.

[108] Andy Liaw and Matthew Wiener. Classification and Regression by randomForest. RNews, 2(3):18-22, 2002. URL https://journal.r-project.org/articles/RN-2002-022/.

[109] Irina Rish. An Empirical Study of the Naive Bayes Classifier. In IJCAI 2001 Workshop on Empirical Methods in Artificial Intelligence, pages 41-46, 2001. URL https://www.cc.gatech.edu/~isbell/reading/papers/Rish.pdf.

[110] George Martvel, Oskar Gustafsson, John Pavia, and Ernst Ahlberg. In-Context Learning for Wound Classification with Small Multimodal Language Models. Author manuscript, arXiv:2607.18819, 2026. URL https://arxiv.org/abs/2607.18819. Author manuscript version consulted.

[111] S. Lloyd. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129-137, 1982. doi: 10.1109/tit.1982.1056489. URL https://doi.org/10.1109/tit.1982.1056489.

[112] David Arthur and Sergei Vassilvitskii. k-means++: The Advantages of Careful Seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1027-1035, 2007. URL https://research.google/pubs/k-means-the- advantages- of-c areful-seeding/.

[113] A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum Likelihood from Incomplete Data Via the EM Algorithm. Journal of the Royal Statistical Society Series B: Statistical Methodology, 39(1):1-22, 1977. doi: 10.1111/j.2517-6161.1977.tb01600.x. URL https://doi.org/10.1111/j.2517-6161.1977.tb01600.x.

[114] James C. Bezdek, Robert Ehrlich, and William Full. FCM: The fuzzy c-means clustering algorithm. Computers & Geosciences, 10(2-3):191-203, 1984. doi: 10.1016/0098-3004(84)90020-7. URL https://doi.org/10.1016/0098-3004(84)90020-7.

[115] Ulrike von Luxburg. A tutorial on spectral clustering. Statistics and Computing, 17(4):395-416, 2007. doi: 10.1007/s11222-007-9033-z. URL https://doi.org/10.1007/s11222-007-9033-z.

[116] Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, and Bernhard Schölkopf. Learning with Local and Global Consistency. In Advances in Neural Information Processing Systems, volume 16, 2003. URL https://papers.neurips.cc/paper_files/paper/2003/has h/87682805257e619d49b8e0dfdcl4affa-Abstract.html.

[117] Jeong-Hun Kim, Jong-Hyeok Choi, Young-Ho Park, Carson Kai-Sang Leung, and Aziz Nasridinov. KNN-SC: Novel Spectral Clustering Algorithm Using k-Nearest Neighbors. IEEE Access, 9:152616-152627, 2021. doi: 10.1109/access.2021.3126854. URL https://doi.org/10.1109/access.2021.3126854.

[118] Chinmay Chakraborty. Computational approach for chronic wound tissue characterization. Informatics in Medicine Unlocked, 17:100162,2019. doi: 10.1016/j.imu.2019.100162. URL https://doi.Org/10.1016/j.imu.2019.100162.

[119] Dhiraj Manohar Dhane, Vishal Krishna, Arun Achar, Chittaranjan Bar, Kunal Sanyal, and Chandan Chakraborty. Spectral Clustering for Unsupervised Segmentation of Lower Extremity Wound Beds Using Optical Images. Journal of Medical Systems, 40(9):207, 2016. doi: 10.1007/s10916-016-0554-x. URL https://doi.org/10.1007/s10916-016-0554-x.

[120] F. Veredas, H. Mesa, and L. Morente. Binary Tissue Classification on Wound Images With Neural Networks and Bayesian Classifiers. IEEE Transactions on Medical Imaging, 29(2):410-427, 2010. doi: 10.1109/tmi.2009.2033595. URL https://doi.org/10.1109/tmi.2009.2033595.

[121] Hazem Wannous, Sylvie Treuillet, and Yves Lucas. Robust tissue classification for reproducible wound assessment in telemedicine environments. Journal of Electronic Imaging, 19(02):1-9, 2010. doi: 10.1117/1.3378149. URL https://doi.org/10.1117/U3378149.

[122] H Wannous, Y Lucas, and S Treuillet. Enhanced Assessment of the Wound-Healing Process by Accurate Multiview Tissue Classification. IEEE Transactions on Medical Imaging, 30(2):315-326, 2011. doi: 10.1109/tmi.2010.2077739. URL https://doi.org/10.1109/tmi.2010.2077739.

[123] Lei Wang, Peder C. Pedersen, Emmanuel Agu, Diane M. Strong, and Bengisu Tulu. Area Determination of Diabetic Foot Ulcer Images Using a Cascaded Two-Stage SVM-Based Classification. IEEE Transactions on Biomedical Engineering, 64(9):2098-2109, 2017. doi: 10.1109/tbme.2016.2632522. URL https://doi.org/10.1109/tbme.2016.2632522.

[124] Rodolfo Herman Lara e Silva and Alexei Manso Correa Machado. Automatic measurement of pressure ulcers using Support Vector Machines and GrabCut. Computer Methods and Programs in Biomedicine, 200: 105867,2021. doi: 10.1016/j.cmpb.2020.105867. URL https://doi.Org/10.1016/j.cmpb.2020.105867.

[125] Syifa’ah Setya Mawarni, Murinto Murinto, and Sunardi Sunardi. Medical External Wound Image Classification Using Support Vector Machine Technique. Khazanah Informatika : Jurnal Ilmu Komputer dan Informatika, 9(2):98-103, 2023. doi: 10.23917/khif.v9i2.22541. URL https://doi.org/10.23917/khif.v9i2.22541.

[126] Mani Sotoodeh, Zelalem H Gero, Wenhui Zhang, Vicki Stover Hertzberg, and Joyce C Ho. Pressure Ulcer Injury in Unstructured Clinical Notes: Detection and Interpretation. In AMIA Annual Symposium Proceedings, volume 2020, pages 1160-1169, 2021. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC8075497/.

[127] Chaoran Qu, Weixiang Luo, Zhixiong Zeng, Xiaoxu Lin, Xuemei Gong, Xiujuan Wang, Yu Zhang, and Yun Li. The predictive effect of different machine learning algorithms for pressure injuries in hospitalized patients: A network meta-analyses. Heliyon, 8(11):e11361, 2022. doi: 10.1016/j.heliyon.2022.e11361. URL https://doi.Org/10.1016/j.heliyon.2022.ell361.

[128] Dhiraj Manohar Dhane, Maitreya Maity, Tushar Mungle, Chittaranjan Bar, Arun Achar, Maheshkumar Kolekar, and Chandan Chakraborty. Fuzzy spectral clustering for automated delineation of chronic wound region using digital images. Computers in Biology and Medicine, 89:551-560, 2017. doi: 10.1016/j.compbiomed.2017.04.004. URL https://doi.Org/10.1016/j.compbiomed.2017.04.004.

[129] Udaya Kumar and Jeeva JB. Segmentation Of Wound By K-Means Clustering And Automatic Prediction Of Healing Time. ECS Transactions, 107(1):20371-20376, 2022. doi: 10.1149/10701.20371ecst. URL https://doi.org/10.1149/10701.20371ecst.

[130] Mirwaes Wahabzada, Manuela Besser, Milad Khosravani, Matheus Thomas Kuska, Kristian Kersting, Anne-Katrin Mahlein, and Ewa Stürmer. Monitoring wound healing in a 3D wound model by hyperspectral imaging and efficient clustering. PLOS ONE, 12(12):e0186425, 2017. doi: 10.1371/journal.pone.0186425. URL https://doi.org/10.1371/journal.pone.0186425.

[131] Ana C. Morgado, Rafaela Carvalho, Ana Filipa Sampaio, and Maria J. M. Vasconcelos. Enhancing chronic wound assessment through agreement analysis and tissue segmentation. Scientific Reports, 15(1):22244, 2025. doi: 10.1038/s41598-025-06703-5. URL https://doi.org/10.1038/s41598-025-06703-5.

[132] Corrado Zengarini, Tommaso Giacometti, Yuri Merli, Davide Griffa, Luca Rapparini, Alessio Natale, et al. Toward Objective Wound Edge Classification in Clinical Practice. Experimental Dermatology, 35(6): e70287, 2026. doi: 10.1111/exd.70287. URL https://doi.org/10.llll/exd.70287.

[133] David Reifs Jiménez, Lorena Casanova-Lozano, Sergi Grau-Carrión, and Ramon Reig-Bolaño. Artificial Intelligence Methods for Diagnostic and Decision-Making Assistance in Chronic Wounds: A Systematic Review. Journal of Medical Systems, 49(1):29, 2025. doi: 10.1007/s10916-025-02153-8. URL https://doi.org/10.1007/s10916-025-02153-8.

[134] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal Loss for Dense Object Detection. Preprint, arXiv:1708.02002, 2017. URL https://arxiv.org/abs/1708.02002.

[135] Abdullah, Muhammad Ateeb Ather, Zulaikha Fatima, and José Luis Oropeza Rodríguez. A severity-aware multi-task CNN-transformer framework for explainable diabetic foot ulcer triage and mobile deployment. Frontiers in Artificial Intelligence, 9:1795751, 2026. doi: 10.3389/frai.2026.1795751. URL https://doi.org/10.3389/frai.2026.1795751.

[136] Sinno Jialin Pan and Qiang Yang. A Survey on Transfer Learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345-1359, 2010. doi: 10.1109/tkde.2009.191. URL https://doi.org/10.1109/tkde.2009.191.

[137] RaniaNiri, Sofia Zahia, Alessio Stefanelli, Kaushal Sharma, Sebastian Probst, Swann Pichon, and Guillaume Chanel. Wound Segmentation with U-Net Using a Dual Attention Mechanism and Transfer Learning. Journal of Imaging Informatics in Medicine, 38(5):3351-3365, 2025. doi: 10.1007/s10278-025-01386-w. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC12572562/.

[138] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C.J. Burges, L. Bottou, and K. Weinberger, editors, Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. URL https://proceedings.neurips.cc/paper_files/paper/201 2/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf.

[139] Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. Preprint, arXiv:1409.1556, 2014. URLhttps://arxiv.org/abs/1409.1556.

[140] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, et al. Going Deeper with Convolutions. Preprint, arXiv:1409.4842, 2014. URL https://arxiv.org/abs/1409.4842.

[141] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alex Alemi. Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning. Preprint, arXiv:1602.07261, 2016. URL https://arxiv.org/abs/1602.07261.

[142] François Chollet. Xception: Deep Learning with Depthwise Separable Convolutions. Preprint, arXiv:1610.02357, 2016. URL https://arxiv.org/abs/1610.02357.

[143] Ramin Mousa, Ehsan Matbooe, Hakimeh Khojasteh, Amirali Bengari, and Mohammadmahdi Vahediahmar. Multi-modal wound classification using wound image and location by xception and gaussian mixture recurrent neural network (gmrnn). Author preprint, arXiv:2505.08086v1, 2025. URL https://arxiv.org/abs/2505.08086vl. Exact version consulted; accessed 2026.

[144] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. Preprint, arXiv:1512.03385, 2015. URL https://arxiv.org/abs/l5l2.03385.

[145] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In Computer Vision - ECCV2016, page 630-645. Springer International Publishing, 2016. ISBN 9783319464930. doi: 10.1007/978-3-319-46493-0_38. URL http://dx.doi.org/l0.l007/978-3-3l9-46493-0_38.

[146] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely Connected Convolutional Networks. Preprint, arXiv:1608.06993, 2016. URL https://arxiv.org/abs/l608.06993.

[147] Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. Preprint, arXiv:1704.04861, 2017. URL https://arxiv.org/abs/l704.0486l.

[148] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. MobileNetV2: Inverted Residuals and Linear Bottlenecks. Preprint, arXiv:1801.04381, 2018. URL https://arxiv.org/abs/l80l.0438l.

[149] Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, et al. Searching for MobileNetV3. Preprint, arXiv:1905.02244, 2019. URL https://arxiv.org/abs/1905.02244.

[150] Danfeng Qin, Chas Leichner, Manolis Delakis, Marco Fornoni, Shixin Luo, Fan Yang, et al. MobileNetV4 - Universal Models for the Mobile Ecosystem. Preprint, arXiv:2404.10518, 2024. URL https://arxiv.org/abs/2404.10518.

[151] Omar Sanseviero and Ian Ballantyne. Introducing Gemma 3n: The developer guide. Google Developers Blog (online), 2025. URL https://developers.googleblog.com/en/introducing-gemma-3 n-developer-guide/.

[152] Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning Transferable Architectures for Scalable Image Recognition. Preprint, arXiv:1707.07012, 2017. URL https://arxiv.org/abs/1707.07012.

[153] Mingxing Tan and Quoc V. Le. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. Preprint, arXiv:1905.11946, 2019. URL https://arxiv.org/abs/1905.11946.

[154] Mingxing Tan and Quoc V. Le. EfficientNetV2: Smaller Models and Faster Training. Preprint, arXiv:2104.00298, 2021. URL https://arxiv.org/abs/2104.00298.

[155] Ziyang Liu, Josvin John, and Emmanuel Agu. Diabetic Foot Ulcer Ischemia and Infection Classification Using EfficientNet Deep Learning Models. IEEE open journal of engineering in medicine and biology, 3:189-201, 2022. doi: 10.1109/ojemb.2022.3219725. URL https://doi.org/10.1109/ojemb.2022.3219725.

[156] Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A ConvNet for the 2020s. Preprint, arXiv:2201.03545, 2022. URL https://arxiv.org/abs/2201.03545.

[157] Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon, and Saining Xie. ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders. Preprint, arXiv:2301.00808, 2023. URLhttps://arxiv.org/abs/2301.00808.

[158] Dorothee A Busch, Mats L Richter, Jens Hüsers, Mareike Przysucha, Florian Kücking, Jonathan M Mang, et al. Machine learning model to classify chronic leg wounds and identify pyoderma gangrenosum. BMJ Health & Care Informatics, 32(1):e101418, 2025. doi: 10.1136/bmjhci-2024-101418. URL https://doi.org/10.1136/bmjhci-2024-101418.

[159] Jie Hu, Li Shen, Samuel Albanie, Gang Sun, and Enhua Wu. Squeeze-and-Excitation Networks. Preprint, arXiv:1709.01507, 2017. URL https://arxiv.org/abs/1709.01507.

[160] Yash Patel, Tirth Shah, Mrinal Kanti Dhar, Taiyu Zhang, Jeffrey Niezgoda, Sandeep Gopalakrishnan, and Zeyun Yu. Integrated image and location analysis for wound classification: a deep learning approach. Scientific reports, 14(1):7043, 2024. doi: 10.1038/s41598-024-56626-w. URL https://doi.org/10.1038/s41598-024-56626-w.

[161] Shekoofeh Azizi, Basil Mustafa, Fiona Ryan, Zachary Beaver, Jan Freyberg, Jonathan Deaton, Aaron Loh, Alan Karthikesalingam, Simon Kornblith, Ting Chen, Vivek Natarajan, and Mohammad Norouzi. Big self-supervised models advance medical image classification. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV), page 3458-3468. IEEE, 2021. doi: 10.1109/iccv48922.2021.00346. URL http://dx.doi.org/10.1109/iccv48922.2021.00346.

[162] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A Simple Framework for Contrastive Learning of Visual Representations. Preprint, arXiv:2002.05709, 2020. URL https://arxiv.org/abs/2002.05709.

[163] Minghui Cong, Zhuli Xiu, Jing Zhou, and Hongqiao Sun. MS-EGT-Net: a multi-scale enhanced graph-transformer network for diabetic foot ulcer classification. Scientific Reports, 16(1):29273, 2026. doi: 10.1038/s41598-026-60024-9. URL https://doi.org/10.1038/s41598-026-60024-9.

[164] Lalit Maurya and Sarfaraj Mirza. MCTFWC: a multiscale CNN-transformer fusion-based model for wound image classification. Signal, Image and Video Processing, 19(7):574, 2025. doi: 10.1007/s11760-025-04072-0. URL https://doi.org/10.1007/s11760-025-04072-0.

[165] Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic Routing Between Capsules. Preprint, arXiv:1710.09829, 2017. URL https://arxiv.org/abs/1710.09829.

[166] Geoffrey Hinton, Sara Sabour, and Nicholas Frosst. Matrix capsules with EM routing. In International Conference on Learning Representations, 2018. URL https: //research.google/pubs/matrix-capsules-with-em-routing/.

[167] Taeyoung Hahn, Myeongjang Pyeon, and Gunhee Kim. Self-Routing Capsule Networks. In Advances in Neural Information Processing Systems, volume 32, 2019. URL https://papers.nips.cc/paper_files/paper/2019/hash/e46bc 064f8e92ac2c404b9871b2a4ef2-Abstract.html.

[168] Xinyu Geng, Jiaming Wang, Jiawei Gong, Yuerong Xue, Jun Xu, Fanglin Chen, and Xiaolin Huang. OrthCaps: An Orthogonal CapsNet with Sparse Attention Routing and Pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6037-6046, 2024. URL https://openaccess.thecvf.com/content/ CVPR2024/html/Geng_0rthCaps_An_0rthogonal_CapsNet_with_S parse_Attention_Routing_and_Pruning_CVPR_2024_paper.html.

[169] Zhangli Lan, Songbai Cai, Xu He, and Xinpeng Wen. FixCaps: An Improved Capsules Network for Diagnosis of Skin Cancer. IEEE Access, 10:76261-76267,2022. doi: 10.1109/access.2022.3181225. URL https://doi.org/10.1109/access.2022.3181225.

[170] Sonali R Nalamwar and Sandeep U. Belgamwar. Multidimensional CapsNets attention-gated approach for skin cancer detection and classification. Computers and Electrical Engineering, 127:110573, 2025. doi: 10.1016/j.compeleceng.2025.110573. URL https://doi.Org/10.1016/j.compeleceng.2025.110573.

[171] Yasir Adil Mukhlif, Nehad T. A. Ramaha, and Alaa Ali Hameed. AEC-CapsNet: Enhanced Capsule Networks With Attention and Expansion-Contraction Mechanisms for Advanced Feature Extraction in Medical Imaging. IETImage Processing, 19(1):e70120, 2025. doi: 10.1049/ipr2.70120. URL https://doi.org/10.1049/ipr2.70120.

[172] Atta Ur Rahman, Mousa Albashrawi, Bibi Saqia, and Zahid Halim. Enhancing skin cancer detection using attention-based CapsNet with transfer learning from pre-trained CNN. Biomedical Signal Processing and Control, 116:109544,2026. doi: 10.1016/j.bspc.2026.109544. URL https://doi.org/10.1016/j.bspc.2026.109544.

[173] Mohammad ZehniyanMiandoab, Mohammad Ghadiri, Sahand Mosayyebpour, Mehrshad Eisaei, Saeed Mirzaee, Saghar Hezarjaribi, and Hamidreza Sadegh Salehi. Comparative Analysis on Transfer Learning Based Model and Modified Capsulenet for Multi-Modal Wound Classification. SSRN preprint, 2025. URL https://doi.org/10.2139/ssrn.5332544. Posted 2025; not treated as peer-reviewed evidence.

[174] Behrouz Rostami, D M Anisuzzaman, Chuanbo Wang, Sandeep Gopalakrishnan, Jeffrey Niezgoda, and Zeyun Yu. Multiclass wound image classification using an ensemble deep CNN-based classifier. Computers in biology and medicine, 134:104536, 2021. doi: 10.1016/j.compbiomed.2021.104536. URL https://doi.Org/10.1016/j.compbiomed.2021.104536.

[175] Moi Hoon Yap, Ryo Hachiuma, Azadeh Alavi, Raphael Brüngel, Bill Cassidy, Manu Goyal, et al. Deep learning in diabetic foot ulcers detection: A comprehensive evaluation. Computers in biology and medicine, 135: 104596,2021. doi: 10.1016/j.compbiomed.2021.104596. URL https://doi.Org/10.1016/j.compbiomed.2021.104596.

[176] Tom J Liu, Mesakh Christian, Yuan-Chia Chu, Yu-Chun Chen, Che-Wei Chang, Feipei Lai, and Hao-Chih Tai. A pressure ulcers assessment system for diagnosis and decision making using convolutional neural networks. Journal of the Formosan Medical Association, 121(11):2227-2236, 2022. doi: 10.1016/jjfma.2022.04.010. URL https://doi.org/10.1016/j.jfma.2022.04.010.

[177] Che Wei Chang, Chun Yee Ho, Feipei Lai, Mesakh Christian, Shih Chen Huang, Dun Hao Chang, and Yo Shen Chen. Application of multiple deep learning models for automatic burn wound assessment. Burns, 49(5): 1039-1051,2023. doi: 10.1016/j.burns.2022.07.006. URL https://doi.org/10.1016/j.burns.2022.07.006.

[178] Ellen Huttunen, Teija Kimpimäki, Jenni E. Salenius, Ilkka Pölönen, Thomas Yambasu, Maria Huttunen, and Teea Salmi. Convolutional Neural Networks in Chronic Wound Segmentation and Tissue Classification Using Real-World Images. International Wound Journal, 23(4):e70912, 2026. doi: 10.1111/iwj.70912. URLhttps://doi.org/10.1111/iwj.70912.

[179] Mustafa Alhababi, Gregory Auner, Hafiz Malik, Muteb Aljasem, and Zaid Aldoulah. Unified wound diagnostic framework for wound segmentation and classification. Machine Learning with Applications, 19:100616, 2025. doi: 10.1016/j.mlwa.2024.100616. URL https://doi.Org/10.1016/j.mlwa.2024.100616.

[180] A. Sharaf Eldin, Asmaa S. Ahmoud, Hanaa M. Hamza, and Hanin Ardah. Enhancing Early Detection of Diabetic Foot Ulcers Using Deep Neural Networks. Diagnostics, 15(16):1996, 2025. doi: 10.3390/diagnostics15161996. URL https://doi.org/10.3390/diagnostics15161996.

[181] Mattias Birkner, Julia Schalk, Peter von den Driesch, and Erwin S. Schultz. Computer-Assisted Differential Diagnosis of Pyoderma Gangrenosum and Venous Ulcers with Deep Neural Networks. Journal of Clinical Medicine, 11:7103,2022. doi: 10.3390/jcm11237103. URL https://doi.org/10.3390/jcm11237103.

[182] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. Preprint, arXiv:1610.02391, 2016. URL https://arxiv.org/abs/1610.02391.

[183] Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask R-CNN. Author manuscript, arXiv:1703.06870, 2017. URL https://arxiv.org/abs/1703.06870.

[184] Alexander Kirillov, Kaiming He, Ross Girshick, Carsten Rother, and Piotr Dollar. Panoptic Segmentation. Author manuscript, arXiv:1801.00868, 2018. URL https://arxiv.org/abs/1801.00868.

[185] T.F. Cootes, C.J. Taylor, D.H. Cooper, and J. Graham. Active Shape Models-Their Training and Application. Computer Vision and Image Understanding, 61(1):38-59, 1995. doi: 10.1006/cviu.1995.1004. URL https://doi.org/10.1006/cviu.1995.1004.

[186] T.F. Cootes, G.J. Edwards, and C.J. Taylor. Active appearance models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23(6): 681-685,2001. doi: 10.1109/34.927467. URL https://doi.org/10.1109/34.927467.

[187] Rolf A. Heckemann, Joseph V. Hajnal, Paul Aljabar, Daniel Rueckert, and Alexander Hammers. Automatic anatomical brain MRI segmentation combining label propagation and decision fusion. NeuroImage, 33(1): 115-126,2006. doi: 10.1016/j.neuroimage.2006.05.061. URL https://doi.Org/10.1016/j.neuroimage.2006.05.061.

[188] Dan Ciresan, Alessandro Giusti, Luca M. Gambardella, and Jürgen Schmidhuber. Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images. In Advances in Neural Information Processing Systems, volume 25, 2012. URL https://papers.neurips.cc/paper_files/paper/2012/hash/45 9a4ddcb586f24efd9395aa7662bc7c-Abstract.html.

[189] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully Convolutional Networks for Semantic Segmentation. Author manuscript, arXiv:1411.4038, 2014. URL https://arxiv.org/abs/1411.4038.

[190] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(12): 2481-2495,2017. doi: 10.1109/tpami.2016.2644615. URL https://doi.org/10.1109/tpami.2016.2644615.

[191] Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature Pyramid Networks for Object Detection. Author manuscript, arXiv:1612.03144, 2016. URL https://arxiv.org/abs/1612.03144.

[192] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid Scene Parsing Network. Author manuscript, arXiv:1612.01105, 2016. URL https://arxiv.org/abs/1612.01105.

[193] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation. Author manuscript, arXiv:1802.02611, 2018. URL https://arxiv.org/abs/1802.02611.

[194] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Lecture Notes in Computer Science, pages 234-241. Springer International Publishing, 2015. doi: 10.1007/978-3-319-24574-4_28. URL https://doi.org/10.1007/978-3-319-24574-4_28.

[195] Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and Checkerboard Artifacts. Distill, 1(10), 2016. doi: 10.23915/distill.00003. URL https://distill.pub/2016/deconv-checkerboard/.

[196] Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation. Author manuscript, arXiv:1606.04797, 2016. URL https://arxiv.org/abs/1606.04797.

[197] Carole H Sudre, Wenqi Li, Tom Vercauteren, Sébastien Ourselin, and M. Jorge Cardoso. Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations. Author manuscript, arXiv:1707.03237, 2017. URL https://arxiv.org/abs/1707.03237.

[198] Seyed Sadegh Mohseni Salehi, Deniz Erdogmus, and Ali Gholipour. Tversky loss function for image segmentation using 3D fully convolutional deep networks. Author manuscript, arXiv:1706.05721, 2017. URL https://arxiv.org/abs/1706.05721.

[199] Nabila Abraham and Naimul Mefraz Khan. A Novel Focal Tversky loss function with improved Attention U-Net for lesion segmentation. Author manuscript, arXiv:1810.07842, 2018. URL https://arxiv.org/abs/1810.07842.

[200] Hoel Kervadec, Jihene Bouchtiba, Christian Desrosiers, Eric Granger, Jose Dolz, and Ismail Ben Ayed. Boundary loss for highly unbalanced segmentation. Author manuscript, arXiv:1812.07032, 2018. URL https://arxiv.org/abs/1812.07032.

[201] Zongwei Zhou, Md Mahfuzur Rahman Siddiquee, Nima Tajbakhsh, and Jianming Liang. UNet++: A Nested U-Net Architecture for Medical Image Segmentation. Author manuscript, arXiv:1807.10165, 2018. URL https://arxiv.org/abs/1807.10165.

[202] Huimin Huang, Lanfen Lin, Ruofeng Tong, Hongjie Hu, Qiaowei Zhang, Yutaro Iwamoto, et al. UNet 3+: A Full-Scale Connected UNet for Medical Image Segmentation. Author manuscript, arXiv:2004.08790, 2020. URL https://arxiv.org/abs/2004.08790.

[203] Daobin Huang, Minghui Wang, Ling Zhang, Haichun Li, Minquan Ye, and Ao Li. Learning rich features with hybrid loss for brain tumor segmentation. BMC Medical Informatics and Decision Making, 21(Suppl 2):63, 2021. doi: 10.1186/s12911-021-01431-y. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC8323198/.

[204] Piercarlo Minoretti, Manuel Gómez Serrano, Andrés Santiago Sáez, Miryam Liaño Riera, and Ángel García Martín. Successful management of chronic wounds by an autophagy-activating magnetized water-based gel in elderly patients: A case series. Cureus, 16(3):e55937, 2024. doi: 10.7759/cureus.55937. URL https://doi.org/10.7759/cureus.55937.

[205] Özgün Qigek, Ahmed Abdulkadir, Soeren S. Lienkamp, Thomas Brox, and Olaf Ronneberger. 3DU-Net: Learning Dense Volumetric Segmentation from Sparse Annotation. In Lecture Notes in Computer Science, pages 424-432. Springer International Publishing, 2016. doi: 10.1007/978-3-319-46723-8_49. URL https://doi.org/10.1007/978-3-319-46723-8_49.

[206] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. Author manuscript, arXiv:1703.01780, 2017. URL https://arxiv.org/abs/1703.01780.

[207] Lequan Yu, Shujun Wang, Xiaomeng Li, Chi-Wing Fu, and Pheng-Ann Heng. Uncertainty-aware Self-ensembling Model for Semi-supervised 3D Left Atrium Segmentation. Author manuscript, arXiv:1907.07034, 2019. URL https://arxiv.org/abs/1907.07034.

[208] Md Zahangir Alom, Mahmudul Hasan, Chris Yakopcic, Tarek M. Taha, and Vijayan K. Asari. Recurrent Residual Convolutional Neural Network based on U-Net (R2U-Net) for Medical Image Segmentation. Author manuscript, arXiv:1802.06955, 2018. URL https://arxiv.org/abs/1802.06955. Preprint version consulted.

[209] Xian Li, Hong Luo, Xiaoyan Liu, Tao Zhang, and Mei Zhang. Novel wound image segmentation with enhanced global context and adaptive channel-aware normalization. Expert Systems with Applications, 302: 130607,2026. doi: 10.1016/j.eswa.2025.130607. URL https://doi.Org/10.1016/j.eswa.2025.130607.

[210] Nabil Ibtehaz and M. Sohel Rahman. MultiResUNet : Rethinking the U-Net architecture for multimodal biomedical image segmentation. Neural Networks, 121:74-87,2020. doi: 10.1016/j.neunet.2019.08.025. URL https://doi.Org/10.1016/j.neunet.2019.08.025.

[211] Ozan Oktay, Jo Schlemper, Loic Le Folgoc, Matthew Lee, Mattias Heinrich, Kazunari Misawa, et al. Attention U-Net: Learning Where to Look for the Pancreas. Author manuscript, arXiv:1804.03999, 2018. URL https://arxiv.org/abs/1804.03999.

[212] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. CBAM: Convolutional Block Attention Module. Author manuscript, arXiv:1807.06521, 2018. URLhttps://arxiv.org/abs/1807.06521.

[213] Zaifang Zhang, Shenjun Sheng, Shihui Zhu, and Jian Jin. Chronic wound assessment system using an improved UPerNet model. International Journal of Imaging Systems and Technology, 35(1):e70032, 2025. doi: 10.1002/ima.70032. URLhttps://doi.org/10.1002/ima.70032.

[214] Debesh Jha, Michael A. Riegler, Dag Johansen, Pál Halvorsen, and Hâvard D. Johansen. DoubleU-Net: A Deep Convolutional Neural Network for Medical Image Segmentation. Author manuscript, arXiv:2006.04868, 2020. URL https://arxiv.org/abs/2006.04868.

[215] Saikat Roy, Gregor Koehler, Constantin Ulrich, Michael Baumgartner, Jens Petersen, Fabian Isensee, Paul F. Jaeger, and Klaus Maier-Hein. MedNeXt: Transformer-driven Scaling of ConvNets for Medical Image Segmentation. Author manuscript, arXiv:2303.09975, 2023. URL https://arxiv.org/abs/2303.09975.

[216] Fabian Isensee, Paul F. Jaeger, Simon A. A. Kohl, Jens Petersen, and Klaus H. Maier-Hein. nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods, 18(2): 203-211,2021. doi: 10.1038/s41592-020-01008-z. URL https://doi.org/10.1038/s41592-020-01008-z.

[217] Saikat Roy, Yannick Kirchhoff, Constantin Ulrich, Maximillian Rokuss, Tassilo Wald, Fabian Isensee, and Klaus Maier-Hein. MedNeXt-v2: Scaling 3D ConvNeXts for Large-Scale Supervised Representation Learning in Medical Image Segmentation. Author manuscript, arXiv:2512.17774, 2025. URL https://arxiv.org/abs/2512.17774. Preprint version consulted.

[218] Fabian Isensee, Tassilo Wald, Constantin Ulrich, Michael Baumgartner, Saikat Roy, Klaus Maier-Hein, and Paul F. Jaeger. nnU-Net Revisited: A Call for Rigorous Validation in 3D Medical Image Segmentation. Author manuscript, arXiv:2404.09556, 2024. URL https://arxiv.org/abs/2404.09556.

[219] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. Author manuscript, arXiv:1706.03762, 2017. URL https://arxiv.org/abs/1706.03762.

[220] Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, et al. TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation. Author manuscript, arXiv:2102.04306, 2021. URL https://arxiv.org/abs/2102.04306. Preprint version consulted.

[221] Jieneng Chen, Jieru Mei, Xianhang Li, Yongyi Lu, Qihang Yu, Qingyue Wei, et al. TransUNet: Rethinking the U-Net architecture design for medical image segmentation through the lens of transformers. Medical Image Analysis,97:103280,2024. doi: 10.1016/j.media.2024.103280. URL https://doi.Org/10.1016/j.media.2024.103280.

[222] Ali Hatamizadeh, Yucheng Tang, Vishwesh Nath, Dong Yang, Andriy Myronenko, Bennett Landman, Holger Roth, and Daguang Xu. UNETR: Transformers for 3D Medical Image Segmentation. Author manuscript, arXiv:2103.10504, 2021. URLhttps://arxiv.org/abs/2103.10504.

[223] Hu Cao, Yueyue Wang, Joy Chen, Dongsheng Jiang, Xiaopeng Zhang, Qi Tian, and Manning Wang. Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation. Author manuscript, arXiv:2105.05537, 2021. URL https://arxiv.org/abs/2105.05537.

[224] Ali Hatamizadeh, Vishwesh Nath, Yucheng Tang, Dong Yang, Holger Roth, and Daguang Xu. Swin UNETR: Swin Transformers for Semantic Segmentation of Brain Tumors in MRI Images. Author manuscript, arXiv:2201.01266, 2022. URL https://arxiv.org/abs/2201.01266.

[225] Albert Gu and Tri Dao. Mamba: Linear-Time Sequence Modeling with Selective State Spaces. Author manuscript, arXiv:2312.00752, 2023. URL https://arxiv.org/abs/2312.00752.

[226] Yessica Nataliani, Hindriyanto Dwi Purnomo, Ivanna K. Timotius, and Purwono Purwono. DFU-MambaLiteUNet: A lightweight and efficient model for diabetic foot ulcer segmentation. Expert Systems with Applications,293:128689,2025. doi: 10.1016/j.eswa.2025.128689. URL https://doi.org/10.1016/j.eswa.2025.128689.

[227] Jun Ma, Feifei Li, and Bo Wang. U-Mamba: Enhancing Long-range Dependency for Biomedical Image Segmentation. Author manuscript, arXiv:2401.04722, 2024. URL https://arxiv.org/abs/2401.04722.

[228] Zhaohu Xing, Tian Ye, Yijun Yang, Guang Liu, and Lei Zhu. SegMamba: Long-range Sequential Modeling Mamba For 3D Medical Image Segmentation. Author manuscript, arXiv:2401.13560, 2024. URL https://arxiv.org/abs/2401.13560.

[229] Daniel Willson Velladurai, R. Venkatesan, Saswati Debnath, Jaydeep Kishore, and Varun Tiwari. Hybrid Mamba and UNet plus plus framework for robust diabetic foot ulcer segmentation. Discover Applied Sciences, 8: 1135,2026. doi: 10.1007/s42452-026-09128-5. URL https://doi.org/10.1007/s42452-026-09128-5.

[230] Zhihan Zhang, Haiguang Huang, Yingwei Yang, and Junjie Liu. DIRANet: A direction-aware segmentation network with structural continuity in medical images. Displays, 95:103588,2026. doi: 10.1016/j.displa.2026.103588. URL https://doi.Org/10.1016/j.displa.2026.103588.

[231] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, et al. Segment Anything. Author manuscript, arXiv:2304.02643, 2023. URL https://arxiv.org/abs/2304.02643.

[232] Hao Wang, Shuaidan Zeng, Weiqing Li, Xiaodi Chen, Qianqian Mei, Huating Chen, Lina Fu, Zhenhui Zhao, Shengping Tang, Kaize Zheng, Yanyan Liang, and Zhu Xiong. Interactive AI assisted pediatric burn assessment based on smartphone images. Scientific Reports, 16(1):16996, 2026. doi: 10.1038/s41598-026-48169-z. URL https://doi.org/10.1038/s41598-026-48169-z.

[233] Radha Kunjalwar, Aditya S Pedaprolu, Akshunna Keerti, and Achal Chaudhari. A case of recurrent diabetic foot ulcers with multi-drug resistant poly-microbial infections. Cureus, 16(7):e65432, 2024. doi: 10.7759/cureus.65432. URL https://doi.org/10.7759/cureus.65432.

[234] Dahim Choi, Chirag Kharbanda, Kevin Saju, Sanjay K. Bhadada, and Manoj K. Bhasin. 1891-LB: DFUCare—SAM powered Segmentation for Enhanced Diabetic Foot Ulcer Analysis Platform. Diabetes, 74(Supplement 1):1891-LB, 2025. doi: 10.2337/db25-1891-lb. URL https://doi.org/10.2337/db25- 1891-lb. Conference abstract.

[235] Jun Ma, Yuting He, Feifei Li, Lin Han, Chenyu You, and Bo Wang. Segment anything in medical images. Nature Communications, 15(1):654, 2024. doi: 10.1038/s41467-024-44824-z. URL https://doi.org/10.1038/s41467-024-44824-z.

[236] Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, et al. SAM 2: Segment Anything in Images and Videos. Author manuscript, arXiv:2408.00714, 2024. URL https://arxiv.org/abs/2408.00714.

[237] Jun Ma, Zongxin Yang, Sumin Kim, Bihui Chen, Mohammed Baharoon, Adibvafa Fallahpour, et al. MedSAM2: Segment Anything in 3D Medical Images and Videos. Author manuscript, arXiv:2504.03600, 2025. URL https://arxiv.org/abs/2504.03600. Preprint version consulted.

[238] Nicolas Carion, Laura Gustafson, Yuan-Ting Hu, Shoubhik Debnath, Ronghang Hu, Didac Suris, et al. SAM 3: Segment Anything with Concepts. Author manuscript, arXiv:2511.16719, 2025. URL https://arxiv.org/abs/2511.16719. 2025 author manuscript; subsequently published at ICLR 2026.

[239] Anglin Liu, Xu R. Cao, Yifan Shen, Yi Lu, Xiang Li, Qianqian Chen, and Jintai Chen. MedSAM3: Delving into Segment Anything with Medical Concepts. Author manuscript, arXiv:2511.19046, 2025. URL https://arxiv.org/abs/2511.19046. Preprint version consulted.

[240] Simon A. A. Kohl, Bernardino Romera-Paredes, Clemens Meyer, Jeffrey De Fauw, Joseph R. Ledsam, Klaus H. Maier-Hein, et al. A Probabilistic U-Net for Segmentation of Ambiguous Images. Author manuscript, arXiv:1806.05034, 2018. URL https://arxiv.org/abs/1806.05034.

[241] Junde Wu, Rao Fu, Huihui Fang, Yu Zhang, Yehui Yang, Haoyi Xiong, Huiying Liu, and Yanwu Xu. MedSegDiff: Medical Image Segmentation with Diffusion Probabilistic Model. In Medical Imaging with Deep Learning, volume 227 of Proceedings of Machine Learning Research, pages 1623-1639, 2024. URL https://proceedings.mlr.press/v227/wu24a.html. Proceedings of MIDL 2023, published in 2024.

[242] Anum Fatima, Moi Hoon Yap, Neil D. Reeves, Michael Odling-Smee, David Bond, and Connah Kendrick. Mind the Gap: A survey of chronic wound datasets, methods, and clinical translation. Medical Image Analysis, 115:104344,2027. doi: 10.1016/j.media.2026.104344. URL https://doi.Org/10.1016/j.media.2026.104344. Available online 2026 as a journal pre-proof; assigned to the 2027 issue.

[243] Indrani Marchal, Zhara Ali, Haroun Ammi, Steven Smet, Lies Van de Voorde, Carolina Varon, et al. Comparing YOLO and U-net deep learning algorithms in chronic wound image segmentation. BMC Medical Imaging,26:217,2026. doi: 10.1186/s12880-026-02266-7. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC13123066/.

[244] Trishaani Acharjee, Rajdeep Chatterjee, Mahendra Kumar Gourisaria, Manoj Sahni, and Ernesto León-Castro. ERYXSeg: a hybrid CNN architecture for robust and resource-aware wound segmentation. Frontiers in Surgery, 13:1790725,2026. doi: 10.3389/fsurg.2026.1790725. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC13329626/.

[245] Maali Alabdulhafith, Abduljabbar S Ba Mahel, Nagwan Abdel Samee, Noha F Mahmoud, Rawan Talaat, Mohammed Saleh Ali Muthanna, and Tamer M Nassef. Automated wound care by employing a reliable U-Net architecture combined with ResNet feature encoders for monitoring chronic wounds. Frontiers in Medicine, 11:1310137,2024. doi: 10.3389/fmed.2024.1310137. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC10865496/.

[246] Rampriya R. S., Sabari Nathan, and Arumuga Arun R. An attention-guided dense convolutional network for automated diabetic foot ulcer segmentation. Frontiers in Endocrinology, 17:1940557,2026. doi: 10.3389/fendo.2026.1940557. URL https://www.frontiersin.org/journals/endocrinology/artic les/10.3389/fendo.2026.1940557/full.

[247] National Institute of Diabetes and Digestive and Kidney Diseases. Diabetes and Foot Problems, n.d. URL https://www.niddk.nih.gov/health-information/diabetes/ov erview/preventing-problems/foot-problems. Online resource, accessed 2026.

[248] Éric Senneville, Zaina Albalawi, Suzanne A van Asten, Zulfiqarali G Abbas, Geneve Allison, Javier Aragon-Sanchez, et al. IWGDF/IDSA Guidelines on the Diagnosis and Treatment of Diabetes-related Foot Infections (IWGDF/IDSA 2023). Clinical Infectious Diseases, page ciad527, 2023. doi: 10.1093/cid/ciad527. URL https://doi.org/10.1093/cid/ciad527.

[249] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In International Conference on Learning Representations, 2021. URL https://arxiv.org/abs/2010.11929. Author manuscript consulted for technical details.

[250] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10012-10022, 2021. URL https://arxiv.org/abs/2103.14030. Author manuscript consulted for technical details.

[251] Manu Goyal, Neil D Reeves, Satyan Rajbhandari, Naseer Ahmad, Chuan Wang, and Moi Hoon Yap. Recognition of ischaemia and infection in diabetic foot ulcers: Dataset and techniques. Computers in biology and medicine, 117:103616,2020. doi: 10.1016/j.compbiomed.2020.103616. URL https://doi.Org/10.1016/j.compbiomed.2020.103616.

[252] Pedro Pereira, Joao Andrade, Helena Costa, Filipe Neves, and Augusto Lourenço. Rectal sleeve for fecal diversion in the management of a sacrococcygeal stage iv pressure ulcer in a dementia patient: A non-surgical alternative to colostomy. Cureus, 17(10):e93868, 2025. doi: 10.7759/cureus.93868. URL https://doi.org/10.7759/cureus.93868.

[253] National Health Service. Pressure sores (pressure ulcers), n.d.. URL https://www.nhs.uk/conditions/pressure-sores/. Online resource, accessed 2026.

[254] National Health Service. Venous leg ulcer, n.d.. URL https://www.nhs.uk/conditions/leg-ulcer/. Online resource, accessed 2026.

[255] MedlinePlus. Surgical wound care - open, n.d.. URL https: //medlineplus.gov/ency/patientinstructions/000040.htm. Online resource, accessed 2026.

[256] Ryan D. Rosen and Biagio Manna. Wound Dehiscence. In StatPearls. StatPearls Publishing, 2023. URL https://www.ncbi.nlm.nih.gov/books/NBK551712/. Updated 2023; accessed 2026.

[257] MedlinePlus. Wounds and Injuries, n.d.. URL https://medlineplus.gov/woundsandinjuries.html. Online resource, accessed 2026.

[258] National Health Service. Burns and scalds, n.d.. URL https://www.nhs.uk/conditions/burns-and-scalds/. Online resource, accessed 2026.

[259] Apurv S. Wadgaonkar, Sanjay V Deshpande, Nachiket P Rahate, and Prashant V Rahate. The miraculous diagnostic role of indocyanine green in a diabetic foot ulcer: A rare case report. Cureus, 16(3):e55525, 2024. doi: 10.7759/cureus.55525. URL https://doi.org/10.7759/cureus.55525.

[260] Rita K. Driver. Utilizing the veraflo instillation negative pressure wound therapy system with advanced care for a case study. Cureus, 8(11):e903, 2016. doi: 10.7759/cureus.903. URL https://doi.org/10.7759/cureus.903.

[261] Medetec. Medetec Wound Database: stock pictures of wounds, n.d. URL https:

//www.medetec.co.uk/files/medetec-image-databases.html. Online resource, accessed 2026.

[262] UWM Big Data Analytics and Visualization Laboratory. Wound segmentation: data release and FUSeg challenge updates, n.d. URL https://github.com/uwm-bigdata/wound-segmentation. Online resource, accessed 2026.

[263] UWM Big Data Laboratory. Wound classification using images and locations: Azh release. URLhttps://github.com/uwm-bigdata/wou nd-classification-using-images-and-locations/tree/e7dd90 de113dcbd39665f2bd0e5613adeffff5fa. Accessed 2026.

[264] DFU Challenge Organizers. Diabetic foot ulcers grand challenge 2021,. URLhttps://dfu-challenge.github.io/dfuc2021.html. Accessed 2026.

[265] Moi Hoon Yap, Bill Cassidy, Joseph M. Pappachan, Claire O’Shea, David Gillespie, and Neil D. Reeves. Analysis towards classification of infection and ischaemia of diabetic foot ulcers. In 2021 IEEE EMBS International Conference on Biomedical and Health Informatics (BHI), pages 1-4, 2021. doi: 10.1109/BHI50953.2021.9508563. URL https://doi.org/10.1109/BHI50953.2021.9508563.

[266] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In International Conference on Learning Representations, 2015. URL https://arxiv.org/abs/1409.0473. Author manuscript consulted for technical details.

[267] PyTorch contributors. Automatic Mixed Precision examples, 2026. URL https: //docs.pytorch.org/docs/2.14/notes/amp_examples.html. Version 2.14 documentation, accessed 2026.

[268] Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735-1780, 1997. doi: 10.1162/neco.1997.9.8.1735. URL https://doi.Org/10.1162/neco.1997.9.8.1735.

[269] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. Author manuscript, arXiv:1412.3555, 2014. URL https://arxiv.org/abs/1412.3555. Author manuscript version consulted.

[270] Felix A. Gers, Jürgen Schmidhuber, and Fred Cummins. Learning to Forget: Continual Prediction with LSTM. Neural Computation, 12(10): 2451-2471,2000. doi: 10.1162/089976600300015015. URL https://doi.org/10.1162/089976600300015015.

[271] PyTorch contributors. GRU: implementation notes, 2026. URL https: //docs.pytorch.org/docs/2.14/generated/torch.nn.GRU.html. Version 2.14 documentation, accessed 2026.

[272] Shuai Li, Wanqing Li, Chris Cook, Ce Zhu, and Yanbo Gao. Independently Recurrent Neural Network (IndRNN): Building A Longer and Deeper RNN. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5457-5466, 2018. URL https://arxiv.org/abs/1803.04831. Author manuscript consulted for technical details.

[273] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer Normalization. Author manuscript, arXiv:1607.06450, 2016. URL https://arxiv.org/abs/1607.06450. Author manuscript version consulted.

[274] Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness. In Advances in Neural Information Processing Systems, volume 35, pages 16344-16359,2022. doi: 10.52202/068431-1189. URL https://arxiv.org/abs/2205.14135. Author manuscript consulted for technical details.

[275] Ramin Mousa, Hadis Taherinia, Khabiba Abdiyeva, Amir Ali Bengari, and Mohammadmahdi Vahediahmar. Integrating Vision and Location with Transformers: A Multimodal Deep Learning Framework for Medical Wound Analysis. Author manuscript, arXiv:2504.10452, 2025. URL https://arxiv.org/abs/2504.10452. Author manuscript version consulted.

[276] David Reifs, Lorena Casanova, Ramon Reig-Bolano, and Andrea Coda. Detection of hypergranulation tissue in chronic wound images using artificial intelligence algorithms. Wound Repair and Regeneration, 34(1): e70125, 2026. doi: 10.1111/wrr.70125. URL https://doi.org/10.1111/wrr.70125.

[277] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 10347-10357, 2021. URL https://proceedings.mlr.press/v139/touvron21a.html. Author manuscript consulted for technical details.

[278] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, et al. DINOv2: Learning Robust Visual Features without Supervision. Transactions on Machine Learning Research,2024. URLhttps://arxiv.org/abs/2304.07193. 2023 author manuscript consulted; published in TMLR in 2024.

[279] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the Knowledge in a Neural Network. Author manuscript, arXiv:1503.02531, 2015. URL https://arxiv.org/abs/1503.02531. Author manuscript version consulted.

[280] Facebook AI Research. DeiT Reference Implementation: DistilledVisionTransformer. Official source code, models.py, 2021. URL https://github.com/facebookresearch/deit/blob/ab5715372d b8c6cad5740714b2216d55aeae052e/models.py. Revision ab5715372db8, 2021; accessed 2026.

[281] Oriane Simeoni, Huy V. Vo, Maximilian Seitzer, Federico Baldassarre, Maxime Oquab, Cijo Jose, et al. DINOv3. Author manuscript, arXiv:2508.10104, 2025. URLhttps://arxiv.org/abs/2508.10104. Author manuscript version consulted.

[282] Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, et al. Swin Transformer V2: Scaling Up Capacity and Resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12009-12019,2022. URLhttps://arxiv.org/abs/2111.09883. Author manuscript consulted for technical details.

[283] Ramin Mousa, Behnaz Rezaei, Laya Mahmoudi, and Jafar Abdollahi. Multi-modal wound classification using wound image and location by Swin Transformer and Transformer. Expert Systems with Applications, 280: 127077,2025. doi: 10.1016/j.eswa.2025.127077. URL https://doi.org/10.1016/Ueswa.2025.127077.

[284] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, et al. Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 568-578, 2021. URL https://arxiv.org/abs/2102.12122. Author manuscript consulted for technical details.

[285] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, et al. PVT v2: Improved baselines with pyramid vision transformer. Computational Visual Media, 8(3):415-424, 2022. doi: 10.1007/s41095-022-0274-8. URL https://doi.org/10.1007/s41095-022-0274-8.

[286] Ali Hassani, Steven Walton, Nikhil Shah, Abulikemu Abuduweili, Jiachen Li, and Humphrey Shi. Escaping the Big Data Paradigm with Compact Transformers. Author manuscript, arXiv:2104.05704, 2021. URL https://arxiv.org/abs/2104.05704. Author manuscript version consulted.

[287] Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. CvT: Introducing Convolutions to Vision Transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 22-31, 2021. URL https://arxiv.org/abs/2103.15808. Author manuscript consulted for technical details.

[288] Sachin Mehta and Mohammad Rastegari. MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer. In International Conference on Learning Representations, 2022. URL https://arxiv.org/abs/2110.02178. Author manuscript consulted for technical details.

[289] Sachin Mehta and Mohammad Rastegari. Separable Self-attention for Mobile Vision Transformers. Author manuscript, arXiv:2206.02680, 2022. URL https://arxiv.org/abs/2206.02680. Author manuscript version consulted.

[290] Mattias Birkner, Julia Schalk, Peter von den Driesch, and Erwin Schultz. Mendeley supplemental figure 1, 2022. URL https://data.mendeley.eom/datasets/mzwv687gzn/1. Version 1, 2022; original file Fig4_2col.jpg, corresponding to published Figure 4; CC BY4.0.

[291] Tej S Ranade, Emily Hu, Kadambari Beelwar, Sandeep Boddeda, Praharsha Mulpur, Adarsh Annapareddy, and A V Gurava Reddy. Technical Feasibility of a Multimodal Electro-Optical and Infrared Imaging Pipeline for Postoperative Wound Assessment After Total Knee Arthroplasty: Formative Evaluation Study. JMIR Formative Research, 10:e99244, 2026. doi: 10.2196/99244. URL https://formative.jmir.Org/2026/l/e99244/. Published 2026; version of record; CC BY 4.0.

[292] Kavyanjali Reddy, Pankaj Gharde, Harshal Tayade, Mihir Patil, Lucky Srivani Reddy, and Dheeraj Surya. Unknown and unacknowledged dangers to every medical student: A rare case of nitric acid burns. Cureus, 16(1):e52203, 2024. doi: 10.7759/cureus.52203. URL https://doi.org/l0.7759/cureus.52203.

[293] Ilya Loshchilov and Frank Hutter. Decoupled Weight Decay Regularization. In International Conference on Learning Representations, 2019. URL https://arxiv.org/abs/l7ll.05l0l. Author manuscript consulted for technical details.

[294] Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11106-11115, 2021. doi: 10.1609/aaai.v35i12.17325. URL https://arxiv.org/abs/20l2.07436. Author manuscript consulted for technical details.

[295] Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun, and Rong Jin. FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 27268-27286, 2022. URL https://proceedings.mlr.press/vl62/zhou22g.html. Author manuscript consulted for technical details.

[296] Informer authors. Informer2020: ProbAttention reference implementation, 2025. URLhttps://github.eom/zhouhaoyi/Informer2020/blob/2 9f2a739226a509202a092b464l63da8lfa74960/models/attn.py. models/attn.py, commit 29f2a739226a, accessed 2026.

[297] Sarthak Jain and Byron C. Wallace. Attention is not Explanation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3543-3556. Association for Computational Linguistics, 2019. doi: 10.18653/v1/N19-1357. URL https://arxiv.org/abs/l902.l0l86. Author manuscript consulted for technical details.

[298] Moses Kiprono. WoundNet-Ensemble: A Novel IoMT System Integrating Self-Supervised Deep Learning and Multi-Model Fusion for Automated, High-Accuracy Wound Classification and Healing Progression Monitoring. Author manuscript, arXiv:2512.18528, 2025. URL https://arxiv.org/abs/25l2.l8528. Author manuscript version consulted.

[299] Juan Anthonio Salas and Che-Wei Lin. Enhancing Multi-label Wound Image Classification with Class-Specific Augmentation Using Vision Transformer Models. In IFMBE Proceedings, pages 262-268. Springer Nature Switzerland, 2025. doi: 10.1007/978-3-031-86323-3_31. URL https://doi.org/10.1007/978-3-031-86323-3_31. ICBHI2024 conference; proceedings published in 2025.

[300] Sumithra M.G and Chandran Venkatesan. SwinDFU-Net: Deep learning transformer network for infection identification in diabetic foot ulcer. Technology and Health Care, 33(1):601-618, 2025. doi: 10.3233/thc-241444. URL https://doi.org/10.3233/thc-241444.

[301] Raihan Ahamed Rifat, Fuyad Hasan Bhoyan, Md Humaion Kabir Mehedi, Md Kaviul Hossain, Md. Jakir Hossen, and M.F. Mridha. ConMatFormer: A multi-attention and transformer integrated ConvNext based deep learning model for enhanced diabetic foot ulcer classification. Results in Engineering,28:108248,2025. doi: 10.1016/j.rineng.2025.108248. URL https://doi.Org/10.1016/j.rineng.2025.108248.

[302] Prithwish Sen and Pinki Roy. YOLO meets CCViT- A lightweight end-to-end system for wound tissue analysis. Biomedical Signal Processing andControl, 106:107734,2025. doi: 10.1016/j.bspc.2025.107734. URL https://doi.org/10.1016/j.bspc.2025.107734.

[303] Muhammad Ashad Kabir and Rabin Dulal. WoundFormer: Multi-Scale Spatial Feature Fusion for Multi-Class Wound Tissue Segmentation. Author manuscript, arXiv:2605.19868, 2026. URL https://arxiv.org/abs/2605.19868. Author manuscript version consulted.

[304] Abderrahmane Benfatah. Do Diabetic Foot Ulcer Segmentation Models Generalize? A Cross-Dataset Benchmark of CNN and Transformer Architectures. Author manuscript, arXiv:2607.02555, 2026. URL https://arxiv.org/abs/2607.02555. Author manuscript version consulted.

[305] Vanessa Borst, Timo Dittus, Tassilo Dege, Astrid Schmieder, and Samuel Kounev. WoundAmbit: Bridging State-of-the-Art Semantic Segmentation and Real-World Wound Care. In Lecture Notes in Computer Science, pages 285-303. Springer Nature Switzerland, 2025. doi: 10.1007/978-3-032-06118-8_17. URL https://doi.org/10.1007/978-3-032-06118-8_17. ECML PKDD 2025 proceedings DOI metadata; revised author manuscript also consulted. arXiv journal-reference year differs from publisher metadata.

[306] Bill Cassidy, Christian McBride, Connah Kendrick, Neil D. Reeves, Joseph M. Pappachan, Cornelius J. Fernandez, et al. An enhanced harmonic densely connected hybrid transformer network architecture for chronic wound segmentation utilising multi-colour space tensor merging. Computers in Biology and Medicine, 192:110172, 2025. doi: 10.1016/j.compbiomed.2025.110172. URL https://doi.Org/10.1016/j.compbiomed.2025.110172.

[307] Skin Integrity Team, Doncaster and Bassetlaw Teaching Hospitals NHS Foundation Trust. Skin care pathway for incontinence associated dermatitis (iad) and moisture associated skin damage (masd), 2022. URL https://www.dbth.nhs.uk/wp-content/uploads/2024/01/Skin-C are-Pathway-for-Incontinence-Associated-Dermatitis-IAD-v 3-2024.pdf. Official NHS pathway; version 3 updated 2022; review scheduled 2024; accessed 2026.

[308] Aged Care Quality and Safety Commission. Incontinence associated dermatitis and pressure injury, 2022. URL https://www.agedcarequality.gov.au/news-publications/clinical-alerts-and-advice/ incontinence-associated-dermatitis-and-pressure-injury. Official clinical guidance; accessed 2026.

[309] Binyang Wang, Yuxue Wang, Tong Sun, Yingke Chen, Liangchen Liu, Chuanxiong Li, and Jin Yan. Integrating wound images and clinical text for pressure injury assessment and treatment recommendation. Bioengineering, 13(6):642, 2026. doi: 10.3390/bioengineering13060642. URL https://doi.org/10.3390/bioengineeringl3060642.

[310] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, et al. Supervised Contrastive Learning. In Advances in Neural Information Processing Systems, volume 33, pages 18661-18673, 2020. URL https://proceedings.neurips.cc/paper_files/paper/202 0/hash/d89a66c7c80a29b1bdbab0f2a1a94af8-Abstract.html.

[311] QwenTeam. Qwen3-vl technical report. Author preprint, arXiv:2511.21631v2, 2025. URL https://arxiv.org/abs/2511.21631v2. Version 2, 2025; architecture consulted 2026.

[312] Jaime Carbonell and Jade Goldstein. The use of mmr, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st annual international ACM SIGIR conference on Research and development in information retrieval, pages 335-336, 1998. doi: 10.1145/290941.291025. URL https://doi.org/10.1145/290941.291025.

[313] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. Author preprint, arXiv:2106.09685v2, 2021. URL https://arxiv.org/abs/2106.09685v2. Exact version consulted; accessed 2026.

[314] Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. Author preprint, arXiv:2402.03300v3, 2024. URL https://arxiv.org/abs/2402.03300v3. Exact version consulted; accessed 2026.

[315] Sirin Apichonbancha, Nutcha Yodrabum, Sasima Tongsai, Chantaramon Thanapaisal, Chanya Sinmaroeng, and Kengkart Winaikosol. Performance, safety, and limitations of multimodal large language models in wound image assessment. Scientific Reports, 16(1):26560, 2026. doi: 10.1038/s41598-026-57441-1. URL https://doi.org/10.1038/s41598-026-57441-1.

[316] scikit-learn developers. GroupShuffleSplit: group-based randomized partitions, 2026. URLhttps://scikit-learn.org/stable/modules/ generated/sklearn.model_selection.GroupShuffleSplit.html. Official scikit-learn 1.9.1 documentation; accessed 2026.

[317] PyTorch contributors. Cross-entropy loss: class indices, ignored targets and reduction, 2026. URLhttps://docs.pytorch.org/docs/2.14/gener ated/torch.nn.functional.cross_entropy.html. Official PyTorch 2.14 documentation; accessed 2026.

[318] PyTorch contributors. Scaled dot-product attention: computation and mask conventions, 2026. URL https://docs.pytorch.Org/docs/2.14/generated/torch.nn.fu nctional.scaled_dot_product_attention.html. Official PyTorch 2.14 documentation; accessed 2026.

[319] Hugging Face. Multimodal chat templates. Transformers documentation, 2026. URLhttps://huggingface.co/docs/transformers/main/en /chat_templating_multimodal. Main documentation accessed 2026; interfaces depend on the selected release.

[320] Connah Kendrick, Bill Cassidy, Joseph M. Pappachan, Claire O’Shea, Cornelious J. Fernandez, Elias Chacko, Koshy Jacob, Neil D. Reeves, and Moi Hoon Yap. Translating clinical delineation of diabetic foot ulcers into machine interpretable segmentation. Preprint, arXiv:2204.11618v2, 2022. URL https://arxiv.org/abs/2204.11618v2.

[321] DFU Challenge Organizers. Diabetic foot ulcers grand challenge 2022,. URL https://dfu-challenge.github.io/dfuc2022.html. Accessed 2026.

[322] leoscode. Wound images segmentation [2760 samples]. URL https://www.kaggle.com/datasets/leoscode/wound-segmentation-images. Accessed 2026.

[323] yasinpratomo. wound_dataset. URL https: //www.kaggle.com/datasets/yasinpratomo/wound-dataset. Accessed 2026.

[324] scikit-learn developers. Common pitfalls and recommended practices,. URL https://scikit-learn.org/stable/common_pitfalls.html. Accessed 2026.

[325] Sasank Chilamkurthy. Transfer learning for computer vision tutorial. URL https://docs.pytorch.org/tutorials/beginner/transfer_lea rning_tutorial.html. Accessed 2026.

[326] Jiahao Xu, Changchang Yin, Odysseas P Chatzipanagiotou, Diamantis I. Tsilimigras, Kevin Clear, Bingsheng Yao, Weidan Cao, Dakuo Wang, Timothy M. Pawlik, and Ping Zhang. Surgwound-bench: a benchmark for surgical wound diagnosis. npj Digital Medicine, 9(1):632, 2026. doi: 10.1038/s41746-026-02791-3. URL https://doi.org/10.1038/s41746-026-02791-3.

[327] Yuxin Zuo, Shang Qu, Yifei Li, Zhang-Ren Chen, Xuekai Zhu, Ermo Hua, Kaiyan Zhang, Ning Ding, and Bowen Zhou. Medxpertqa: Benchmarking expert-level medical reasoning and understanding. In Proceedings of the 42ndInternational Conference on Machine Learning, volume 267, pages 80961-80990, 2025. URL https://proceedings.mlr.press/v267/zuo25a.html.

[328] SurgWound authors. Surgwound: official benchmark code and dataset links, . URLhttps://github.com/xuxuxuxuxuxjh/SurgWound. Accessed 2026.

[329] SurgWound authors. Surgwound: official dataset card,. URL https://huggingface.co/datasets/xuxuxuxuxu/SurgWound. Accessed 2026.

[330] Joyce Y. Kim and Harry Dao. Physiology, Integument. In StatPearls. StatPearls Publishing, Treasure Island, FL, 2023. URL https://www.ncbi.nlm.nih.gov/books/NBK554386/. Updated 2023; accessed 2026.

[331] Arturo Robles-Tenorio, John David Jaar Paz, and Ali Kimyaghalam. Venous Leg Ulcer. In StatPearls. StatPearls Publishing, Treasure Island, FL,2026. URL https://www.ncbi.nlm.nih.gov/books/NBK567802/. Updated 2026; accessed 2026.

[332] scikit-learn developers. brier_score_loss. scikit-learn 1.9 documentation, 2026. URLhttps://scikit-learn.Org/l.9/modules/generated/s klearn.metrics.brier_score_loss.html. Version 1.9.1 consulted; accessed 2026.

[333] Python Software Foundation. venv: Creation of virtual environments, python 3.13 documentation.

https://docs.python.org/3.l3/library/venv.html, 2026. Official documentation; virtual-environment creation and direct interpreter invocation.

[334] PyTorch Contributors. Previous pytorch versions: Version 2.9.1 installation commands.

https://pytorch.org/get-started/previous-versions/, 2026. Official version-specific installation guide; CPU wheel route for Linux and Windows.

Image Credits

Every wound photograph is a sourced clinical image. No clinical photograph is repeated across numbered book figures, including through a different crop. Photograph-map/overlay pairs within one figure retain their original same-case relationship. Rectangular panel selection and new explanatory layouts are declared; no photo was regenerated, recoloured or upsampled. A file’s licence is separate from its host’s general footer.

Jonathan Moore, 2008. Figure 1.3 uses Neuropathic heel ulcer diabetic.jpg; Figure 1.6 uses Venous ulcer dorsal leg.jpg; CC BY 3.0 (https://creativeco mmons.org/licenses/by/3.0/). Exact files: https://commons.wikimedi a.org/wiki/File:Neuropathic_heel_ulcer_diabetic.jpg and https: //commons.wikimedia.org/wiki/File:Venous_ulcer_dorsal_leg.jpg. Associated article: Creating the Ideal Microcosm for Rapid Incorporation of Bioengineered Alternative Tissues Using An Advanced Hydrogel Impregnated Gauze Dressing: A Case Series, DOI 10.3827/faoj.2008.0109.0002. Its old article URLs return 410; original article panel numbers are not invented. Source photo pixels are unchanged.

Drummyfish, 2018. Figure 1.5, Sutured wound.jpg, the creator’s own postoperative wound below the neck, CC0 1.0: https://commons.wikimedia.org/wiki /File:Sutured_wound.jpg; https://creativecommons.org/publicdoma in/zero/1.0/. Original pixels retained.

Prakash et al., 2016. T. V. Prakash, Ajay Chaudhary, Shyam Purushothaman, Smitha K. V. and Varada Arvind K., Epidermal Grafting for Chronic Complex Wounds in India: A Case Series, Cureus 8:e516, DOI https://doi.org/10.775 9/cureus.516; copyright the authors; CC BY 3.0.[12] Source Figures 1A, 2A and 3A appear once each in Figures 1.1, 1.4 and 3.2, respectively. Exact native panels are selected from the original plates; A labels retained. The knee and pressure- related heel are different wound sites in source case 2; no common healing sequence or treatment effect is asserted.

Idogun et al., 2021. Precious O. Idogun, Mindy C. Ward, Yeshanew Teklie, Wilhelmine Wiese-Rometsch and Joel Baker, Newly Diagnosed Idiopathic Thrombocytopenia Post COVID-19 Vaccine Administration, Cureus 13:e14853, DOI https://doi.org/10.7759/cureus.14853; copyright the authors; CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).[13] Figure 1.2 selects a central region of source Figure 2, excluding the wristband. Thrombocytopenia context is documented; neither traumatic mechanism nor vaccine causality is inferred.

Talat et al., 2025. Fawad Talat, Saqib Gul, Owais Gul and Maria Khalid, Inferior Vena Cava Atresia: A Rare Cause of Recurrent Deep Venous Thrombosis and Infected Venous Ulcers, Cureus 17:e87729, DOI https://doi.org/10.7759/cu reus.87729; copyright the authors; CC BY 4.0.[93] Source Figure 1 (right leg) is used only in Figure 3.1; source Figure 2 (left leg) only in Figure 5.1. Original photo pixels retained; processing boxes and separate schematic masks are new, unexecuted explanations.

Minoretti et al., 2024. Piercarlo Minoretti, Manuel Gómez Serrano, Andrés Santiago Sáez, Miryam Liaño Riera and Ángel García Martín, Successful Man-agement of Chronic Wounds by an Autophagy-Activating Magnetized Water-Based Gel in Elderly Patients: A Case Series, Cureus 16:e55937, DOI https: //doi.org/10.7759/cureus.55937; copyright the authors; CC BY 4.0.[204]

Only the baseline A panels are used: source Figures 2A, 4A and 5A in Figure 5.7; source Figures 1A and 3A in Figure 6.2. All five are distinct cases; exact native rectangular selections retain their A labels. These photos illustrate documented wound contexts, without importing the paper’s treatment mechanism or efficacy claims.

Kunjalwar et al., 2024. Radha Kunjalwar, Aditya S. Pedaprolu, Akshunna Keerti and Achal Chaudhari, A Case of Recurrent Diabetic Foot Ulcers With Multi-drug Resistant Poly-Microbial Infections, Cureus 16:e65432, DOI https://doi.or g/10.7759/cureus.65432; copyright the authors; CC BY 4.0.[233] Figure 5.18 selects source Figure 1A. Prompt boxes, points and contours are new schematic teaching overlays, not clinical annotations or model results.

Pereira et al., 2025. Pedro Pereira, Joao Andrade, Helena Costa, Filipe Neves and Augusto Lourengo, Rectal Sleeve for Fecal Diversion in the Management of a Sacrococcygeal Stage IV Pressure Ulcer in a Dementia Patient: A Non-surgical Alternative to Colostomy, Cureus 17:e93868, DOI https://doi.org/10.7759/ cureus.93868; copyright the authors; CC BY 4.0.[252] Figure 6.1 uses source Figure 1 with original pixels and new conceptual boxes. No treatment result is inferred.

Wadgaonkar et al., 2024; Driver, 2016. Figure 6.2 uses source Figure 1 from each: Apurv S. Wadgaonkar, Sanjay V. Deshpande, Nachiket P. Rahate and Prashant V. Rahate, The Miraculous Diagnostic Role of Indocyanine Green in a Diabetic Foot Ulcer: A Rare Case Report, Cureus 16:e55525, DOI https://doi.or g/10.7759/cureus.55525, CC BY 4.0; Rita K. Driver, Utilizing the VeraFlo Instillation Negative Pressure Wound Therapy System with Advanced Care for a Case Study, Cureus 8:e903, DOI https://doi.org/10.7759/cureus.903, CC BY 3.0.[259, 260] Copyright the respective authors; original photo pixels retained in a new layout. Driver’s image is a failed postoperative flap, cropped to the upper clinical region to exclude the handwritten ruler; Wadgaonkar’s is the clinical view, not a fluorescence map.

Reddy et al., 2024. Kavyanjali Reddy, Pankaj Gharde, Harshal Tayade, Mihir Patil, Lucky Srivani Reddy and Dheeraj Surya, Unknown and Unacknowledged Dangers to Every Medical Student: A Rare Case of Nitric Acid Burns, Cureus 16:e52203, DOI https://doi.org/10.7759/cureus.52203; copyright the authors; CC BY 4.0.[292] Original Figure 1 is used once in Figure 6.19, as an independent chemical-burn example. The adjacent SCARWID contract is a new, unexecuted diagram informed by Busaranuvong et al., arXiv:2502.20277v1, Sections 3.1-3.2.[25] No query identity, infection reference or model result is transferred.

Birkner et al., 2022. Mattias Birkner, Julia Schalk, Peter von den Driesch and Erwin S. Schultz, Computer-Assisted Differential Diagnosis of Pyoderma Gan-grenosum and Venous Ulcers with Deep Neural Networks, J. Clin. Med. 11:7103, DOI https://doi.org/10.3390/jcm11237103.[181] Creator-supplied original Fig4_2col.jpg, Mendeley Data v1, 2022, DOI https://doi.org/10.17632 /mzwv687gzn.1; copyright the creators; CC BY 4.0.[290] Disjoint original clinical columns are used: column 4 with its matching PG maps in Figure 6.15; columns 1 and 3 in Figure 6.24; column 2 in Figure 7.28. Source headers are omitted; exact photo/map panels and new explanatory labels/layouts are distinguished. Binary PG/UC error labels follow the reference groups and incorrect-CNN marks, not new inference.

Ranade et al., 2026. Copyright Tej S. Ranade, Emily Hu, Kadambari Beel- war, Sandeep Boddeda, Praharsha Mulpur, Adarsh Annapareddy and A. V. Gurava Reddy. Technical Feasibility of a Multimodal Electro-Optical and Infrared Imaging Pipeline for Postoperative Wound Assessment After Total Knee Arthroplasty: Formative Evaluation Study, originally published in JMIR Formative Research, 2026, volume 10, e99244; DOI https://doi.org/10.2196/99244.p91] Original publication: https://formative.jmir.org/2026/1/e99244/. Reused and adapted under CC BY 4.0: https://creativecommons.org/licenses/by/ 4.0/. Figure 6.17 retains original Figure 5A-B photo/predicted-overlay pixels; panel headings and the source legend are typeset anew in a different layout. The complete panels are shown without an enlarged inset, pixel recolouring, invented reference mask or added tissue annotation.

About the Author

Dr. Massoud Pourmandi works in artificial intelligence, machine learning and mathematical engineering. He received his doctorate in Electrical and Electronics Engineering from Bogazigi University in 2023. His doctoral research addressed low-density parity-check code design for distributed storage systems.

His research interests include deep learning, computer vision, multimodal systems, large language models and reasoning. His earlier work includes neural and fuzzy methods for pattern recognition and medical image analysis, alongside research in coding and communication systems. He has also taught and mentored learners in mathematics, engineering, programming and artificial intelligence, emphasizing connections between conceptual understanding, mathematical derivation and implementation.

Index

abrasion, 6

accuracy, 17

activation function, 49

activation memory, 166

acute wound, 6

Adam, 62

AdamW, 373

angular margin, 90

ArcFace, 90

area under the ROC curve, 41

artificial intelligence, 14

atrous spatial pyramid pooling, 265

attention gate, 263

attention rollout, 365

average precision, 15

average symmetric surface distance, 290

avulsion, 6

backpropagation, 61

balanced accuracy, 107

batch normalization, 83

BCE, 248

binary cross-entropy, 244

Brier score, 107

calibrated area, 45

calibration, 13

causal mask, 326

centroid, 145

channel attention, 265

chronic wound, 1

class activation mapping, 354

class imbalance, 38

class token, 330

classification, 2

CLIP, 365

closed injury, 3

contusion, 6

convergence, 61

convolution, 20

cosine similarity, 136

covariance matrix, 142

cross-attention, 271 cross-correlation, 74

cross-entropy, 60

decision tree, 132

deep learning, 14

deep supervision, 249

DeiT, 334

DenseNet, 181

depthwise separable convolution, 178

dermis, 3

development data, 16

diabetic foot ulcer, 19

Dice loss, 246

Dice score, 208

discount factor, 97

domain adaptation, 169

dropout, 82

dynamic routing, 194

embedded selection, 117

embedding space, 85

epidermis, 3

epoch, 61

equivariance, 71

eschar, 7

evaluation unit, 16

evidence lower bound, 286

exponential moving average, 252

external testing, 18

feature extraction, 153

feature map, 70

feature selection, 117

federated averaging, 92

federated learning, 20

fine-tuning, 153

focal loss, 165

forecast horizon, 377

forget gate, 319

full-scale fusion, 261

Gaussian mixture model, 142

generalized Dice, 246

Grad-CAM, 217

gradient descent, 60

granulation tissue, 7

Group Relative Policy Optimization

(GRPO), 465

growth rate, 181

GRPO, 465

GRU, 319-320

Hausdorff distance, 289

hematoma, 4

hidden layer, 50

horizontal federated learning, 95

incision, 4

independently recurrent network, 321

infection, 3

input gate, 319

instance segmentation, 232

interaction budget, 284

intersection over union, 15

invariance, 71

inverted bottleneck, 183

Jaccard similarity, 137

label propagation, 146

laceration, 6

layer normalization, 327

learning rate, 60

localization, 17

log loss, 42

logit, 69

LoRA, 458

low-rank adaptation (LoRA), 458

LSTM, 318

machine learning, 14

macro averaging, 39

Mahalanobis distance, 86

Mamba, 275

Markov decision process, 97

max pooling, 71

maximal marginal relevance (MMR), 449

metric learning, 20

micro averaging, 39

minibatch, 61

Minkowski distance, 135

MobileNet, 183

model-written caption, 387

momentum, 61

multi-head attention, 347

multilabel classification, 119

multilayer perceptron, 419

multimodal classification, 396

naive Bayes, 125

necrotic tissue, 18

negative example, 88

negative predictive value, 37

neural network, 48

neuropathy, 7

nnU-Net, 269

open wound, 4

oracle crop, 546

output stride, 236

overfitting, 81

oversampling, 122

padding, 72

parameter sharing, 78

patch merging, 273

patient-cluster bootstrap, 46

patient-level bootstrap, 214

patient-level split, 118

perfusion, 1

policy gradient, 99

pooling, 70

precision / positive predictive value,

prediction ledger, 527

preprocessing, 126

pressure injury, 11

privacy, 20

projection shortcut, 179

promptable segmentation, 279

pyoderma gangrenosum, 354

random forest, 132

rationale grounding, 465

reasoning distillation, 465

receiver operating characteristic, 40

receptive field, 77

reference label, 22

reference mask, 22

reference standard, 18

regularization, 60

reinforcement learning, 33

reset gate, 320

ResNet, 178

responsibility, 143

ROC, 40

SAM 2, 282

satisfiability modulo theories (SMT),

SCARWID, 365

segmentation, 17

selective prediction, 47

self-attention, 268

self-supervised learning, 20

semantic segmentation, 232

semi-supervised learning, 32

sensitivity / recall, 22

separable self-attention, 347

seroma, 6

signed distance map, 247

slough, 7

SMOTE, 122

soft clustering, 135

spatial attention, 187

spatial reduction, 343

specificity, 37

spectral clustering, 145

split learning, 104

stride, 72

subcutaneous tissue, 3

supervised learning, 30

support vector, 14

Swin Transformer, 273

temperature scaling, 216

tokenization, 345

transfer learning, 95

transposed convolution, 241

TransUNet, 271

triplet loss, 506

tuning set, 16

Tversky index, 247

U-Net, 14

ulcus cruris, 354

unannotated pixel, 233

undersampling, 122

UNet 3+, 249

unsupervised learning, 31

update gate, 320

validation, 20

variance reduction, 99

venous ulcer, 161

vertical federated learning, 95

voxel spacing, 255

weighted cross-entropy, 245

windowed attention, 272

wound, 1

wound-type classification, 72

[...]

Excerpt out of 730 pages  - scroll top

Buy now

Title: Machine Learning for Wound Image Analysis

Textbook , 2026 , 730 Pages

Autor:in: Massoud Pourmandi (Author)

Computer Sciences - Artificial Intelligence
Look inside the ebook

Details

Title
Machine Learning for Wound Image Analysis
Subtitle
From Mathematical Foundations to Research Practice
Author
Massoud Pourmandi (Author)
Publication Year
2026
Pages
730
Catalog Number
V1787813
ISBN (PDF)
9783389211113
Language
English
Tags
Wound image analysis machine learning deep learning medical image analysis computer vision wound classification wound segmentation convolutional neural networks capsule networks U-Net vision transformers multimodal learning
Product Safety
GRIN Publishing GmbH
Quote paper
Massoud Pourmandi (Author), 2026, Machine Learning for Wound Image Analysis, Munich, GRIN Verlag, https://www.grin.com/document/1787813
Look inside the ebook
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
  • Depending on your browser, you might see this message in place of the failed image.
Excerpt from  730  pages
Grin logo
  • Grin.com
  • Shipping
  • Contact
  • Privacy
  • Terms
  • Imprint
  • Withdraw Contract