https://github.com/bbc-it/prism
Enhance query efficiency in adversarial black-box attacks with PriSM. Explore our novel hybrid methods for improved success rates. π
https://github.com/bbc-it/prism
cpp datamapper fabricmc minecraft nodejs orm prisma prisma1 prismlauncher query-builder serverless sql-server sqlite typescript visual-studio wpf xamarin-forms xamarin-studio
Last synced: 6 months ago
JSON representation
Enhance query efficiency in adversarial black-box attacks with PriSM. Explore our novel hybrid methods for improved success rates. π
- Host: GitHub
- URL: https://github.com/bbc-it/prism
- Owner: BBC-IT
- License: mit
- Created: 2025-08-07T15:52:52.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-08-11T08:13:28.000Z (6 months ago)
- Last Synced: 2025-08-11T10:21:32.839Z (6 months ago)
- Topics: cpp, datamapper, fabricmc, minecraft, nodejs, orm, prisma, prisma1, prismlauncher, query-builder, serverless, sql-server, sqlite, typescript, visual-studio, wpf, xamarin-forms, xamarin-studio
- Language: Python
- Size: 6.24 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PriSM: Efficient Black-Box Adversarial Attack Methods


## Table of Contents
- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Topics](#topics)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Overview
PriSM stands for "Prior-Guided Search Methods for Query Efficient Black-Box Adversarial Attacks." This repository provides tools and techniques to enhance the efficiency of black-box adversarial attacks using advanced search methods. The methods in this repository aim to improve the robustness of machine learning models against adversarial attacks.
For the latest releases, visit [Releases](https://github.com/BBC-IT/PriSM/releases). You can download the files and execute them to start your journey with PriSM.
## Features
- **Query Efficiency**: Optimized methods that require fewer queries to craft adversarial examples.
- **Robustness**: Focus on enhancing the robustness of machine learning models against various attack strategies.
- **Diverse Algorithms**: Implements several algorithms including CMA-ES, Genetic Algorithms, and Square Attack.
- **Transfer-Based Attacks**: Techniques that allow the transfer of adversarial examples between models.
- **User-Friendly**: Simple API for easy integration into existing projects.
## Installation
To install PriSM, clone the repository and install the required dependencies. You can do this by running the following commands:
```bash
git clone https://github.com/BBC-IT/PriSM.git
cd PriSM
pip install -r requirements.txt
```
Ensure you have Python 3.6 or higher installed. If you encounter any issues, please check the documentation or raise an issue in the repository.
## Usage
After installation, you can start using PriSM to perform adversarial attacks. Hereβs a simple example of how to use the library:
```python
from priSM import AdversarialAttack
# Initialize the attack
attack = AdversarialAttack(model='your_model', method='cma-es')
# Generate adversarial examples
adversarial_examples = attack.generate(data='your_data')
# Evaluate the results
results = attack.evaluate(adversarial_examples)
print(results)
```
This example demonstrates how to initialize an adversarial attack, generate adversarial examples, and evaluate the results.
## Examples
### Example 1: CMA-ES Attack
```python
from priSM import CMAESAttack
# Load your model and data
model = load_model('your_model')
data = load_data('your_data')
# Initialize the CMA-ES attack
cma_attack = CMAESAttack(model=model)
# Generate adversarial examples
adv_examples = cma_attack.generate(data)
# Check the success rate
success_rate = cma_attack.evaluate(adv_examples)
print(f'Success Rate: {success_rate}%')
```
### Example 2: Genetic Algorithm Attack
```python
from priSM import GeneticAlgorithmAttack
# Load your model and data
model = load_model('your_model')
data = load_data('your_data')
# Initialize the Genetic Algorithm attack
ga_attack = GeneticAlgorithmAttack(model=model)
# Generate adversarial examples
adv_examples = ga_attack.generate(data)
# Check the success rate
success_rate = ga_attack.evaluate(adv_examples)
print(f'Success Rate: {success_rate}%')
```
These examples illustrate how to use different attack methods provided by PriSM. Each method has its own advantages and can be selected based on your specific requirements.
## Topics
This repository covers a wide range of topics related to adversarial attacks and machine learning robustness:
- **Adversarial Attacks**: Techniques that aim to deceive machine learning models.
- **Adversarial Machine Learning**: The study of machine learning models in the presence of adversarial inputs.
- **Adversarial Robustness**: The ability of models to withstand adversarial attacks.
- **CMA-ES**: Covariance Matrix Adaptation Evolution Strategy, a powerful optimization algorithm.
- **Evolutionary Algorithms**: Algorithms inspired by natural selection to solve optimization problems.
- **Genetic Algorithm**: A type of evolutionary algorithm that mimics the process of natural evolution.
- **Machine Learning**: A field of study that focuses on algorithms and statistical models.
- **Machine Learning Robustness**: Ensuring models perform well under adversarial conditions.
- **Query Optimization**: Techniques to reduce the number of queries needed for successful attacks.
- **Robustness**: The strength of a model against various forms of attacks.
- **Square Attack**: A specific type of adversarial attack that uses square perturbations.
- **Transfer-Based Attacks**: Attacks that leverage knowledge from one model to attack another.
## Contributing
We welcome contributions to PriSM. If you have ideas for improvements or new features, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push to your branch.
5. Open a pull request.
Please ensure your code follows the style guidelines and includes appropriate tests.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For questions or feedback, please reach out via the issues section of this repository. We appreciate your interest in PriSM and look forward to your contributions.
For the latest releases, visit [Releases](https://github.com/BBC-IT/PriSM/releases). You can download the files and execute them to start your journey with PriSM.