# Predictive Analysis of Vehicular Lane Changes: An Integrated LSTM Approach
## 2 Methodologies
### Data Extraction and Feature Engineering
#### 2.1.2 Maneuver Labeling  
After filtering out the significant data, understanding the behavior of vehicles during lane-changing maneuvers is the next step. This involves further data categorization and mathematical modeling.  
To more aptly represent the intricacies of lane-changing maneuvers, it is imperative to introduce two additional features related to lateral motion: lateral speed (\(v_{x}\)) and steering angle (\(\theta\)).  
The steering angle is defined as the angle between the vehicle's front direction and its steering direction. It can be inferred from the ratio of the lateral position difference to the longitudinal position difference. The computation for the steering angle can be performed using Equation (1):  
\[\theta=\arctan\frac{\Delta x}{\Delta y}=\arctan\frac{x_{t}-x_{t-1}}{y_{t}-y_{t -1}} \tag{1}\]  
Given that the speed \(v\) represents the longitudinal speed, the lateral speed can be deduced from the steering angle in Equation (2):  
\[v_{x}=v\cdot\tan\theta \tag{2}\]  
In the context of vehicular movement, lane-changing maneuvers are specifically defined by the vehicle's intention to transition from one lane to another. Each action in a vehicle's trajectory sequence can be taxonomically categorized as either lane keeping, denoted by \(-1\), or lane changing, denoted by \(+1\). For those vehicles that engage in a lane-changing operation, the trajectory data can be parsed into three discrete phases: (1) lane keeping before the lane change; (2) a lane-changing event; and (3) lane keeping after the lane change. Subsequently, a continuous sequence of trajectory data typically manifests as an alternating pattern of these categorized states, represented by successive runs of \(+1\) and \(-1\), which reflect the oscillatory nature of lane keeping and lane changing during a journey.  
Analytically, the behavior of the lateral speed \(v_{x}\) and steering angle \(\theta\) serve as instrumental indicators for identifying the phases of a lane change. In the lane-keeping phase, both \(v_{x}\) and \(\theta\) are approximately zero, signifying static lateral motion. Conversely, during the lane-changing event, both variables exhibit a discernible pattern, typically characterized by an initial increase followed by a subsequent decrease. This characteristic behavior of \(v_{x}\) and \(\theta\) thus provides a reliable metric for distinguishing lane-changing maneuvers from lane-keeping actions.  
To systematically analyze vehicular maneuvers, we initially subjected the raw data of the lateral speed \(v_{x}\) and steering angle \(\theta\) to a smoothing operation. Subsequently, we computed their respective mean values. At each time step, a vehicle was identified as undergoing a lane-changing event if both \(v_{x}\) and \(\theta\) concurrently exceeded their respective mean values. In such cases, the maneuver was categorically labeled as a lane-changing event and denoted by \(+1\). Otherwise, the vehicle was considered to maintain its current lane, and the maneuver was tagged as lane keeping, denoted by \(-1\).  
Figure 2 provides several examples of vehicular lane change trajectories. In this representation, red points are employed to denote lane change maneuvers and are annotated with a label of \(+1\). Conversely, blue points are used to signify lane-keeping activities before or after lane changing and are marked with a label of \(-1\).