A torch based package for fuzzy rank based ensembles
Project description
Fuzzy-Rank-Ensemble-Torch
A PyTorch-based implementation of a Fuzzy Rank-based Ensemble compatible with the MONAI framework for medical image segmentation and classification tasks.
The code is based on our papers:
- "A fuzzy rank-based ensemble of CNN models for MRI segmentation" published in Elseiver Biomedical Signal Processing and Control journal.
- "A Fuzzy Rank-based Ensemble of CNN Models for Classification of Cervical Cytology" published in Nature-Scientific Reports journal.
Installation
Basic Installation
pip install fuzzy-rank-ensemble-torch
With MONAI Support
pip install fuzzy-rank-ensemble-torch[monai]
Development Installation
git clone https://github.com/Digiratory/fuzzy-rank-ensemble-torch.git
cd fuzzy-rank-ensemble-torch
pip install -e .
Usage
Pure PyTorch Implementation
import torch
from fuzzy_rank_ensemble_torch import fuzzy_rank_ensemble
# Initialize prediction tensors from different models
# Shape: [Batch, Class Index]
# Inception v3 model predictions
inception_v3_pred = torch.tensor([[0.261, 0.315, 0.102, 0.286]])
# Xception model predictions
xception_pred = torch.tensor([[0.402, 0.347, 0.201, 0.050]])
# DenseNet-169 model predictions
densenet_169_pred = torch.tensor([[0.357, 0.467, 0.131, 0.045]])
# Apply fuzzy rank ensemble
result = fuzzy_rank_ensemble([inception_v3_pred, xception_pred, densenet_169_pred])
print(f"Ensemble Result: {result}")
MONAI Integration
import torch
from fuzzy_rank_ensemble_torch.monai import FuzzyRankBasedEnsemble
# Initialize models and predictions (same as above)
# ...
# Create ensemble instance
ens = FuzzyRankBasedEnsemble()
# Apply ensemble to predictions
result = ens([inception_v3_pred, xception_pred, densenet_169_pred])
# Verify result matches expected output
expected = torch.tensor([[1-0.4587, 1-0.4264, 1-0.5948, 1-0.5883]])
assert torch.allclose(result, expected, rtol=1e-03)
Also, you can use dictionary-based wrapper FuzzyRankBasedEnsembled.
Citation
If you use this software in your research, please cite our work:
@article{10.1016/j.bspc.2024.107342,
title = {A fuzzy rank-based ensemble of CNN models for MRI segmentation},
journal = {Biomedical Signal Processing and Control},
volume = {102},
pages = {107342},
year = {2025},
issn = {1746-8094},
doi = {10.1016/j.bspc.2024.107342},
url = {https://www.sciencedirect.com/science/article/pii/S1746809424014009},
author = {Valenkova, Daria and Lyanova, Asya and Sinitca, Aleksandr and Sarkar, Ram and Kaplun, Dmitrii},
}
@article{manna2021fuzzy,
title = {A fuzzy rank-based ensemble of CNN models for classification of cervical cytology},
author = {Manna, Ankur and Kundu, Rohit and Kaplun, Dmitrii and Sinitca, Aleksandr and Sarkar, Ram},
journal = {Scientific Reports},
volume = {11},
number = {1},
pages = {1--18},
year = {2021},
doi = {10.1038/s41598-021-93783-8},
publisher = {Nature Publishing Group}
}
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
This project is licensed under the Apache-2.0 license - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fuzzy_rank_ensemble_torch-0.1.1.tar.gz.
File metadata
- Download URL: fuzzy_rank_ensemble_torch-0.1.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1dbecdb2d82c740b906dbf3075601800a1557a54ad23c7eede4c24ef940d643
|
|
| MD5 |
2b56d7423afdf725d3b6db3e6bed8a45
|
|
| BLAKE2b-256 |
9238dc64ff49fa7b787bd8b14e78d43266e091e3733ed55f95a132decb53fc9c
|
Provenance
The following attestation bundles were made for fuzzy_rank_ensemble_torch-0.1.1.tar.gz:
Publisher:
python-publish.yml on Digiratory/fuzzy-rank-ensemble-torch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fuzzy_rank_ensemble_torch-0.1.1.tar.gz -
Subject digest:
d1dbecdb2d82c740b906dbf3075601800a1557a54ad23c7eede4c24ef940d643 - Sigstore transparency entry: 741512800
- Sigstore integration time:
-
Permalink:
Digiratory/fuzzy-rank-ensemble-torch@ab2a7c8593f7fe616d6bafbe6388d1e156f68b87 -
Branch / Tag:
refs/tags/release/0.1.1 - Owner: https://github.com/Digiratory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ab2a7c8593f7fe616d6bafbe6388d1e156f68b87 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
177170989f9c249fadd8347aba7617abf22559fbaa4826f1b742b8aeb8020ddb
|
|
| MD5 |
cbc38645b67a2872f7519763bd624d7c
|
|
| BLAKE2b-256 |
3ac47f794242c82c57a518a33268d8623fdb39f1225dc583a39d92dbafdb0b18
|
Provenance
The following attestation bundles were made for fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on Digiratory/fuzzy-rank-ensemble-torch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl -
Subject digest:
177170989f9c249fadd8347aba7617abf22559fbaa4826f1b742b8aeb8020ddb - Sigstore transparency entry: 741512815
- Sigstore integration time:
-
Permalink:
Digiratory/fuzzy-rank-ensemble-torch@ab2a7c8593f7fe616d6bafbe6388d1e156f68b87 -
Branch / Tag:
refs/tags/release/0.1.1 - Owner: https://github.com/Digiratory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ab2a7c8593f7fe616d6bafbe6388d1e156f68b87 -
Trigger Event:
release
-
Statement type: