NhanPhamThanh-IT
Neural-Network-Breast-Cancer-Classification
Jupyter Notebook

๐Ÿฉบ Advanced neural network for breast cancer classification using Wisconsin dataset. Analyzes cell nucleus characteristics from FNA samples to distinguish malignant/benign masses with 96.5% accuracy. Features comprehensive documentation, automated setup, testing framework, and deployment guides. Educational ML project with 15,000+ lines of docs.

Last updated Jan 19, 2026
16
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
1
Language breakdown
Jupyter Notebook 96.7%
Python 3.3%
โ–ธ Files click to expand
README

๐Ÿง  Neural Network Breast Cancer Classification

Python TensorFlow License Status

Advanced machine learning approach for automated breast cancer diagnosis using neural networks

๐Ÿ“Š Dataset โ€ข ๐Ÿ”ฌ Features โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“ˆ Results โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿšข Deployment โ€ข ๐Ÿงช Testing


๐Ÿš€ Quick Navigation

  • ๐Ÿƒ Get Started: Run python setup.py for automated setup
  • ๐Ÿ“– Learn: Explore comprehensive documentation (15,000+ lines)
  • ๐Ÿงช Train Model: Open models/training.ipynb in Jupyter
  • ๐Ÿšข Deploy: Check deployment guide for production
  • ๐Ÿค Contribute: Read contributing guidelines
  • โ“ Help: Check FAQ for common questions

๐ŸŽฏ Project Overview

This project implements a sophisticated neural network classifier for breast cancer diagnosis using the Wisconsin Breast Cancer Dataset. The system analyzes cell nucleus characteristics from Fine Needle Aspiration (FNA) samples to distinguish between malignant and benign breast masses with high accuracy.

๐ŸŒŸ Key Highlights

  • High Accuracy: Achieves 96.5% classification accuracy with comprehensive evaluation
  • Clinical Relevance: Based on real medical diagnostic procedures (FNA)
  • Deep Learning: Advanced neural network architectures with regularization
  • Comprehensive Documentation: 15,000+ lines of detailed documentation
  • Production Ready: Complete deployment pipeline from local to cloud
  • Educational Focus: Structured for learning with detailed explanations
  • Automated Setup: One-command project setup with environment verification
  • Testing Framework: Comprehensive testing with 90%+ coverage goals
  • Multiple Deployment Options: Jupyter, Web App, API, Docker, Cloud platforms

๐Ÿ”ฌ Medical Context

Breast cancer is the second most common cancer among women worldwide. Early detection through accurate diagnosis is crucial for successful treatment outcomes. This project leverages machine learning to assist medical professionals in making more consistent and accurate diagnoses based on quantitative cell nucleus analysis.

๐Ÿฉบ Fine Needle Aspiration (FNA)

The dataset is based on FNA samples, a minimally invasive procedure that:

  • Uses a thin needle to extract cell samples from breast masses
  • Provides cell nucleus characteristics for analysis
  • Enables computer-aided diagnosis to support medical decisions

๐Ÿ“Š Dataset

The Wisconsin Breast Cancer Dataset contains 569 samples with 30 features each, derived from digitized images of FNA samples. Each feature represents a characteristic of cell nuclei present in the image.

Feature Categories

  • Radius: Mean of distances from center to points on the perimeter
  • Texture: Standard deviation of gray-scale values
  • Perimeter: Nucleus perimeter measurements
  • Area: Nucleus area measurements
  • Smoothness: Local variation in radius lengths
  • Compactness: Perimeterยฒ / area - 1.0
  • Concavity: Severity of concave portions of the contour
  • Concave Points: Number of concave portions of the contour
  • Symmetry: Nucleus symmetry measurements
  • Fractal Dimension: "Coastline approximation" - 1
Each category includes:
  • Mean: Average value
  • Standard Error: Standard error of the mean
  • Worst: Mean of the three largest values

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip package manager
  • Jupyter Notebook (optional, for interactive analysis)

Installation

  • Clone the repository
git clone https://github.com/NhanPhamThanh-IT/Neural-Network-Breast-Cancer-Classification.git
   cd Neural-Network-Breast-Cancer-Classification
  • Automated Setup (Recommended)
python setup.py

This automated script will:

- โœ… Check Python version (3.8+ required) - ๐Ÿ“ฆ Install all dependencies from requirements.txt - ๐Ÿ” Verify package installations - ๐Ÿงช Test imports and functionality - ๐Ÿค– Check TensorFlow GPU availability - ๐Ÿ““ Set up custom Jupyter kernel - ๐Ÿ“ Create necessary project directories - ๐ŸŽ‰ Provide next steps guidance

  • Manual Setup (Alternative)
# Create virtual environment (recommended)
   python -m venv venv
   # Windows
   venv\Scripts\activate
   # macOS/Linux
   source venv/bin/activate

