SECTION 1: LEARNING OBJECTIVES

By the end of this lesson, you will be able to:

  • Understand the fundamental architecture of artificial neural networks – neurons, layers, activation functions, and backpropagation.

  • Distinguish between shallow and deep learning and explain why deep learning is particularly powerful for unstructured financial data.

  • Apply feedforward neural networks (Multi-Layer Perceptrons) to financial classification and regression problems.

  • Understand the role of activation functions – ReLU, Sigmoid, Tanh, and Softmax – and their appropriate applications.

  • Explain the backpropagation algorithm and how neural networks learn via gradient descent.

  • Implement dropout and batch normalisation to prevent overfitting in financial models.

  • Apply Long Short-Term Memory (LSTM) networks for time series forecasting and sequential financial data.

  • Understand Convolutional Neural Networks (CNNs) and their application to alternative data (charts, satellite images, text).

  • Implement neural networks using TensorFlow/Keras for a practical financial use case – credit default prediction and stock price forecasting.

  • Recognise the regulatory challenges of deep learning in banking – black-box nature, validation complexity, and explainability requirements.

  • Apply SHAP and LIME to interpret deep learning models for regulatory compliance.


SECTION 2: THE RISE OF DEEP LEARNING IN FINANCE

Deep learning (DL) has transformed financial analytics by enabling models to automatically learn hierarchical representations from raw data. Unlike traditional machine learning, which requires manual feature engineering, DL learns features directly from data.

Why deep learning matters in finance:

 
 
Challenge Traditional ML Deep Learning
High-dimensional data Struggles with >100 features Excels with thousands of features
Unstructured data Requires extensive preprocessing Learns directly from raw data (text, images, audio)
Non-linear relationships Captures some via kernels/ensembles Learns complex, hierarchical non-linearities
Time series (sequential) ARIMA, SARIMA, Prophet LSTMs capture long-term dependencies
Alternative data Manual feature extraction End-to-end learning from alternative sources

Key applications in banking and finance:

  1. Credit Scoring – Using alternative data (e.g., transaction history, social media, mobile data) to assess creditworthiness in emerging markets.

  2. Fraud Detection – Real-time anomaly detection on transaction sequences.

  3. Algorithmic Trading – Price prediction, sentiment analysis from news, and high-frequency trading.

  4. Customer Analytics – Churn prediction, next-best-offer recommendation.

  5. Risk Management – Portfolio risk forecasting, stress testing with scenario generation.

  6. Regulatory Compliance – AML (Anti-Money Laundering) transaction monitoring.

  7. Document Processing – Extracting information from financial documents (NLP) and cheque processing (computer vision).


SECTION 3: NEURAL NETWORK FUNDAMENTALS

3.1 The Perceptron – The Building Block

perceptron is the simplest neural network unit:

y=f(∑i=1nwixi+b)

  • xi = inputs

  • wi = weights

  • b = bias

  • f = activation function

3.2 Multi-Layer Perceptron (MLP)

An MLP consists of:

  • Input Layer – accepts the features.

  • Hidden Layers – one or more layers of neurons that learn representations.

  • Output Layer – produces the prediction (e.g., probability of default).

Forward Propagation:
For a layer l, the output of neuron j is:

aj(l)=f(∑iwji(l)ai(l−1)+bj(l))

where ai(l−1) are activations from the previous layer.

3.3 Activation Functions
 
 
Activation Formula Range Use Case
Sigmoid σ(x)=11+e−x (0,1) Output layer for binary classification
Tanh tanh⁡(x)=ex−e−xex+e−x (-1,1) Hidden layers (centered)
ReLU f(x)=max⁡(0,x) (0,∞) Hidden layers (most common)
Leaky ReLU f(x)=max⁡(0.01x,x) (-∞,∞) Prevents dead neurons
Softmax exi∑jexj (0,1) sum=1 Multi-class classification output

Why ReLU is preferred: It is computationally efficient, mitigates the vanishing gradient problem, and induces sparsity.

3.4 The Loss Function

For binary classification (default prediction), we use Binary Cross-Entropy:

L=−1n∑i=1n[yilog⁡(y^i)+(1−yi)log⁡(1−y^i)]

For regression (stock price prediction), we use Mean Squared Error:

L=1n∑i=1n(yi−y^i)2

3.5 Backpropagation – The Learning Algorithm

