# shivammitra/fingerprint-based-blood-group-detection architecture

> Architecture diagram of the GitHub repository shivammitra/fingerprint-based-blood-group-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivammitra/fingerprint-based-blood-group-detection
- Repository: https://github.com/shivammitra/fingerprint-based-blood-group-detection

## Overview

This repository is a research/prototype system for predicting blood group from fingerprint imagery, with supporting model experiments and interpretability artifacts.

At a high level, the repo is organized around four subsystems:

1. Data package
- `Dataset/` contains eight compressed datasets, one per blood group class:
  - `A+.zip`, `A-.zip`, `AB+.zip`, `AB-.zip`, `B+.zip`, `B-.zip`, `O+.zip`, `O-.zip`
- This strongly suggests the core supervised-learning problem is an 8-class classification task.
- The zipped format indicates the raw images are likely stored externally from the code and unpacked for training or evaluation.

2. Model experimentation and training
- `fingerprint_detection/` contains Jupyter notebooks for multiple CNN architectures:
  - `Alexnet.ipynb`
  - `Lenet.ipynb`
  - `Resnet.ipynb`
  - `Vgg16.ipynb`
- These notebooks are likely where model-specific preprocessing, training, validation, and comparison happen.
- The architecture boundary here is “experiment notebooks per backbone,” rather than a single consolidated training service.
- The naming implies the repo compares several deep learning feature extractors on the same fingerprint dataset.

3. Prediction orchestration
- `ensemble_prediction.py` is likely the integration layer that combines outputs from the individual model experiments.
- This file probably serves as the main inference or aggregation script, taking predictions from multiple networks and producing a final blood-group classification.
- In the architecture, this sits above the single-model notebooks and represents the ensemble decision boundary.

4. Explainability and domain analysis
- `xai.py` suggests explainable AI tooling for model interpretation.
- `ridge_analysis/` contains one markdown document per blood group:
  - `blood_group_A+.md`, etc.
- This indicates the repo includes post hoc analysis focused on ridge features or fingerprint ridge patterns, likely used to connect model behavior with fingerprint characteristics.
- These artifacts are downstream of the trained models and are intended for interpretation/reporting rather than training.

Likely end-to-end data flow

- Fingerprint images are organized by blood-group label in `Dataset/`.
- Individual CNNs are trained and evaluated in the notebooks under `fingerprint_detection/`.
- Their outputs are combined in `ensemble_prediction.py` to produce the final class prediction.
- `xai.py` generates explanation outputs to show why a prediction was made.
- `ridge_analysis/*.md` captures class-specific qualitative analysis of ridge patterns or findings.

Repo boundaries and architecture style

- This is not a multi-service application; it is a machine-learning research repository.
- The main boundary is between:
  - raw data,
  - model training experiments,
  - prediction aggregation,
  - interpretability/reporting.
- The code appears to be organized for experimentation rather than production deployment.
- There is no evidence of a database, message broker, web backend, or external API integration in the file tree.

Relevant technologies implied by the structure

- Python for orchestration and analysis scripts.
- Jupyter notebooks for model development and experimentation.
- Deep learning CNN architectures for image classification.
- Markdown for analysis documentation.
- ZIP archives as the dataset distribution format.

If you are drawing an architecture diagram, the most accurate depiction would show:
- dataset archives as the input layer,
- multiple parallel model-training branches for AlexNet/LeNet/ResNet/VGG16,
- an ensemble aggregation layer,
- a separate explainability/analysis layer,
- and markdown-based ridge-analysis outputs as the final interpretive artifacts.

