Skip to content

Neural Networks for River Flow Prediction using MLPs. Custom implementation with multiple optimization algorithms, comprehensive data analysis, and professional documentation.

License

Notifications You must be signed in to change notification settings

dominichubble/neural-networks-river-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Neural Networks for River Flow Prediction

Python License Jupyter

A comprehensive implementation and comparison of artificial neural networks for predicting river flow using Multi-Layer Perceptrons (MLPs) with various optimization techniques.

🎯 Project Overview

This project demonstrates the application of artificial neural networks to environmental data analysis, specifically focusing on river flow prediction. The implementation includes multiple neural network architectures, training algorithms, and comprehensive performance analysis.

Key Features

  • Custom MLP Implementation: Built from scratch with sigmoid activation functions
  • Multiple Training Algorithms: Backpropagation, momentum, bold driver, and learning rate annealing
  • Comprehensive Data Processing: Interpolation, feature engineering, and multiple standardization methods
  • Advanced Visualization: Interactive plots, correlation matrices, and performance comparisons
  • Statistical Analysis: Bootstrap prediction intervals and model validation
  • Professional Reporting: Automated figure generation and results export

πŸ“Š Results Summary

The project successfully demonstrates:

  • High Prediction Accuracy: Best model achieved RΒ² > 0.85 on test data
  • Algorithm Comparison: Systematic evaluation of 6+ different training configurations
  • Feature Analysis: Correlation analysis and feature importance evaluation
  • Robust Validation: Cross-validation and prediction interval estimation

πŸš€ Quick Start

Option 1: Interactive Jupyter Notebook (Recommended)

# Clone the repository
git clone https://github.com/dominichubble/neural-networks-river-prediction.git
cd neural-networks-river-prediction

# Install dependencies
pip install -r requirements.txt

# Launch Jupyter and open the main analysis notebook
jupyter notebook AI_ANN_Coursework_Analysis.ipynb

Option 2: Command Line Execution

# Run the complete analysis
python main.py

πŸ“ Project Structure

β”œβ”€β”€ πŸ““ AI_ANN_Coursework_Analysis.ipynb    # Main interactive analysis notebook
β”œβ”€β”€ 🐍 main.py                            # Command-line interface
β”œβ”€β”€ πŸ“Š data/                              # Processed datasets and results
β”œβ”€β”€ 🧠 mlp/                               # Neural network implementation
β”‚   β”œβ”€β”€ mlp.py                           # Core MLP functions
β”‚   β”œβ”€β”€ network_training.py             # Training algorithms
β”‚   └── network_initialization.py       # Weight initialization
β”œβ”€β”€ πŸ”§ utils/                            # Utility modules
β”‚   β”œβ”€β”€ data_processor.py               # Data preprocessing
β”‚   β”œβ”€β”€ experiment_manager.py           # Experiment orchestration
β”‚   └── report_visualizer.py            # Visualization functions
β”œβ”€β”€ πŸ§ͺ evaluation/                       # Model evaluation tools
β”œβ”€β”€ πŸ“ˆ plots/                            # Generated visualizations
β”œβ”€β”€ πŸ“‹ requirements.txt                  # Python dependencies
└── πŸ“– README.md                         # This file

πŸ› οΈ Technical Implementation

Neural Network Architecture

  • Input Layer: Variable size based on feature engineering
  • Hidden Layers: Configurable (single/multiple layers)
  • Output Layer: Single node for regression
  • Activation: Sigmoid function with custom derivative

Training Algorithms

  1. Standard Backpropagation: Basic gradient descent
  2. Momentum: Accelerated convergence with momentum term
  3. Bold Driver: Adaptive learning rate adjustment
  4. Learning Rate Annealing: Exponential, linear, and cosine decay

Data Processing Pipeline

  1. Data Loading: Excel file parsing with pandas
  2. Interpolation: Missing value handling
  3. Feature Engineering: Time-based and statistical features
  4. Standardization: Multiple methods (robust, z-score, min-max)
  5. Train/Validation/Test Split: Temporal splitting for time series

πŸ“ˆ Performance Metrics

The models are evaluated using:

  • Mean Squared Error (MSE)
  • Root Mean Squared Error (RMSE)
  • Mean Absolute Error (MAE)
  • R-squared (RΒ²)
  • Training Time and Efficiency

πŸ“Š Visualizations

The project generates comprehensive visualizations including:

  • Data distribution and correlation analysis
  • Learning curves and training progress
  • Model performance comparisons
  • Prediction vs. actual scatter plots
  • Feature importance analysis
  • Bootstrap prediction intervals

πŸ”¬ Key Findings

  1. Robust standardization performed best for this dataset
  2. Momentum-based training showed superior convergence
  3. Feature engineering significantly improved prediction accuracy
  4. Model ensemble potential identified for future work

πŸ“š Dependencies

  • Core: numpy, pandas, matplotlib
  • Analysis: scipy, seaborn
  • UI: tqdm, jupyter
  • Data: openpyxl

πŸ‘” Portfolio Project

This project was developed as part of an AI/Neural Networks coursework and serves as a professional portfolio demonstration of machine learning expertise, software engineering skills, and data science capabilities.

πŸ“„ License

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

πŸ“¬ Contact

Dominic Hubble

πŸ’Ό For Employers

This project demonstrates:

  • Machine Learning Expertise: Custom neural network implementation from scratch
  • Software Engineering Skills: Clean, modular code with comprehensive documentation
  • Data Science Workflow: Complete pipeline from raw data to actionable insights
  • Technical Communication: Ability to explain complex concepts clearly
  • Professional Standards: Industry best practices and attention to detail

πŸ† Portfolio Showcase

This project demonstrates proficiency in:

  • βœ… Custom neural network implementation from mathematical foundations
  • βœ… Multiple optimization algorithm comparisons and analysis
  • βœ… Professional data science workflow with comprehensive documentation
  • βœ… Software engineering best practices with modular, maintainable code
  • βœ… Technical communication through clear explanations and visualizations

🎯 Key Achievements

  • High Accuracy: Achieved RΒ² > 0.85 on environmental prediction task
  • Algorithm Mastery: Implemented 6+ different training optimization techniques
  • Professional Quality: Industry-standard code organization and documentation
  • Complete Pipeline: End-to-end solution from raw data to deployment-ready model

This repository serves as a professional portfolio demonstration of machine learning and software engineering capabilities.

About

Neural Networks for River Flow Prediction using MLPs. Custom implementation with multiple optimization algorithms, comprehensive data analysis, and professional documentation.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published