Backpropagation computes the gradient of the loss with respect to each weight using the chain rule. The gradients are then used to update weights via Gradient Descent:

wnew=wold−η∂L∂w

where η is the learning rate.

The Chain Rule (simplified for a single neuron):

∂L∂w=∂L∂a⋅∂a∂z⋅∂z∂w

  • z=wx+b (pre-activation)

  • a=f(z) (activation)

  • L is the loss

This process is repeated for millions of iterations, adjusting weights to minimise the loss.

3.6 Optimisation Algorithms
 
 
Algorithm Description Financial Use
SGD Standard gradient descent with mini-batches. Baseline; can be slow.
Adam Adaptive learning rate; combines momentum and RMSprop. Most popular; converges quickly.
RMSprop Adjusts learning rates per parameter. Good for non-stationary data.
Nadam Adam with Nesterov momentum. Slight improvement over Adam.

SECTION 4: ADVANCED NEURAL NETWORK ARCHITECTURES

4.1 Long Short-Term Memory (LSTM) for Time Series

Why we need LSTM: Standard feedforward networks cannot capture long-term dependencies in sequences. Recurrent Neural Networks (RNNs) have memory, but suffer from vanishing gradients.

LSTM architecture includes a cell state (long-term memory) and gates that control information flow:

  1. Forget Gate – decides what information to discard from the cell state.

  2. Input Gate – decides what new information to store.

  3. Output Gate – decides what information to output.

Equations (simplified):

ft=σ(Wf⋅[ht−1,xt]+bf)(Forget gate)it=σ(Wi⋅[ht−1,xt]+bi)(Input gate)C~t=tanh⁡(WC⋅[ht−1,xt]+bC)(Candidate cell state)Ct=ft⊙Ct−1+it⊙C~t(New cell state)ot=σ(Wo⋅[ht−1,xt]+bo)(Output gate)ht=ot⊙tanh⁡(Ct)(Hidden state)

Financial application: Forecasting stock prices, predicting loan default over time using payment history, fraud detection on transaction sequences.

4.2 Convolutional Neural Networks (CNNs) for Alternative Data

CNNs are designed for grid-like data (images, time-frequency representations). They use:

  • Convolutional layers – apply filters to detect local patterns.

  • Pooling layers – reduce dimensionality.

  • Fully connected layers – final classification/regression.

Financial applications:

  • Chart pattern recognition – identifying technical patterns (head and shoulders, cup and handle).

  • Satellite imagery analysis – counting cars in retail parking lots to predict sales.

  • Document processing – extracting information from scanned financial documents.

  • Time series classification – using 1D convolutions on time series data.

4.3 Transformer Models for Finance

Transformers, introduced in the “Attention is All You Need” paper, have revolutionised NLP and are now applied to finance:

  • Key innovation: Self-attention mechanisms that weigh the importance of different parts of the input.

  • Applications: Sentiment analysis of financial news, earnings call transcripts, regulatory filings.

  • Example: FinBERT – a BERT model fine-tuned on financial text.


SECTION 5: IMPLEMENTATION IN PYTHON – TENSORFLOW/KERAS

python
# ===================================================================
# MODULE 4, LESSON 7: DEEP LEARNING WITH TENSORFLOW/KERAS
# ===================================================================

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import roc_auc_score, classification_report, confusion_matrix
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers, models, callbacks
import shap
import warnings
warnings.filterwarnings('ignore')

# Set random seeds for reproducibility
np.random.seed(42)
tf.random.set_seed(42)

print("="*70)
print("DEEP LEARNING FOR CREDIT DEFAULT PREDICTION")
print("="*70)

# ----------------------------------------------------------------
# PART A: DATA PREPARATION (Using the same dataset as Lesson 1)
# ----------------------------------------------------------------

# Generate synthetic data (reusing from Lesson 1)
n_customers = 10000
income = np.random.gamma(5, 15, n_customers) + 20
age = np.random.normal(45, 12, n_customers).clip(18, 80)
debt_to_income = np.random.beta(2, 5, n_customers) * 60
credit_score = np.random.normal(700, 50, n_customers).clip(550, 850)
loan_amount = np.random.gamma(4, 50, n_customers) + 50

log_odds = -4.5 + 0.04 * debt_to_income - 0.005 * credit_score + 0.01 * (loan_amount/1000)
prob_default = 1 / (1 + np.exp(-log_odds))
default = np.random.binomial(1, prob_default, n_customers)

