Skip to content
Merged

V3 #187

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b2b82de
Merge pull request #186 from BitMind-AI/testnet
benliang99 May 2, 2025
489d960
V3
dylanuys May 8, 2025
b35e33f
removing v2 ci pipeline
dylanuys May 8, 2025
9060514
removing outdated .gitmodules
dylanuys May 8, 2025
0ca99fb
keeping the noise that sample size of 50 and slight decay of .5 in EM…
dylanuys May 9, 2025
e310c06
release 2.2.6 datasets, models, and lora support (#188)
dylanuys May 10, 2025
b890a93
deprecate stable-diffusion-inpainting
dylanuys May 10, 2025
f50603d
.env templates
dylanuys May 13, 2025
e8415cd
V3/RGB (#191)
dylanuys May 13, 2025
db19e47
V3 frame extraction (#192)
dylanuys May 13, 2025
1db5255
setup.sh
dylanuys May 13, 2025
98cf933
removing wandb log call from generator
dylanuys May 13, 2025
304a9d1
V3/2.2.9 (#189)
dylanuys May 13, 2025
9b72f0f
V3/2.2.11 (#190)
dylanuys May 13, 2025
024582c
fixing truthy tuple assertion
dylanuys May 13, 2025
3925d80
Update min_compute.yml
dylanuys May 13, 2025
3f0a5f2
fixing setup script name in docs
dylanuys May 13, 2025
1ba819f
correct script name
dylanuys May 13, 2025
c6b652f
updated requirements.txt with bittensor-cli
dylanuys May 13, 2025
ffb4ad9
Merge branch 'v3' of github.com:bitmind-ai/bitmind-subnet into v3
dylanuys May 13, 2025
57ae7d6
removing wandb.off
dylanuys May 13, 2025
29a5c44
import cleanup
dylanuys May 13, 2025
f82fdc0
miner substrate thread restart + vali autoupdate test
dylanuys May 13, 2025
82c1916
Merge branch 'v3' of github.com:BitMind-AI/bitmind-subnet into v3
dylanuys May 13, 2025
1e7538f
temporary v3 branch set to test autoudpate
dylanuys May 13, 2025
d6782c4
Merge branch 'v3' of github.com:bitmind-ai/bitmind-subnet into v3
dylanuys May 13, 2025
7c0070f
autoupdate update
dylanuys May 13, 2025
6e6ee95
lower frequency of audoupdate check
dylanuys May 13, 2025
009bff7
autoudpate test
dylanuys May 13, 2025
3bc2719
check autoupdate at setp 0
dylanuys May 13, 2025
9495bf4
typo
dylanuys May 13, 2025
e790af0
Merge branch 'v3' of github.com:BitMind-AI/bitmind-subnet into v3
dylanuys May 13, 2025
d88bec7
autoupdate test
dylanuys May 13, 2025
5fdd74f
dont set weights immediately at startup in case of many restarts
dylanuys May 13, 2025
5f5a310
Merge branch 'v3' of github.com:bitmind-ai/bitmind-subnet into v3
dylanuys May 13, 2025
023510a
Pyproject toml (#193)
dylanuys May 13, 2025
06eec1f
autoupdate test
dylanuys May 13, 2025
4b348ea
resetting version after autoupdate tests
dylanuys May 13, 2025
abd2714
Add Hugging Face model access instructions to validator docs; improve…
benliang99 May 13, 2025
617a7d0
fixing image_samples check for i2i
dylanuys May 13, 2025
a04768f
hf_xet requirement
dylanuys May 13, 2025
d5b48c6
Merge remote-tracking branch 'origin/v3' into V3/device-map
benliang99 May 13, 2025
bbb0841
wandb autorestart
dylanuys May 13, 2025
8a21081
Fix: raise error if image is None for i2i/i2v tasks and ensure image …
benliang99 May 13, 2025
0074632
fixing wandb autorestart
dylanuys May 13, 2025
8133fa4
Merge branch 'V3/device-map' into wandb-auto-restart
dylanuys May 13, 2025
d6d39dc
error log
dylanuys May 13, 2025
e8d1c46
Merge pull request #195 from BitMind-AI/wandb-auto-restart
benliang99 May 13, 2025
7902830
Update setup.sh to install Node.js 20.x LTS from NodeSource for pm2 c…
benliang99 May 13, 2025
918e182
Merge pull request #194 from BitMind-AI/V3/device-map
benliang99 May 14, 2025
d173d3e
external port for proxy cuz tensordock rugged us (#196)
dylanuys May 14, 2025
9d82d34
incentive doc
dylanuys May 14, 2025
adff924
Typo
benliang99 May 14, 2025
444a316
proxy updates
dylanuys May 14, 2025
fad2407
v2 parity encoding (#197)
dylanuys May 14, 2025
1f439d7
final autoupdate test
dylanuys May 14, 2025
a607f6b
reset version
dylanuys May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .env.miner.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ======= Miner Configuration (FILL IN) =======
# Wallet
WALLET_NAME=
WALLET_HOTKEY=

# Network
CHAIN_ENDPOINT=wss://entrypoint-finney.opentensor.ai:443
# OTF public finney endpoint: wss://entrypoint-finney.opentensor.ai:443
# OTF public testnet endpoint: wss://test.finney.opentensor.ai:443/

# Axon port and (optionally) ip
AXON_PORT=8091
AXON_EXTERNAL_IP=[::]

FORCE_VPERMIT=true

# Device for detection models
DEVICE=cpu

# Logging
LOGLEVEL=trace
29 changes: 29 additions & 0 deletions .env.validator.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ======= Validator Configuration (FILL IN) =======
# Wallet
WALLET_NAME=
WALLET_HOTKEY=

# API Keys
WANDB_API_KEY=
HUGGING_FACE_TOKEN=

# Network
CHAIN_ENDPOINT=wss://entrypoint-finney.opentensor.ai:443
# OTF public finney endpoint: wss://entrypoint-finney.opentensor.ai:443
# OTF public testnet endpoint: wss://test.finney.opentensor.ai:443/

# Validator Proxy
PROXY_PORT=10913
PROXY_EXTERNAL_PORT=10913

# Cache config
SN34_CACHE_DIR=~/.cache/sn34
HEARTBEAT=true

# Generator config
GENERATION_BATCH_SIZE=3
DEVICE=cuda

# Other
LOGLEVEL=info
AUTO_UPDATE=false
40 changes: 0 additions & 40 deletions .github/workflows/ci.yml

This file was deleted.

Empty file removed .gitmodules
Empty file.
32 changes: 14 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
MIT License
The MIT License (MIT)
Copyright © 2023 Yuma Rao
Copyright © 2025 BitMind

Copyright (c) 2023 Opentensor
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
the Software.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
132 changes: 57 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,87 @@
<p align="center">
<img src="static/Bitmind-Logo.png" alt="BitMind Logo" width="150"/>
<img src="docs/static/Bitmind-Logo.png" alt="BitMind Logo" width="150"/>
</p>
<h1 align="center">BitMind Subnet<br><small>Bittensor Subnet 34 | Deepfake Detection</small></h1>

![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

The BitMind Subnet is **the world's first decentralized AI-generated content detection network**. Built on Bittensor, our incentive mechanism rewards the most accurate detection algorithms, creating an adaptive defense against synthetic media.

<table style="border: none !important; width: 100% !important; border-collapse: collapse !important; margin: 0 auto !important;">
<tbody>
<tr>
<td><b>Docs</b></td>
<td><b>Resources</b></td>
</tr>
<tr style="vertical-align: top !important">
<td>
⛏️ <a href="docs/Mining.md">Mining Guide</a><br>
🔧 <a href="docs/Validating.md">Validator Guide</a><br>
🏗️ <a href="#Subnet-Architecture">Architecture Diagrams</a><br>
📈 <a href="docs/Incentive.md">Incentive Mechanism</a><br>
🤝 <a href="docs/Contributor_Guide.md">Contributor Guide</a></td>
<td>
🚀 <a href="<https://www.bitmind.ai/apps>">SN34-Powered Applications</a><br>
🤗 <a href="https://huggingface.co/bitmind">BitMind Huggingface</a><br>
📊 <a href="https://wandb.ai/bitmindai/bitmind-subnet">Mainnet 34 W&B</a> | <a href="https://wandb.ai/bitmindai/bitmind">Testnet 168 W&B</a><br>
📖 <a href="docs/Glossary.md">Project Structure and Terminology</a><br>
<a href="https://docs.bittensor.com/learn/bittensor-building-blocks">🧠 Bittensor Introduction</a><br>
</td>
</tr>
</tbody>
</table>
<h1 align="center">SN34<br><small>Deepfake Detection</small></h1>

<div align="center">
<a href="https://www.bitmind.ai/apps">Applications</a>
</div>

<div align="center">
<a href="docs/Mining.md">Mining Guide</a> ·
<a href="docs/Validating.md">Validator Guide</a> ·
<a href="docs/Incentive.md">Incentive Mechanism Overview</a>
</div>

<div align="center">
<a href="https://huggingface.co/bitmind">HuggingFace</a> ·
<a href="https://wandb.ai/bitmindai/bitmind-subnet">Mainnet 34 W&B</a> ·
<a href="https://wandb.ai/bitmindai/bitmind-subnet">Testnet 168 W&B</a>
</div>

<div align="center">
<a href="https://app.bitmind.ai/statistics">Leaderboard</a>
</div>

## Decentralized Detection of AI Generated Content
The explosive growth of generative AI technology has unleashed an unprecedented wave of synthetic media creation. These AI-generated images, videos, and other content have become remarkably sophisticated, making them virtually indistinguishable from authentic media. This development presents a critical challenge to information integrity and societal trust in the digital age, as the line between real and synthetic content continues to blur.
The explosive growth of generative AI technology has unleashed an unprecedented wave of synthetic media creation. AI-generated audiovisual content has become remarkably sophisticated, oftentimes indistinguishable from authentic media. This development presents a critical challenge to information integrity and societal trust in the digital age, as the line between real and synthetic content continues to blur.

To address this growing challenge, SN34 aims to create the most accurate fully-generalized detection system. Here, fully-generalized means that the system is capable of detecting both synthetic and semi-synthetic media with high degrees of accuracy regardless of their content or what model generated them. Our incentive mechanism evolves alongside state-of-the-art generative AI, rewarding miners whose detection algorithms best adapt to new forms of synthetic content.


## Core Components

> This documentation assumes basic familiarity with Bittensor concepts. For an introduction, please check out the docs: https://docs.bittensor.com/learn/bittensor-building-blocks.
> This documentation assumes basic familiarity with [Bittensor concepts](https://docs.bittensor.com/learn/bittensor-building-blocks).

<b><a href="docs/Mining.md">Miners</a></b>

**Miners**
- Miners are tasked with running binary classifiers that discern between genuine and AI-generated content, and are rewarded based on their accuracy.
- Miners predict a float value in [0., 1.], with values greater than 0.5 indicating the image or video is AI generated.
- For each challenge, a miner is presented an image or video and is required to respond with a multiclass prediction [$p_{real}$, $p_{synthetic}$, $p_{semisynthetic}$] indicating whether the media is real, fully generated, or partially modified by AI.


**Validators**
<b><a href="docs/Validating.md">Validators</a></b>
- Validators challenge miners with a balanced mix of real and synthetic media drawn from a diverse pool of sources.
- We continually add new datasets and generative models to our validators in order to maximize coverage of the types of diverse data. Models and datasets are defined in `bitmind/validator/config.py`.
- We continually add new datasets and generative models to our validators in order to evolve the subnet's detection capabilities alongside advances in generative AI.


## Subnet Architecture

> Overview of the validator neuron, miner neuron, and other components external to the subnet.

![Subnet Architecture](static/Subnet-Arch.png)

**Challenge Generation and Scoring (Pink Arrows)**

For each challenge, the validator randomly samples a real or synthetic image/video from the cache, applies random augmentations to the sampled media, and distributes the augmented data to 50 randomly selected miners for classification. It then scores the miners responses, and logs comprehensive challenge results to [Weights and Biases](https://wandb.ai/bitmindai/bitmind-subnet), including the generated media, original prompt, miner responses and rewards, and other challenge metadata.

**Data Generation and Downloads (Blue Arrows)**:

The synthetic data generator coordinates a VLM and LLM to generate prompts for our suite of text-to-image, image-to-image, and text-to-video models. Each generated image/video is written to the cache along with the prompt, generation parameters, and other metadata.

The real data fetcher performs partial dataset downloads, fetching random compressed chunks of datasets from HuggingFace and unpacking random portions of these chunks into the cache along with their metadata. Partial downloads avoid requiring TBs of space for large video datasets like OpenVid1M.

**Organic Traffic (Green Arrows)**
Overview of the validator neuron, miner neuron, and other components external to the subnet.

![Subnet Architecture](docs/static/Subnet-Arch.png)

<details>
<summary><b>Challenge Generation and Scoring (Peach Arrows</span>)</b></summary>
<ul>
<li>The validator first randomly samples an image or video from its local media cache.</li>
<li>The sampled media can be real, synthetic, or semisynthetic, and was either downloaded from an dataset on Huggingface or generated locally by one of many generative models.</li>
<li>The sampled media is then augmented by a pipeline of random transformations, adding to the challenge difficulty and mitigating incentive mechanism gaming via lookups.</li>
<li>The augmented media is then sent to miners for classification.</li>
<li>The validator scores the miners responses and logs comprehensive challenge results to <a href="https://wandb.ai/bitmindai/bitmind-subnet">Weights and Biases</a>, including the generated media, original prompt, miner responses and rewards, and other challenge metadata.</li>
</ul>
</details>

<details>
<summary><b>Data Generation and Downloads (Blue Arrows)</b></summary>
The blue arrows show how the validator media cache is maintained by two parallel tracks:
<ul>
<li>The synthetic data generator coordinates a VLM and LLM to generate prompts for our suite of text-to-image, image-to-image, and text-to-video models. Each generated image/video is written to the cache along with the prompt, generation parameters, and other metadata.</li>
<li>The real data fetcher performs partial dataset downloads, fetching random compressed chunks of datasets from HuggingFace and unpacking random portions of these chunks into the cache along with their metadata. Partial downloads avoid requiring TBs of space for large video datasets like OpenVid1M.</li>
</ul>
</details>

<details>
<summary><b>Organic Traffic (Green Arrows)</b></summary>

<a href="https://www.bitmind.ai/apps">Application</a> requests are distributed to validators by an API server and load balancer in BitMind's cloud. A vector database caches subnet responses to avoid uncessary repetitive calls coming from salient images on the internet.
</details>



## Community

<p align="left">
<a href="https://discord.gg/kKQR98CrUn">
<img src="static/Join-BitMind-Discord.png" alt="Join us on Discord" width="60%">
<img src="docs/static/Join-BitMind-Discord.png" alt="Join us on Discord" width="60%">
</a>
</p>

For real-time discussions, community support, and regular updates, <a href="https://discord.gg/kKQR98CrUn">join our Discord server</a>. Connect with developers, researchers, and users to get the most out of BitMind Subnet.

## License
This repository is licensed under the MIT License.
```text
# The MIT License (MIT)
# Copyright © 2023 Yuma Rao

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all copies or substantial portions of
# the Software.

# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
```
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
9 changes: 0 additions & 9 deletions autoupdate_miner_steps.sh

This file was deleted.

9 changes: 0 additions & 9 deletions autoupdate_validator_steps.sh

This file was deleted.

14 changes: 0 additions & 14 deletions base_miner/DFB/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions base_miner/DFB/config/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions base_miner/DFB/config/constants.py

This file was deleted.

Loading