Applying Neural Networks to Real Data

This demo shows how neural networks can be applied to real civil engineering datasets. Unlike simple demonstrations with synthetic data, you'll work with actual multi-feature regression problems from four civil engineering domains.

What You'll Learn:
  • How to configure neural network architecture for regression problems
  • Training neural networks epoch-by-epoch on real data
  • Comparing neural network performance against linear regression baselines
  • Making predictions in real-world units
  • Understanding how network weights evolve during training
Each dataset includes multiple normalized features and a single target variable, allowing you to explore how neural networks capture complex non-linear relationships.
Architecture & Training Tab:
• Select a dataset from the dropdown (Structures, Environment, Transport, Geotechnics)
• Configure the network: Add/remove hidden layers (max 3), adjust neurons per layer (1-10), choose activation functions
• Set the learning rate (default 0.01)
• Click "Train 1 Epoch" to train for one complete pass through the data
• Watch the loss decrease and network weights update in real-time
• Hover over edges in the network diagram to see weight values
• Use "Reset Weights" to restart training with the same architecture

Evaluate Test Set Tab:
• Click "Evaluate on Test Set" to compare neural network vs linear regression
• Review metrics (MSE, MAE, R²) for both models
• Lower MSE/MAE and higher R² indicate better performance

Manual Prediction Tab:
• Enter feature values in real-world units (e.g., kg/m³ for cement)
• Click "Use Sample" to auto-fill with a training example
• Click "Predict" to see both neural network and linear regression predictions
• All values are automatically normalized/denormalized for you
Network Diagram:
Blue nodes: Input features
Purple nodes: Hidden layer neurons
Green node: Output (prediction)
Edge thickness: Represents weight magnitude (thicker = larger absolute value)
Edge color: Positive weights (blue), negative weights (red)
Hover on edges: Shows exact weight value and connection
Hover on nodes: Shows bias value (hidden and output layers only)

Loss Chart:
• X-axis: Training epoch number
• Y-axis: Mean squared error on training data
• Should decrease as training progresses
• Flatten indicates convergence

Datasets:
Structures: Predict concrete strength from mix design
Environment: Predict wastewater treatment BOD
Transport: Predict electric vehicle pricing
Geotechnics: Predict soil uniformity coefficient
Getting Started:
• Start with 1 hidden layer of 4-6 neurons and ReLU activation
• Train for 10-20 epochs to see initial convergence
• Compare results with linear regression baseline in Evaluate tab

Architecture Design:
• More layers ≠ always better. Start simple, add complexity if needed
• ReLU is usually a good default activation function
• For these datasets, 1-2 hidden layers typically sufficient
• Too many neurons can lead to overfitting on small datasets

Training Tips:
• Learning rate 0.01 is a good starting point
• If loss oscillates, try reducing learning rate (e.g., 0.001)
• If loss decreases very slowly, try increasing learning rate
• Use "Clear History" to reset the chart without resetting weights

Troubleshooting:
• Loss not decreasing? Try resetting weights and retraining
• Loss becomes NaN? Reduce learning rate significantly
• Poor test performance? Network may be overfitting - try simpler architecture
• NN worse than linear? Dataset may have mostly linear relationships

Dataset Selection

Concrete Compressive Strength
Predict concrete compressive strength from mix design parameters. 4 features, 948 samples.
Features: Cement content, superplasticizer amount, concrete age, and water content
Target: Compressive strength in megapascals (MPa)
Note: All data is pre-normalized (mean=0, std=1)

Network Architecture

Architecture Configuration

Hidden Layers: 1
Layer 1:

Training Loss

Training Controls

0.0101
20
Training Progress
0 / 0
Epoch: 0 Training Loss: -

Model Evaluation

Compare the trained neural network against a multivariate linear regression baseline on the test set.

Model MSE MAE
Neural Network - - -
Linear Regression - - -

Make Predictions

Enter feature values in real-world units to make predictions with the trained models.

326
12.0
106
178

Neural Network Prediction

-

Linear Regression Prediction

-