# Install dependencies pip install -r requirements.txt

# For development (optional) pip install -r requirements-dev.txt

๐Ÿƒโ€โ™‚๏ธ Running the Project

Option 1: Automated Setup (Recommended)

python setup.py

This script will automatically:

  • Check Python version compatibility
  • Install all required dependencies
  • Verify package installations
  • Set up Jupyter kernel
  • Create necessary directories
  • Run basic functionality tests

Option 2: Manual Setup

  • Install dependencies
pip install -r requirements.txt
  • Launch Jupyter Notebook
jupyter notebook
  • Open the training notebook
- Navigate to models/training.ipynb - Run all cells to train and evaluate the model
  • Explore the results
- View model performance metrics - Analyze feature importance - Examine prediction confidence

๐Ÿ”ง Project Structure

Neural-Network-Breast-Cancer-Classification/
โ”œโ”€โ”€ ๐Ÿ“ docs/                          # Comprehensive documentation
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ dataset.md                 # Dataset analysis and medical context (1,237 lines)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ neural-network.md          # Neural network theory and implementation (875 lines)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ pandas.md                  # Data manipulation guide (875 lines)
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ tensorflow.md              # TensorFlow implementation reference (897 lines)
โ”œโ”€โ”€ ๐Ÿ“ models/                        # Model training and data
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ training.ipynb             # Main training notebook (46 cells)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“Š breastcancerdataset.csv  # Wisconsin Breast Cancer Dataset
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ saved_models/              # Trained model files (created during training)
โ”‚   โ””โ”€โ”€ ๐Ÿ“ checkpoints/               # Training checkpoints (created during training)
โ”œโ”€โ”€ ๐Ÿ“ logs/                          # Training logs and metrics (auto-created)
โ”œโ”€โ”€ ๐Ÿ“ outputs/                       # Generated outputs and results (auto-created)
โ”œโ”€โ”€ ๐Ÿ“ plots/                         # Visualization plots (auto-created)
โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt               # Production dependencies
โ”œโ”€โ”€ ๐Ÿ“„ requirements-dev.txt           # Development and testing dependencies
โ”œโ”€โ”€ ๐Ÿ“„ setup.py                       # Automated project setup script (250+ lines)
โ”œโ”€โ”€ ๐Ÿ“„ README.md                      # Project overview (this file)
โ”œโ”€โ”€ ๐Ÿ“„ CONTRIBUTING.md                # Comprehensive contribution guidelines
โ”œโ”€โ”€ ๐Ÿ“„ CHANGELOG.md                   # Version history and release notes
โ”œโ”€โ”€ ๐Ÿ“„ API.md                         # Complete API documentation (800+ lines)
โ”œโ”€โ”€ ๐Ÿ“„ TESTING.md                     # Testing framework and strategies (1,000+ lines)
โ”œโ”€โ”€ ๐Ÿ“„ DEPLOYMENT.md                  # Deployment guide from local to cloud (1,200+ lines)
โ”œโ”€โ”€ ๐Ÿ“„ FAQ.md                         # Frequently asked questions (800+ lines)
โ”œโ”€โ”€ ๐Ÿ“„ PROJECT_STRUCTURE.md           # Detailed project organization guide
โ”œโ”€โ”€ ๐Ÿ“„ PROJECT_SUMMARY.md             # Complete project overview and highlights
โ””โ”€โ”€ ๐Ÿ“„ LICENSE                        # MIT License

๐Ÿ“Š Documentation Statistics

  • Total Documentation: 15,000+ lines across multiple files
  • Comprehensive Guides: 4 detailed technical guides in docs/
  • API Reference: Complete API documentation with examples
  • Testing Documentation: Full testing framework and best practices
  • Deployment Guide: From local development to cloud production

๐Ÿง  Neural Network Architecture

The model implements a sophisticated deep learning architecture:

  • Input Layer: 30 features (cell nucleus characteristics)
  • Hidden Layers: Multiple dense layers with dropout for regularization
  • Activation Functions: ReLU for hidden layers, Sigmoid for output
  • Optimization: Adam optimizer with adaptive learning rate
  • Loss Function: Binary crossentropy for binary classification

Model Features

  • Dropout Regularization: Prevents overfitting
  • Batch Normalization: Stabilizes training
  • Early Stopping: Prevents overtraining
  • Learning Rate Scheduling: Adaptive learning rate adjustment

๐Ÿ“ˆ Results

Performance Metrics

| Metric | Score | | ------------- | ----- | | Accuracy | 96.5% | | Precision | 95.8% | | Recall | 97.2% | | F1-Score | 96.5% | | AUC-ROC | 0.987 |

Key Insights

  • Most Important Features: Worst perimeter, worst area, worst concave points
  • Model Robustness: Consistent performance across different data splits
  • Clinical Relevance: Results align with medical understanding of cancer characteristics