X = np.column_stack([income, age, debt_to_income, credit_score, loan_amount])
y = default

# Train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)

# Standardise
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)

print(f"Training samples: {len(X_train)}")
print(f"Test samples: {len(X_test)}")
print(f"Default rate (train): {y_train.mean():.4f}")

# ----------------------------------------------------------------
# PART B: BUILDING A FEEDFORWARD NEURAL NETWORK (MLP)
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART B: MULTI-LAYER PERCEPTRON (MLP)")
print("-"*60)

# Define the model architecture
model = keras.Sequential([
    layers.Dense(64, activation='relu', input_shape=(X_train_scaled.shape[1],)),
    layers.Dropout(0.3),  # Prevent overfitting
    layers.Dense(32, activation='relu'),
    layers.Dropout(0.2),
    layers.Dense(16, activation='relu'),
    layers.Dense(1, activation='sigmoid')  # Binary classification output
])

# Compile the model
model.compile(
    optimizer='adam',
    loss='binary_crossentropy',
    metrics=['accuracy', keras.metrics.AUC(name='auc')]
)

# Display architecture
model.summary()

# Early stopping to prevent overfitting
early_stop = callbacks.EarlyStopping(
    monitor='val_loss',
    patience=20,
    restore_best_weights=True,
    verbose=1
)

# Train the model
history = model.fit(
    X_train_scaled, y_train,
    epochs=100,
    batch_size=128,
    validation_split=0.2,
    callbacks=[early_stop],
    verbose=1
)

# Evaluate
train_loss, train_acc, train_auc = model.evaluate(X_train_scaled, y_train, verbose=0)
test_loss, test_acc, test_auc = model.evaluate(X_test_scaled, y_test, verbose=0)

print(f"\nTraining Results:")
print(f"  AUC: {train_auc:.4f}")
print(f"  Accuracy: {train_acc:.4f}")

print(f"\nTest Results:")
print(f"  AUC: {test_auc:.4f}")
print(f"  Accuracy: {test_acc:.4f}")

# ----------------------------------------------------------------
# PART C: VISUALISING TRAINING HISTORY
# ----------------------------------------------------------------

fig, axes = plt.subplots(1, 2, figsize=(14, 5))

# Loss
ax = axes[0]
ax.plot(history.history['loss'], label='Training Loss', linewidth=2)
ax.plot(history.history['val_loss'], label='Validation Loss', linewidth=2)
ax.set_xlabel('Epoch')
ax.set_ylabel('Loss')
ax.set_title('Training and Validation Loss')
ax.legend()
ax.grid(True, alpha=0.3)

# AUC
ax = axes[1]
ax.plot(history.history['auc'], label='Training AUC', linewidth=2)
ax.plot(history.history['val_auc'], label='Validation AUC', linewidth=2)
ax.set_xlabel('Epoch')
ax.set_ylabel('AUC')
ax.set_title('Training and Validation AUC')
ax.legend()
ax.grid(True, alpha=0.3)

plt.tight_layout()
plt.savefig('mlp_training_history.png', dpi=300)
plt.show()

# ----------------------------------------------------------------
# PART D: PREDICTIONS AND EVALUATION
# ----------------------------------------------------------------

# Predictions
y_pred_prob = model.predict(X_test_scaled, verbose=0).flatten()
y_pred_class = (y_pred_prob >= 0.5).astype(int)

# Confusion Matrix
cm = confusion_matrix(y_test, y_pred_class)

fig, ax = plt.subplots(figsize=(8, 6))
sns.heatmap(cm, annot=True, fmt='d', cmap='Blues',
            xticklabels=['No Default', 'Default'],
            yticklabels=['No Default', 'Default'],
            ax=ax)
ax.set_title('Confusion Matrix – MLP Neural Network', fontsize=14)
ax.set_ylabel('Actual')
ax.set_xlabel('Predicted')
plt.tight_layout()
plt.savefig('mlp_confusion_matrix.png', dpi=300)
plt.show()

# Classification Report
print("\nClassification Report:")
print(classification_report(y_test, y_pred_class, target_names=['No Default', 'Default']))

# ROC Curve
from sklearn.metrics import roc_curve, roc_auc_score

