# gbrlfaria/rune-breaker architecture

> Architecture diagram of the GitHub repository gbrlfaria/rune-breaker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gbrlfaria/rune-breaker
- Repository: https://github.com/gbrlfaria/rune-breaker

## Overview

##### Project Type & Purpose
- Its purpose is to test and demonstrate how modern ML techniques can bypass visual obfuscation in anti-botting mechanisms.
- The pipeline covers multiple phases—from data collection & labeling to preprocessing, dataset generation, CNN model training, and evaluation.

##### Breaking Down the File Structure into Main Components
- Core Files and Utilities:
– “common.py” contains general-purpose functions possibly shared across modules.
– Standard configuration files (e.g. .gitignore, LICENSE, requirements.txt) support development.
- Preprocessing Tools:
– In the “preprocessing” folder, “label.py” is the interactive labeling tool.
- Operations for Dataset Generation:
– “operations/make_dataset.py” creates balanced, augmented training, validation, and testing splits.
– “operations/revert_dataset.py” (likely to reverse/adjust dataset processing if needed).
- Model Implementation:
– “model/train.py” sets up and trains the CNN architecture using Keras.
– “model/classify.py” runs evaluation/classification on the testing set.
- Results:
– “results” folder holds output logs and experiment summaries (e.g. denoising.txt, grayscale.txt, pipeline.txt, thresholding.txt).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input & Labeling Layer
    subgraph "Input & Labeling"
        raw("Raw Game Screenshots"):::input
        labelTool("Labeling Tool (preprocessing/label.py)"):::labeling
    end

    %% Preprocessing & Augmentation Layer
    subgraph "Preprocessing & Augmentation"
        process("Image Preprocessing & Arrow Detection (preprocessing/preprocess.py)"):::preproc
        dataset("Dataset Generation (operations/make_dataset.py)"):::dataset
        datasetRev("Dataset Reversion Utility (operations/revert_dataset.py)"):::dataset
    end

    %% Model Training & Evaluation Layer
    subgraph "Model Training & Evaluation"
        train("CNN Model Training (model/train.py)"):::ml
        evaluate("Model Evaluation & Classification (model/classify.py)"):::ml
        results("Results & Experiment Summaries (results/)"):::results
    end

    %% Support Components
    common("Core Utilities (common.py)"):::support
    docs("Documentation (docs/)"):::support
    opencv("OpenCV Library"):::external
    keras("Keras Library"):::external

    %% Data Flow
    raw -->|"labeled images"| labelTool
    labelTool -->|"labeled data"| process
    process -->|"preprocessed images"| dataset
    dataset -->|"augmented dataset"| train
    train -->|"trained model"| evaluate
    evaluate -->|"performance metrics"| results

    %% Support Relationships
    common --- labelTool
    common --- process
    docs --- process
    process --- opencv
    train --- keras

    %% Optional link: dataset reversion used as a fallback
    dataset ---|"fallback"| datasetRev

    %% Click Events
    click common "https://github.com/gbrlfaria/rune-breaker/blob/revamp/common.py"
    click docs "https://github.com/gbrlfaria/rune-breaker/tree/revamp/docs/"
    click labelTool "https://github.com/gbrlfaria/rune-breaker/blob/revamp/preprocessing/label.py"
    click process "https://github.com/gbrlfaria/rune-breaker/blob/revamp/preprocessing/preprocess.py"
    click dataset "https://github.com/gbrlfaria/rune-breaker/blob/revamp/operations/make_dataset.py"
    click datasetRev "https://github.com/gbrlfaria/rune-breaker/blob/revamp/operations/revert_dataset.py"
    click train "https://github.com/gbrlfaria/rune-breaker/blob/revamp/model/train.py"
    click evaluate "https://github.com/gbrlfaria/rune-breaker/blob/revamp/model/classify.py"
    click results "https://github.com/gbrlfaria/rune-breaker/tree/revamp/results/"

    %% Styles
    classDef input fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef labeling fill:#D5F5E3,stroke:#196F3D,stroke-width:2px;
    classDef preproc fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef dataset fill:#FCF3CF,stroke:#B9770E,stroke-width:2px;
    classDef ml fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef results fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef support fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef external fill:#E8DAEF,stroke:#512E5F,stroke-width:2px;
```
