Deformation-aware LSTM (DT-LSTM) is a recurrent neural module that integrates deformable convolutions to adaptively adjust spatial receptive fields, enhancing robustness to geometric deformations in sequential visual data.
The architecture replaces fixed input-to-state convolutions with learned offset-based deformable convolutions, achieving state-of-the-art performance (98.8% accuracy on GEMEP) on human body emotion recognition tasks.
Its training protocol uses cross-entropy loss with He-normal initialization and Adam optimization, ensuring effective end-to-end learning for adaptive spatio-temporal feature integration.
Deformation-aware Long Short-Term Memory networks (DT-LSTM) are a class of recurrent neural modules designed to enhance robustness to geometric deformations (such as scaling and rotation) in sequential visual data. By integrating deformable convolutions into the input-to-state transitions of ConvLSTM cells, DT-LSTM enables adaptive spatio-temporal modeling for tasks including human body emotion recognition in videos of arbitrary length (Tahghighi et al., 2020).
1. Architectural Principles of DT-LSTM
DT-LSTM modifies the standard ConvLSTM cell by incorporating deformable convolutions (⊗) in place of fixed convolutions (∗) for input-to-state transformations. Given input tensor Xt∈RC×H×W, previous hidden state Ht−1∈RC′×H×W, and previous cell state Ct−1∈RC′×H×W, the cell computes:
Here, σ(⋅) denotes the sigmoid function, tanh(⋅) the hyperbolic tangent, and ∘ the Hadamard (elementwise) product. All state-to-state transitions utilize standard convolutions, whereas the input-to-state transitions for the input and candidate gates (it and gt) utilize deformable convolutions with offsets Δp learned at each time step by a lightweight offset network (Tahghighi et al., 2020).
2. Deformable Convolution Formulation
The deformable convolution operation replaces fixed-grid sampling with spatially adaptive sampling. For a convolution weight kernel Ht−1∈RC′×H×W0 over a standard receptive field Ht−1∈RC′×H×W1 (e.g., Ht−1∈RC′×H×W2), standard convolution computes:
Ht−1∈RC′×H×W3
In deformable convolution, the sampling locations are perturbed by learned offsets Ht−1∈RC′×H×W4:
Ht−1∈RC′×H×W5
Off-grid sampling is handled by bilinear interpolation. The set of offsets Ht−1∈RC′×H×W6 is produced via a learnable offset subnetwork Ht−1∈RC′×H×W7:
Ht−1∈RC′×H×W8
where Ht−1∈RC′×H×W9 and Ct−1∈RC′×H×W0 are the weights of a Ct−1∈RC′×H×W1 convolution outputting Ct−1∈RC′×H×W2 offset maps per input location (Tahghighi et al., 2020).
3. Offset Subnetwork and Gate-specific Adaptation
For each gate Ct−1∈RC′×H×W3, the corresponding offset network produces gate-specific offsets per time step:
Ct−1∈RC′×H×W4
Each spatial location Ct−1∈RC′×H×W5 thus possesses Ct−1∈RC′×H×W6 learned 2D offsets. These offsets deform the regular grid Ct−1∈RC′×H×W7 in the deformable convolution, yielding gate-adaptive spatial behavior. This architectural design enables the cell to locally adapt the spatial receptive fields of feature integration, increasing tolerance to geometric image transformation (Tahghighi et al., 2020).
4. Training Protocol and Initialization
DT-LSTM models are trained end-to-end with a standard cross-entropy loss over target classes. All convolutional kernels—including deformable and offset networks—utilize He-normal initialization. Offset biases are initialized to zero, ensuring initial behavior matches a standard convolution. Ct−1∈RC′×H×W8 regularization (weight decay coefficient Ct−1∈RC′×H×W9) is applied for all learnable parameters. The Adam optimizer is employed with an initial learning rate of it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)0, decayed by a factor of it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)1 every 20 epochs, with early stopping based on validation accuracy (Tahghighi et al., 2020).
5. Experimental Configuration and Workflow
The GEMEP corpus (145 clips, 17 emotion categories) serves as the primary testbed. Video preprocessing includes:
Uniform temporal sampling with jitter (T=32 frames per clip)
Frame resizing (from it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)2 to it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)3)
Data augmentation: random translations (it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)4 pixels), rotations (it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)5), brightness shifts, and Gaussian blur
This yields approximately 9,052 augmented video clips, partitioned 80%/20% for training/validation. The network architecture comprises:
3D-CNN block (it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)6D convolution + pooling) for short-term spatio-temporal features
Three DT-LSTM cells applied at frame indices it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)7, propagating hidden states temporally
Shallow 2D CNN (it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)8 conv + average pooling) over it=σ(Wxi⊗ΔptiXt+Whi∗Ht−1+bi)ft=σ(Wxf∗Xt+Whf∗Ht−1+bf)gt=tanh(Wxg⊗ΔptgXt+Whg∗Ht−1+bg)ot=σ(Wxo∗Xt+Who∗Ht−1+bo)Ct=ft∘Ct−1+it∘gtHt=ot∘tanh(Ct)9 for spatial feature extraction
Fully-connected layer with softmax activation for 17-way emotion classification
Pseudocode for the DT-LSTM cell and the end-to-end training loop is provided in the original work, specifying distinct offset computations per gate and detailed sequential data flow (Tahghighi et al., 2020).
6. Empirical Performance and Application
DT-LSTM achieves 98.8% accuracy for whole human body emotion recognition on the GEMEP dataset validation set, establishing state-of-the-art performance within the experimental context. The framework is tailored for robust emotion analysis from body pose and motion, directly addressing the challenge of intra-class variability due to pose and geometric deformation. The deformation-aware mechanism enables the model to generalize across diverse visual appearances and movement styles, a key advantage over prior approaches focusing only on static or facial information (Tahghighi et al., 2020).
7. Implementation Highlights and Pseudocode
The following table summarizes principal computational blocks as instantiated in the DT-LSTM approach:
Block
Operation Type
Distinguishing Feature
Offset Subnet
2D Convolution
Outputs σ(⋅)1 offsets per spatial position
Input-to-state
Deformable Convolution
Per-gate, per-timestep learned offsets
State-to-state
Standard 2D Convolution
Fixed convolutional neighborhoods
Training pseudocode:
σ(⋅)3
The DefConvLSTMCell operation involves offset generation (per gate, via σ(⋅)2) and deformable convolution for the input-to-state connections, with state updates as defined by the equations above.