fpr, tpr, _ = roc_curve(y_test, y_pred_prob)
auc = roc_auc_score(y_test, y_pred_prob)

fig, ax = plt.subplots(figsize=(8, 6))
ax.plot(fpr, tpr, 'b-', linewidth=2, label=f'MLP (AUC={auc:.3f})')
ax.plot([0, 1], [0, 1], 'r--', linewidth=1, label='Random (AUC=0.5)')
ax.set_xlabel('False Positive Rate')
ax.set_ylabel('True Positive Rate')
ax.set_title('ROC Curve – MLP Neural Network')
ax.legend()
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('mlp_roc_curve.png', dpi=300)
plt.show()

# ----------------------------------------------------------------
# PART E: EXPLAINABILITY WITH SHAP (Regulatory Compliance)
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART E: MODEL EXPLAINABILITY WITH SHAP")
print("-"*60)

# Create a SHAP explainer for the neural network
# Use a smaller subset for speed
background = X_train_scaled[:100]

# Define a prediction function for SHAP
def predict_function(x):
    return model.predict(x, verbose=0).flatten()

# Create explainer using KernelSHAP (works with any black-box model)
explainer = shap.KernelExplainer(predict_function, background)

# Explain a few test samples
shap_values = explainer.shap_values(X_test_scaled[:50])

# Summary plot
feature_names = ['Income', 'Age', 'DTI', 'Credit Score', 'Loan Amount']

fig, ax = plt.subplots(figsize=(12, 6))
shap.summary_plot(shap_values, X_test_scaled[:50], feature_names=feature_names, show=False)
plt.title('SHAP Summary Plot – Neural Network Feature Impact', fontsize=14)
plt.tight_layout()
plt.savefig('mlp_shap_summary.png', dpi=300)
plt.show()

print("\nBusiness Insight from SHAP:")
print("  - Credit Score and DTI are the most important features.")
print("  - Higher DTI increases default risk (positive SHAP values).")
print("  - Higher Credit Score decreases default risk (negative SHAP values).")

# ----------------------------------------------------------------
# PART F: LSTM FOR TIME SERIES FORECASTING
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART F: LSTM FOR TIME SERIES FORECASTING")
print("-"*60)

# Generate synthetic stock price data
np.random.seed(42)
n_points = 1000
t = np.arange(n_points)

# Random walk with drift
returns = np.random.normal(0.0005, 0.015, n_points)
price = 100 * np.exp(np.cumsum(returns))

# Add some pattern
price += 5 * np.sin(2 * np.pi * t / 50)  # 50-day cycle

# Create sequences for LSTM (predict next day's price)
def create_sequences(data, seq_length):
    X_seq, y_seq = [], []
    for i in range(len(data) - seq_length):
        X_seq.append(data[i:i+seq_length])
        y_seq.append(data[i+seq_length])
    return np.array(X_seq), np.array(y_seq)

seq_length = 30
X_seq, y_seq = create_sequences(price, seq_length)

# Train-test split (80-20)
split_idx = int(0.8 * len(X_seq))
X_train_seq, X_test_seq = X_seq[:split_idx], X_seq[split_idx:]
y_train_seq, y_test_seq = y_seq[:split_idx], y_seq[split_idx:]

# Reshape for LSTM [samples, timesteps, features]
X_train_seq = X_train_seq.reshape(-1, seq_length, 1)
X_test_seq = X_test_seq.reshape(-1, seq_length, 1)

# Build LSTM model
lstm_model = keras.Sequential([
    layers.LSTM(50, activation='tanh', return_sequences=True, input_shape=(seq_length, 1)),
    layers.Dropout(0.2),
    layers.LSTM(25, activation='tanh'),
    layers.Dropout(0.2),
    layers.Dense(1)
])

lstm_model.compile(optimizer='adam', loss='mse', metrics=['mae'])

# Early stopping
early_stop_lstm = callbacks.EarlyStopping(
    monitor='val_loss',
    patience=20,
    restore_best_weights=True,
    verbose=1
)

# Train LSTM
history_lstm = lstm_model.fit(
    X_train_seq, y_train_seq,
    epochs=100,
    batch_size=32,
    validation_split=0.2,
    callbacks=[early_stop_lstm],
    verbose=0
)

# Predict
y_pred_lstm = lstm_model.predict(X_test_seq, verbose=0).flatten()

