# karthik6-cpu/cartoonization-robustness-study architecture

> Architecture diagram of the GitHub repository karthik6-cpu/cartoonization-robustness-study, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karthik6-cpu/cartoonization-robustness-study
- Repository: https://github.com/karthik6-cpu/cartoonization-robustness-study

## Overview

This repository is a research record for two distinct image-robustness studies plus a small matched-corruption pilot. The main workflow compares cartoonized and JPEG-compressed versions of matched images using saved ResNet-18 checkpoints, then reports recognition and image-quality analyses. A separate BICR-Net prototype studies synthetic corruption factors and their interactions. The source index exposes only the pilot generator, so links for the broader experimental tracks rely on the README’s descriptions; implementation-level wiring cannot be verified from the sampled source.

Main entry points: [`research_extension/compound_corruptions.py`](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/compound_corruptions.py) (Corruption generator), [`01_opencv_cartoonization_pilot.ipynb`](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/01_opencv_cartoonization_pilot.ipynb) (Appearance domains), [`Cartoonization_JPEG_Robustness_Research.ipynb`](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/Cartoonization_JPEG_Robustness_Research.ipynb) (JPEG recompression), [`CAFRNet_v2_Final_Research_Experiments.ipynb`](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/CAFRNet_v2_Final_Research_Experiments.ipynb) (ResNet evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_phase1["Cartoonization study"]
  node_appearance_transforms["Appearance domains"]
  node_jpeg_states["JPEG recompression"]
  node_resnet_eval["ResNet evaluation"]
  node_predictions[("Prediction records")]
end

subgraph group_bicr["BICR-Net prototype"]
  node_encoder["ResNet-18 encoder"]
  node_factorizer["Degradation factorizer"]
  node_interaction["Latent interactions"]
  node_correction_head["Correction and head"]
  node_bicr_eval[("Saved evaluations")]
end

subgraph group_pilot["Compound pilot"]
  node_pilot_generator["Corruption generator"]
  node_pilot_manifest["Matched manifest"]
  node_pilot_predictions[("Pilot predictions<br/>[README.md]")]
end

subgraph group_research_outputs["Research outputs"]
  node_phase1_analysis["Matched analysis"]
  node_phase1_summary["Study summary"]
  node_bicr_limits["Limitations record"]
end

node_researcher(("Researcher"))
node_matched_images[("Matched images")]
node_inference_user(("Inference user"))

node_researcher -->|"selects sources"| node_matched_images
node_matched_images -->|"transforms into"| node_appearance_transforms
node_appearance_transforms -->|"recompresses"| node_jpeg_states
node_jpeg_states -->|"evaluates with"| node_resnet_eval
node_resnet_eval -->|"records predictions"| node_predictions
node_predictions -->|"analyzes"| node_phase1_analysis
node_phase1_analysis -->|"summarizes"| node_phase1_summary
node_matched_images -.->|"inputs"| node_encoder
node_encoder -->|"extracts factors"| node_factorizer
node_factorizer -->|"forms interactions"| node_interaction
node_interaction -->|"corrects and classifies"| node_correction_head
node_correction_head -->|"evaluated in"| node_bicr_eval
node_bicr_eval -->|"qualified by"| node_bicr_limits
node_inference_user -->|"runs on test split"| node_pilot_generator
node_matched_images -->|"generates variants"| node_pilot_generator
node_pilot_generator -->|"writes manifest"| node_pilot_manifest
node_inference_user -->|"runs inference"| node_pilot_predictions

click node_appearance_transforms "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/01_opencv_cartoonization_pilot.ipynb"
click node_jpeg_states "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/Cartoonization_JPEG_Robustness_Research.ipynb"
click node_resnet_eval "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/CAFRNet_v2_Final_Research_Experiments.ipynb"
click node_predictions "https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/research/predictions"
click node_phase1_analysis "https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/research/metrics"
click node_phase1_summary "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research/FINAL_RESULTS_SUMMARY.md"
click node_encoder "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md"
click node_factorizer "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md"
click node_interaction "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md"
click node_correction_head "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md"
click node_bicr_eval "https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/BICR_Net_Research/results"
click node_bicr_limits "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/RESULTS_AND_LIMITATIONS.md"
click node_pilot_generator "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/compound_corruptions.py"
click node_pilot_manifest "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/compound_corruptions.py"
click node_pilot_predictions "https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_appearance_transforms,node_jpeg_states,node_resnet_eval,node_predictions,node_inference_user toneBlue
class node_encoder,node_factorizer,node_interaction,node_correction_head,node_bicr_eval,node_matched_images toneAmber
class node_pilot_generator,node_pilot_manifest,node_pilot_predictions toneMint
class node_phase1_analysis,node_phase1_summary,node_bicr_limits toneRose
class node_researcher toneIndigo
```

## Components

### Cartoonization study

- [Appearance domains](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/01_opencv_cartoonization_pilot.ipynb): `01_opencv_cartoonization_pilot.ipynb`
- [JPEG recompression](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/Cartoonization_JPEG_Robustness_Research.ipynb): `Cartoonization_JPEG_Robustness_Research.ipynb`
- [ResNet evaluation](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/CAFRNet_v2_Final_Research_Experiments.ipynb): `CAFRNet_v2_Final_Research_Experiments.ipynb`
- [Prediction records](https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/research/predictions): `research/predictions`

### BICR-Net prototype

- [ResNet-18 encoder](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md): `BICR_Net_Research/ARCHITECTURE_AND_METHOD.md`
- [Degradation factorizer](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md): `BICR_Net_Research/ARCHITECTURE_AND_METHOD.md`
- [Latent interactions](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md): `BICR_Net_Research/ARCHITECTURE_AND_METHOD.md`
- [Correction and head](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/ARCHITECTURE_AND_METHOD.md): `BICR_Net_Research/ARCHITECTURE_AND_METHOD.md`
- [Saved evaluations](https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/BICR_Net_Research/results): `BICR_Net_Research/results`

### Compound pilot

- [Corruption generator](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/compound_corruptions.py): `research_extension/compound_corruptions.py`
- [Matched manifest](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/compound_corruptions.py): `research_extension/compound_corruptions.py`
- [Pilot predictions](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research_extension/README.md): `research_extension/README.md`

### Research outputs

- [Matched analysis](https://github.com/karthik6-cpu/cartoonization-robustness-study/tree/main/research/metrics): `research/metrics`
- [Study summary](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/research/FINAL_RESULTS_SUMMARY.md): `research/FINAL_RESULTS_SUMMARY.md`
- [Limitations record](https://github.com/karthik6-cpu/cartoonization-robustness-study/blob/main/BICR_Net_Research/RESULTS_AND_LIMITATIONS.md): `BICR_Net_Research/RESULTS_AND_LIMITATIONS.md`

### Other components

- **Researcher**
- **Matched images**
- **Inference user**

## Connections

- Researcher → Matched images: selects sources (evidence: `README.md`)
- Matched images → Appearance domains: transforms into (evidence: `README.md`)
- Appearance domains → JPEG recompression: recompresses (evidence: `README.md`)
- JPEG recompression → ResNet evaluation: evaluates with (evidence: `README.md`)
- ResNet evaluation → Prediction records: records predictions (evidence: `README.md`)
- Prediction records → Matched analysis: analyzes (evidence: `README.md`)
- Matched analysis → Study summary: summarizes (evidence: `README.md`)
- Matched images → ResNet-18 encoder: inputs
- ResNet-18 encoder → Degradation factorizer: extracts factors (evidence: `README.md`)
- Degradation factorizer → Latent interactions: forms interactions (evidence: `README.md`)
- Latent interactions → Correction and head: corrects and classifies (evidence: `README.md`)
- Correction and head → Saved evaluations: evaluated in (evidence: `README.md`)
- Saved evaluations → Limitations record: qualified by (evidence: `README.md`)
- Inference user → Corruption generator: runs on test split (evidence: `research_extension/compound_corruptions.py`)
- Matched images → Corruption generator: generates variants (evidence: `research_extension/compound_corruptions.py`)
- Corruption generator → Matched manifest: writes manifest (evidence: `research_extension/compound_corruptions.py`)
- Inference user → Pilot predictions: runs inference (evidence: `README.md`)
