scieee AI-readable full text Open interactive document viewer

A Transformer-based Physics-informed Network for Trajectory Prediction and State Estimation

Souli, Nicolas; Grigoriou, Yiannis; Chrysanthou, Panagiotis; Kolios, Panagiotis; Ellinas, Georgios

Abstract

The rapid progress in the field of Unmanned Aerial Vehicle (UAV) technology has gained significant interest from both the industry and the research community, paving the way for new opportunities in various applications, including monitoring of critical infrastructures, object avoidance, autonomous deliveries, and search-and-rescue missions. However, UAV operations are heavily influenced by environmental factors and sensor failures, necessitating a reliable and precise framework for state identification and trajectory prediction. This work presents a novel real-time onboard UAV system designed to achieve the main objectives of state identification and trajectory prediction, utilizing a lightweight multi-task learning model based on a Transformer-based physics-informed neural network framework. The proposed framework leverages the shared feature learning capabilities of a Transformer-based network and a physics-informed loss function to accurately achieve both the classification of drone states and trajectory forecasting objectives. This framework is trained and evaluated using a custom-designed dataset that encompasses drone movements across different outdoor scenarios. A prototype system is subsequently developed and thoroughly tested in real-world experiments, showcasing its enhanced performance compared to existing methods.

Full text

A Transformer-based Physics-informed Network for Trajectory Prediction and State Estimation Nicolas Souli, Yiannis Grigoriou, Panagiotis Chrysanthou, Panayiotis Kolios, and Georgios Ellinas Abstract— The rapid progress in the field of Unmanned Aerial Vehicle (UAV) technology has gained significant interest from both the industry and the research community, paving the way for new opportunities in various applications, including monitoring of critical infrastructures, object avoidance, autonomous deliveries, and search-and-rescue missions. However, UAV operations are heavily influenced by environmental factors and sensor failures, necessitating a reliable and precise framework for state identification and trajectory prediction. This work presents a novel real-time onboard UAV system designed to achieve the main objectives of state identification and trajectory prediction, utilizing a lightweight multi-task learning model based on a Transformer-based physics-informed neural network framework. The proposed framework leverages the shared feature learning capabilities of a Transformer-based network and a physics-informed loss function to accurately achieve both the classification of drone states and trajectory forecasting objectives. This framework is trained and evaluated using a custom-designed dataset that encompasses drone movements across different outdoor scenarios. A prototype system is subsequently developed and thoroughly tested in real-world experiments, showcasing its enhanced performance compared to existing methods. I. INTRODUCTION Unmanned aerial vehicles are being widely utilized in a variety of use cases, including disaster management, civil infrastructure inspection, wireless communication coverage, and security of critical infrastructures. This is a result of their user-friendly operation, affordable hardware, and adaptability [1]. However, to ensure safety, enhance real-time situational awareness for operators and meet latency, security, and reliability requirements during critical UAV operations (e.g., search-and-rescue and disaster management), robust, efficient, and reliable flight monitoring mechanisms are becoming a mandate especially in scenarios where sensors malfunction [2], [3], [4], [4], [5]. Recent research studies have mainly focused on single-task neural network (NN) approaches for either state identification or trajectory prediction, utilizing long short-term memory (LSTM) and recurrent neural networks (RNN). Nevertheless, these techniques are not able to accurately capture temporal dependencies in data across extended time horizons [6], [7]. N. Souli, Y. Grigoriou, P. Chrysanthou, and G. Ellinas are with the Department of Electrical and Computer Engineering and the KIOS Research and Innovation Center of Excellence (KIOS CoE), University of Cyprus, Nicosia, Cyprus. P. Kolios is with the Department of Computer Science and the KIOS CoE, University of Cyprus. Emails: {nsouli02, grigoriou.yiannis, chrysanthou.a.panagiotis, pkolios, gellinas}@ucy.ac.cy This work was partially supported by the Border Management and Visa Policy Instrument (BMVI), co-financed by the European Union and the Republic of Cyprus (BMVI/2021-2022/SA/1.2.1/015) (project REACTION) and by the European Union’s Horizon Europe research and innovation program under grant agreement No 101187121 (EUSOME). It was also partially supported from the Republic of Cyprus through the Deputy Ministry of Research, Innovation and Digital Policy. To overcome this limitation, Transformer-based approaches, which employ self-attention mechanisms, have showcased improved time-series data processing performance [8]. These networks outperform both RNNs and LSTM architectures in various applications, including natural language processing and time series forecasting [9]. Also, physics-informed Transformer architectures are currently employed, introducing domain-specific constraints into attention mechanisms, to achieve accuracy improvements over data-only approaches for vehicle trajectory forecasting, system parameter estimation, and state classification [10], [11]. Despite the recent developments in physics-informed neural networks, their deployment in the context of fully autonomous UAV navigation requires further investigation. This work builds upon our previously developed Transformer-based multi-task learning framework, MELFST [12], which is designed to simultaneously identify UAV states and predict trajectories using multi-modal input data. The MELF-ST framework’s main aim was to enhance the two-fold objective performance by utilizing the UAV’s sensor data in a data-only approach. In contrast, this work proposes an onboard real-time system for UAV state identification and trajectory prediction that employs a lightweight Transformerbased model along with a physics-informed mechanism (MTTPI), which achieves the multi-task objective of trajectory prediction and state identification with improved efficiency and inference accuracy. The main contributions of this research approach are the following: (i) the design of a novel custom Transformer-based multi-task learning model that obtains the two-fold objective of state identification and trajectory prediction by employing time-series data from external and onboard UAV sensors; (ii) the implementation of a physics-informed loss function to improve the model’s trajectory prediction accuracy and robustness; (iii) the development of a lightweight model of the proposed learning architecture and its deployment on a UAV, leveraging SQL databases for sensor data management, Transformer-based modules, and a multi-task learning framework to jointly perform real-time classification and trajectory prediction, while also using low computational requirements. The implemented prototype is evaluated through real-world outdoor experiments, demonstrating accurate performance in classification and three-dimensional (3D) trajectory forecasting under operational conditions. II. RELATED WORK Traditional UAV state estimation frameworks have primarily employed simultaneous localization and mapping (SLAM) [13] and visual–inertial odometry (VIO) [14] methodologies to achieve continuous and real-time estimation of the aerial vehicle’s pose. Despite their accurate results in controlled scenarios, SLAM and VIO approaches encounter significant computational overhead and exhibit reduced accuracy in complex outdoor conditions, thereby leading to the exploration of convolutional neural network (CNN)-based deep learning methods, as presented in [15] and [16], which have demonstrated reliable and precise performance across various environments. To ensure accurate and efficient UAV trajectory prediction, research approaches have conventionally relied on filter-based techniques, such as the Unscented Kalman Filter [17]. Also, data-driven trajectory prediction methods (e.g., deep learning (DL) techniques) have recently shown great promise; however, recurrent architectures such as RNNs and LSTMs are unable to capture temporal dependencies in long-term horizons, an area where Transformer-based models provide more accurate results and robustness [18]. The Transformer architecture, as described in [8], has been widely adopted for sequential prediction tasks, such as natural language processing and time-series forecasting, utilizing the self-attention mechanism that improves the analysis of long-term data dependencies. In [19], a spatial–temporal graph-attention Transformer is introduced for autonomous-vehicle trajectory prediction, achieving high accuracy when trained on a dedicated trajectory dataset. However, the proposed method’s predictive performance decreased under various driving scenarios and locations. In a similar vein, a lane Transformer architecture, as described in [20], is applied in autonomous vehicle driving; however, it exhibits reduced accuracy over prolonged prediction horizons, highlighting the need for improved strategies that can better capture long-term data dependencies. Only a limited number of research efforts have incorporated physics-informed Transformer architectures to facilitate accurate long-term prediction tasks. For example, the work in [21] proposed a trajectory prediction model physicsinformed Transformer to predict hypersonic glide vehicle (HGV) trajectories over long-range paths. Even though longrange trajectory predictions are obtained by using historical motion data, the proposed framework is constrained by its reliance on synthetic HGV trajectories without real-world finetuning and no outdoor experimental evaluation, by its fixedlength model input requirement, and by the limited physical knowledge model, all of which hinder its generalization to longer or more complex prediction scenarios. Additionally, in [22], a physics-informed deep learning framework that exploits the advantages of data-driven and physics-based models to predict vehicle trajectory on highways. Despite the model’s demonstrated accuracy on highway longitudinal datasets, it remains constrained by its one-dimensional trajectory formulation, fixed-length input requirement, and reliance on synthetic data that limit its applicability to multidimensional, dynamically complex traffic scenarios. Further, multi-task learning (MTL), as initially introduced in [23], is a method for training a single model to perform multiple tasks simultaneously by leveraging shared information across those tasks. Therefore, the multi-task learning technique has been demonstrated to enhance predictive accuracy, improve generalization, and mitigate overfitting [24]. MTL implementations typically utilize hard or soft parameter sharing schemes and integrate task-specific attention modules [24], [25], [26]. In UAV applications, MTL enables the simultaneous optimization of different objectives, such as object detection, state identification, and trajectory prediction, by leveraging shared feature information. This approach reduces dependence on large annotated datasets that are often difficult to obtain [27], [28]. Even though Transformer-based approaches have demonstrated effectiveness in single-task trajectory forecasting and classification, Transformer-based models have not been applied within a physics-informed, MTL framework for UAV operations and have only been tested using synthetic datasets with a fixed-length model input requirement. To address those gaps, an onboard, lightweight, physics-informed Transformer-based system is proposed that simultaneously performs real-time 3D trajectory prediction and UAV state identification in real-world outdoor environments. III. SYSTEM ARCHITECTURE The proposed system processes drone telemetry data, camera information, and external weather sensor data in real time using a modular architecture centered around DJI’s Payload Software Development Kit (PSDK). As illustrated in Fig. 1, telemetry data is directly acquired from the drone via the PSDK interface. This data includes real-time information such as global positioning data (GPS), velocity, acceleration, orientation, weather data (such as wind speed and angle), and camera video stream (used to compute the visual odometry (VO) measurements) that are made available to the onboard processing module for further analysis and prediction. Fig. 1: MT-TPI model framework. A. Feature-Based Visual Odometry The VO module (used for the creation of Dataset-2 [29]) provides real-time (10 Hz) frame-to-frame motion estimates, and is fully integrated within DJI-PSDK. A sparse feature pipeline based on fast keypoint extraction and binary descriptors runs on an NVIDIA Jetson Xavier NX. 1) Camera Model and Intrinsics: A pin-hole camera model is assumed with horizontal and vertical fields-of-view θh,θvand an image resolution of W×Hpixels. The focal lengths (in pixels) are computed as: fx=W 2 tan(θh/2), fy=H 2 tan(θv/2),(1) and the intrinsic camera matrix becomes: K=  fx0W/2 0fyH/2 0 0 1  .(2) This follows the standard formulation presented in [30]. 2) Sparse Feature Extraction and Matching: After conversion to grayscale, the keypoints are detected and the binary descriptors are computed. The descriptors of consecutive frames are matched using the Hamming distance. Outliers are removed using RANSAC applied to a homography matrix H. The decomposition of Hwith Kyields pixel displacements (∆x, ∆y)[31]. 3) Pixel-to-World Coordinate Transformation: Given the barometric altitude h, the dimensions of the ground-projected field-of-view are: FOVx= 2htan(θh/2),FOVy= 2htan(θv/2).(3) This yields the pixel-to-meter scale factors: mx=FOVx W, my=FOVy H,(4) and the resulting displacements in the camera frame are: ∆xreal = ∆x mx,∆yreal = ∆y my.(5) 4) Heading Compensation and Sensor Fusion: To transform the displacement of the camera frame into the global North–East frame, we apply a rotation using the heading angle θprovided by the UAV’s inertia measurement unit (IMU). ∆x′ ∆y′=cos θ−sin θ sin θcos θ∆xreal ∆yreal.(6) This corrected displacement is then fused with inertial measurements such as velocity, and processed by the Transformer-based multi-task model. B. Transformer-based Physics-informed Model A sequence of Transformer encoder blocks incorporating layer normalization, multi-head self-attention, and feedforward networks is utilized to capture temporal dependencies in the input data. The Transformer-based architecture consists of two distinct branches, one for predicting continuous 3D trajectory outputs and one for state classification. Both branches employ a positional encoding layer to maintain the order of the input sequence. By utilizing TimeDistributed dense layers and splitting the outputs to focus on the forecast horizon, the model successfully calculates future data related to trajectory prediction and state estimation. In order to improve the Transformer-based framework’s trajectory predictions performance based on physical motion constrains, a physics-informed loss component is designed and applied in the proposed Transformer-based architecture to augment the standard trajectory MSE with physics-based and axis-specific penalties (i.e., the standard loss function is augmented with physics-informed penalties). The proposed physics-informed loss comprises four primary components and trainable scaling weights as follows: Weighted Mean-Squared Error (wMSE): A baseline MSE is computed over the three position coordinates: wMSE = 1 N T N X i=1 T X t=1 h(xi,t −ˆxi,t)2+ (yi,t −ˆyi,t)2+ 10 (zi,t −ˆzi,t)2i (7) where Nis the batch of trajectory window (sample size), T is the forecast horizon length (number of future time steps predicted), and (xi,t, yi,t, zi,t)and (ˆxi,t,ˆyi,t,ˆzi,t)denote the true and predicted 3D positional data (latitude, longitude and altitude) of the t-th sample at the time-step t, respectively. Finite-Difference Acceleration: Predicted positions employ discrete velocity and acceleration estimates via ˆvi,t =ˆyi,t −ˆyi,t−1 ∆t,ˆai,t =ˆvi,t −ˆvi,t−1 ∆t(8) where ∆tdenotes interval between the samples (0.1s) Physics Residual: Assuming zero thrust measurement, free-fall (due to gravity) is enforced by using the deviation of the vertical acceleration: Rphys =1 N(T−1) N X i=1 T−1 X t=1  ˆai,t −[0,0,−g]⊤  2 2,(9) where g= 9.81m/s2. Vertical MAE (ZMAE): To robustly bound altitude errors, we include an αzpenalty on vertical deviations: ZMAE =1 N T N X i=1 T X t=1zi,t −ˆzi,t.(10) Horizontal MAE (XYMAE): Simultaneously, the lateral accuracy is controlled via the sum of absolute errors in the (x)–(y)plane: XYMAE =1 N T N X i=1 T X t=1|xi,t −ˆxi,t|+|yi,t −ˆyi,t|(11) Trainable Scaling Weights: Three scalar parameters λphys, αz, and βxy are learned during training to balance the relative importance of the physics residual and MAE terms. λphys is defined as the weight of the physics residual, and αzand βxy are the vertical and horizontal MAE terms, respectively. During training, these weights are automatically adjusted to achieve a balance between accurately fitting the data and following the physical model. Trajectory Loss Component: The overall trajectory objective is the sum of the previously mentioned components, weighted by their respective trainable parameters: Ltraj = wMSE + λphys Rphys +αzZMAE +βxy XYMAE. (12) Finally, the physics-informed trajectory loss is applied to the multi-task objective by combining it with the binary cross-entropy classification loss: L= 0.5Ltraj + 0.5LBCE,(13) where LBCE denotes the average binary cross-entropy over the flight-mode labels. Moreover, a ModelCheckpoint callback is employed to preserve the model weights associated with the lowest validation loss, while an EarlyStopping callback terminates training if that loss does not improve for a pre-defined number of epochs. It must be noted that the flight data obtained through the PSDK is stored in a database for labeling and future use. During labeling, each time step is annotated with one of the following five modes, “IDLE-HOVER”, “ASCEND”, “DESCEND”, “TURN”, or “HMSL” (horizontal movement straight line) based on pre-determined thresholds applied to altitude change, yaw rate, and horizontal displacement. When the labeling procedure ends, the time-series data is then partitioned into overlapping segments using a slidingwindow scheme to generate the input-output pairs required for forecasting. Moreover, the network processes the UAV’s sensor and kinematic data in sliding windows of 90 time steps (9s at 0.1s intervals), enabling the model to capture the drone’s dynamics. From this 90-step sliding window, the model then predicts the next 30 time steps (3s look-ahead horizon) for both 3D trajectory prediction and state classification. This window-to-horizon design ensures that historical data is effectively leveraged to accurately forecast the future behavior of the drone. Subsequently, each segmented sequence is flattened, normalized through min–max scaling, and then restored to its original spatio-temporal dimensions. These sequences are then passed into a pre-trained ONNX model (an MT-TPI model converted into ONNX format to achieve real-time inference) [32], which simultaneously computes trajectory predictions and flight-mode classification outputs under a multi-task configuration. IV. MT-TPI ALGORITHM MT-TPI, as detailed in Alg. 1, systematically processes the collected sensor data through a sequence of steps designed for drone trajectory prediction and current state identification. In the processing pipeline, raw sensor records are first retrieved and organized into input–output sets, including the multi-class flight-mode labels. Key parameters of a sliding window process include the input size (IS), window size (WS), and head size (HS) to segment the time series data. The data are subsequently partitioned into training, validation, and test subsets. A multi-task Transformer model is then constructed with the chosen hyperparameters (batch size, number of epochs, number of classes, attention head size, and learning rate), compiled with the physics-informed and classification losses, and finally evaluated on the test set to quantify its trajectory-prediction and classification performance. Finally, the Haversine formula [33] is used to compute the Euclidean distance difference (in meters) between ground truth and predicted positions, and class-wise metrics (Precision, Recall and F1-score) [34] are employed to evaluate the state identification performance of the model. V. PERFORMANCE EVALUATION A. Hardware Configuration The aerial platforms employed for data acquisition and testing of the proposed system are the DJI Matrice 350 RTK and DJI Matrice 300 RTK. They were selected due to their support for integration with onboard development Algorithm 1 MT-TPI Framework Model Input: Collected UAV flight dataset + Visual Odometry displacement 1: procedure (Model Initialization and Training) 2: Configure model hyperparameters 3: Reshape and normalize input sequences for model compatibility 4: Export the model to ONNX format for accelerated inference 5: Compile the model with physics-informed loss, train, and validate 6: Calculate and update ridge regression weights for refinement 7: end procedure 8: procedure (Data Preprocessing and Windowing Strategy) 9: Capture UAV sensor measurements using the DJI PSDK interface 10: Perform Visual Odometry on frames from the camera and calculate displacement in meters 11: if Drone landed then 12: Mission complete 13: else 14: Store preprocessed and structured data into the database 15: Feed the dataset into the MT-TPI model 16: Compute predicted trajectory state estimation 17: end if 18: end procedure Model Output: Predicted trajectory and classified UAV operational states environments. In addition, the drones are equipped with the DJI Zenmuse H20T camera, enabling visual odometry by analyzing frames captured during flight. These drones are equipped with the NVIDIA Jetson Xavier NX, an embedded AI computing module responsible for executing the custom software onboard. Through the use of DJI’s PSDK, the Jetson Xavier NX facilitates direct, real-time interaction with sensor outputs and telemetry data from the drone’s flight systems. Furthermore, the system is complemented by the TriSonica Mini Wind and Weather Sensor, which provides measurements of wind speed and wind direction. B. Data Acquisition and Annotation The datasets used in this study were previously collected and are publicly available on Zenodo, referred to as Dataset1 and Dataset-2 [35], [29]. Specifically, Dataset-1 comprises 20 distinct 3D spatial flight trajectories logged at a frequency of 10 Hz, resulting in approximately 30 minutes of flight time per mission and totaling 276,057 entries. Dataset-2 encompasses 18 unique drone 3D flights, with each trajectory repeated multiple times, amounting to roughly 15 minutes of flight time per mission and a total of 111,082 entries. Both datasets are divided into 65% for training, 20% for validation, and 15% for testing purposes. The primary differences between the two datasets are in the variety of flight patterns and the additional sensor data. Dataset-2 not only includes a broader set of drone sensor features, as can be seen in Table I, but also incorporates outputs from an onboard sensor fusion algorithm, providing enhanced positional accuracy and additional estimation data. The dataset includes annotations for the UAV operational modes (IDLE-HOVER, ASCEND, TURN, HMSL, DESCEND), facilitating activity classification and are thus particularly suitable for use in MTL models aimed at trajectory forecasting. C. Experimental Results This section presents the experimental evaluation of the MT-TPI model. Its position prediction accuracy is assessed by comparing the predicted trajectory against ground truth (GT, which is GPS+RTK) data from Dataset-2. In addition, the ability of the model to correctly identify the state of the TABLE I: Datasets 1&2 feature comparison. Feature Dataset-1 Dataset-2 Wind Speed (m/s) ✓ ✓ Wind Angle (degrees) ✓ ✓ Battery Voltage (V) ✓ ✓ Battery Current (A) ✓ ✓ Longitude / Latitude (x,y)✓ ✓ Altitude (z)✓ ✓ Orientation (quaternions) ✓ ✓ Velocity (vx,vy,vz)✓ ✓ Angular Velocity (avx,avy,avz)✓ ✓ Linear Acceleration (ax,ay,az)✓ ✓ Payload Mass (g) ✓ ✓ ESC Speed / Voltage – ✓ Control Inputs (d roll, d pitch, d yaw) – ✓ Heading / Yaw – ✓ Sensor Fusion (lon, lat) – ✓ UAV is examined by comparing the UAV’s predicted and actual states in a series of complex 3D flight experiments. TABLE II: Average Euclidean distance error for trajectory prediction using WS=90 and Forecast Horizon=3s Prediction Time (s) MT-TPI (m) MTLF-FVO (m) MELF-ST (m) t+1 0.55 1.37 4.19 t+2 0.56 1.44 4.59 t+3 0.67 1.74 4.91 The key characteristics of the three models evaluated in this work are as follows: (i) MT-TPI: Physics-informed Transformer trained with Dataset-2 using sensor fusion; (ii) MTLF-FVO: Transformer trained with Dataset-2 using sensor fusion [36]; (iii) MELF-ST: Transformer trained on Dataset-2 but using the specified feature set from Dataset1. As shown in Table II, MT-TPI demonstrates the best performance in trajectory prediction, with average Euclidean error values of 0.55 m, 0.56 m, and 0.67 m, for forecast horizons t+ 1,t+ 2, and t+ 3, respectively. In contrast, MTLF-FVO, which is trained using the same dataset outputs higher errors of 1.37 m, 1.44 m, and 1.74 m for the same time steps. The MELF-ST model performs the worst, with errors of 4.19 m, 4.59 m, and 4.91 m., as it is trained on a reduced feature set (i.e., without the fused sensor data available to the other two models). These results emphasize the importance of sensor fusion inputs in enhancing prediction accuracy and further highlight the benefits of physics-informed techniques. Furthermore, Fig. 2 showcases the cumulative distribution function (CDF) of the Euclidean error for trajectory prediction, comparing MT-TPI, MTLF-FVO, and MELF-ST. The results show that MT-TPI provides more accurate and consistent trajectory estimates compared to the other two models, managing the lowest overall error distribution. In particular, MT-TPI reaches the 95th percentile error at approximately 1.00m, while MTLF-FVO and MELF-ST reach the same percentile at around 2.75m and 8.20m, respectively. Fig. 3 presents the mean absolute error (MAE) along longitude (X), latitude (Y), and altitude (Z) for the three models. The results showcase that MT-TPI consistently achieves the lowest error across all axes, with a maximum MAE of 0.73m in longitude and 0.52m in altitude. In contrast, MELF-ST shows the highest errors, especially in the Y-axis, where its MAE reaches 3.51m. Fig. 4 presents the 3D trajectory estimations for two flight paths (Complex and Linear). The outputs of the three models are evaluated against the GPS+RTK (ground truth). In Fig. 2: Average CDF error for predicted trajectories. Fig. 3: MAE along X, Y, Z axes (compared to GT). both paths, MT-TPI and MTLF-FVO are comparable to the GT trajectory, demonstrating accurate trajectory prediction across all three spatial dimensions. In contrast, MELF-ST exhibits noticeable deviations, particularly during turns and altitude changes, as can be seen in Fig. 4a. These results illustrate that MT-TPI and MTLF-FVO offer more accurate and consistent trajectory predictions, with minimal drift or error over time. Additionally, based on Fig. 4b, MTLF-FVO and MT-TPI are almost identical to the GT path, highlighting their increased performance. (a) Trajectory prediction compared to GT (complex path). (b) Trajectory prediction compared to GT (linear path). Fig. 4: 3D flight path prediction results compared to the GT. To assess multi-label classification performance, macroaveraged metrics Precision, Recall, and F1-score are computed for each model (Table III). MT-TPI achieves a Precision of 0.7864, Recall of 0.7876, and F1-score of 0.7791, outperforming both the MTLF-FVO and MELF-ST models. These results demonstrate that incorporating the physicsinformed loss into the Transformer architecture significantly enhances classification accuracy across all flight modes. TABLE III: Class-wise metrics (macro-averaged) for the three models Model Precision Recall F1-score MTLF-FVO (WS=90) 0.73 0.77 0.70 MELF-ST (WS=90) 0.7184 0.7339 0.7193 MT-TPI (WS=90) 0.7864 0.7876 0.7791 Finally, Fig. 5 depicts the CPU, GPU, RAM, and power usage of the Jetson onboard processing unit, with 100% corresponding to its 20W maximum power consumption. The results illustrate that the MT-TPI framework can achieve real-time trajectory prediction and state identification with the use of an embedded processing unit (with average CPU and GPU resource utilization of 90% and 30%, respectively). Fig. 5: Onboard resource allocation for MT-TPI. VI. CONCLUSIONS This work presents a real-time, physics-informed MTL framework utilizing a Transformer-based network implemented onboard a UAV. The proposed system leverages the Transformer-based model’s capability to process sequential data, combined with a physics-informed loss function (which embeds UAV physical constraints in terms of movement) and sensor fusion, to accurately determine the drone’s state and predict its trajectory over a specified look-ahead horizon. MT-TPI is trained using custom-designed real-world datasets that incorporate complex drone flight paths across various altitudes and long distances. The experimental outcomes presented an average accuracy of 0.75m for trajectory prediction over a 3s look-ahead and showed a classification accuracy with an F1-score of 0.7791, which aligns with the benchmark set by GPS+RTK. Moreover, MT-TPI is thoroughly evaluated through real-world outdoor tests, demonstrating its capability for safe and efficient UAV-based operations. Future research includes the investigation of a GPS-free MT-TPI model, the utilization of additional sensor modalities to improve the system’s performance, and the extension of the training datasets to enhance both state estimation and trajectory prediction tasks. REFERENCES [1] H. Shakhatreh et al., “Unmanned aerial vehicles (UAVs): A survey on civil applications and key research challenges,” IEEE Access, vol. 7, pp. 48 572–48 634, 2019. [2] C. Xu et al., “Recent research progress of unmanned aerial vehicle regulation policies and technologies in urban low altitude,” IEEE Access, vol. 8, pp. 74 175–74 194, 2020. [3] M. Corbetta et al., “Real-time UAV trajectory prediction for safety monitoring in low-altitude airspace,” in Proc. Aviation Forum, 2019. [4] S. Waharte and N. Trigoni, “Supporting search and rescue operations with UAVs,” in Proc. IEEE EST, 2010, pp. 142–147. [5] Y. Huang et al., “A survey on trajectory-prediction methods for autonomous driving,” IEEE Trans. Intell. Veh., vol. 7, no. 3, 2022. [6] P. Shu et al., “Trajectory prediction of UAV based on LSTM,” in Proc. ICBASE, 2021, pp. 448–451. [7] K. Xiao, et al., “Trajectory prediction of UAV in smart city using recurrent neural networks,” in Proc. IEEE ICC, 2019, pp. 1–6. [8] A. Vaswani et al., “Attention is all you need,” in Proc. NIPS, 2017. [9] Q. Tong et al., “Long-term trajectory prediction model based on transformer,” IEEE Access, vol. 11, pp. 143 695–143 703, 2023. [10] S. Lu et al., “Enhanced trajectory forecasting for hypersonic glide vehicle via physics-embedded neural ODE,” Drones, vol. 8, 2024. [11] C. Wang et al., “A dynamics-enhanced learning model for multihorizon trajectory prediction in autonomous vehicles,” Information Fusion, vol. 118, p. 102924, 2025. [12] N. Souli et al., “A multi-task transformer architecture for drone state identification and trajectory prediction,” in Proc. IEEE DCOSS-IoT, 2024, pp. 285–291. [13] H. Durrant-Whyte and T. Bailey, “Simultaneous localization and mapping: part I,” IEEE Robot. Autom. Mag., vol. 13, no. 2, 2006. [14] C. Forster et al., “SVO: Fast semi-direct monocular visual odometry,” in Proc. IEEE ICRA, 2014, pp. 15–22. [15] A. Kendall et al., “PoseNet: A convolutional network for real-time 6-DOF camera relocalization,” in Proc. IEEE ICCV, 2015. [16] A. Loquercio et al., “DroNet: Learning to fly by driving,” IEEE Robotics & Automation Letters, vol. 3, no. 2, pp. 1088–1095, 2018. [17] S. J. Julier and J. K. Uhlmann, “Unscented filtering and nonlinear estimation,” Proc. of the IEEE, vol. 92, no. 3, pp. 401–422, 2004. [18] Y. Bengio et al., “Learning long-term dependencies with gradient descent is difficult,” IEEE Trans. Neural Netw., vol. 5, no. 2, 1994. [19] K. Zhang et al., “Trajectory prediction for autonomous driving using spatial-temporal graph attention transformer,” IEEE Trans. Intell. Transp. Syst., vol. 23, no. 11, pp. 22 343–22 353, 2022. [20] Z. Wang et al., “Lane transformer: A high-efficiency trajectory prediction model,” IEEE Open J. Intell. Transp. Syst., vol. 4, 2023. [21] J. Ren et al., “Long-term trajectory prediction of hypersonic glide vehicle based on physics-informed transformer,” IEEE Trans. Aerosp. Electron. Syst., vol. 59, no. 6, pp. 9551–9561, 2023. [22] M. Geng et al., “A physics-informed transformer model for vehicle trajectory prediction on highways,” Transportation Research Part C: Emerging Technologies, vol. 154, p. 104272, 2023. [23] R. Caruana, “Multitask learning,” Machine Learning, vol. 28, 1997. [24] S. Ruder, “An overview of multi-task learning in deep neural networks,” arXiv:1706.05098 [cs.LG], 2017. [25] R. Caruana, Multitask Learning. Springer, 1998. [26] X. Liu et al., “Multi-task deep neural networks for natural language understanding,” arXiv:1901.11504 [cs.CL], 2019. [27] G. Verdon et al., “Learning to learn with quantum neural networks via classical neural networks,” arXiv:1907.05415 [quant-ph], 2019. [28] A. Palamas et al., “A multi-task learning framework for drone state identification and trajectory prediction,” in Proc. IEEE DCOSS-IoT, 2023, pp. 676–683. [29] Y. Grigoriou et al., “Drone onboard multi-modal sensor and featurebased visual odometry dataset for complex outdoor scenarios,” Mar. 2025. [Online]. Available: https://doi.org/10.5281/zenodo.15089283 [30] R. Hartley and A. Zisserman, Multiple View Geometry in Computer Vision. Cambridge University Press, 2003. [31] R. Szeliski, Computer Vision: Algorithms and Applications. Springer, 2022. [32] F. Xu, “Faster scalable ML model deployment using ONNX and open source tools,” in Proc. IEEE Infrastructure Conference, 2020. [33] E. Winarno et al., “Location based service for presence system using Haversine method,” in Proc. ICITech, 2017, pp. 1–4. [34] F. P. Moreno et al., “Prediction of air traffic complexity through a dynamic complexity indicator and machine learning models,” Journal of Air Transport Management, vol. 119, p. 102632, 2024. [35] Y. Grigoriou et al., “Drone onboard multi-modal sensor dataset for complex outdoor scenarios,” Sep. 2024. [Online]. Available: https://doi.org/10.5281/zenodo.13682870 [36] Y. Grigoriou, N. Souli et al., “UAV state estimation and trajectory prediction using transformer and feature-based visual odometry,” in Proc. IEEE SMC, 2025, pp. 1–8.