Datasets:
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
- π Database Overview
- π¬ Disease Classes
- π Database Files
- π Usage
- π§ Model Architecture
- π Performance Characteristics
- π§ Technical Details
- π Use Cases
- π Data Privacy & Ethics
- π οΈ Building the Database
- π Future Enhancements
- π Citation
- π Contact & Support
- βοΈ License
- π About Gaston Software Solutions LLP
π₯ Health Imaging RAG Database
A comprehensive Retrieval-Augmented Generation (RAG) database for medical image analysis, built using DenseNet-121 deep learning model and FAISS vector search.
Developed by: Gaston Software Solutions LLP
Location: Ntinda, Kampala, Uganda
Contact: info@gss-tec.com
Website: www.gss-tec.com
π Database Overview
Statistics
- Total Images: 66,828 medical images
- Embedding Dimension: 1,024 features per image
- Model: DenseNet-121 (pretrained on ImageNet)
- Vector Index: FAISS (GPU-accelerated)
Dataset Distribution
| Dataset | Images | Classes | Description |
|---|---|---|---|
| Malaria | 55,116 | 2 | Cell images for malaria detection |
| Pneumonia | 11,712 | 2 | Chest X-rays for pneumonia diagnosis |
| Total | 66,828 | 4 | Combined medical imaging database |
π¬ Disease Classes
1. Malaria Detection (55,116 images)
- Parasitized: 27,558 images - Cells infected with malaria parasites
- Uninfected: 27,558 images - Healthy blood cells
2. Pneumonia Detection (11,712 images)
- NORMAL: 3,166 images - Healthy chest X-rays
- PNEUMONIA: 8,546 images - Chest X-rays showing pneumonia
π Database Files
The RAG database consists of three essential files:
1. embeddings.npy (261.05 MB)
- Format: NumPy array
- Shape: (66828, 1024)
- Content: DenseNet-121 feature vectors for all images
- Purpose: Dense vector representations for similarity search
2. metadata.json (17.20 MB)
- Format: JSON
- Content: Image metadata including:
image_path: Original file pathclass: Disease classificationdataset: Source dataset namefilename: Image filename
- Purpose: Linking search results back to original images
3. faiss_index.bin (261.05 MB)
- Format: FAISS binary index
- Type: IndexFlatIP (Inner Product)
- Content: Optimized vector search index
- Purpose: Fast similarity search across 66K+ images
π Usage
Loading the Database
import numpy as np
import faiss
import json
from pathlib import Path
# Load embeddings
embeddings = np.load('embeddings.npy')
# Load metadata
with open('metadata.json', 'r') as f:
metadata = json.load(f)
# Load FAISS index
index = faiss.read_index('faiss_index.bin')
print(f"Loaded {index.ntotal} vectors")
Performing Similarity Search
from PIL import Image
import torchvision.transforms as transforms
import torchvision.models as models
import torch
# Load DenseNet-121 model
model = models.densenet121(weights=models.DenseNet121_Weights.IMAGENET1K_V1)
model.classifier = torch.nn.Identity()
model.eval()
# Image preprocessing
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
])
# Extract features from query image
def extract_features(image_path):
img = Image.open(image_path).convert('RGB')
img_tensor = transform(img).unsqueeze(0)
with torch.no_grad():
features = model(img_tensor).numpy()
# Normalize
features = features / np.linalg.norm(features)
return features
# Search for similar images
query_features = extract_features('query_image.jpg')
k = 5 # Number of similar images to retrieve
distances, indices = index.search(query_features, k)
# Get results
for i, idx in enumerate(indices[0]):
result = metadata[idx]
print(f"{i+1}. {result['class']} - {result['filename']}")
print(f" Similarity: {distances[0][i]:.4f}")
π§ Model Architecture
DenseNet-121
- Architecture: Dense Convolutional Network
- Layers: 121 layers with dense connections
- Feature Dimension: 1,024
- Pretrained: ImageNet-1K
- Advantages:
- Better gradient flow through dense connections
- Parameter efficiency
- Strong feature extraction for medical images
- Proven performance on healthcare datasets
π Performance Characteristics
Search Performance
- Index Type: Flat (exact search)
- Distance Metric: Inner Product (cosine similarity)
- Search Speed: ~1ms per query (GPU)
- Accuracy: 100% (exact nearest neighbors)
Memory Requirements
- Total Size: ~539 MB (all three files)
- RAM for Loading: ~600 MB
- GPU Memory: ~500 MB (for model inference)
π§ Technical Details
Feature Extraction Pipeline
- Input: RGB medical images (variable sizes)
- Preprocessing:
- Resize to 256Γ256
- Center crop to 224Γ224
- Normalize with ImageNet statistics
- Model: DenseNet-121 (without classification layer)
- Output: 1,024-dimensional feature vector
- Normalization: L2 normalization for cosine similarity
Vector Index
- Algorithm: FAISS IndexFlatIP
- Normalization: L2-normalized vectors
- Similarity: Cosine similarity via inner product
- GPU Support: Yes (for faster search)
π Use Cases
1. Medical Image Retrieval
Find similar medical images based on visual features:
- Retrieve similar disease presentations
- Find reference cases for diagnosis
- Compare patient scans with historical data
2. Diagnostic Support
Assist healthcare professionals:
- Identify similar cases from database
- Provide visual references for rare conditions
- Support differential diagnosis
3. Research & Analysis
Enable medical research:
- Analyze disease patterns across large datasets
- Study visual similarities in medical conditions
- Build training datasets for ML models
4. Educational Tools
Support medical education:
- Create case study collections
- Build interactive learning tools
- Demonstrate disease variations
π Data Privacy & Ethics
Important Considerations
- Public Datasets: All images from publicly available Kaggle datasets
- De-identification: Ensure patient privacy in any deployment
- Clinical Use: This is a research tool, not for clinical diagnosis
- Validation: Always validate results with medical professionals
- Bias: Be aware of potential dataset biases
π οΈ Building the Database
The database was built using:
- Notebook:
Health_Imaging_RAG_Colab.ipynb - Platform: Google Colab with T4 GPU
- Processing Time: ~30-40 minutes
- Framework: PyTorch + FAISS
Datasets Sources (Kaggle)
paultimothymooney/chest-xray-pneumoniaiarunava/cell-images-for-detecting-malaria
π Future Enhancements
Planned Additions
- Skin disease images
- Brain tumor MRI scans
- Tuberculosis chest X-rays
- Additional disease categories
Technical Improvements
- Implement IVF index for faster search at scale
- Add metadata filtering capabilities
- Support for multi-modal queries
- Real-time feature extraction API
π Citation
If you use this database in your research, please cite:
@software{health_imaging_rag_2026,
author = {{Gaston Software Solutions LLP}},
title = {Health Imaging RAG Database},
year = {2026},
publisher = {GSS-LLP},
address = {Ntinda, Kampala, Uganda},
url = {https://www.gss-tec.com},
note = {Medical image retrieval system using DenseNet-121 and FAISS}
}
Please also cite the original datasets:
@dataset{pneumonia_xray,
author = {Paul Mooney},
title = {Chest X-Ray Images (Pneumonia)},
year = {2018},
publisher = {Kaggle},
url = {https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia}
}
@dataset{malaria_cells,
author = {Arunava},
title = {Cell Images for Detecting Malaria},
year = {2019},
publisher = {Kaggle},
url = {https://www.kaggle.com/datasets/iarunava/cell-images-for-detecting-malaria}
}
π Contact & Support
Gaston Software Solutions LLP
- Email: info@gss-tec.com
- Website: www.gss-tec.com
- Location: Ntinda, Kampala, Uganda
For technical support, questions, or collaboration opportunities, please contact us via email.
βοΈ License
MIT License
Copyright (c) 2026 Gaston Software Solutions LLP
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.
Intellectual Property Notice
This Health Imaging RAG Database is provided by Gaston Software Solutions LLP (GSS-LLP) under the MIT License for open-source use.
While the software is open-source and freely available for use, modification, and distribution under the MIT License terms, the intellectual property rights, including the database architecture, processing pipeline, and implementation methodology, remain the property of Gaston Software Solutions LLP.
Key Points:
- β Free to use, modify, and distribute under MIT License
- β Open-source for research and commercial applications
- β No warranty or liability from GSS-LLP
- β οΈ Intellectual property and methodology rights retained by GSS-LLP
- β οΈ Original datasets subject to their respective licenses
- β οΈ Medical use requires appropriate validation and regulatory compliance
Dataset Licenses
The underlying medical image datasets are sourced from Kaggle and are subject to their respective licenses. Users must comply with the original dataset licenses when using this RAG database. Please refer to:
- Pneumonia X-Ray Dataset: https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
- Malaria Cells Dataset: https://www.kaggle.com/datasets/iarunava/cell-images-for-detecting-malaria
π About Gaston Software Solutions LLP
Gaston Software Solutions LLP (GSS-LLP) is a technology company based in Ntinda, Kampala, Uganda, specializing in AI/ML solutions, software development, and data science applications for healthcare and other industries.
Our Mission: Leveraging cutting-edge technology to solve real-world problems and improve lives through innovative software solutions.
Services:
- AI/ML Model Development
- Healthcare Technology Solutions
- Custom Software Development
- Data Science Consulting
- RAG Systems & Vector Databases
Visit us at www.gss-tec.com or contact info@gss-tec.com for more information.
Last Updated: June 2026
Version: 1.0
Total Images: 66,828
Model: DenseNet-121
Developed by: Gaston Software Solutions LLP
License: MIT
- Downloads last month
- 12