Skip to content

Attention-guided Multi-Branching-pipeline with Enhanced Residual fusion

Notifications You must be signed in to change notification settings

OpenSeizureDetector/AMBER

 
 

Repository files navigation

logo

AMBER (Attention-guided Multi-Branching-pipeline with Enhanced Residual fusion) is an experimental deep learning architecture for biomedical engineering. Designed for one-dimensional, multimodal detection tasks, the architecture addresses the challenges of processing heterogeneous data sources by constructing independent pipelines for each feature modality


📔 Table of Contents

🌟 About the Project

📷 Screenshots

screenshot

Project Title

Getting Started

Prerequisites

Ensure you have the following installed on your system:

  • Python
  • pip (Python package installer)

Installation

Navigate to the Project Directory

 cd your-repo

Clone Repository

git clone https://github.com/jpordoy/AMBER.git

‼️ Prerequisites

This project uses Yarn as package manager

 npm install --global yarn

⚙️ Installation

🧪 Running Tests

To run tests, run the following command

  yarn test test

🏃 Run Locally

Clone the project

  git clone https://github.com/Louis3797/awesome-readme-template.git

Go to the project directory

  cd my-project

Install dependencies

  yarn install

How To Run The Code

Please put your training data as a csv file in the "Data/" of this project.

import pandas as pd
import numpy as np
from data_loader import DataLoader
from data_formatter import DataFormatter
from model import Amber
from kfold_cv import KFoldCrossValidation
from evaluator import evaluate_model_performance
from config import config

# Define your DataFrame and parameter
mypath = 'Data/Train.csv'
df = pd.read_csv(mypath)
target_column = 'label'  # Name of the target column

# Step 1: Load Data
data_loader = DataLoader(dataframe=df, time_steps=config.N_TIME_STEPS, step=config.step, target_column=target_column)
segments, labels = data_loader.load_data()

# Step 2: Format Data
data_formatter = DataFormatter(config=config)
X_train_reshaped, X_test_reshaped, y_train, y_test = data_formatter.format_data(segments, labels)

# Reshape y_test correctly
y_test_reshaped = np.asarray(y_test, dtype=np.float32)

# Initialize model
ts_model = Amber(row_hidden=config.row_hidden, col_hidden=config.row_hidden, num_classes=config.N_CLASSES)

# Create an instance of KFoldCrossValidation
kfold_cv = KFoldCrossValidation(ts_model, [X_train_reshaped['Feature_1'], X_train_reshaped['Feature_2']], y_train)

# Run the cross-validation
kfold_cv.run()

# Evaluate the model performance
evaluation_results = evaluate_model_performance(ts_model, [X_test_reshaped['Feature_1'], X_test_reshaped['Feature_2']], y_test_reshaped)

# Access individual metrics
print("Accuracy:", evaluation_results["accuracy"])
print("F1 Score:", evaluation_results["f1"])
print("Cohen's Kappa:", evaluation_results["cohen_kappa"])

👋 Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

📜 Code of Conduct

Please read the Code of Conduct

❔ FAQ

  • Question 1

    • Answer 1
  • Question 2

    • Answer 2

⚠️ License

Distributed under the no License. See LICENSE.txt for more information.

🤝 Contact

Your Name - @twitter_handle - email@email_client.com

Project Link: https://github.com/Louis3797/awesome-readme-template

💎 Acknowledgements

About

Attention-guided Multi-Branching-pipeline with Enhanced Residual fusion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.4%
  • Python 0.6%