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.
Metadata
Release files for fuzzy-rank-ensemble-torch 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fuzzy_rank_ensemble_torch-0.1.1.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / fuzzy_rank_ensemble_torch-0.1.1.tar.gz
| Download URL | fuzzy_rank_ensemble_torch-0.1.1.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1dbecdb2d82c740b906dbf3075601800a1557a54ad23c7eede4c24ef940d643
|
|
BLAKE2b-256 checksum How to use checksums |
9238dc64ff49fa7b787bd8b14e78d43266e091e3733ed55f95a132decb53fc9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2025.
Transparency logRelease files / fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl
| Download URL | fuzzy_rank_ensemble_torch-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
177170989f9c249fadd8347aba7617abf22559fbaa4826f1b742b8aeb8020ddb
|
|
BLAKE2b-256 checksum How to use checksums |
3ac47f794242c82c57a518a33268d8623fdb39f1225dc583a39d92dbafdb0b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2025.
Transparency log