Main entry points: [`ensemble_prediction.py`](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/ensemble_prediction.py) (Ensemble), [`xai.py`](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/xai.py) (XAI), [`Dataset`](https://github.com/shivammitra/fingerprint-based-blood-group-detection/tree/main/Dataset) (Blood group data), [`fingerprint_detection/Alexnet.ipynb`](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Alexnet.ipynb) (AlexNet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data"]
  node_dataset_archives[("Blood group data<br/>dataset archive set")]
end

subgraph group_experiments["Model Experiments"]
  node_alexnet_nb["AlexNet<br/>cnn notebook<br/>[Alexnet.ipynb]"]
  node_lenet_nb["LeNet<br/>cnn notebook<br/>[Lenet.ipynb]"]
  node_resnet_nb["ResNet<br/>cnn notebook<br/>[Resnet.ipynb]"]
  node_vgg16_nb["VGG16<br/>cnn notebook<br/>[Vgg16.ipynb]"]
end

subgraph group_inference["Prediction"]
  node_ensemble_pred["Ensemble<br/>prediction script"]
  node_app_entry["App entry<br/>application script<br/>[app_1.py]"]
end

subgraph group_interpretability["Explainability"]
  node_xai_tooling["XAI<br/>explainability script<br/>[xai.py]"]
  node_ridge_docs["Ridge analysis<br/>markdown reports"]
end

node_dataset_archives -->|"train/eval data"| node_alexnet_nb
node_dataset_archives -->|"train/eval data"| node_lenet_nb
node_dataset_archives -->|"train/eval data"| node_resnet_nb
node_dataset_archives -->|"train/eval data"| node_vgg16_nb
node_alexnet_nb -->|"model output"| node_ensemble_pred
node_lenet_nb -->|"model output"| node_ensemble_pred
node_resnet_nb -->|"model output"| node_ensemble_pred
node_vgg16_nb -->|"model output"| node_ensemble_pred
node_ensemble_pred -->|"final prediction"| node_app_entry
node_ensemble_pred -->|"explain"| node_xai_tooling
node_alexnet_nb -.->|"inspect"| node_xai_tooling
node_lenet_nb -.->|"inspect"| node_xai_tooling
node_resnet_nb -.->|"inspect"| node_xai_tooling
node_vgg16_nb -.->|"inspect"| node_xai_tooling
node_xai_tooling -->|"report"| node_ridge_docs
node_dataset_archives -.->|"class context"| node_ridge_docs

click node_dataset_archives "https://github.com/shivammitra/fingerprint-based-blood-group-detection/tree/main/Dataset"
click node_alexnet_nb "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Alexnet.ipynb"
click node_lenet_nb "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Lenet.ipynb"
click node_resnet_nb "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Resnet.ipynb"
click node_vgg16_nb "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Vgg16.ipynb"
click node_ensemble_pred "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/ensemble_prediction.py"
click node_app_entry "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/app_1.py"
click node_xai_tooling "https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/xai.py"
click node_ridge_docs "https://github.com/shivammitra/fingerprint-based-blood-group-detection/tree/main/ridge_analysis"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset_archives toneBlue
class node_alexnet_nb,node_lenet_nb,node_resnet_nb,node_vgg16_nb toneAmber
class node_ensemble_pred,node_app_entry toneMint
class node_xai_tooling,node_ridge_docs toneRose
```

## Components

### Data

Compressed labeled fingerprint datasets for the 8 blood-group classes.

- [Blood group data](https://github.com/shivammitra/fingerprint-based-blood-group-detection/tree/main/Dataset): dataset archive set · Eight ZIP archives, one per blood-group class, used as the supervised-learning input. · `Dataset`

### Model Experiments

Notebook-based CNN training and evaluation branches.

- [AlexNet](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Alexnet.ipynb): cnn notebook · Experiment notebook for AlexNet-based fingerprint classification. · `fingerprint_detection/Alexnet.ipynb`
- [LeNet](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Lenet.ipynb): cnn notebook · Experiment notebook for LeNet-based fingerprint classification. · `fingerprint_detection/Lenet.ipynb`
- [ResNet](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Resnet.ipynb): cnn notebook · Experiment notebook for ResNet-based fingerprint classification. · `fingerprint_detection/Resnet.ipynb`
- [VGG16](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/fingerprint_detection/Vgg16.ipynb): cnn notebook · Experiment notebook for VGG16-based fingerprint classification. · `fingerprint_detection/Vgg16.ipynb`

### Prediction

Aggregation and application-facing prediction flow.

- [Ensemble](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/ensemble_prediction.py): prediction script · Combines model outputs into a final blood-group prediction. · `ensemble_prediction.py`
- [App entry](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/app_1.py): application script · Top-level application script for running the repo workflow. · `app_1.py`

### Explainability

Post hoc interpretation and ridge-pattern analysis artifacts.

- [XAI](https://github.com/shivammitra/fingerprint-based-blood-group-detection/blob/main/xai.py): explainability script · Explainability tooling for interpreting model predictions. · `xai.py`
- [Ridge analysis](https://github.com/shivammitra/fingerprint-based-blood-group-detection/tree/main/ridge_analysis): markdown reports · Class-specific ridge-analysis notes for all eight blood groups. · `ridge_analysis`

## Connections

- Blood group data → AlexNet: train/eval data · Fingerprint images feed the AlexNet experiment.
- Blood group data → LeNet: train/eval data · Fingerprint images feed the LeNet experiment.
- Blood group data → ResNet: train/eval data · Fingerprint images feed the ResNet experiment.
- Blood group data → VGG16: train/eval data · Fingerprint images feed the VGG16 experiment.
- AlexNet → Ensemble: model output · AlexNet predictions are one input to the ensemble.
- LeNet → Ensemble: model output · LeNet predictions are one input to the ensemble.
- ResNet → Ensemble: model output · ResNet predictions are one input to the ensemble.
- VGG16 → Ensemble: model output · VGG16 predictions are one input to the ensemble.
- Ensemble → App entry: final prediction · The ensemble is surfaced through the application entrypoint.
- Ensemble → XAI: explain · Prediction results are interpreted with XAI tooling.
- AlexNet → XAI: inspect · Individual model behavior may also be analyzed.
- LeNet → XAI: inspect · Individual model behavior may also be analyzed.
- ResNet → XAI: inspect · Individual model behavior may also be analyzed.
- VGG16 → XAI: inspect · Individual model behavior may also be analyzed.
- XAI → Ridge analysis: report · Explainability findings are captured in ridge-analysis notes.
- Blood group data → Ridge analysis: class context · The class-labeled dataset provides the domain context for the reports.