# Evaluate
from sklearn.metrics import mean_absolute_error, mean_squared_error

mae = mean_absolute_error(y_test_seq, y_pred_lstm)
rmse = np.sqrt(mean_squared_error(y_test_seq, y_pred_lstm))

print(f"LSTM Forecast Evaluation:")
print(f"  MAE:  {mae:.4f}")
print(f"  RMSE: {rmse:.4f}")

# Visualise LSTM predictions
fig, ax = plt.subplots(figsize=(14, 6))

# Plot actual vs predicted
ax.plot(y_test_seq[:100], 'b-', linewidth=1.5, label='Actual Price')
ax.plot(y_pred_lstm[:100], 'r--', linewidth=1.5, label='LSTM Predicted')
ax.set_title('LSTM Stock Price Prediction (First 100 Points)', fontsize=14)
ax.set_xlabel('Time Step')
ax.set_ylabel('Price')
ax.legend()
ax.grid(True, alpha=0.3)

plt.tight_layout()
plt.savefig('lstm_forecast.png', dpi=300)
plt.show()

# ----------------------------------------------------------------
# PART G: HYPERPARAMETER TUNING WITH KERASTUNER
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART G: HYPERPARAMETER TUNING (KerasTuner)")
print("-"*60)

# Note: This is a demonstration. Full tuning can be time-consuming.
# In practice, you would run this with more trials.

try:
    import keras_tuner as kt
    
    def build_model(hp):
        model = keras.Sequential()
        model.add(layers.Dense(
            units=hp.Int('units_1', min_value=32, max_value=128, step=32),
            activation='relu',
            input_shape=(X_train_scaled.shape[1],)
        ))
        model.add(layers.Dropout(hp.Float('dropout_1', 0.1, 0.4, step=0.1)))
        
        model.add(layers.Dense(
            units=hp.Int('units_2', min_value=16, max_value=64, step=16),
            activation='relu'
        ))
        model.add(layers.Dropout(hp.Float('dropout_2', 0.1, 0.4, step=0.1)))
        
        model.add(layers.Dense(1, activation='sigmoid'))
        
        model.compile(
            optimizer=keras.optimizers.Adam(
                hp.Choice('learning_rate', [1e-2, 1e-3, 1e-4])
            ),
            loss='binary_crossentropy',
            metrics=['accuracy', keras.metrics.AUC(name='auc')]
        )
        return model
    
    # For demonstration, we use a small number of trials
    tuner = kt.RandomSearch(
        build_model,
        objective='val_auc',
        max_trials=5,  # Increase for production
        executions_per_trial=1,
        directory='keras_tuner',
        project_name='credit_default'
    )
    
    tuner.search(
        X_train_scaled, y_train,
        epochs=30,
        validation_split=0.2,
        callbacks=[callbacks.EarlyStopping(monitor='val_loss', patience=10)],
        verbose=0
    )
    
    best_hps = tuner.get_best_hyperparameters(num_trials=1)[0]
    print(f"Best Hyperparameters:")
    print(f"  Units Layer 1: {best_hps.get('units_1')}")
    print(f"  Dropout 1: {best_hps.get('dropout_1')}")
    print(f"  Units Layer 2: {best_hps.get('units_2')}")
    print(f"  Dropout 2: {best_hps.get('dropout_2')}")
    print(f"  Learning Rate: {best_hps.get('learning_rate')}")
    
    # Build and train best model
    best_model = tuner.get_best_models(num_models=1)[0]
    test_auc_best = best_model.evaluate(X_test_scaled, y_test, verbose=0)[3]
    print(f"Test AUC with tuned model: {test_auc_best:.4f}")
    
except ImportError:
    print("KerasTuner not installed. Install with: pip install keras-tuner")
    print("Skipping hyperparameter tuning demonstration.")

# ----------------------------------------------------------------
# PART H: MODEL COMPARISON AND REGULATORY CONSIDERATIONS
# ----------------------------------------------------------------

print("\n" + "="*70)
print("PART H: MODEL COMPARISON & REGULATORY CONSIDERATIONS")
print("="*70)

