13. Evaluation, Experimentation, and Vision AnalyticsIntroduction and ContextA computer-vision system is not established by a high score on a single test set. It is established when its performance is measured against an appropriate objective, compared with credible alternatives, tested under realistic variation, and integrated safely into a human or organizational decision process. Evaluation therefore extends beyond metric calculation. It includes experimental design, data governance, uncertainty, explainability, robustness, statistical reasoning, and the economics of deployment. This perspective is especially important in advanced vision applications. A classifier used to sort products, a segmentation model used to estimate crop disease, and a diagnostic-support system used by radiologists do not have the same error costs. Accuracy may be useful in one setting and dangerously misleading in another. Similarly, a model that performs well on images collected from one camera may fail after a change in illumination, sensor, population, or acquisition protocol. Vision analytics refers to the systematic use of measurements, experiments, model outputs, uncertainty estimates, and operational information to understand and improve visual decision systems. The purpose is not merely to rank models, but to determine whether a model is valid for a particular use, under stated assumptions and constraints. Learning ObjectivesAfter studying this chapter, the learner should be able to: 1. Select task-specific metrics for classification, detection, segmentation, retrieval, and generation. 2. Design valid train–validation–test experiments and establish meaningful baselines. 3. Use ablation studies, statistical comparison, confidence intervals, and significance tests appropriately. 4. Analyse uncertainty, calibration, explainability, robustness, and distribution shift. 5. Incorporate cost-sensitive analysis and human-in-the-loop decision support. 6. Evaluate vision systems using technical, operational, ethical, and economic criteria. 7. Communicate experimental evidence in a reproducible and professionally defensible manner. From Model Scores to EvidenceEvaluation begins by defining the decision problem. The question is not simply “How accurate is the model?” but “What decision will the model support, for whom, under what conditions, and with what consequences?” This framing determines the unit of analysis, the target label, the acceptable error rate, and the relevant metric. A sound evaluation protocol specifies the population of interest, sampling procedure, data partitions, preprocessing operations, model version, hardware, random seeds, and evaluation code. Without these details, reported performance may be irreproducible or may reflect accidental properties of the dataset rather than genuine generalization. Data partitioning and leakageTraining data are used to estimate model parameters; validation data support model selection and hyperparameter tuning; the test set is reserved for final estimation of generalization. Repeatedly inspecting the test set converts it into a validation set and produces optimistic results. In postgraduate research, an external test set or a second institution is often valuable because it tests transportability. The split must reflect the deployment setting. Randomly splitting frames from the same video can place near-duplicate images in both training and test sets. In medical imaging, images from one patient must not be distributed across partitions. In industrial inspection, products from the same production batch may share correlated defects. Grouped, temporal, geographic, or domain-based splits are therefore often more defensible than an indiscriminate random split. Data leakage also occurs through preprocessing. Computing normalization statistics, feature-selection rules, or synthetic augmentation parameters using the complete dataset allows information from the test set to influence training. Leakage can be subtle, but its effect is a falsely confident estimate of performance. Baselines and experimental controlsA baseline is a reference system against which a proposed method is interpreted. Useful baselines include a majority-class predictor, a simple linear or nearest-neighbour model, a classical image-processing pipeline, a previously published method, and a strong contemporary model. The baseline should use comparable data, preprocessing, and evaluation conditions. A comparison is meaningful only when relevant factors are controlled. If one method receives higher-resolution images, stronger augmentation, or additional annotations, an observed improvement cannot be attributed solely to its architecture. Experimental claims should identify the changed factor and hold other factors constant where possible. Metrics That Reflect the TaskClassificationFor binary classification, the confusion matrix contains true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN). Accuracy is Accuracy = (TP + TN) / (TP + TN + FP + FN). It is informative when class proportions and error costs are reasonably balanced. Precision, also called positive predictive value, is TP/(TP+FP), while recall or sensitivity is TP/(TP+FN). Specificity is TN/(TN+FP). The F1 score is the harmonic mean of precision and recall: F1 = 2PR/(P+R). F1 is useful when both false positives and false negatives matter, but it does not represent true negatives and should not be interpreted as a universal measure of utility. The F-beta score weights recall more heavily when missing a positive case is particularly costly. Receiver operating characteristic (ROC) curves display true-positive rate against false-positive rate over thresholds. The area under the ROC curve (AUROC) measures ranking ability across thresholds. Precision–recall curves are generally more revealing when the positive class is rare because they focus on positive predictive performance. Threshold-specific measures should accompany threshold-free summaries whenever a real operating threshold exists. Multiclass evaluation may use macro averaging, which gives each class equal weight, or micro averaging, which weights instances equally. Per-class precision, recall, and confusion matrices are essential because a single aggregate score can conceal systematic failure on a minority class. Detection and segmentationObject detection commonly uses intersection over union (IoU), defined as the area of overlap divided by the area of union between predicted and reference boxes or masks. A prediction is considered a match when its IoU exceeds a specified threshold and its class is correct. Average precision (AP) summarizes the precision–recall relationship for one class at a selected IoU criterion; mean average precision (mAP) averages AP across classes and, in some protocols, across multiple IoU thresholds. For semantic or binary segmentation, the Dice coefficient is Dice = 2|A ∩ B|/(|A|+|B|), where A and B are predicted and reference regions. The Jaccard index is equivalent to IoU. Pixel accuracy can be misleading when background pixels dominate. Boundary metrics, lesion-level sensitivity, instance counts, and connected-component errors may be more relevant in applications where object boundaries or missed instances affect decisions. Retrieval, reconstruction, and generationImage retrieval systems may be evaluated using precision at k, recall at k, mean average precision, or normalized discounted cumulative gain. These metrics account for the ordering of returned images, not merely whether a relevant image appears somewhere in the result set. For reconstruction and enhancement, mean squared error and peak signal-to-noise ratio measure numerical fidelity, whereas structural similarity attempts to reflect perceptual structure. Neither guarantees that an image is clinically or operationally useful. Generative systems require evaluation of fidelity, diversity, conditioning accuracy, memorization, and human preference; a visually plausible image may still contain fabricated structures. Experimental Design for Vision ResearchA rigorous experiment is a chain of decisions rather than a single training run. The researcher should formulate a hypothesis, define the estimand, select data and partitions, specify the intervention, determine metrics, estimate variability, and record deviations from the plan. A useful experimental record includes dataset version, label policy, inclusion and exclusion criteria, model configuration, optimizer, training schedule, augmentation policy, stopping rule, hardware, software versions, and failed runs. Reporting only the best seed is a form of selective reporting. Multiple seeds or repeated folds provide evidence about training variability, although they do not substitute for an independent test set. Ablation studiesAn ablation study removes or changes one component of a system to estimate its contribution. For example, a study may compare a complete detector with versions lacking multiscale features, a loss term, a data-augmentation strategy, or a pretraining source. A proper ablation keeps the evaluation set and major training budget consistent. Ablation results must be interpreted cautiously. Components can interact: removing two modules together may produce a different effect from the sum of their individual effects. Factorial designs are useful when interactions are scientifically important. Ablations should also measure computational cost, memory, latency, and annotation requirements, not only accuracy. Statistical comparisonA reported difference is not automatically a meaningful difference. Performance estimates have sampling variability. Confidence intervals can be obtained through analytic methods or resampling, such as bootstrap procedures. For paired predictions on the same examples, paired tests are usually more appropriate than treating model outputs as independent. McNemar’s test can compare two classifiers on paired binary outcomes; bootstrap comparisons can be applied to metrics such as F1, IoU, or average precision. Statistical significance depends on sample size and does not establish practical importance. A small improvement may be statistically reliable but operationally irrelevant, while a clinically important difference may be uncertain because the test set is small. Multiple comparisons also increase the chance of false discoveries. Predefined hypotheses, correction procedures, effect sizes, and uncertainty intervals improve credibility. Uncertainty, Calibration, and Selective PredictionA model’s confidence score is not necessarily a probability that its prediction is correct. Calibration measures the agreement between predicted probabilities and observed frequencies. A well-calibrated model assigning probability 0.8 to many cases should be correct on approximately 80 percent of them, subject to sampling variation. Reliability diagrams, expected calibration error, and class-specific calibration analyses are common tools. Temperature scaling and related post-training methods can improve calibration on a validation set, but calibration may deteriorate under distribution shift. Calibration must therefore be assessed in the population and operating conditions where predictions will be used. Uncertainty has several sources. Aleatoric uncertainty arises from noise or inherent ambiguity in the observation; epistemic uncertainty reflects limited knowledge about the model or data distribution. Ensembles, stochastic inference, Bayesian approximations, and conformal prediction provide different approaches to uncertainty or prediction sets. No method removes uncertainty; each relies on assumptions that must be examined. Selective prediction allows a system to abstain when confidence is low. Coverage is the proportion of cases on which the model predicts, while selective risk is the error rate on those cases. In safety-critical settings, abstention can route difficult cases to a human reviewer. The system must nevertheless be evaluated for whether its abstentions are concentrated in particular demographic groups or operational conditions. Explainability and Error AnalysisExplainability methods attempt to show why a model produced an output. Saliency maps, occlusion tests, class-activation methods, counterfactual images, concept-based explanations, and example-based retrieval offer different forms of evidence. An attractive heat map is not proof of causal reasoning. Explanations should be tested for faithfulness, stability, sensitivity to relevant changes, and usefulness to the intended user. Error analysis is often more valuable than a single aggregate score. Errors should be stratified by class, object size, illumination, viewpoint, image quality, demographic or geographic group where appropriate, and acquisition device. Reviewing false positives and false negatives can reveal ambiguous labels, annotation defects, shortcut learning, domain gaps, or a mismatch between the model objective and the operational need. A practical error taxonomy distinguishes data errors, label errors, model errors, threshold errors, and workflow errors. This classification helps determine whether the remedy is better annotation, additional data, model redesign, threshold adjustment, user training, or process redesign. Robustness, Shift, and Stress TestingRobustness is the ability to maintain acceptable performance under relevant variation. Stress tests may alter brightness, contrast, blur, compression, noise, scale, occlusion, viewpoint, weather, or sensor characteristics. These transformations should represent plausible deployment conditions rather than arbitrary distortions selected to produce a desired result. Distribution shift occurs when the deployment distribution differs from the training distribution. Covariate shift changes the input distribution; label shift changes class proportions; concept shift changes the relationship between inputs and labels. Domain generalization, adaptation, monitoring, and periodic revalidation can address these problems, but each introduces assumptions and possible failure modes. Robustness should be reported as a performance profile, not a single robustness score. The report should state the perturbation, severity, affected subgroup, confidence interval, and operational consequence. Out-of-distribution detection may identify unfamiliar inputs, but it can fail when novel examples resemble known data or when the detector itself is poorly calibrated. Cost-Sensitive Vision Analytics and Human Decision SupportTechnical metrics become decisions through thresholds and workflows. Suppose a false negative costs substantially more than a false positive. The optimal threshold may then favour sensitivity, even if precision declines. A simplified expected cost can be written as Expected cost = C_FN × FN + C_FP × FP + C_review × N_review, where the costs reflect the application and N_review is the number of cases sent to a human. In practice, costs may include financial loss, delay, safety risk, legal exposure, and reputational harm. Human-in-the-loop design should specify when the human sees the model output, what evidence is presented, how disagreement is handled, and whether the human can override the system. Automation bias may cause users to accept an incorrect prediction merely because it is machine-generated. Conversely, alert fatigue may cause users to ignore frequent warnings. The combined human–machine system must therefore be evaluated, not just the model in isolation. Useful measures include human accuracy with and without assistance, time per case, override rate, calibration of human confidence, workload, and error severity. A model that lowers average accuracy but substantially improves detection of rare, high-cost events may still be valuable; such a claim requires explicit cost and workflow analysis. Illustrative Case Study: Visual Inspection of Pharmaceutical VialsBackgroundA manufacturer develops a computer-vision system to detect particles, cracks, and fill-level defects in transparent pharmaceutical vials. Images are collected from multiple cameras on a production line. Defects are rare, and the system is intended to flag suspect vials for human inspection rather than make an irreversible release decision. Situation and problemAn initial prototype reports 99.4 percent accuracy. However, only 0.3 percent of vials in the test sample are defective. The quality team is concerned that the model may be exploiting camera-specific backgrounds and may miss rare but serious defects. AnalysisThe team replaces the random image split with a batch-based split so that vials from the same production run do not appear in both training and testing. It creates an external test set from a second camera and a later production month. Precision–recall curves, defect-level recall, false alarms per thousand vials, and inference latency are selected as primary measures. Accuracy is retained only as a descriptive statistic. Error analysis shows that small particles are frequently missed and that reflections are mistaken for cracks. Calibration is poor at the original threshold. The team also estimates the cost of missed defects, manual review, and line stoppage. Because a false negative is substantially more costly than a review, the operational threshold is lowered and uncertain cases are routed to inspectors. Approach and solutionThe revised experiment compares a classical background-subtraction baseline, a standard object detector, and the proposed detector. Ablations evaluate the contribution of polarized lighting, synthetic defect augmentation, and a reflection-suppression preprocessing step. Each model is trained with several random seeds, and bootstrap intervals are reported for defect recall and false-alarm rate. Inspectors receive the image, predicted defect region, confidence, and a short explanation indicating the image evidence used by the model. OutcomeThe original accuracy claim is no longer the principal result. The final report shows performance separately by defect type, camera, production batch, and defect size. The system achieves higher recall for critical defects while keeping review volume within the staffing capacity of the line. The team also establishes drift monitoring for illumination, camera focus, and the rate of abstentions. Deployment approval is conditional on periodic revalidation and a documented override procedure. Learning pointsThe case demonstrates that class imbalance can make accuracy deceptive; that realistic partitioning is essential; that cost-sensitive thresholds may be more important than architecture changes; and that a safe system is a coordinated model, monitoring process, and human workflow. Limitations, Risks, and Professional GovernanceCommon mistakes include tuning on the test set, reporting only the best run, using accuracy for imbalanced data, ignoring confidence intervals, comparing models with different data budgets, and treating explanation visualizations as evidence of causality. Another frequent error is evaluating synthetic or laboratory data while making claims about uncontrolled field conditions. Labels may contain ambiguity or systematic bias. Consensus labels do not necessarily represent objective truth, particularly in medical, social, or low-quality imagery. Dataset documentation should record provenance, consent and licensing, annotation procedures, known gaps, and intended use. Sensitive attributes should be handled lawfully and only when their collection and analysis are justified. Privacy-preserving practices may include de-identification, access controls, retention limits, encryption, and secure logging. Models used in regulated domains require traceability, validation, change control, incident reporting, and human accountability. Fairness analysis should examine performance and error costs across relevant groups, while recognizing that group definitions and sample sizes affect interpretation. A system should not be deployed merely because it exceeds a benchmark if its failure modes are unacceptable in context. Emerging DirectionsCurrent evaluation practice is moving toward foundation-model assessment, multimodal systems, continual monitoring, and evaluation under open-world conditions. Vision-language models require tests of grounding, hallucination, compositional reasoning, and resistance to misleading prompts. Synthetic data can expand rare cases, but its realism, diversity, and label validity must be verified. Operational analytics increasingly combines model metrics with data-drift indicators, annotation queues, user overrides, latency, energy consumption, and financial outcomes. Reproducible experiment tracking, model cards, dataset documentation, and machine-readable evaluation reports support auditability. Conformal and distribution-free methods are attracting interest because they can provide prediction sets or risk guarantees under stated assumptions, although guarantees may weaken after distribution shift. Best Practices for Rigorous Vision EvaluationA defensible evaluation programme should: - define the use case, population, failure costs, and decision threshold before final testing;
- use partitions that reflect patients, products, locations, time, or other dependence structures;
- report task-appropriate metrics, subgroup results, uncertainty intervals, and computational cost;
- compare against simple and strong baselines under matched conditions;
- perform ablations, sensitivity analyses, robustness tests, and structured error review;
- assess calibration and abstention when predictions guide consequential decisions;
- evaluate the human–machine workflow rather than the model alone;
- preserve experiment metadata, code, data versions, and model artifacts;
- monitor deployed performance and define triggers for revalidation or withdrawal.
Chapter SummaryEvaluation of computer-vision systems is an evidence-building activity that connects model behaviour with real decisions. Valid evaluation requires appropriate data partitions, leakage prevention, credible baselines, task-specific metrics, repeated experiments, ablations, and statistical uncertainty. Classification, detection, segmentation, retrieval, and generative tasks require different measures, and aggregate scores must be supplemented by subgroup and error analyses. Calibration and uncertainty indicate when a model should be trusted or should abstain. Explainability is useful only when its faithfulness and practical value are examined. Robustness testing must represent plausible shifts in sensors, environments, populations, and workflows. Cost-sensitive analysis converts errors into operational choices, while human-in-the-loop design evaluates the combined performance of people and algorithms. Governance, privacy, fairness, documentation, monitoring, and reproducibility are essential parts of professional vision analytics. Key TermsEvaluation: Systematic measurement of a model or decision system against defined objectives. Baseline: A reference method used to interpret the performance of a proposed approach. Data leakage: Unintended use of information from evaluation data during model development. Calibration: Agreement between predicted probabilities and observed frequencies. Precision: Proportion of predicted positive cases that are truly positive. Recall: Proportion of actual positive cases detected by the model. Specificity: Proportion of actual negative cases correctly rejected. F1 score: Harmonic mean of precision and recall. Intersection over union: Overlap area divided by union area for predicted and reference regions. Average precision: Summary of a precision–recall curve for a detection or retrieval task. Ablation study: Experiment that removes or changes components to estimate their contribution. Confidence interval: Range expressing uncertainty around an estimated quantity. Calibration error: Quantitative discrepancy between predicted confidence and empirical correctness. Epistemic uncertainty: Uncertainty associated with limited model or data knowledge. Aleatoric uncertainty: Uncertainty arising from noise or intrinsic ambiguity in observations. Selective prediction: Prediction strategy that permits abstention on uncertain cases. Distribution shift: Change between training and deployment data distributions. Robustness: Ability to maintain acceptable performance under relevant variation. Cost-sensitive analysis: Evaluation that assigns different consequences or costs to errors. Human-in-the-loop: Workflow in which human judgment and automated prediction jointly support decisions. Review QuestionsShort Answer Questions1. Why can accuracy be misleading in a highly imbalanced vision dataset? 2. Distinguish calibration from classification accuracy. 3. What is the purpose of an ablation study? 4. Define distribution shift and give one example in computer vision. 5. Why should grouped or temporal splits sometimes replace random image splits? Long Answer Questions1. Explain how metrics should be selected for classification, object detection, and segmentation tasks. 2. Discuss the design of a statistically credible computer-vision experiment, including baselines, repeated runs, confidence intervals, and test-set protection. 3. Explain uncertainty estimation, calibration, and selective prediction in a safety-sensitive application. 4. Analyse the role of robustness testing and error taxonomies in diagnosing deployment failure. 5. Discuss how cost-sensitive analysis and human-in-the-loop design change the evaluation of a vision system. Analytical / Application Questions1. A defect detector has 98 percent accuracy but detects only 60 percent of critical defects. Propose a revised evaluation protocol and justify the metrics you would use. 2. Two segmentation models differ by 1.2 Dice points on the same test images. Design an analysis to determine whether the difference is statistically and operationally meaningful. 3. A deployed camera system performs well during daytime but poorly at night. Diagnose possible causes and propose experiments, monitoring signals, and mitigation strategies. 22. Multiple Choice Questions with AnswersQuestion 1A vision dataset contains 0.5% positive cases. Which evaluation choice is most informative for the positive class? A. Accuracy alone B. Precision–recall analysis with threshold-specific recall C. Number of training epochs D. Image storage size Correct Answer: B. Precision–recall analysis with threshold-specific recall Question 2Which partitioning strategy best prevents leakage when multiple images come from the same patient? A. Randomly split all images B. Place the highest-quality images in the test set C. Assign all images from a patient to one partition D. Use only augmented images in testing Correct Answer: C. Assign all images from a patient to one partition Question 3What does an ablation study primarily investigate? A. The legal ownership of a dataset B. The contribution of individual system components C. The number of classes in a label set D. The physical size of image files Correct Answer: B. The contribution of individual system components Question 4A calibrated model assigns probability 0.8 to a large group of cases. Approximately what should occur if calibration is good? A. The model should be correct on about 20% of those cases B. The model should be correct on about 50% of those cases C. The model should be correct on about 80% of those cases D. Every case should be classified correctly Correct Answer: C. The model should be correct on about 80% of those cases Question 5Which measure is especially useful for evaluating overlap between a predicted segmentation and its reference mask? A. Dice coefficient B. Inference clock speed only C. Number of model parameters only D. Training batch size Correct Answer: A. Dice coefficient Question 6A model has high overall performance but fails on images from a new camera. This is most directly evidence of: A. Perfect calibration B. Distribution shift or limited domain generalization C. Successful data leakage prevention D. Lower annotation cost Correct Answer: B. Distribution shift or limited domain generalization Question 7If false negatives are much more costly than false positives, which action may be justified? A. Choose a threshold that increases sensitivity B. Ignore the confusion matrix C. Evaluate only true negatives D. Remove all human review Correct Answer: A. Choose a threshold that increases sensitivity Question 8Why are paired comparisons useful when two models are tested on the same examples? A. They account for the dependence created by shared examples B. They guarantee that the better model is causal C. They eliminate all sampling uncertainty D. They make class imbalance irrelevant Correct Answer: A. They account for the dependence created by shared examples Question 9Which statement about saliency maps is most defensible? A. A visually attractive map proves causal reasoning B. Saliency maps require tests of faithfulness and stability C. Saliency maps replace performance evaluation D. They are independent of the model and input Correct Answer: B. Saliency maps require tests of faithfulness and stability Question 10In a human-in-the-loop inspection system, which evaluation is most appropriate? A. Measure only model accuracy in isolation B. Measure only GPU memory C. Measure combined human–machine accuracy, workload, time, and overrides D. Measure only the number of model layers Correct Answer: C. Measure combined human–machine accuracy, workload, time, and overrides
|