Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
9645225
model manager with tests
wjurkowlaniec Aug 9, 2024
f094721
fixed test, stub competition and dataset manager
wjurkowlaniec Aug 9, 2024
72a65e9
fixes from PR
wjurkowlaniec Aug 13, 2024
f39a5f3
fix using config
wjurkowlaniec Aug 13, 2024
cd0114d
typing
wjurkowlaniec Aug 13, 2024
76cc3b0
Merge pull request #2 from safe-scan-ai/idea
konrad0960 Aug 13, 2024
42277ac
not tested, competition and dataset manager
wjurkowlaniec Aug 18, 2024
6bb82cf
still not tested, model runner
wjurkowlaniec Aug 18, 2024
4acf64a
WIP model runner and some example code for testing
wjurkowlaniec Aug 19, 2024
f29be14
lil refactor
wjurkowlaniec Aug 19, 2024
8552feb
WIP
wjurkowlaniec Aug 20, 2024
3e2a3f6
Merge pull request #16 from safe-scan-ai/competition-manager
wjurkowlaniec Aug 20, 2024
a41d151
working dataset downloading
wjurkowlaniec Aug 20, 2024
77db33e
logging added
wjurkowlaniec Aug 20, 2024
4210050
Merge pull request #23 from safe-scan-ai/pluging_dataset
notbulubula Aug 20, 2024
a3374aa
tmp path correction
notbulubula Aug 20, 2024
53c95d8
yeah working
wjurkowlaniec Aug 20, 2024
c4e211e
Adding onnx runner
notbulubula Aug 21, 2024
627000e
Adding wandb loging
notbulubula Aug 22, 2024
0cb7944
snapshot commit
konrad0960 Aug 17, 2024
bd523f9
commiting metadata on chain PoC
konrad0960 Aug 19, 2024
81db375
store and retrieve metadata on chain PoC
konrad0960 Aug 20, 2024
166ed29
miner work in progress
wjurkowlaniec Aug 21, 2024
4283840
moved config
wjurkowlaniec Aug 21, 2024
0893460
evaluating model locally from dataset
wjurkowlaniec Aug 22, 2024
101b7b4
miner manager + override logging formats
wjurkowlaniec Aug 22, 2024
f21a14b
support for multiple competitions
wjurkowlaniec Aug 23, 2024
5afc101
multi competition scheduler and debug runner
wjurkowlaniec Aug 23, 2024
ee78877
integration (not tested) with chain storage
wjurkowlaniec Aug 23, 2024
22289f0
little refactoring, added repo type to dataset as well
wjurkowlaniec Aug 23, 2024
f04412e
Restructuring competition handlers
notbulubula Aug 23, 2024
4fd067e
Dynamic batch size for onnx
notbulubula Aug 23, 2024
fb2e9b2
Renaming and adding types
notbulubula Aug 23, 2024
71b7e7a
Fix
notbulubula Aug 23, 2024
f18a283
Removing redundant mapping
notbulubula Aug 23, 2024
719809c
Merge pull request #24 from safe-scan-ai/testing_integration
wjurkowlaniec Aug 23, 2024
4721df8
Update README.md
LEMSTUDI0 Aug 23, 2024
43c8ebe
Update README.md
LEMSTUDI0 Aug 23, 2024
b798afe
Merge branch 'dev' into basi-miner
wjurkowlaniec Aug 23, 2024
e3dfbfa
Update README.md
LEMSTUDI0 Aug 23, 2024
97b8c0e
merge fixes in progress
wjurkowlaniec Aug 23, 2024
70f3db2
Update README.md
LEMSTUDI0 Aug 23, 2024
032a79e
Update README.md
LEMSTUDI0 Aug 23, 2024
052cae7
Update README.md
LEMSTUDI0 Aug 23, 2024
de2d161
Update README.md
LEMSTUDI0 Aug 23, 2024
51c3b5e
Update README.md
LEMSTUDI0 Aug 23, 2024
c13d185
Update README.md
wjurkowlaniec Aug 23, 2024
36bb63c
fixing melanoma_handler
notbulubula Aug 23, 2024
dc2852c
Merge pull request #17 from safe-scan-ai/basi-miner
wjurkowlaniec Aug 23, 2024
4fa3699
upload code with model, working
wjurkowlaniec Aug 24, 2024
db3fb9d
Update README.md
LEMSTUDI0 Aug 26, 2024
650ebaa
here you go
wjurkowlaniec Aug 26, 2024
efb8edc
Update README.md
LEMSTUDI0 Aug 26, 2024
baf3677
Update README.md
LEMSTUDI0 Aug 26, 2024
0e7f6f1
Update README.md
LEMSTUDI0 Aug 26, 2024
47a758a
Add files via upload
LEMSTUDI0 Aug 26, 2024
6f9c8fe
Update README.md
LEMSTUDI0 Aug 26, 2024
e31cb7c
Update README.md
LEMSTUDI0 Aug 26, 2024
435d330
Delete DOCS/header.png
LEMSTUDI0 Aug 26, 2024
1e2708d
Add files via upload
LEMSTUDI0 Aug 26, 2024
32830d4
Update neurons/miner3.py
wjurkowlaniec Aug 26, 2024
ada902c
Update neurons/miner3.py
wjurkowlaniec Aug 26, 2024
a6f7f5f
Merge pull request #30 from safe-scan-ai/code_checking
wjurkowlaniec Aug 26, 2024
82b75a3
Update README.md
LEMSTUDI0 Aug 26, 2024
b7fdc6c
Update README.md
LEMSTUDI0 Aug 26, 2024
fcb5429
Update README.md
LEMSTUDI0 Aug 26, 2024
50f635f
Update README.md
LEMSTUDI0 Aug 26, 2024
9ce2ee6
Update README.md
LEMSTUDI0 Aug 26, 2024
c4809e6
Update README.md
LEMSTUDI0 Aug 26, 2024
29851eb
Update README.md
LEMSTUDI0 Aug 26, 2024
f3e90f7
Update README.md
LEMSTUDI0 Aug 26, 2024
a91c700
Update README.md
LEMSTUDI0 Aug 26, 2024
116efce
Update README.md
LEMSTUDI0 Aug 26, 2024
dcfc236
Update README.md
LEMSTUDI0 Aug 26, 2024
0faa0ab
Update README.md
LEMSTUDI0 Aug 26, 2024
e841f6c
Update README.md
LEMSTUDI0 Aug 26, 2024
cde2ce9
Update README.md
LEMSTUDI0 Aug 26, 2024
30ed888
Update README.md
LEMSTUDI0 Aug 26, 2024
3c4807d
Update README.md
LEMSTUDI0 Aug 26, 2024
6da68ea
Update README.md
LEMSTUDI0 Aug 26, 2024
25179d2
Update README.md
LEMSTUDI0 Aug 26, 2024
d2aef5e
Update README.md
LEMSTUDI0 Aug 26, 2024
f5c3e05
plugged in config and integrated pushing model metadata on chain from…
konrad0960 Aug 26, 2024
1916435
some adjustments
konrad0960 Aug 27, 2024
c1555a8
Update README.md
wjurkowlaniec Aug 28, 2024
93b175e
Merge pull request #25 from safe-scan-ai/LEMSTUDI0-patch-1
wjurkowlaniec Aug 28, 2024
9515a74
Merge pull request #34 from safe-scan-ai/dev
wjurkowlaniec Aug 28, 2024
8ce5430
Update README.md
LEMSTUDI0 Aug 28, 2024
1739fcf
Merge pull request #37 from safe-scan-ai/LEMSTUDI0-patch-1
wjurkowlaniec Aug 28, 2024
46743f5
Competition readme and script for downloading dataset (#29)
wjurkowlaniec Aug 28, 2024
468b45b
fix readme (#38)
wjurkowlaniec Aug 28, 2024
80f5543
Update README.md
wjurkowlaniec Aug 28, 2024
6b2b1cf
Update README.md
LEMSTUDI0 Aug 28, 2024
4becee9
initial rewarding model
konrad0960 Aug 28, 2024
16fd4ca
rewards
konrad0960 Aug 29, 2024
ac660e4
rewarder tests
konrad0960 Aug 29, 2024
153f9b9
test discussed case
wjurkowlaniec Aug 29, 2024
89e594e
fixed test
wjurkowlaniec Aug 30, 2024
7b78ae9
plugged in config and integrated pushing model metadata on chain from…
konrad0960 Aug 26, 2024
5d76dd6
some adjustments
konrad0960 Aug 27, 2024
3f0517d
fixes to chain model
wjurkowlaniec Aug 29, 2024
b5c57da
bittensor connection only on submitting models, fixes in configuratio…
wjurkowlaniec Aug 30, 2024
5cc3eef
working uploading model info to chain
wjurkowlaniec Aug 30, 2024
55d9cac
Update DOCS/miner.md
wjurkowlaniec Aug 30, 2024
7e65a98
config
wjurkowlaniec Aug 31, 2024
7cc2091
Merge pull request #31 from safe-scan-ai/plug-config-into-miner
wjurkowlaniec Aug 31, 2024
c71d53f
in progress fixing competition scheduler
wjurkowlaniec Aug 26, 2024
9fe4a1a
competition scheduler
wjurkowlaniec Aug 28, 2024
75c3808
fixes for running competitions
wjurkowlaniec Aug 28, 2024
70e1eea
highhopes
notbulubula Aug 28, 2024
c9d7ce6
various fixes, wandb logging
wjurkowlaniec Aug 28, 2024
358cd66
finished scheduler
wjurkowlaniec Aug 29, 2024
e8b4629
updated tests for model manager
wjurkowlaniec Aug 29, 2024
dec9fd1
fix for wandb sending
wjurkowlaniec Aug 29, 2024
a809097
Update cancer_ai/validator/competition_manager.py
wjurkowlaniec Aug 30, 2024
0d440f7
CR fixes in progress
wjurkowlaniec Aug 30, 2024
e220e6b
validator docs
wjurkowlaniec Aug 30, 2024
4e53cde
PR fixes
wjurkowlaniec Aug 30, 2024
ad9940e
plugged in config and integrated pushing model metadata on chain from…
konrad0960 Aug 26, 2024
282b277
some adjustments
konrad0960 Aug 27, 2024
60650c2
fixes to chain model
wjurkowlaniec Aug 29, 2024
9c5d9ff
bittensor connection only on submitting models, fixes in configuratio…
wjurkowlaniec Aug 30, 2024
2260ab8
fixes for running competitions
wjurkowlaniec Aug 28, 2024
22d3e4c
various fixes, wandb logging
wjurkowlaniec Aug 28, 2024
dc3ceb8
CR fixes in progress
wjurkowlaniec Aug 30, 2024
ead2946
PR fixes
wjurkowlaniec Aug 30, 2024
a1bf9bf
fix
wjurkowlaniec Aug 31, 2024
a4479b1
Merge pull request #33 from safe-scan-ai/schedule_competitions
wjurkowlaniec Aug 31, 2024
6cfdacb
new rewarder with tests
konrad0960 Aug 31, 2024
329bd39
merge with dev branch
konrad0960 Aug 31, 2024
3595282
Merge pull request #44 from safe-scan-ai/rewarder
konrad0960 Aug 31, 2024
3da8b33
miner config
wjurkowlaniec Aug 31, 2024
ba27bcc
fixing feet
wjurkowlaniec Aug 31, 2024
16ebbfe
WIP validator integration
konrad0960 Sep 1, 2024
2d2a28e
fixes for configuration
wjurkowlaniec Sep 1, 2024
d4f3892
Merge pull request #43 from safe-scan-ai/integration_1
wjurkowlaniec Sep 1, 2024
2b2ae6f
rewarded logic adjustments
konrad0960 Sep 1, 2024
b7acded
resolved Wojtek's comments
konrad0960 Sep 1, 2024
3cbb820
adjustments
konrad0960 Sep 1, 2024
b5228d9
miner config
wjurkowlaniec Aug 31, 2024
1756e45
fixing feet
wjurkowlaniec Aug 31, 2024
302bcc0
fixes for configuration
wjurkowlaniec Sep 1, 2024
c1097f7
WIP testing validator
konrad0960 Sep 1, 2024
e962942
config unification for miner and validator, renaming, attempt to do c…
wjurkowlaniec Sep 2, 2024
3f442a1
fix configs and make main loop run
wjurkowlaniec Sep 2, 2024
89b812b
Update requirements.txt
wjurkowlaniec Sep 2, 2024
2f13c99
autovali test
konrad0960 Sep 2, 2024
d5618b1
autovali
konrad0960 Sep 2, 2024
a9183b1
delete setup.py
konrad0960 Sep 2, 2024
9c9dfc1
autovalidator-test
konrad0960 Sep 2, 2024
6884deb
further autovalidator fixes
konrad0960 Sep 2, 2024
90c8407
furthe autovali testing
konrad0960 Sep 2, 2024
fa17367
working autovalidator
konrad0960 Sep 2, 2024
056ce99
autovalidator fix
konrad0960 Sep 2, 2024
6440dbc
weight utils fix
konrad0960 Sep 2, 2024
4e13ac6
check back 15 minutes of there are any due competitions to run
wjurkowlaniec Sep 2, 2024
9ba8bf6
competittion runner
wjurkowlaniec Sep 3, 2024
8894650
fixed states saving/loading
konrad0960 Sep 3, 2024
d39772d
deleted unecessary test process
konrad0960 Sep 3, 2024
433d46a
optimized not optimized code
wjurkowlaniec Sep 3, 2024
15abb62
Update neurons/competition_runner.py
wjurkowlaniec Sep 3, 2024
5ff0f00
Update miner.md
wjurkowlaniec Sep 3, 2024
a5d377e
Update README.md
wjurkowlaniec Sep 3, 2024
98b1876
Update README.md
LEMSTUDI0 Sep 3, 2024
3c098ae
Update README.md
LEMSTUDI0 Sep 3, 2024
124844b
Update miner.md
LEMSTUDI0 Sep 3, 2024
1f0b8d6
komit
wjurkowlaniec Sep 4, 2024
0c8e00e
Create prerequirements.md
LEMSTUDI0 Sep 4, 2024
4367da9
Update prerequirements.md
LEMSTUDI0 Sep 4, 2024
c253ee7
Adding WANDB setup
notbulubula Sep 4, 2024
fd7667a
some timing adjustments
konrad0960 Sep 4, 2024
f8caf35
Update README.md
LEMSTUDI0 Sep 4, 2024
42a094b
Update README.md
LEMSTUDI0 Sep 4, 2024
ed41d3c
auto-validator docs
konrad0960 Sep 4, 2024
c46b863
Merge pull request #47 from safe-scan-ai/competition_run_logger
wjurkowlaniec Sep 4, 2024
61af1bd
validator docs
konrad0960 Sep 4, 2024
6cb4396
adjusted to Wojtek's comments
konrad0960 Sep 4, 2024
f00ad3d
Adjusted miner readme
konrad0960 Sep 4, 2024
8f8375d
Merge pull request #49 from safe-scan-ai/auto-validator-documentation
konrad0960 Sep 4, 2024
bd2cb3c
Merge pull request #51 from safe-scan-ai/competition_run_logger
konrad0960 Sep 4, 2024
28268a5
some time adjustments
konrad0960 Sep 4, 2024
aa2607f
merge with dev
konrad0960 Sep 4, 2024
64a773b
Merge pull request #46 from safe-scan-ai/validator-integration
konrad0960 Sep 4, 2024
23baf3d
more wandb logging
wjurkowlaniec Sep 4, 2024
192d9e0
small fix
wjurkowlaniec Sep 4, 2024
9da5123
logging errors and whole runs
wjurkowlaniec Sep 4, 2024
17d24ce
initial changelog
wjurkowlaniec Sep 4, 2024
5bd4bed
Merge branch 'dev' into wandb-logging
wjurkowlaniec Sep 4, 2024
62f988e
Merge pull request #52 from safe-scan-ai/wandb-logging
wjurkowlaniec Sep 4, 2024
c68ac83
Update README.md
LEMSTUDI0 Sep 4, 2024
75bca96
Update README.md
LEMSTUDI0 Sep 4, 2024
fa1f497
Update README.md
LEMSTUDI0 Sep 4, 2024
09aae1a
Update README.md
LEMSTUDI0 Sep 4, 2024
ad5bf14
Merge branch 'main' into dev
wjurkowlaniec Sep 4, 2024
75b5f2a
Merge pull request #54 from safe-scan-ai/dev
wjurkowlaniec Sep 4, 2024
68f5e6f
Update README.md
LEMSTUDI0 Sep 4, 2024
e0cd4f0
Update README.md
LEMSTUDI0 Sep 4, 2024
e3e136c
Update README.md
LEMSTUDI0 Sep 4, 2024
758bde5
Update README.md
LEMSTUDI0 Sep 4, 2024
7921f71
installation in progress
wjurkowlaniec Sep 4, 2024
ffcbe85
Update validator.md
wjurkowlaniec Sep 5, 2024
e3e8c42
split dataset chunks
wjurkowlaniec Sep 5, 2024
2ef2b9a
Update validator.md
wjurkowlaniec Sep 5, 2024
eec2fb0
Delete Validator.md
wjurkowlaniec Sep 5, 2024
8279de3
Merge branch 'main' into performance
wjurkowlaniec Sep 5, 2024
fd474a6
Merge pull request #60 from safe-scan-ai/performance
notbulubula Sep 5, 2024
e9d84f0
miner fixes (#59)
konrad0960 Sep 5, 2024
cdb3aa6
Adding Melanoma.md (#62)
notbulubula Sep 5, 2024
96740a7
Release production (#86)
wjurkowlaniec Sep 11, 2024
c63fc94
validator documentation fixes
wjurkowlaniec Sep 11, 2024
3ff1d39
trld validator (#89)
wjurkowlaniec Sep 12, 2024
d6ba9f6
fix documentation
wjurkowlaniec Sep 13, 2024
b02cc8d
Merge pull request #91 from safe-scan-ai/docs_fix
notbulubula Sep 13, 2024
a28ecff
Fixing input sizes (#92)
notbulubula Sep 13, 2024
29df589
Sync retry mechanism (#93)
konrad0960 Sep 13, 2024
a3b84da
Update miner.py (#94)
StudioMax971 Sep 15, 2024
8279011
Setting version key (#102)
konrad0960 Sep 19, 2024
b27cce8
Extra wandb info for competitions, refactoring (#103)
wjurkowlaniec Sep 30, 2024
6a27d50
WIP Dev (#108)
wjurkowlaniec Dec 7, 2024
8983169
fix requirements (#122)
wjurkowlaniec Dec 13, 2024
a3af78d
Commit reveal update (#124)
konrad0960 Dec 30, 2024
4894472
Update versions (#127)
konrad0960 Mar 12, 2025
9104819
Refactor org data fetch (#130)
konrad0960 Mar 14, 2025
788305d
hf token fix (#134)
konrad0960 Mar 14, 2025
ca56dd4
Update validator.md
wjurkowlaniec Mar 16, 2025
5d5d50f
Update validator.md
wjurkowlaniec Mar 16, 2025
c9d810e
validator hotfixes (#135)
konrad0960 Mar 17, 2025
2e65d01
hf retry hotfix (#136)
konrad0960 Mar 17, 2025
9a2316e
get fresh packages from evaluting competition datasets (#137)
wjurkowlaniec Mar 17, 2025
bbce8b8
Update miner.md
wjurkowlaniec Mar 18, 2025
23eaa7a
Update miner.md
wjurkowlaniec Mar 18, 2025
e52a20a
fetch only zip files from datasets (#138)
wjurkowlaniec Mar 18, 2025
417eee3
Update min_compute.yml
wjurkowlaniec Mar 18, 2025
d08ed9f
Update min_compute.yml
wjurkowlaniec Mar 18, 2025
6f1f704
fixed timestamp issue (#139)
konrad0960 Mar 18, 2025
06b90ae
refactor of miner evaluation (#140)
konrad0960 Mar 19, 2025
08e832d
Fix model date checking + cleanup (#141)
wjurkowlaniec Mar 22, 2025
1e187ad
New rewarder mechanism - moving average
wjurkowlaniec Mar 28, 2025
06b85c4
download miner model fix (#146)
konrad0960 Mar 28, 2025
54a27af
slashing model copying (#147)
konrad0960 Apr 1, 2025
22691db
updated comp handler (#149)
konrad0960 Apr 1, 2025
32105a0
models and comp manager adjustments (#150)
konrad0960 Apr 2, 2025
e12ca38
fix dataset unpacking
wjurkowlaniec Apr 3, 2025
df19600
fix date comparisson (#151)
konrad0960 Apr 4, 2025
db1cb02
slashing mfs copiers 2 (#152)
konrad0960 Apr 8, 2025
2bf2bd5
Update config.py
konrad0960 Apr 10, 2025
0807999
rewarder fixed (#148)
wjurkowlaniec Apr 14, 2025
4e75c24
error handling for chain data fetch (#155)
konrad0960 Apr 16, 2025
766a61a
Wandb data rewrite + various optimizations (#154)
wjurkowlaniec Apr 17, 2025
45bba24
fixes
wjurkowlaniec Apr 17, 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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WANDB_API_KEY =
WANDB_BASE_URL="https://api.wandb.ai"
WANDB_SILENT="true"
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.py[cod]
*$py.class

.DS_Store
*.onnx

# C extensions
*.so

Expand Down Expand Up @@ -60,7 +63,7 @@ cover/
local_settings.py
db.sqlite3
db.sqlite3-journal

*.db
# Flask stuff:
instance/
.webassets-cache
Expand Down Expand Up @@ -163,3 +166,14 @@ testing/

# Editors
.vscode/settings.json
datasets
data
wandb
ecosystem.config.js


keys


local_datasets/
*.csv
14 changes: 14 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[MESSAGES CONTROL]
disable=W1203, # logging-fstring-interpolation
C0111, # missing-docstring
C0103, # invalid-name
C0114 # missing-module-docstring

[FORMAT]
max-line-length=120

[BASIC]
good-names=i,j,k,ex,Run,_,id,ge

[MASTER]
ignore=migrations
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

## 0.6.2

- Establish version_key to match weights_version subnet hyperparameter

## 0.6.1

- TLDR for validators
- Safe-Scan banner for validator script

## 0.6

- added blacklisting of miners
- various logic fixes
- protection from model copying
- chain synchtonization fixes
- fixes for miner CLI
- stability improvements

## 0.5.1

- Various fixes for miner script

## 0.5

- Initial release of the subnet code
68 changes: 68 additions & 0 deletions DOCS/COMPETITIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Safe Scan: Machine Learning Competitions for Cancer Detection

Welcome to **Safe Scan**, a platform dedicated to organizing machine learning competitions focused on cancer detection. Our goal is to foster innovation in developing accurate and efficient models for cancer detection using machine learning. Here, you will find all the details needed to participate, submit your models, and understand the evaluation process.

## Table of Contents

1. [Overview](#overview)
2. [Competition Trigger and Data Batch Handling](#competition-trigger-and-data-batch-handling)
3. [Model Submission Requirements](#model-submission-requirements)
4. [Evaluation and Scoring](#evaluation-and-scoring)
5. [Configuration and Development](#configuration-and-development)
6. [Command-Line Interface (CLI) Tools](#command-line-interface-cli-tools)
7. [Communication Channels](#communication-channels)
8. [Contribute](#contribute)

## Overview

Safe Scan organizes dynamic competitions focused on cancer detection using machine learning. These competitions provide participants with the opportunity to develop and test their models in a responsive and adaptive environment driven by real-world data.

## Competition Trigger and Data Batch Handling

- **Competition Initiation**: Competitions are triggered by data batch insertions from external medical institutions, creating a steady stream of new, non-public data for testing purposes.
- **Data Handling Process**: Medical institutions upload each new batch of data to a central reference repository on Hugging Face, along with a reference entry for the new data batch file.
- **Automatic Detection and Competition Start**: Validators monitor this centralized repository for new data batch entries. When new data is detected, validators initiate a competition by downloading and processing the data batch.

## Model Submission Requirements

- **Model Submission**: Participants, referred to as miners, must submit their trained models at the end of each competition.
- **Format**: All models must be in ONNX format. This ensures uniform testing and allows for broad deployment options, including on mobile and web platforms.
- **Training Code**: Each submission should include the code used for training the model to ensure transparency and reproducibility.
- **Upload Process**: Models are uploaded to Hugging Face at the end of each test. Miners then submit the Hugging Face repository link on the blockchain for evaluation by validators.
- **Timing Constraint**: Only models submitted at least 30 minutes before the competition start time are eligible for evaluation. This requirement ensures that models have not been retrained with the new data batch, maintaining fairness and integrity across the competition.

## Evaluation and Scoring

- **Independent Evaluation**: Each validator independently evaluates the submitted models according to predefined criteria.
- **Scoring Mechanism**: Detailed scoring mechanisms are outlined in the [DOCS](/DOCS/competitions) directory. Validators run scheduled competitions and assess the models based on these criteria.
- **Winning Criteria**: The best-performing model, according to the evaluation metrics, is declared the winner of the competition.
- **Rewards**: The winner receives the full emission for that competition, divided by the number of competitions held.
- **Rewards Time Decay**: If a miner stays in the top position for more than 30 days, their rewards start to decrease gradually. Every 7 days after the initial 30 days, their share of the rewards decreases by 10%. This reduction continues until their share reaches a minimum of 10% of the original reward.

## Command-Line Interface (CLI) Tools

- **Local Testing**: Miners are provided with an easy-to-use command-line interface (CLI) for local testing of their models. This tool helps streamline the process of testing models, uploading to Hugging Face, and submitting to the competition.
- **Automated Data Retrieval**: Code for automating the retrieval of training data for each competition is available to integrate with the model training process. The script is defined in [scripts/get_dataset.py](/scripts/get_dataset.py).

## Communication Channels

Stay connected and up-to-date with the latest news, discussions, and support:

- **Discord**: Join our [Safe Scan Discord channel](https://discord.gg/rbBu7WuZ) and the Bittensor Discord in the #safescan channel for real-time updates and community interaction.
- **Dashboard**: Access the competition dashboard on [Hugging Face](https://huggingface.co/spaces/safescanai/dashboard).
- **Blog**: Visit our [blog](https://safe-scan.ai/news/) for news and updates.
- **Twitter/X**: Follow us on [Twitter/X](https://x.com/SAFESCAN_AI) for announcements and highlights.
- **Email**: Contact us directly at [[email protected]](mailto:[email protected]) for any inquiries or support.

## Development

- **Software Lifecycle**: The project follows a structured software lifecycle, including Git flow and integration testing. These practices ensure robust development and encourage community contributions.


## Contribute

We welcome contributions to this project! Whether you're interested in improving our codebase, adding new features, or enhancing documentation, your involvement is valued. To contribute:

- Follow our software lifecycle and Git flow processes.
- Ensure all code changes pass integration testing.
- Contact us on our [Safe Scan Discord channel](https://discord.gg/rbBu7WuZ) for more details on how to get started.
75 changes: 75 additions & 0 deletions DOCS/COMPETITIONS.md.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@





# Safe Scan: Machine Learning Competitions for Cancer Detection

Welcome to **Safe Scan**, a platform dedicated to organizing machine learning competitions focused on cancer detection. Our goal is to foster innovation in developing accurate and efficient models for cancer detection using machine learning. Here, you can find all the details needed to participate, submit your models, and understand the evaluation process.

## Table of Contents

1. [Overview](#overview)
2. [Competition Schedule](#competition-schedule)
3. [Dataset and Model Submission](#dataset-and-model-submission)
4. [Evaluation and Scoring](#evaluation-and-scoring)
5. [Configuration and Development](#configuration-and-development)
6. [Command-Line Interface (CLI) Tools](#command-line-interface-cli-tools)
7. [Communication Channels](#communication-channels)
8. [Contribute](#contribute)

## Overview

Safe Scan organizes continuous competitions focused on cancer detection using machine learning. These competitions aim to advance the field by providing participants with the opportunity to develop and test their models in a structured environment.

## Competition Schedule

- **Frequency**: Competitions are held multiple times a day, at specific hours, continuously. This allows participants to join at different times that suit them best.
- **Timed Events**: Each competition starts with a dataset release 5 minutes before testing, providing a short window for participants to prepare.
- **Testing and Evaluation**: Models are evaluated immediately after each test, ensuring a quick feedback loop for participants.

## Dataset and Model Submission

- **Dataset Release**: A new dataset is provided for each competition, which is released exactly 5 minutes before testing begins. This dataset is used for training the models.
- **Model Submission**: Participants, referred to as "miners," are required to submit their trained models at the end of each competition.
- **Format**: All models must be in ONNX format. This ensures uniform testing and allows for broad deployment options, including on mobile and web platforms.
- **Training Code**: Each submission should include the code used for training the model to ensure transparency and reproducibility.
- **Upload Process**: Models are uploaded to Hugging Face at the end of each test. Miners then submit the Hugging Face repository link on the blockchain for evaluation by validators.

## Evaluation and Scoring

- **Independent Evaluation**: Each validator independently evaluates the submitted models according to predefined criteria.
- **Scoring Mechanism**: Detailed scoring mechanisms are outlined in the [DOCS](/DOCS/competitions) directory. Validators run scheduled competitions and assess the models based on these criteria.
- **Winning Criteria**: The best-performing model, according to the evaluation metrics, is declared the winner of the competition.
- **Rewards**: The winner receives the full emission for that competition, divided by the number of competitions held.
- **Rewards time decay**: If a miner stays at the top position for more than 30 days, their rewards start to decrease gradually. Every 7 days after the initial 30 days, their share of the rewards decreases by 10%. This reduction continues until their share reaches a minimum of 10% of the original reward.

## Configuration and Development

- **Competition Configuration**: Each competition is configured through a `competition_config.json` file. This file defines all parameters and rules for the competition and is used by both miners and validators.
- **Tracking Changes**: Changes to the competition configuration are tracked via a GitHub issue tracker, ensuring transparency and allowing for community input.
- **Software Lifecycle**: The project follows a structured software lifecycle, including Git flow and integration testing. This ensures robust development practices and encourages community contributions.

## Command-Line Interface (CLI) Tools

- **Local Testing**: Miners are provided with an easy-to-use command-line interface (CLI) for local testing of their models. This tool helps streamline the process of testing models, uploading to Hugging Face, and submitting to the competition.
- **Automated Data Retrieval**: Code for automating the retrieval of training data for each competition is available to integrate with the model training process. The script is defined in [scripts/get_dataset.py](/scripts/get_dataset.py).

## Communication Channels

Stay connected and up-to-date with the latest news, discussions, and support:

- **Discord**: Join our [Safe Scan Discord channel](https://discord.gg/rbBu7WuZ) and the Bittensor Discord in the #safescan channel for real-time updates and community interaction.
- **Dashboard**: Access the competition dashboard on [Hugging Face](https://huggingface.co/spaces/safescanai/dashboard).
- **Blog**: Visit our [blog](https://safe-scan.ai/news/) for news and updates.
- **Twitter/X**: Follow us on [Twitter/X](https://x.com/SAFESCAN_AI) for announcements and highlights.
- **Email**: Contact us directly at [[email protected]](mailto:[email protected]) for any inquiries or support.

## Contribute

We welcome contributions to this project! Whether you're interested in improving our codebase, adding new features, or enhancing documentation, your involvement is valued. To contribute:

- Follow our software lifecycle and Git flow processes.
- Ensure all code changes pass integration testing.
- Contact us on our [Safe Scan Discord channel](https://discord.gg/rbBu7WuZ) for more details on how to get started.

70 changes: 70 additions & 0 deletions DOCS/competitions/1-MELANOMA-V3.md.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Description of Melanoma Competition

## Overview
This competition invites participants to develop a machine learning model that **aids in detecting the possibility of melanoma**. The goal is to create a model that can identify patterns in data that are associated with an increased likelihood of melanoma in visual recognition.

### Objective
The primary objective is to develop a model that can analyze photos taken by users of their skin lesions or areas of concern.
The model should **assist users** by providing a risk assessment or likelihood score that helps them decide if they should seek further medical advice.
As a result, best model will be released in Skin Scan mobile app to run locally on the phone, and a website that will host it, free for anyone to use.

## Evaluation Criteria
Models will be evaluated based on described **performance metrics** of the model.
The evaluation will be calculaded on following metrics with described weights.

### Performance Metrics

The models will be assessed on the following metrics with the corresponding weights:

| **Metric** | **Description** | **Weight** |
|-------------|-------------------------------------------------------|------------|
| **F-beta** | Prioritizes recall, with a high beta to emphasize it. $\beta = 2$ | 0.60 |
| **Accuracy**| Measures the overall correctness of predictions. | 0.30 |
| **AUC** | Evaluates the model's ability to distinguish classes. | 0.10 |

### Mathematical Formulas

1. **F-beta Score $F\_\beta\$**


$$F_\beta = \left(1 + \beta^2\right) \cdot \frac{\text{Precision} \cdot \text{Recall}}{\left(\beta^2 \cdot \text{Precision}\right) + \text{Recall}}$$


Where:
- **$\beta$** is the weight of recall in the combined score
- in our case $\beta = 2$ for higher recall importance

2. **Accuracy**

$$\text{Accuracy} = \frac{\text{True Positives} + \text{True Negatives}}{\text{Total Number of Samples}}$$

3. **Area Under the Curve (AUC)**

AUC is the area under the Receiver Operating Characteristic (ROC) curve. It is calculated using the trapezoidal rule:

$$\text{AUC} = \int_0^1 \text{TPR} \, d(\text{FPR})$$

Where:
- **TPR** = True Positive Rate
- **FPR** = False Positive Rate


## Model Inputs and Outputs

### Inputs
- **Input Format**: Multiple images in JPEG or PNG format.
- **Input Features**: During preprocessing, images are resized to 224x224 pixels. Images are converted to numpy arrays with a datatype of `np.float32`, normalized to the range [0, 1].

### Outputs
- **Output Format**: A numerical value between 0 and 1, represented as a `float`. This value indicates the likelihood or risk score of the area of concern warranting further investigation.

### Submission Requirements
- **Model Submission**: Models must be submitted in ONNX format. They should be capable of handling dynamic batch sizes and accept inputs with the shape `(batch , 3 , 224 , 224)`, where `batch` represents the batch dimension. This ensures that the model can process a variable number of images in a single batch.


## Rules and Guidelines

- **Timeline**:
- Competitions are triggered dynamically by new data batch uploads from external medical institutions, with no predefined schedule. Competitions may occur at any time based on the timing of new data insertions.
- Each time a new data batch is detected in the central reference repository on Hugging Face, a new competition is initiated immediately by validators.
- Results of competition will be available on the dashboard
70 changes: 70 additions & 0 deletions DOCS/competitions/1-MELANOMA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Description of Melanoma Competition

## Overview
This competition invites participants to develop a machine learning model that **aids in detecting the possibility of melanoma**. The goal is to create a model that can identify patterns in data that are associated with an increased likelihood of melanoma in visual recognition.

### Objective
The primary objective is to develop a model that can analyze photos taken by users of their skin lesions or areas of concern.
The model should **assist users** by providing a risk assessment or likelihood score that helps them decide if they should seek further medical advice.
As a result, best model will be released in Skin Scan mobile app to run locally on the phone, and a website that will host it, free for anyone to use.

## Evaluation Criteria
Models will be evaluated based on described **performance metrics** of the model.
The evaluation will be calculaded on following metrics with described weights.

### Performance Metrics

The models will be assessed on the following metrics with the corresponding weights:

| **Metric** | **Description** | **Weight** |
|-------------|-------------------------------------------------------|------------|
| **F-beta** | Prioritizes recall, with a high beta to emphasize it. $\beta = 2$ | 0.60 |
| **Accuracy**| Measures the overall correctness of predictions. | 0.30 |
| **AUC** | Evaluates the model's ability to distinguish classes. | 0.10 |

### Mathematical Formulas

1. **F-beta Score $F\_\beta\$**


$$F_\beta = \left(1 + \beta^2\right) \cdot \frac{\text{Precision} \cdot \text{Recall}}{\left(\beta^2 \cdot \text{Precision}\right) + \text{Recall}}$$


Where:
- **$\beta$** is the weight of recall in the combined score
- in our case $\beta = 2$ for higher recall importance

2. **Accuracy**

$$\text{Accuracy} = \frac{\text{True Positives} + \text{True Negatives}}{\text{Total Number of Samples}}$$

3. **Area Under the Curve (AUC)**

AUC is the area under the Receiver Operating Characteristic (ROC) curve. It is calculated using the trapezoidal rule:

$$\text{AUC} = \int_0^1 \text{TPR} \, d(\text{FPR})$$

Where:
- **TPR** = True Positive Rate
- **FPR** = False Positive Rate


## Model Inputs and Outputs

### Inputs
- **Input Format**: Multiple images in JPEG or PNG format.
- **Input Features**: During preprocessing, images are resized to 224x224 pixels. Images are converted to numpy arrays with a datatype of `np.float32`, normalized to the range [0, 1].

### Outputs
- **Output Format**: A numerical value between 0 and 1, represented as a `float`. This value indicates the likelihood or risk score of the area of concern warranting further investigation.

### Submission Requirements
- **Model Submission**: Models must be submitted in ONNX format. They should be capable of handling dynamic batch sizes and accept inputs with the shape `(batch , 3 , 224 , 224)`, where `batch` represents the batch dimension. This ensures that the model can process a variable number of images in a single batch.


## Rules and Guidelines

- **Timeline**:
- Competitions are triggered dynamically by new data batch uploads from external medical institutions, with no predefined schedule. Competitions may occur at any time based on the timing of new data insertions.
- Each time a new data batch is detected in the central reference repository on Hugging Face, a new competition is initiated immediately by validators.
- Results of competition will be available on the dashboard
Binary file added DOCS/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading