NetAlpha
NetAlpha is a Python package designed to train a multi-branch Convolutional Neural Network (CNN) model that integrates ResNet50V2 and DenseNet169 architectures for superior image classification tasks.
Table of Contents
- Introduction
- Features
- Installation
- Usage
- Programmatic Usage
- Project Structure
- Documentation
- Contributing
- License
- Contact
- Acknowledgments
Introduction
NetAlpha offers a hybrid architecture combining the strengths of ResNet50V2 and DenseNet169 for high-performance image classification. By integrating these architectures, NetAlpha provides robust feature extraction and better generalization for diverse datasets.
Features
- Hybrid Architecture: Combines ResNet50V2 and DenseNet169 for enhanced feature extraction.
- Data Augmentation: Advanced augmentation techniques to improve model robustness.
- Early Stopping & Learning Rate Scheduling: Built-in callbacks for better training control.
- Command-Line Interface (CLI): Simplified training and configuration through CLI commands.
- Customizable Hyperparameters: Fine-tune learning rate, batch size, and more.
- Training Visualization: Plot training and validation metrics for better insights.
Installation
Prerequisites
- Python: Version 3.6 or higher.
- TensorFlow: Version 2.x or later.
- pip: Latest version recommended.
Installation via Pip
Install NetAlpha directly from PyPI:
pip install netalpha
Usage
Command-Line Interface
Once installed, you can use the netalpha_train command.
Basic Usage
netalpha_train --train_dir PATH_TO_TRAIN_DIR --val_dir PATH_TO_VAL_DIR [OPTIONS]
Options
--train_dir: (Required) Path to the training data directory.--val_dir: (Required) Path to the validation data directory.--epochs: Number of epochs (default: 50).--batch_size: Batch size (default: 8).--initial_lr: Initial learning rate (default: 1e-4).--output_dir: Directory to save model outputs (default:./).--plot: Add this flag to generate training plots.
Help
To see a detailed list of options, run:
netalpha_train --help
Examples
Example 1: Basic Training
netalpha_train --train_dir ./data/train --val_dir ./data/val --epochs 30 --batch_size 16
Example 2: Training with Custom Parameters
netalpha_train --train_dir ./data/train --val_dir ./data/val --epochs 40 --batch_size 32 --initial_lr 5e-5 --output_dir ./outputs --plot
Data Preparation
Organize your dataset as follows:
dataset/
├── train/
│ ├── class1/
│ │ ├── image1.jpg
│ │ ├── image2.jpg
│ │ └── ...
│ └── class2/
│ ├── image1.jpg
│ ├── image2.jpg
│ └── ...
└── val/
├── class1/
│ ├── image1.jpg
│ ├── image2.jpg
│ └── ...
└── class2/
├── image1.jpg
├── image2.jpg
└── ...
Programmatic Usage
NetAlpha can also be used in Python scripts:
from netalpha import build_model
# Build the model
model = build_model(input_shape=(224, 224, 3), num_classes=2)
# Compile the model
model.compile(
optimizer="adam",
loss="categorical_crossentropy",
metrics=["accuracy"]
)
# Train or evaluate as needed
Project Structure
netalpha/
├── netalpha/
│ ├── __init__.py
│ ├── model.py
│ └── utils.py
├── scripts/
│ └── train_model.py
├── setup.py
├── README.md
├── LICENSE
└── requirements.txt
Documentation
For detailed documentation, visit the GitHub repository.
Contributing
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Clone your fork:
git clone https://github.com/yourusername/netalpha.git
- Create a new branch:
git checkout -b feature/new-feature
- Commit your changes:
git commit -am "Add new feature"
- Push the branch:
git push origin feature/new-feature
- Open a pull request.
Reporting Issues
If you encounter any issues, please open an issue.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
- Author: Ihtesham Jahangir
- Email: ihteshamjahangir21@gmail.com
- GitHub: ihtesham-jahangir
Acknowledgments
- TensorFlow and Keras Teams: For their excellent frameworks.
- Researchers: Behind ResNet and DenseNet architectures.
- Open Source Community: For fostering innovation and collaboration.
This README provides detailed information about NetAlpha, making it easy for users to install, use, and contribute to the project.
Metadata
Release files for NetAlpha 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netalpha-0.1.7.tar.gz | 7.4 kB | Without provenance | Details for netalpha-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| NetAlpha-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for NetAlpha-0.1.7-py3-none-any.whl |
Total release size: 15.4 kB
Release files / netalpha-0.1.7.tar.gz
| Download URL | netalpha-0.1.7.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5701f563f63f80c178730e0aaf7fdae26a338b42c4a9070a3a2d46bebc2f03cc
|
|
BLAKE2b-256 checksum How to use checksums |
9d1a048ba28981923b734ce22bc4d3f80cdc3ecd3d1ea4407693d219fceb2b55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / NetAlpha-0.1.7-py3-none-any.whl
| Download URL | NetAlpha-0.1.7-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22adf487cdf17d2c1fdd04aa9e56bfe39cd916183922dbb0b5769a8388ef412b
|
|
BLAKE2b-256 checksum How to use checksums |
b740faf63ad76694979e4a9a02575ba0a205405e595237b3010ec42a1ad415d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for NetAlpha 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.