# hyukjunlim/cheapnet architecture

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

- Interactive diagram: https://gitdiagram.com/hyukjunlim/cheapnet
- Repository: https://github.com/hyukjunlim/cheapnet

## Overview

##### Project Type and Purpose
- CheapNet is a research-oriented, full-stack machine learning project aimed at protein–ligand binding affinity prediction using a novel cross-attention mechanism on hierarchical representations.
- The README clearly explains the primary goal: integrating atom-level representations with cluster-level interactions to predict binding affinity efficiently. The design also highlights efficiency and high predictive performance.

##### Analyzing the File Structure
- The repository is organized around a core module (atom3d) and several experiment/evaluation directories (cross_dataset, diverse_protein, lep).
- datasets: Code for handling data ingestion, preprocessing, and LMDB-related manipulations.
- filters: Contains scripts for filtering and processing protein structure data (PDB, SCOP, sequence-based filters).
- models: Implements different neural network architectures (CNN, ENN, GNN, MLP) used within the binding affinity prediction model.
- protein: Manages protein-specific functionalities (e.g., SCOP and sequence representations).
- splits: Likely used to manage data splits based on sequence or other criteria.
- util: Offers helper functions for logging, file operations, ensemble methods, graph-related operations, transforms, voxelization, and more.
- The additional top-level subdirectories (cross_dataset, diverse_protein, lep) represent different evaluation scenarios or adaptations of the core model into varying datasets. They include training, prediction, evaluation scripts, logging, model weights, and configuration files.
- Other important files (e.g., environment YAML files, Makefile, README, configuration files) indicate how to deploy and run the experiments.

##### Instructing the Principal Software Engineer
- Input Data flows to Data Preprocessing.
- Preprocessed Data feeds into the Model Architecture.
- With brief notes:
- That the “cross-attention” mechanism is central to the Model Architecture module.
- Legends for abbreviations like CNN, GNN, ENN, etc.

- The core processing modules in the atom3d package, detailing data handling (datasets, filters, splits), modeling (models, protein representations), and supporting utilities.
- The separate evaluation/training modules (cross_dataset, diverse_protein, lep) as distinct clients interacting with the core engine.
- The overall data pipeline from preprocessing through to prediction and evaluation, including key mechanisms (hierarchical aggregation and cross-attention).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    Raw["Raw Data"]:::data

    subgraph "Atom3d Core Engine"
        subgraph "Data Preprocessing Module"
            Data1["Datasets"]:::coreClick
            Data2["Filters"]:::coreClick
            Data3["Splits"]:::coreClick
        end
        Preproc["Preprocessed Data"]:::core
        Model["Model Architecture Module (cross-attention)"]:::coreClick
        Protein["Protein Representation Module"]:::coreClick
        Util["Utility Module"]:::coreClick
    end

    subgraph "Evaluation Modules"
        Eval1["Cross-dataset Module"]:::evalClick
        Eval2["Diverse Protein Module"]:::evalClick
        Eval3["LEP Module"]:::evalClick
    end

    Assets["External Assets & Configurations"]:::extClick

    %% Data Flow Connections
    Raw -->|"ingests"| Data1
    Raw -->|"ingests"| Data2
    Raw -->|"ingests"| Data3
    Data1 -->|"aggregates"| Preproc
    Data2 -->|"aggregates"| Preproc
    Data3 -->|"aggregates"| Preproc
    Preproc -->|"supplies_data"| Model
    Protein -->|"processes_protein"| Model
    Model -->|"triggers_training"| Eval1
    Model -->|"triggers_training"| Eval2
    Model -->|"triggers_training"| Eval3

    %% Utility Support Connections (dotted lines)
    Util -.->|"supports"| Data1
    Util -.->|"supports"| Model
    Util -.->|"supports"| Eval1
    Util -.->|"supports"| Assets

    %% Click Events
    click Data1 "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/datasets"
    click Data2 "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/filters"
    click Data3 "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/splits"
    click Model "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/models"
    click Protein "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/protein"
    click Util "https://github.com/hyukjunlim/cheapnet/tree/main/atom3d/atom3d/util"
    click Eval1 "https://github.com/hyukjunlim/cheapnet/tree/main/cross_dataset"
    click Eval2 "https://github.com/hyukjunlim/cheapnet/tree/main/diverse_protein"
    click Eval3 "https://github.com/hyukjunlim/cheapnet/tree/main/lep"
    click Assets "https://github.com/hyukjunlim/cheapnet/tree/main/assets"

    %% Styles
    classDef core fill:#A6CEE3,stroke:#1F78B4,stroke-width:2px;
    classDef eval fill:#B2DF8A,stroke:#33A02C,stroke-width:2px;
    classDef data fill:#FDBF6F,stroke:#FF7F00,stroke-width:2px;
    classDef ext fill:#CAB2D6,stroke:#6A3D9A,stroke-width:2px;
    classDef coreClick fill:#A6CEE3,stroke:#1F78B4,stroke-width:2px;
    classDef evalClick fill:#B2DF8A,stroke:#33A02C,stroke-width:2px;
    classDef extClick fill:#CAB2D6,stroke:#6A3D9A,stroke-width:2px;

    class Raw data;
    class Preproc,Model,Protein,Util core;
    class Data1,Data2,Data3 core;
    class Eval1,Eval2,Eval3 eval;
    class Assets ext;
```
