Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| courses:xai:pr_2026 [2026/11/29 12:10] – admin | courses:xai:pr_2026 [2026/11/30 08:20] (current) – [Project description] admin | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Projects marked with {{: | Projects marked with {{: | ||
| + | Select project: [[https:// | ||
| ===== 1. Comparing Human and AI Attention in Visual Anomaly Detection ===== | ===== 1. Comparing Human and AI Attention in Visual Anomaly Detection ===== | ||
| Line 17: | Line 18: | ||
| The goal of this project is to prepare a pilot study comparing the visual attention of human operators with the anomaly regions identified by an artificial intelligence model. | The goal of this project is to prepare a pilot study comparing the visual attention of human operators with the anomaly regions identified by an artificial intelligence model. | ||
| - | The study will use the CoinDefect6K dataset, which contains images of coins acquired in an industrial visual-inspection setting. A selected visual anomaly-detection method, preferably PatchCore from the Anomalib library, should be used to generate pixel-level anomaly maps for selected images. The same images will then be presented to human participants using Tobii-PyTracker, | + | The study will use the [[https:// |
| The project should investigate whether human participants and the anomaly-detection model focus on similar image regions when evaluating whether a coin contains a defect. | The project should investigate whether human participants and the anomaly-detection model focus on similar image regions when evaluating whether a coin contains a defect. | ||
| Line 33: | Line 34: | ||
| * Prepare a basic visual-inspection experiment using Tobii-PyTracker. | * Prepare a basic visual-inspection experiment using Tobii-PyTracker. | ||
| * Present each image to participants and ask them to decide whether it contains a defect. | * Present each image to participants and ask them to decide whether it contains a defect. | ||
| - | * Optionally ask participants to indicate the suspected defect location using the mouse. | + | * Ask participants to indicate the suspected defect location using verbal description (voice is recorded with tobii-pytracker and later is transcibed into description). |
| * Record: | * Record: | ||
| * gaze coordinates, | * gaze coordinates, | ||
| Line 39: | Line 40: | ||
| * inspection time, | * inspection time, | ||
| * participant decision, | * participant decision, | ||
| - | * decision confidence, | + | * voice |
| - | * manually indicated defect location, if collected. | + | * Conduct a pilot experiment. |
| - | * Conduct a pilot experiment | + | |
| * Remove invalid gaze samples and transform the gaze coordinates into the coordinate system of the displayed image. | * Remove invalid gaze samples and transform the gaze coordinates into the coordinate system of the displayed image. | ||
| * Generate individual and aggregated human-attention heatmaps. | * Generate individual and aggregated human-attention heatmaps. | ||
| Line 83: | Line 83: | ||
| * A short technical report describing the experiment, results, limitations, | * A short technical report describing the experiment, results, limitations, | ||
| - | ==== Important considerations ==== | ||
| - | |||
| - | * The displayed image must not be resized differently for AI-map generation and gaze analysis. | ||
| - | * Screen coordinates must be transformed carefully into image coordinates. | ||
| - | * The order of images should be randomized. | ||
| - | * A short calibration and familiarization stage should be included. | ||
| - | * Human participants should not be shown the AI anomaly maps before making their decisions. | ||
| - | * As gaze and participant decisions are collected, the study must follow the applicable institutional requirements for research involving human participants. | ||
| ===== 2. Comparing Human and AI Attention in Image Classification ===== | ===== 2. Comparing Human and AI Attention in Image Classification ===== | ||
| - | **Difficulty: | + | **Difficulty: |
| **Project type:** Human-centered AI, image classification, | **Project type:** Human-centered AI, image classification, | ||
| Line 119: | Line 111: | ||
| * top-5 predictions, | * top-5 predictions, | ||
| * class probabilities. | * class probabilities. | ||
| - | * Generate class-specific model-attention maps using Grad-CAM. | + | * Generate class-specific model-attention maps using Grad-CAM |
| * Optionally compare Grad-CAM with one additional attribution method, such as Integrated Gradients or Occlusion. | * Optionally compare Grad-CAM with one additional attribution method, such as Integrated Gradients or Occlusion. | ||
| * Implement an eye-tracking experiment using Tobii-PyTracker. | * Implement an eye-tracking experiment using Tobii-PyTracker. | ||
| Line 127: | Line 119: | ||
| * participant classification, | * participant classification, | ||
| * response time, | * response time, | ||
| - | * confidence, | + | * participant |
| - | * whether the participant | + | |
| * Generate human-attention heatmaps. | * Generate human-attention heatmaps. | ||
| * Compare human gaze with the attribution map generated for: | * Compare human gaze with the attribution map generated for: | ||
| Line 177: | Line 168: | ||
| * A technical report documenting the experimental procedure and results. | * A technical report documenting the experimental procedure and results. | ||
| - | ==== Important considerations ==== | ||
| - | * Grad-CAM is a post-hoc approximation and should not be described as a direct measurement of where the model “looked.” | ||
| - | * The attribution must be generated for a clearly specified class. | ||
| - | * The displayed image should correspond exactly to the image crop received by the classifier. | ||
| - | * ImageNet labels may be overly specific. A mapping to a smaller set of human-readable categories may be required. | ||
| - | * The selected stimuli should be tested before the final study to ensure that the required classes are understandable to participants. | ||
| ===== 3. Ablation Study of Counterfactuals by Design ===== | ===== 3. Ablation Study of Counterfactuals by Design ===== | ||
| - | **Difficulty: | + | **Difficulty: |
| **Project type:** Time-series counterfactual explanations, | **Project type:** Time-series counterfactual explanations, | ||
| Line 198: | Line 183: | ||
| The goal of this project is to investigate the role of individual components of the objective function used in Counterfactuals by Design. | The goal of this project is to investigate the role of individual components of the objective function used in Counterfactuals by Design. | ||
| - | The student should first reproduce the original version of the method described in the paper “Counterfactuals by Design: Residual Decomposition and Back-to-Normality Editing for Time Series.” | + | The first version of the paper and the available materials can be found at: |
| https:// | https:// | ||
| Line 208: | Line 193: | ||
| ==== Main tasks ==== | ==== Main tasks ==== | ||
| - | * Run the available implementation of the first Counterfactuals by Design method. | ||
| - | * Reproduce at least one experiment reported in the original work. | ||
| * Run the second version of the implementation provided by the supervisor. | * Run the second version of the implementation provided by the supervisor. | ||
| * Identify all independently weighted components of the training and counterfactual-generation objectives. | * Identify all independently weighted components of the training and counterfactual-generation objectives. | ||
| Line 227: | Line 210: | ||
| * the complete objective function, | * the complete objective function, | ||
| - | * removal of each reconstruction-related component, | + | * removal of each term from cost fuciton |
| - | * removal of each classification or validity component, | + | |
| - | * removal of each decomposition or separation component, | + | |
| - | * removal of regularization terms, | + | |
| - | * removal of constraints controlling the counterfactual residual, | + | |
| - | * removal of terms responsible for preserving the normal or morphology component, | + | |
| - | * selected weight sweeps for the most influential components. | + | |
| For each loss component, test at least: | For each loss component, test at least: | ||
| Line 282: | Line 259: | ||
| * A ranked summary of the practical importance of the loss components. | * A ranked summary of the practical importance of the loss components. | ||
| * A report discussing which components are essential, beneficial, redundant, or potentially harmful. | * A report discussing which components are essential, beneficial, redundant, or potentially harmful. | ||
| - | |||
| - | ==== Important considerations ==== | ||
| - | |||
| - | * An ablation must change only the examined component. | ||
| - | * Hyperparameters unrelated to the ablated component must remain fixed. | ||
| - | * Failure to generate a counterfactual is a valid result and must be recorded. | ||
| - | * The analysis should not rely only on validity because removing constraints may improve validity while producing unrealistic counterfactuals. | ||
| - | * Conclusions should be based on repeated experiments rather than individual examples. | ||
| ===== 4. Robustness of DANCE to Errors in the Feature-Relationship Graph ===== | ===== 4. Robustness of DANCE to Errors in the Feature-Relationship Graph ===== | ||
| - | **Difficulty: | + | **Difficulty: |
| **Project type:** Counterfactual explanations, | **Project type:** Counterfactual explanations, | ||
| Line 302: | Line 271: | ||
| ==== Project description ==== | ==== Project description ==== | ||
| - | DANCE uses a feature-relationship graph to guide counterfactual generation. In practice, | + | DANCE uses a feature-relationship graph to guide counterfactual generation. In practice, |
| - | The goal of this project is to evaluate | + | The goal of this project is to evaluate |
| - | The study should | + | A complete reference [[https:// |
| + | |||
| + | * install and configure ACFX, | ||
| + | * prepare a tabular classification dataset, | ||
| + | * train a classifier, | ||
| + | * learn a feature-relationship graph using DirectLiNGAM, | ||
| + | * generate counterfactuals with DANCE, | ||
| + | * calculate the required counterfactual-quality metrics, | ||
| + | * handle unsuccessful generation attempts, | ||
| + | * save the evaluation results. | ||
| + | |||
| + | The reference notebook also contains the implementation of the evaluation metrics. Students | ||
| + | |||
| + | The main contribution of the project should be the systematic corruption of feature-relationship graphs and the experimental analysis of how different | ||
| + | |||
| + | The study should determine whether | ||
| + | |||
| + | ==== Starting materials ==== | ||
| + | |||
| + | The following materials will be provided: | ||
| + | |||
| + | * a Google Colab notebook demonstrating a complete ACFX workflow, | ||
| + | * an example tabular classification dataset, | ||
| + | * code for training a basic classifier, | ||
| + | * code for learning a graph with DirectLiNGAM, | ||
| + | * code for generating counterfactuals using DANCE, | ||
| + | * implementations of the required evaluation metrics, | ||
| + | * an example showing how to store the results in a structured record. | ||
| + | |||
| + | The student is expected to understand, adapt, and extend the provided code. The project is not limited to rerunning the reference notebook. | ||
| ==== Main tasks ==== | ==== Main tasks ==== | ||
| - | * Configure | + | * Run and understand the provided |
| + | * Verify that the reference experiment can be reproduced. | ||
| + | * Refactor the notebook where necessary to support repeated experiments. | ||
| * Select approximately 5–10 tabular classification datasets. | * Select approximately 5–10 tabular classification datasets. | ||
| - | * Use datasets with different: | + | * Include |
| * numbers of features, | * numbers of features, | ||
| * sample sizes, | * sample sizes, | ||
| Line 318: | Line 318: | ||
| * graph densities, | * graph densities, | ||
| * proportions of categorical attributes. | * proportions of categorical attributes. | ||
| - | * Train or load one classifier | + | * Train or load one classifier |
| - | * Learn or define a baseline feature-relationship graph. | + | * Learn or define a baseline feature-relationship graph for each dataset. |
| - | * Generate counterfactuals using the unmodified graph. | + | * Generate counterfactuals using the original, |
| - | * Implement | + | * Implement |
| - | * Run DANCE with the corrupted graphs. | + | * Generate multiple corrupted versions of each baseline graph. |
| - | * Evaluate counterfactual quality using the same factual | + | * Run DANCE using the original and corrupted graphs. |
| - | * Repeat | + | * Evaluate counterfactual quality using the metrics provided in the reference notebook. |
| - | * Save the corrupted adjacency matrices and experimental metadata so that every result | + | * Ensure that the same classifier, |
| + | * Repeat | ||
| + | * Save all corrupted adjacency matrices, random seeds, configuration parameters, | ||
| + | * Analyze which graph errors are most harmful to DANCE. | ||
| + | |||
| + | ==== Dataset selection ==== | ||
| + | |||
| + | The selected datasets should provide a diverse evaluation environment. The collection should preferably contain: | ||
| + | |||
| + | * binary and multiclass classification problems, | ||
| + | * datasets with continuous attributes, | ||
| + | * datasets with categorical attributes, | ||
| + | * datasets with mixed attribute types, | ||
| + | * low-dimensional and higher-dimensional datasets, | ||
| + | * datasets with balanced and imbalanced classes. | ||
| + | |||
| + | Datasets may be obtained from sources such as: | ||
| + | |||
| + | * OpenML, | ||
| + | * the UCI Machine Learning Repository, | ||
| + | * scikit-learn, | ||
| + | * established counterfactual-explanation benchmarks. | ||
| + | |||
| + | The student should document: | ||
| + | |||
| + | * the dataset source, | ||
| + | * the prediction task, | ||
| + | * the number of instances, | ||
| + | * the number and types of features, | ||
| + | * the class distribution, | ||
| + | * preprocessing operations, | ||
| + | * train-test splitting, | ||
| + | * feature scaling, | ||
| + | * the method used to obtain the baseline graph. | ||
| + | |||
| + | The exact selection of datasets should be agreed upon with the supervisor before running the full experiment. | ||
| + | |||
| + | ==== Baseline experiment ==== | ||
| + | |||
| + | For each dataset, the student should first establish a clean-graph baseline. | ||
| + | |||
| + | The baseline should include: | ||
| + | |||
| + | * a fixed train-test split, | ||
| + | * a trained classifier, | ||
| + | * an unmodified feature-relationship graph, | ||
| + | * a fixed collection of factual instances, | ||
| + | * a defined desired class for every factual instance, | ||
| + | * counterfactuals generated with DANCE, | ||
| + | * all required evaluation metrics, | ||
| + | * counterfactual-generation time, | ||
| + | * successful and unsuccessful generation attempts. | ||
| + | |||
| + | The clean-graph baseline must be completed before introducing graph corruption. | ||
| + | |||
| + | Whenever possible, factual instances should initially be classified correctly by the classifier. The same factual instances must subsequently be used in every graph-corruption condition. | ||
| ==== Required graph-corruption operators ==== | ==== Required graph-corruption operators ==== | ||
| + | |||
| + | The graph representation and orientation must remain consistent with the convention used by ACFX and the graph-learning method. For example, when using a DirectLiNGAM adjacency matrix, the student must verify which matrix dimension represents a parent and which represents a child before modifying the graph. | ||
| === Edge removal === | === Edge removal === | ||
| - | Randomly remove a selected | + | Randomly remove a selected |
| - | Suggested levels: | + | Suggested |
| * 0%, | * 0%, | ||
| Line 342: | Line 399: | ||
| * 60%. | * 60%. | ||
| - | Include an additional | + | In addition to random removal, implement at least one targeted variant: |
| + | |||
| + | * remove | ||
| + | * remove edges associated with the most influential features. | ||
| + | |||
| + | The number of removed edges and their original weights must be recorded. | ||
| === Edge addition === | === Edge addition === | ||
| - | Add nonexistent | + | Add edges that do not exist in the baseline graph. Self-loops |
| - | Suggested levels | + | Suggested |
| * 5%, | * 5%, | ||
| Line 356: | Line 418: | ||
| * 60%. | * 60%. | ||
| - | Test at least two variants: | + | Implement |
| * random edge addition, | * random edge addition, | ||
| * addition of edges conflicting with the original causal or topological order. | * addition of edges conflicting with the original causal or topological order. | ||
| + | |||
| + | The weight of a newly added edge should be sampled using a documented strategy. For example, its absolute value may be sampled from the distribution of nonzero weights in the original graph. | ||
| === Edge-weight noise === | === Edge-weight noise === | ||
| - | For every nonzero edge weight, apply additive noise: | + | Add noise to every nonzero edge weight: |
| '' | '' | ||
| Line 371: | Line 435: | ||
| '' | '' | ||
| - | and '' | + | and '' |
| Suggested noise levels: | Suggested noise levels: | ||
| - | * sigma = 0.05, | + | * '' |
| - | * sigma = 0.10, | + | * '' |
| - | * sigma = 0.25, | + | * '' |
| - | * sigma = 0.50, | + | * '' |
| - | * sigma = 1.00. | + | * '' |
| + | |||
| + | The definition of '' | ||
| + | |||
| + | The student should also report how often the added noise changes the sign of an edge. | ||
| === Edge-sign reversal === | === Edge-sign reversal === | ||
| - | Reverse the sign of a selected proportion of edge weights: | + | Reverse the sign of a selected proportion of existing nonzero edges. |
| + | |||
| + | Suggested corruption levels: | ||
| * 5%, | * 5%, | ||
| Line 389: | Line 459: | ||
| * 20%, | * 20%, | ||
| * 40%. | * 40%. | ||
| + | |||
| + | Random and targeted sign reversal may be compared. A targeted strategy could reverse the signs of the strongest edges first. | ||
| === Combined corruption === | === Combined corruption === | ||
| - | Apply edge removal, addition, | + | Apply several corruption types simultaneously, |
| + | |||
| + | * edge removal, | ||
| + | * edge addition, | ||
| + | * edge-weight noise. | ||
| + | |||
| + | The combined condition should represent a realistic estimated graph containing several types of error. | ||
| + | |||
| + | At least three combined corruption levels should be prepared: | ||
| + | |||
| + | * low corruption, | ||
| + | * medium corruption, | ||
| + | * high corruption. | ||
| + | |||
| + | The exact parameters of these levels must be documented and applied consistently across repeated runs. | ||
| + | |||
| + | ==== Graph validity and acyclicity ==== | ||
| + | |||
| + | Some corruption operators may introduce cycles or invalidate the original feature ordering. | ||
| + | |||
| + | The implementation must explicitly check: | ||
| + | |||
| + | * whether the corrupted graph contains self-loops, | ||
| + | * whether the graph remains acyclic, | ||
| + | * whether the original topological order is still valid, | ||
| + | * whether all matrix dimensions remain consistent, | ||
| + | * whether the corrupted graph contains non-finite weights. | ||
| + | |||
| + | If DANCE requires a directed acyclic graph, the student should select and document one of the following strategies: | ||
| + | |||
| + | * reject graph modifications that introduce cycles, | ||
| + | * remove an edge responsible for each introduced cycle, | ||
| + | * restrict edge addition to edges consistent with a topological order, | ||
| + | * run a separate experiment comparing acyclic and cycle-producing corruption. | ||
| + | |||
| + | The chosen strategy must remain consistent within a given experiment. | ||
| ==== Required experiment controls ==== | ==== Required experiment controls ==== | ||
| * The classifier must remain fixed across graph-corruption conditions. | * The classifier must remain fixed across graph-corruption conditions. | ||
| - | * The factual instances | + | |
| - | * The same feature bounds | + | |
| - | * Graph perturbations must not modify the dataset | + | * The desired |
| + | * The same feature bounds | ||
| + | * The same categorical-feature definitions | ||
| + | * The same counterfactual-generation hyperparameters | ||
| + | * Graph perturbations must not modify the dataset | ||
| * Results must include both successful and unsuccessful generation attempts. | * Results must include both successful and unsuccessful generation attempts. | ||
| - | * If DANCE requires an acyclic | + | * Random corruption must be reproducible using stored random seeds. |
| - | * Random | + | * The clean graph must be included as the 0% corruption |
| + | * The same evaluation implementation must be used for all methods and conditions. | ||
| + | |||
| + | If a graph corruption | ||
| ==== Required metrics ==== | ==== Required metrics ==== | ||
| - | The project should | + | The reference notebook contains implementations of the required metrics and demonstrates how to calculate them for counterfactuals generated by ACFX: [[https:// |
| + | |||
| + | The project should report at least: | ||
| * number of generated counterfactuals, | * number of generated counterfactuals, | ||
| * number of valid counterfactuals, | * number of valid counterfactuals, | ||
| * fidelity or validity rate, | * fidelity or validity rate, | ||
| - | * mean target-class probability, | + | * mean desired-class probability, |
| * classification loss, | * classification loss, | ||
| * proximity loss, | * proximity loss, | ||
| * sparsity loss, | * sparsity loss, | ||
| - | * causality or graph-consistency loss, | + | * graph-consistency |
| * diversity, | * diversity, | ||
| * Local Outlier Factor score, | * Local Outlier Factor score, | ||
| - | * counterfactual generation time, | + | * counterfactual-generation time, |
| * generation failure rate. | * generation failure rate. | ||
| - | The accompanying reference notebook already uses classification loss, range-normalized proximity, sparsity, graph-based causal penalty, determinant-based diversity, and novelty-mode Local Outlier Factor. The implementation | + | The provided |
| - | ==== Required Python module ==== | + | * classification loss based on the margin between the strongest alternative class and the desired class, |
| + | * range-normalized proximity for continuous attributes, | ||
| + | * change-based proximity for categorical attributes, | ||
| + | * sparsity measured as the proportion of modified features, | ||
| + | * graph-consistency penalty based on the supplied weighted relationship graph, | ||
| + | * determinant-based diversity, | ||
| + | * novelty-mode Local Outlier Factor. | ||
| - | Prepare | + | Students should preserve the provided metric definitions to ensure that results are comparable across datasets and graph-corruption conditions. |
| + | |||
| + | A metric may be modified or extended only when: | ||
| + | |||
| + | * the change is clearly justified, | ||
| + | * the new definition is documented, | ||
| + | * the original metric is also retained for comparison. | ||
| + | |||
| + | ==== Use of the provided metrics module ==== | ||
| + | |||
| + | The reference notebook creates and imports | ||
| '' | '' | ||
| - | The file should provide reusable implementations of at least: | + | The module provides the following functions: |
| * '' | * '' | ||
| Line 439: | Line 571: | ||
| * '' | * '' | ||
| - | The implementations | + | Students are not required to reimplement these functions from scratch. |
| + | |||
| + | However, they should: | ||
| + | |||
| + | * understand | ||
| + | * verify that the input arrays have the expected shapes, | ||
| + | * correctly define continuous and categorical attributes, | ||
| + | * ensure that the desired-class probability column is selected correctly, | ||
| + | * preserve handling of empty counterfactual sets, | ||
| + | * preserve reporting of unsuccessful generation attempts, | ||
| + | * add tests if the module is extended, | ||
| + | * document every modification to the provided implementation. | ||
| - | The main evaluation function | + | The main evaluation function |
| * '' | * '' | ||
| Line 457: | Line 600: | ||
| * '' | * '' | ||
| - | The module must: | + | This dictionary should be extended with experimental metadata, including: |
| - | * support binary and multiclass classifiers, | + | * dataset name, |
| - | * correctly identify the target-class | + | * factual-instance identifier, |
| - | * support continuous and categorical attributes, | + | * original |
| - | * handle an empty counterfactual set without crashing, | + | * desired class, |
| - | * return '' | + | * corruption operator, |
| - | * validate array dimensions, | + | * corruption intensity, |
| - | * avoid computing means over empty arrays, | + | * graph-corruption seed, |
| - | * include docstrings and type hints, | + | * counterfactual-generation seed, |
| - | * include a small collection | + | * number of original graph edges, |
| + | * number | ||
| + | * graph density, | ||
| + | * acyclicity status, | ||
| + | * counterfactual-generation hyperparameters. | ||
| - | ==== Metrics output example | + | ==== Interpretation of the metrics |
| - | An evaluation record should follow | + | * '' |
| - | + | * '' | |
| - | * '' | + | |
| * '' | * '' | ||
| * '' | * '' | ||
| * '' | * '' | ||
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| * '' | * '' | ||
| * '' | * '' | ||
| * '' | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The term '' | ||
| ==== Research questions ==== | ==== Research questions ==== | ||
| Line 487: | Line 638: | ||
| * How quickly does counterfactual quality deteriorate as graph corruption increases? | * How quickly does counterfactual quality deteriorate as graph corruption increases? | ||
| * Is DANCE more sensitive to missing edges, additional edges, incorrect signs, or inaccurate weights? | * Is DANCE more sensitive to missing edges, additional edges, incorrect signs, or inaccurate weights? | ||
| - | * Does graph corruption affect validity and plausibility differently? | + | * Does graph corruption affect validity, proximity, sparsity, |
| + | * Are strong graph relationships more important than weak relationships? | ||
| * Are dense graphs more vulnerable to corruption than sparse graphs? | * Are dense graphs more vulnerable to corruption than sparse graphs? | ||
| + | * Does sensitivity depend on the number of features? | ||
| + | * Does sensitivity differ between continuous and categorical attributes? | ||
| * Are some datasets more sensitive because their predictions depend on a small number of relationships? | * Are some datasets more sensitive because their predictions depend on a small number of relationships? | ||
| - | * Does DANCE remain | + | * Does DANCE remain |
| + | * Which corruption operators cause counterfactual-generation failures? | ||
| * Can graph uncertainty be estimated from the variability of generated counterfactuals? | * Can graph uncertainty be estimated from the variability of generated counterfactuals? | ||
| + | * Can counterfactual variability indicate that a graph should not be trusted? | ||
| + | |||
| + | ==== Suggested experimental procedure ==== | ||
| + | |||
| + | For each dataset: | ||
| + | |||
| + | - Prepare a fixed train-test split. | ||
| + | - Train the classifier. | ||
| + | - Learn or define the baseline graph. | ||
| + | - Select a fixed collection of factual instances. | ||
| + | - Generate counterfactuals using the baseline graph. | ||
| + | - Calculate and store the baseline metrics. | ||
| + | - Generate corrupted graphs using each required corruption operator. | ||
| + | - Run DANCE using every corrupted graph. | ||
| + | - Repeat stochastic corruption using at least 5 random seeds. | ||
| + | - Calculate all metrics using the provided metrics module. | ||
| + | - Store successful and unsuccessful runs. | ||
| + | - Aggregate results by dataset, corruption operator, and corruption intensity. | ||
| + | - Compare all conditions with the clean-graph baseline. | ||
| + | |||
| + | As a practical minimum, the student should evaluate approximately 50 factual instances per dataset. If runtime permits, 100 or more instances per dataset are recommended. | ||
| ==== Suggested analysis ==== | ==== Suggested analysis ==== | ||
| Line 497: | Line 673: | ||
| For each metric, report: | For each metric, report: | ||
| - | * absolute metric value, | + | * the absolute metric value, |
| - | * difference relative to the clean-graph baseline, | + | * the difference relative to the clean-graph baseline, |
| - | * relative percentage degradation, | + | * the relative percentage degradation, |
| - | * mean and standard deviation across graph-corruption seeds. | + | * the mean across graph-corruption seeds, |
| + | * the standard deviation across graph-corruption seeds, | ||
| + | * confidence intervals where appropriate, | ||
| + | * the number and rate of unsuccessful runs. | ||
| - | Use degradation curves in which the x-axis represents corruption intensity | + | Use degradation curves in which: |
| + | |||
| + | * the x-axis represents | ||
| + | * the y-axis represents counterfactual quality, | ||
| + | * separate lines represent corruption operators, | ||
| + | * uncertainty bands represent variability across seeds or factual instances. | ||
| + | |||
| + | Consider reporting the area under the degradation curve as a summary | ||
| + | |||
| + | * higher fidelity and target-class probability are better, | ||
| + | * lower classification, | ||
| + | * higher LOF scores indicate more typical samples when using '' | ||
| + | * diversity should be interpreted jointly with validity and plausibility. | ||
| + | |||
| + | The analysis should distinguish between: | ||
| + | |||
| + | * gradual quality degradation, | ||
| + | * sudden failure thresholds, | ||
| + | * dataset-specific sensitivity, | ||
| + | * corruption-specific sensitivity, | ||
| + | * variability caused by stochastic counterfactual generation, | ||
| + | * variability caused by graph corruption. | ||
| + | |||
| + | ==== Recommended result visualizations ==== | ||
| + | |||
| + | * Metric degradation curves. | ||
| + | * Counterfactual-generation failure-rate curves. | ||
| + | * Heatmaps comparing datasets and corruption operators. | ||
| + | * Box plots showing variability across corruption seeds. | ||
| + | * Graph visualizations before and after corruption. | ||
| + | * Scatter plots comparing graph distance with counterfactual-quality degradation. | ||
| + | * Pareto plots comparing validity, proximity, sparsity, and graph consistency. | ||
| + | * Representative factual-counterfactual pairs for low, medium, and high graph corruption. | ||
| ==== Expected deliverables ==== | ==== Expected deliverables ==== | ||
| + | * An extended version of the provided Google Colab notebook. | ||
| * A reusable graph-corruption module. | * A reusable graph-corruption module. | ||
| - | * A standalone | + | * Implementations of all required graph-corruption operators. |
| - | * Unit tests for the metric implementations. | + | * Tests for graph-corruption functions. |
| + | * Any documented extensions to '' | ||
| * A reproducible DANCE experiment pipeline. | * A reproducible DANCE experiment pipeline. | ||
| - | * Clean and corrupted graph files. | + | * Configuration files or dictionaries defining all experiments. |
| - | * A CSV file containing per-sample and aggregated results. | + | * Original |
| - | * Robustness curves for every corruption operator. | + | * Stored random seeds and graph-corruption metadata. |
| + | * A CSV or Parquet | ||
| + | * A CSV or Parquet file containing | ||
| + | * Robustness curves for every graph-corruption operator. | ||
| * A comparison of dataset-level sensitivity. | * A comparison of dataset-level sensitivity. | ||
| - | * A report identifying | + | |
| + | | ||
| + | * Instructions for reproducing the experiments in Google Colab or a local Python environment. | ||
| + | |||
| + | ==== Minimum completion criteria ==== | ||
| + | |||
| + | To complete the project successfully, | ||
| + | |||
| + | * reproduce the provided baseline notebook, | ||
| + | * evaluate at least 5 datasets, | ||
| + | * implement edge removal, edge addition, edge-weight noise, and edge-sign reversal, | ||
| + | * include at least one combined corruption condition, | ||
| + | * use at least 5 graph-corruption seeds per stochastic condition, | ||
| + | * include a clean-graph baseline, | ||
| + | * evaluate the same factual instances across graph conditions, | ||
| + | * report all required metrics, | ||
| + | * record unsuccessful generation attempts, | ||
| + | * provide reproducible result files, | ||
| + | * analyze the relationship between corruption intensity and counterfactual quality. | ||
| + | |||
| + | ==== Optional extensions ==== | ||
| + | * Compare DirectLiNGAM and NOTEARS graphs. | ||
| + | * Compare learned graphs with expert-defined graphs. | ||
| + | * Introduce uncertainty estimates for graph edges. | ||
| + | * Weight graph penalties according to edge confidence. | ||
| + | * Develop corruption operators that preserve a selected topological order. | ||
| + | * Compare random and adversarial graph corruption. | ||
| + | * Identify the smallest graph modification that substantially changes a counterfactual. | ||
| + | * Analyze whether ensemble graphs improve DANCE robustness. | ||
| + | * Compare DANCE with a counterfactual method that does not use a feature-relationship graph. | ||
| ===== 5. Comparison of Counterfactual Generators for ECG Classification ===== | ===== 5. Comparison of Counterfactual Generators for ECG Classification ===== | ||
| Line 531: | Line 776: | ||
| A common ECG classifier and the same factual test signals must be used for all methods. The evaluation should determine whether the generated signals are valid counterfactuals, | A common ECG classifier and the same factual test signals must be used for all methods. The evaluation should determine whether the generated signals are valid counterfactuals, | ||
| - | The recommended dataset is PTB-XL. The initial comparison may focus on a binary task, such as normal versus abnormal ECG, or on selected diagnostic superclasses. The exact classification task should be fixed before the counterfactual methods are compared. | + | The recommended dataset is [[https:// |
| ==== Required types of counterfactual generator ==== | ==== Required types of counterfactual generator ==== | ||