Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GenoArmory: A Unified Evaluation Framework for Adversarial Attacks on Genomic Foundation Models

License

NotificationsYou must be signed in to change notification settings

MAGICS-LAB/GenoArmory

Repository files navigation

Image

A comprehensive toolkit for DNA sequence Adversarial Attack and Defense Benchmark.

arXivGithubHugging Face PretrainedHugging Face Dataset

Installation

You can install GenoArmory using pip:

pip install genoarmory

You can also install package from our source code:

git clone https://github.com/MAGICS-LAB/GenoArmory.gitconda create -n genoarmory pip=3.9pip install.

Quick Start

# Initialize modelfromGenoArmoryimportGenoArmoryimportjson# You need to initialize GenoArmory with a model and tokenizer.# For visualization, you don't need a real model/tokenizer, so you can use None if the method doesn't use them.gen=GenoArmory(model=None,tokenizer=None)params_file='/projects/p32013/DNABERT-meta/scripts/PGD/pgd_dnabert.json'# Visulizationgen.visualization(folder_path='/projects/p32013/DNABERT-meta/BERT-Attack/results/meta/test',output_pdf_path='/projects/p32013/DNABERT-meta/BERT-Attack/results/meta/test')# Attackifparams_file:try:withopen(params_file,"r")asf:kwargs=json.load(f)exceptjson.JSONDecodeErrorase:raiseValueError(f"Invalid JSON in params file '{params_file}':{e}")exceptFileNotFoundError:raiseFileNotFoundError(f"Params file '{params_file}' not found.")gen.attack(attack_method='pgd',model_path='magicslabnu/GERM',**kwargs)

Command Line Usage

GenoArmory can also be used from the command line:

# Attackpython GenoArmory.py --model_path magicslabnu/GERM attack --method pgd --params_file /projects/p32013/DNABERT-meta/scripts/PGD/pgd_dnabert.json# Defensepython GenoArmory.py --model_path magicslabnu/GERM defense --method at --params_file /projects/p32013/DNABERT-meta/scripts/AT/at_pgd_dnabert.json# Visualizationpython GenoArmory.py --model_path magicslabnu/GERM visualize --folder_path /projects/p32013/DNABERT-meta/BERT-Attack/results/meta/test --save_path /projects/p32013/DNABERT-meta/BERT-Attack/results/meta/test/frequency.pdf# Read MetaDatapython GenoArmory.py --model_path magicslabnu/GERMread --type attack --method TextFooler --model_name dnabert

Features

  • Multiple attack methods:

    • BERT-Attack
    • TextFooler
    • PGD
    • FIMBA
  • Defense methods:

    • ADFAR
    • FreeLB
    • Traditional Adversarial Training
  • Visualization tools

  • Artifact management

  • Batch processing

  • Command-line interface

Documentation

For detailed documentation, visit [docs](We will release soon).

License

This project is licensed under the MIT License.

Citation

If you have any question regarding our paper or codes, please feel free to start an issue.

If you use GenoArmory in your work, please kindly cite our paper:

@misc{luo2025genoarmoryunifiedevaluationframework,      title={GenoArmory: A Unified Evaluation Framework for Adversarial Attacks on Genomic Foundation Models},       author={Haozheng Luo and Chenghao Qiu and Yimin Wang and Shang Wu and Jiahao Yu and Han Liu and Binghui Wang and Yan Chen},      year={2025},      eprint={2505.10983},      archivePrefix={arXiv},      primaryClass={cs.LG},      url={https://arxiv.org/abs/2505.10983}, }

About

GenoArmory: A Unified Evaluation Framework for Adversarial Attacks on Genomic Foundation Models

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp