HybridNet: Adaptive CNN-LSTM Fusion

A hybrid deep learning architecture combining CNNs and Bidirectional LSTMs with an adaptive gating mechanism for state-of-the-art CIFAR-10 classification.

AI/MLComputer VisionDeep Learning
# features

Key Features

Core technologies and system features.

Hybrid Architecture

Dual-stream CNN and Bi-LSTM network capturing both local spatial features and global dependencies.

Adaptive Fusion

Learned gating mechanism that dynamically weights CNN and LSTM feature maps based on input context.

Optimized Training

Advanced data augmentation and callback strategies (EarlyStopping, Checkpointing) for robust convergence.

Performance Tracking

Real-time accuracy/loss visualization and comprehensive confusion matrix analysis reaching 72%+.

# source

Project Source Code

Explore the primary logical modules.

EXPLORER
hybrid_fusion.py
srchybrid_fusion.py
1import tensorflow as tf
2 from tensorflow.keras import layers
3
4 class AdaptiveFusion(layers.Layer):
5 def __init__(self):
6 super(AdaptiveFusion, self).__init__()
7 self.gate = layers.Dense(1, activation='sigmoid')
8
9 def call(self, cnn_features, lstm_features):
10 # Flatten CNN features for gating
11 combined = tf.concat([cnn_features, lstm_features], axis=-1)
12 gate_weight = self.gate(combined)
13
14 # Weighted fusion: gate * CNN + (1-gate) * LSTM
15 fused = gate_weight * cnn_features + (1 - gate_weight) * lstm_features
16 return fused, gate_weight
# simulation

Live Simulation Output

Simulated console execution.

simulation
$_
# repositories

Source Code

GitHub repositories for this project.