# wudejian789/2020tianchi-proteinsecondarystructureprediction-top1 architecture

> Architecture diagram of the GitHub repository wudejian789/2020tianchi-proteinsecondarystructureprediction-top1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wudejian789/2020tianchi-proteinsecondarystructureprediction-top1
- Repository: https://github.com/wudejian789/2020tianchi-proteinsecondarystructureprediction-top1

## Overview

##### Main Components

a) Data Processing Layer:
- Input handling for protein sequences (data_seq_train.txt)
- Input handling for structure data (data_sec_train.txt)
- Feature engineering components:
- One-hot encoding
- Word2vec encoding
- Physicochemical properties encoding

b) Model Architecture Layer:
- Embedding Layer (64 dimensions)
- One-hot encoding (25 dimensions)
- Physicochemical features (14 dimensions)
- Word2vec features (25 dimensions)
- CNN Layer
- Multiple window sizes [1,9,81]
- BiGRU Layer
- Output Layer

c) Training System:
- Cross-validation component (3-fold)
- Model ensemble mechanism
- Early stopping mechanism

##### Flow Representation

- Data flow from input files through preprocessing
- Feature transformation pipeline
- Model training flow
- Prediction pipeline

##### Specific Implementation Details

- DataClass (from utils.py)
- FinalModel (from DL_ClassifierModel.py)
- Predictor_final (from SecondStructurePredictor.py)

##### Technical Specifications

Annotations showing:
- Input dimensions
- Output dimensions
- Window sizes for CNN
- Embedding dimensions
- Model hyperparameters

##### Storage Components

Cache and model directories with their purposes:
- Model storage
- Cached features
- Pretrained embeddings

##### Prediction System at the bottom

This design captures both the high-level architecture and the specific implementation details that make this protein structure prediction system unique.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Input Layer
    subgraph DataInput
        SeqInput["Sequence Input\n(data_seq_train.txt)"]:::data
        StructInput["Structure Input\n(data_sec_train.txt)"]:::data
        DataUtils["Data Processing Utilities"]:::code
    end
    click DataUtils "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/blob/master/utils.py"

    %% Feature Engineering Layer
    subgraph FeatureEngineering
        OneHot["One-hot Encoding\n(25 dim)"]:::feature
        Word2Vec["Word2Vec Encoding\n(25 dim)"]:::feature
        PhysChem["Physicochemical\nProperties\n(14 dim)"]:::feature
        Cache["Feature Cache"]:::storage
    end
    click Cache "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/tree/master/cache/"

    %% Model Architecture Layer
    subgraph ModelArchitecture
        NNLayers["Neural Network Layers"]:::model
        Embedding["Embedding Layer\n(64 dim)"]:::model
        CNN["CNN Layer\n[1,9,81] windows"]:::model
        BiGRU["BiGRU Layer"]:::model
        Output["Output Layer"]:::model
        ModelImpl["Model Implementation"]:::code
    end
    click NNLayers "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/blob/master/nnLayer.py"
    click ModelImpl "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/blob/master/DL_ClassifierModel.py"

    %% Training System
    subgraph Training
        CrossVal["3-Fold Cross\nValidation"]:::training
        Ensemble["Model Ensemble"]:::training
        EarlyStop["Early Stopping"]:::training
        ModelStorage["Model Storage"]:::storage
        Metrics["Model Evaluation"]:::training
    end
    click ModelStorage "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/tree/master/model/"
    click Metrics "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/blob/master/metrics.py"

    %% Prediction System
    subgraph Prediction
        PredictPipe["Prediction Pipeline"]:::prediction
    end
    click PredictPipe "https://github.com/wudejian789/2020TIANCHI-ProteinSecondaryStructurePrediction-TOP1/blob/master/SecondStructurePredictor.py"

    %% Connections
    SeqInput --> DataUtils
    StructInput --> DataUtils
    DataUtils --> OneHot & Word2Vec & PhysChem
    OneHot & Word2Vec & PhysChem --> Cache
    Cache --> Embedding
    Embedding --> CNN
    CNN --> BiGRU
    BiGRU --> Output
    Output --> CrossVal
    CrossVal --> Ensemble
    Ensemble --> ModelStorage
    ModelStorage --> PredictPipe
    CrossVal --> Metrics

    %% Styles
    classDef data fill:#b3e0ff,stroke:#333,stroke-width:2px
    classDef feature fill:#90EE90,stroke:#333,stroke-width:2px
    classDef model fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef training fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef prediction fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef code fill:#F0F8FF,stroke:#333,stroke-width:2px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Data Input"]:::data
        L2["Feature Engineering"]:::feature
        L3["Model Components"]:::model
        L4["Training Components"]:::training
        L5["Prediction System"]:::prediction
        L6["Code Modules"]:::code
        L7["Storage"]:::storage
    end
```