๐Ÿ”ฌ Features

๏ฟฝ Automated Setup

  • One-Command Setup: python setup.py handles everything
  • Environment Verification: Python version and dependency checks
  • GPU Detection: Automatic TensorFlow GPU configuration detection
  • Jupyter Integration: Custom kernel setup for the project
  • Directory Creation: Automatic creation of necessary project directories

๏ฟฝ๐Ÿ“Š Data Analysis

  • Comprehensive exploratory data analysis
  • Statistical correlation analysis
  • Feature importance ranking
  • Data visualization and insights
  • Medical context integration

๐Ÿค– Machine Learning

  • Deep neural network implementation
  • Advanced preprocessing pipeline
  • Cross-validation and model selection
  • Hyperparameter optimization
  • Regularization techniques (Dropout, Batch Normalization)

๐Ÿ“ˆ Evaluation

  • Multiple performance metrics
  • Confusion matrix analysis
  • ROC curve and AUC analysis
  • Model interpretability features
  • Comprehensive testing framework

๐Ÿ› ๏ธ Engineering

  • Modular and maintainable code
  • Comprehensive documentation (15,000+ lines)
  • Production-ready implementation
  • Easy reproducibility
  • CI/CD ready with testing framework

๐ŸŒ Deployment Options

  • Local Development: Jupyter notebook interface
  • Web Application: Flask-based web interface
  • API Deployment: RESTful API with health checks
  • Docker: Containerized deployment
  • Cloud Platforms: AWS, GCP, Azure deployment guides
  • Model Serving: TensorFlow Serving for production

๐Ÿ“– Documentation

Comprehensive documentation is available throughout the project:

๐Ÿ“š Core Documentation (docs/)

๐Ÿ”ง Development Documentation

๐Ÿ“‹ Project Information

๐ŸŽฏ Educational Value

This project serves as a comprehensive learning resource for:

  • Machine Learning Students: Complete ML pipeline implementation
  • Medical AI Researchers: Healthcare applications and considerations
  • Data Scientists: Professional-grade project structure and documentation
  • Software Engineers: Production deployment and testing strategies

๐Ÿค Contributing

We welcome contributions! This project includes comprehensive guidelines for contributors.

๐Ÿ“‹ Quick Contributing Steps

  • Fork the repository
  • Create a feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

๐Ÿ“– Comprehensive Guidelines

Please read our detailed guides:

๐Ÿ”ง Development Setup

# Clone and setup development environment
git clone https://github.com/NhanPhamThanh-IT/Neural-Network-Breast-Cancer-Classification.git
cd Neural-Network-Breast-Cancer-Classification

Run automated setup

python setup.py

Install development dependencies

pip install -r requirements-dev.txt

Run tests

pytest

Format code

black . flake8 .

๐Ÿ’ก Contribution Areas

  • ๐Ÿ› Bug Reports: Report issues or unexpected behavior
  • ๐Ÿ’ก Feature Requests: Suggest improvements or new features
  • ๐Ÿ“ Documentation: Improve or expand documentation
  • ๐Ÿงช Testing: Add or improve tests
  • ๐Ÿ”ง Code: Fix bugs or implement new features
  • ๐Ÿ“Š Data Analysis: Improve data processing or analysis
  • ๐Ÿค– Model Improvements: Enhance neural network architecture

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add comprehensive docstrings
  • Include unit tests for new features
  • Update documentation as needed
  • Use conventional commit messages

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • University of Wisconsin: For providing the breast cancer dataset
  • Medical Community: For advancing computer-aided diagnosis research
  • Open Source Community: For the amazing tools and libraries
  • Contributors: Thank you to all who contribute to this educational resource

โš•๏ธ Medical Disclaimer

Important: This project is for educational and research purposes only. It should never be used for actual medical diagnosis or treatment decisions. Always consult qualified healthcare professionals for medical advice, diagnosis, or treatment.

๐ŸŽ“ Educational Impact

This project serves multiple educational purposes:

  • Academic Research: Baseline implementation for medical AI research
  • Learning Resource: Complete ML pipeline for students and professionals
  • Best Practices: Professional-grade project structure and documentation
  • Industry Reference: Production-ready deployment strategies

๐Ÿ“Š Project Statistics

  • 15,000+ lines of comprehensive documentation
  • Production-ready deployment configurations
  • Comprehensive testing framework with 90%+ coverage goals
  • Multi-platform support (Windows, macOS, Linux)
  • Cloud deployment ready (AWS, GCP, Azure)
  • Educational focus with detailed explanations throughout

๐Ÿ“ž Contact

Nhan Pham Thanh


โญ Star this repository if you find it helpful!

Made with โค๏ธ for advancing medical AI research

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท NhanPhamThanh-IT/Neural-Network-Breast-Cancer-Classification ยท Updated daily from GitHub