请看下图,它表示汽车、人或船等物体在二维 x 和 y 空间中移动的轨迹,它们在该空间中的点绘制在此处:
如果绿色的点丢失了,我们想根据这个差距之前和之后的点来取回这些点怎么办。我为此找到了一个解决方案(这里的论文:https ://ieeexplore.ieee.org/document/8713215 ,但是,作者没有提供有关他们的 LSTM 架构和输入训练数据的许多细节),可以概括为更复杂的曲线是使用 LSTM 神经网络。有了这个,我们可以输入这个间隙之前和之后的点并输出缺失的点。这是我目前使用的 LSTM 架构,它是在 Python 中使用库 Tensorflow 实现的:
time_step=10 # how many points previously to use to predict
X_train, y_train = create_dataset(scaled_traj, time_step)
# reshape input to be [samples, time steps, features] which is required for LSTM
units = 3 # before 3 # for nodes in network
model = Sequential()
model.add(LSTM(units, input_shape=(time_step,2), return_sequences=True)) # no activation as we are not returning a binary value
model.add(LSTM(units, return_sequences=True))
model.add(LSTM(units))
model.add(Dense(2)) # LSTM with return_sequence=False will return just one output so does Dense have to be 2
opt = tf.keras.optimizers.Adam(lr=0.001, decay=1e-6)
model.compile(
loss='mean_squared_error',
optimizer=opt,
metrics=['accuracy'],
)
model.summary()
model.fit(X_train,
y_train,
epochs=500
)
对于训练,我将前一个(例如十个点)输入为 X,下一个点输入为 y。训练后,对于输入,我尝试在间隙中取之前的点并输出下一个点。以下是结果:
我还尝试绘制前向传递的加权和,前一个点输出下一个,后向传递。这是结果,这要好得多:
如此处所示,轨迹仍然不准确,因此我尝试使用训练数据中的端点进行训练,以用于预测下一个点。然而,这在这里产生了更糟糕的结果:
此外,这里是只有缺失点的轨迹:
有了这一切,我的项目就在这里:https ://github.com/eleehiga/Trajectory_Correction_Research/blob/main/NN_Reconstruction.py 。你们能帮助我如何改进我的 LSTM 架构、使用哪些点的训练方法、如何更好地使用这个训练有素的神经网络来填充缺失点的重建方法,以及我可以做的其他事情来重建轨迹更精确地?



