Apparatus for predicting speed of vehicle and method thereof
An apparatus for predicting a speed of a vehicle includes storage that stores a transformer model which completes learning, and a controller that predicts the speed of the vehicle based on the transformer model. The controller may extract feature information about a state of the vehicle from past driving information of the vehicle to input the feature information to an encoder of the transformer model, and extract feature information about the state of the vehicle from future driving information of the vehicle to input the feature information to a decoder of the transformer model.
1 . An apparatus for predicting a speed of a vehicle, the apparatus comprising:
a storage configured to store a transformer model which completes learning; and
a controller configured to predict the speed of the vehicle based on the transformer model;
wherein the controller is further configured to extract feature information about a state of the vehicle from past driving information of the vehicle, to input the feature information to an encoder of the transformer model, and to extract feature information about the state of the vehicle from future driving information of the vehicle to input the feature information to a decoder of the transformer model.
2 . The apparatus of claim 1 , wherein the controller is further configured to receive a radar signal through a vehicle network and extract first feature information about the state of the vehicle from the radar signal based on a first 1D convolutional neural network (CNN).
3 . The apparatus of claim 2 , wherein the radar signal includes at least one of a separation distance from a front vehicle and a relative speed.
4 . The apparatus of claim 2 , wherein the controller is further configured to receive a vehicle control signal through the vehicle network, and to extract second feature information about the state of the vehicle from the vehicle control signal based on a second 1D CNN.
5 . The apparatus of claim 4 , wherein the vehicle control signal includes at least one of a vehicle speed, a steering angle, a longitudinal acceleration of the vehicle, a lateral acceleration of the vehicle, a front wheel motor torque of the vehicle, a rear wheel motor torque of the vehicle, a brake hydraulic pressure, an accelerator pedal sensor (APS) value, and a brake pedal sensor (BPS) value.
6 . The apparatus of claim 4 , wherein the controller is further configured to fuse the first feature information and the second feature information based on a fully connected neural network (FCNN), and to input a fused result to the encoder of the transformer.
7 . The apparatus of claim 1 , wherein the controller is further configured to generate token information and extract third feature information about the state of the vehicle from the token information based on a 1D convolutional neural network (CNN).
8 . The apparatus of claim 7 , wherein the token information includes start token information and placeholder token information, and wherein the start token information includes a past speed of the vehicle, and the placeholder token information includes a zero vector.
9 . The apparatus of claim 7 , wherein the controller is further configured to receive front road information of the vehicle from a navigation device, and to extract fourth feature information about the state of the vehicle from the road information based on a multi-head attention (MHA) scheme.
10 . The apparatus of claim 9 , wherein the road information includes at least one of a type of a road, a curvature of the road, a slope of the road, traffic light information on the road, a location of a crosswalk on the road, a location of a speed bump on the road, a location of a speed camera on the road, and a location of a traffic accident.
11 . The apparatus of claim 9 , wherein the controller is further configured to fuse the third feature information and the fourth feature information based on a cross attention scheme and input a fused result to the decoder of the transformer.
12 . A method of predicting a speed of a vehicle, the method comprising:
storing, by a storage, a transformer model which completes learning; and
predicting, by a controller, the speed of the vehicle based on the transformer model;
wherein the predicting of the speed of the vehicle includes:
inputting, by the controller, feature information to an encoder of the transformer model by extracting the feature information about a state of the vehicle from past driving information of the vehicle; and
inputting, by the controller, feature information to a decoder of the transformer model by extracting the feature information about the state of the vehicle from future driving information of the vehicle.
13 . The method of claim 12 , wherein inputting feature information to the encoder of the transformer model includes:
receiving, by the controller, a radar signal through a vehicle network;
extracting, by the controller, first feature information about the state of the vehicle from the radar signal based on a first 1D convolutional neural network (CNN);
receiving, by the controller, a vehicle control signal through the vehicle network; and
extracting, by the controller, second feature information about the state of the vehicle from the vehicle control signal based on a second 1D CNN.
14 . The method of claim 13 , wherein inputting feature information to the encoder of the transformer model further includes:
integrating, by the controller, the first feature information and the second feature information based on a fully connected neural network (FCNN); and
inputting, by the controller, a fused result to the encoder of the transformer.
15 . The method of claim 13 , wherein the radar signal includes at least one of a separation distance from a front vehicle and a relative speed.
16 . The method of claim 13 , wherein the vehicle control signal includes at least one of a vehicle speed, a steering angle, a longitudinal acceleration of the vehicle, a lateral acceleration of the vehicle, a front wheel motor torque of the vehicle, a rear wheel motor torque of the vehicle, a brake hydraulic pressure, an accelerator pedal sensor (APS) value, and a brake pedal sensor (BPS) value.
17 . The method of claim 12 , wherein inputting feature information to the decoder of the transformer model includes:
generating, by the controller, token information;
extracting, by the controller, third feature information about the state of the vehicle from the token information based on a 1D convolutional neural network (CNN);
receiving, by the controller, front road information of the vehicle from a navigation device; and
extracting, by the controller, fourth feature information about the state of the vehicle from the road information based on a multi-head attention (MHA) scheme.
18 . The method of claim 17 , wherein inputting feature information to the decoder of the transformer model further includes:
integrating, by the controller, the third feature information and the fourth feature information based on a cross attention scheme; and
inputting, by the controller, a fused result to the decoder of the transformer.
19 . The method of claim 17 , wherein the token information includes start token information and placeholder token information, the start token information includes a past speed of the vehicle, and the placeholder token information includes a zero vector.
20 . The method of claim 17 , wherein the road information includes at least one of a type of a road, a curvature of the road, a slope of the road, traffic light information on the road, a location of a crosswalk on the road, a location of a speed bump on the road, a location of a speed camera on the road, and a location of a traffic accident.