comparison = pd.DataFrame({
    'Model': ['Logistic Regression', 'Random Forest', 'XGBoost', 'MLP (Neural Network)'],
    'Test AUC': [0.72, 0.78, 0.84, test_auc],
    'Interpretability': ['High', 'Low', 'Low', 'Very Low'],
    'Explainability Tools': ['Coefficients', 'Feature Importance', 'SHAP', 'SHAP/LIME'],
    'Regulatory Fit': ['Excellent', 'Moderate', 'Moderate', 'Poor (requires validation)']
})
print(comparison.to_string(index=False))

print("\nRegulatory Considerations for Deep Learning:")
print("  • SR 11-7: Deep learning is considered 'high complexity'.")
print("  • Requires extensive validation: feature importance, SHAP, and alternative benchmarks.")
print("  • Must demonstrate that the model is not 'black-box' – use LIME/SHAP for every prediction.")
print("  • Document the architecture, training process, and validation results thoroughly.")
print("  • Use in conjunction with simpler models (e.g., logistic regression) as a benchmark.")
print("  • For critical decisions (credit underwriting), many banks still prefer interpretable models.")

SECTION 6: KEY HYPERPARAMETERS AND TUNING

 
 
Hyperparameter Description Typical Range Tuning Strategy
Number of layers Depth of the network 2-5 (for finance) Start shallow; increase if needed.
Number of neurons Width of each layer 16-512 Powers of 2; use GridSearch or Bayesian optimisation.
Learning rate Step size in gradient descent 0.0001-0.01 Use learning rate schedules (e.g., ReduceLROnPlateau).
Batch size Samples per gradient update 32-256 Larger batches = faster but less stable.
Dropout rate Fraction of neurons to drop 0.1-0.5 Higher = more regularisation.
Activation function Non-linearity ReLU (hidden), Sigmoid/Softmax (output) Standard for most problems.
Optimiser Update rule Adam, SGD, RMSprop Adam is default for most finance problems.

SECTION 7: DEEP LEARNING IN PRODUCTION – CHALLENGES

 
 
Challenge Mitigation
Black-box nature Use SHAP, LIME, and Layer-wise Relevance Propagation (LRP).
Computational cost Use GPU acceleration; consider cloud services (AWS, GCP, Azure).
Overfitting Use dropout, batch normalisation, early stopping, and cross-validation.
Data requirements Deep learning requires large datasets. For small datasets, use transfer learning.
Regulatory acceptance Document thoroughly; provide benchmark comparisons with simpler models.
Model drift Monitor performance with PSI and AUC; implement automated retraining pipelines.
Explainability Provide SHAP explanations in model output reports for every decision.

SECTION 8: BUSINESS APPLICATIONS IN BANKING

 
 
Application DL Architecture Benefit
Credit Scoring (Alternative Data) MLP + LSTM Captures transaction history and non-linear relationships.
Fraud Detection LSTM + CNN Captures temporal patterns and transaction sequences.
Algorithmic Trading LSTM + Transformer Learns complex market dynamics.
Sentiment Analysis BERT/FinBERT Analyses news, social media, and earnings calls.
Document Processing CNN + RNN Extracts information from scanned financial documents.
Portfolio Optimisation Reinforcement Learning Learns optimal asset allocation strategies.
Stress Testing Generative Adversarial Networks (GANs) Generates realistic stress scenarios.

SECTION 9: SUMMARY FOR THE DATA PRACTITIONER

  • Neural networks learn hierarchical representations from data without manual feature engineering.

  • Activation functions (ReLU, Sigmoid, Softmax) introduce non-linearity; backpropagation enables learning.

  • LSTM networks are essential for sequential data (time series, transactions).

  • Dropout and early stopping are critical to prevent overfitting.

  • SHAP and LIME are mandatory for explainability in regulatory environments.

  • Deep learning outperforms traditional ML on large, complex datasets but requires more data, compute, and validation.

  • In banking, validate deep learning models extensively and always benchmark against simpler, interpretable models.


SECTION 10: RECOMMENDED NEXT STEPS

  1. Experiment with different architectures (more layers, different activation functions).

  2. Apply LSTM to a real-world financial time series (e.g., stock prices, exchange rates).

  3. Learn about attention mechanisms and Transformers for financial NLP.

  4. Explore Reinforcement Learning for portfolio optimisation and trading.

  5. Understand Generative Adversarial Networks (GANs) for synthetic data generation and stress testing.

  6. Prepare for the next lesson on Clustering and Unsupervised Learning.


[END OF LESSON 7 – MODULE 4]