# mickramygoseng/cnn-vs-svm-based-baybayin-ocr architecture

> Architecture diagram of the GitHub repository mickramygoseng/cnn-vs-svm-based-baybayin-ocr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr
- Repository: https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr

## Overview

This is a Baybayin OCR research pipeline: image samples are fetched and converted into SVM features and CNN pixels, split into repeated stratified folds, then evaluated by both models with metrics saved for comparison. Dataset sanity and cross-model correspondence checks are a separate supporting workflow. The sampled source confirms these stages and their file-based handoffs; MANOVA is mentioned in the README but has no implementation represented in the supplied tree.

Main entry points: [`modules/evaluation/evaluate.py`](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/evaluate.py) (Evaluation runner), [`modules/pre_processing/preprocess.py`](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/preprocess.py) (Preprocessing runner), [`dataset_validation.py`](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/dataset_validation.py) (Sanity validator), [`modules/sampling/sample.py`](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/sampling/sample.py) (Sampling runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Image preparation"]
  node_raw_images["Raw samples"]
  node_fetch["Image fetcher<br/>[get_image_paths.py]"]
  node_prep_runner["Preprocessing runner<br/>[preprocess.py]"]
  node_image_preprocess["Image conversion"]
  node_processed_data["Processed datasets"]
end

subgraph group_sampling["Fold sampling"]
  node_sample_runner["Sampling runner<br/>[sample.py]"]
  node_fold_splitter["Stratified splitter<br/>[sampling.py]"]
  node_sampled_folds["Sampled folds"]
end

subgraph group_evaluation["Model evaluation"]
  node_evaluate_runner["Evaluation runner<br/>[evaluate.py]"]
  node_svm_model["SVM model<br/>[SVM.py]"]
  node_cnn_model["CNN model<br/>[CNN.py]"]
  node_metrics["Metrics results"]
end

subgraph group_validation["Dataset validation"]
  node_validator["Sanity validator"]
  node_validation_report["Validation checks"]
end

node_researcher(("Researcher"))

node_researcher -->|"provides samples"| node_raw_images
node_researcher -->|"runs preprocessing"| node_prep_runner
node_prep_runner -->|"fetches paths"| node_fetch
node_fetch -->|"reads images"| node_raw_images
node_prep_runner -->|"converts images"| node_image_preprocess
node_prep_runner -->|"writes datasets"| node_processed_data
node_researcher -->|"runs sampling"| node_sample_runner
node_sample_runner -->|"loads datasets"| node_processed_data
node_sample_runner -->|"runs splits"| node_fold_splitter
node_fold_splitter -->|"writes folds"| node_sampled_folds
node_researcher -->|"runs evaluation"| node_evaluate_runner
node_evaluate_runner -->|"loads fold data"| node_sampled_folds
node_evaluate_runner -->|"runs SVM"| node_svm_model
node_evaluate_runner -->|"runs CNN"| node_cnn_model
node_svm_model -->|"returns metrics"| node_evaluate_runner
node_cnn_model -->|"returns metrics"| node_evaluate_runner
node_evaluate_runner -->|"saves metrics"| node_metrics
node_researcher -->|"runs checks"| node_validator
node_validator -->|"checks datasets"| node_processed_data
node_validator -->|"checks fold data"| node_sampled_folds
node_validator -->|"prints findings"| node_validation_report

click node_fetch "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/get_image_paths.py"
click node_prep_runner "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/preprocess.py"
click node_image_preprocess "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/preprocess_images.py"
click node_sample_runner "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/sampling/sample.py"
click node_fold_splitter "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/sampling/sampling.py"
click node_evaluate_runner "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/evaluate.py"
click node_svm_model "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/models/SVM.py"
click node_cnn_model "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/models/CNN.py"
click node_validator "https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/dataset_validation.py"

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_raw_images,node_fetch,node_prep_runner,node_image_preprocess,node_processed_data toneBlue
class node_sample_runner,node_fold_splitter,node_sampled_folds toneAmber
class node_evaluate_runner,node_svm_model,node_cnn_model,node_metrics toneMint
class node_validator,node_validation_report toneRose
class node_researcher toneIndigo
```

## Components

### Image preparation

- **Raw samples**
- [Image fetcher](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/get_image_paths.py): `modules/pre_processing/get_image_paths.py`
- [Preprocessing runner](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/preprocess.py): `modules/pre_processing/preprocess.py`
- [Image conversion](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/pre_processing/preprocess_images.py): `modules/pre_processing/preprocess_images.py`
- **Processed datasets**

### Fold sampling

- [Sampling runner](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/sampling/sample.py): `modules/sampling/sample.py`
- [Stratified splitter](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/sampling/sampling.py): `modules/sampling/sampling.py`
- **Sampled folds**

### Model evaluation

- [Evaluation runner](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/evaluate.py): `modules/evaluation/evaluate.py`
- [SVM model](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/models/SVM.py): `modules/evaluation/models/SVM.py`
- [CNN model](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/modules/evaluation/models/CNN.py): `modules/evaluation/models/CNN.py`
- **Metrics results**

### Dataset validation

- [Sanity validator](https://github.com/mickramygoseng/cnn-vs-svm-based-baybayin-ocr/blob/main/dataset_validation.py): `dataset_validation.py`
- **Validation checks**

### Other components

- **Researcher**

## Connections

- Researcher → Raw samples: provides samples (evidence: `README.md`)
- Researcher → Preprocessing runner: runs preprocessing (evidence: `README.md`)
- Preprocessing runner → Image fetcher: fetches paths (evidence: `modules/pre_processing/preprocess.py`)
- Image fetcher → Raw samples: reads images (evidence: `modules/pre_processing/get_image_paths.py`)
- Preprocessing runner → Image conversion: converts images (evidence: `modules/pre_processing/preprocess.py`)
- Preprocessing runner → Processed datasets: writes datasets (evidence: `modules/pre_processing/preprocess.py`)
- Researcher → Sampling runner: runs sampling (evidence: `README.md`)
- Sampling runner → Processed datasets: loads datasets (evidence: `modules/sampling/sample.py`)
- Sampling runner → Stratified splitter: runs splits (evidence: `modules/sampling/sample.py`)
- Stratified splitter → Sampled folds: writes folds (evidence: `modules/sampling/sampling.py`)
- Researcher → Evaluation runner: runs evaluation (evidence: `README.md`)
- Evaluation runner → Sampled folds: loads fold data (evidence: `modules/evaluation/evaluate.py`)
- Evaluation runner → SVM model: runs SVM (evidence: `modules/evaluation/evaluate.py`)
- Evaluation runner → CNN model: runs CNN (evidence: `modules/evaluation/evaluate.py`)
- SVM model → Evaluation runner: returns metrics (evidence: `modules/evaluation/models/SVM.py`)
- CNN model → Evaluation runner: returns metrics (evidence: `modules/evaluation/models/CNN.py`)
- Evaluation runner → Metrics results: saves metrics (evidence: `modules/evaluation/evaluate.py`)
- Researcher → Sanity validator: runs checks (evidence: `README.md`)
- Sanity validator → Processed datasets: checks datasets (evidence: `dataset_validation.py`)
- Sanity validator → Sampled folds: checks fold data (evidence: `dataset_validation.py`)
- Sanity validator → Validation checks: prints findings (evidence: `dataset_validation.py`)
