## 1 Introduction  
Maritime vessels, as a critical component of global trade and transportation, generate a wealth of data concerning their location, trajectories, and speed. These data, meticulously monitored and logged to maintain course, can also provide a wealth of meta information that can be harnessed for various purposes. Historically, the importance of marine vessel classification and data analysis can be traced back to early geographical and historical contexts. Understanding the geographical location, topographical features, and historical exploration of maritime routes provides the foundation for the modern system of maritime transportation [1]. In recent years, advancements in data analysis techniques have enabled the extraction of more value from the data generated by maritime vessels. For instance, the application of density-based spatial clustering of applications with noise (DBSCAN) has been used to model vessel behaviors based on trajectory point data. This approach allows for the detection of vessel trajectory anomalies, such as unexpected stops, deviations from regulated routes, or inconsistent speed, thereby contributing to situational awareness, vessel collision prevention, safe navigation, and route planning. Moreover, the concepts of 'big trajectories' and'semantic trajectories' have emerged, referring to enriched sets of trajectory data that combine multiple semantic aspects with pure spatio-temporal facets [2]. This approach allows for a more comprehensive analysis of trajectory data, unveiling patterns in the life of humans, objects, and animals, and informing policy-making in various application domains in transportation [3], security, health, tourism, and the environment. Specifically, in the context of fishing vessels, real-time anomaly detection models based on edge computing have been developed [4; 5]. These models make full use of the information of moving edge nodes and nearby nodes and combine a historical trajectory extraction detection model with an online anomaly detection model to detect anomalies. This approach has proven effective for real-time anomaly detection of fishing vessels, providing valuable information about promising fishing locations and weather anomalies. Activities related to naval travel are difficult to track due to their nature and the lack of sensors that can record data. In most cases, the main monitoring system for a vessel is its GPS. AIS is used to track the trajectories of vessels and offer more precise information on the sailed route [6; 7; 8]. The observed data offer insight into anomalies in the planned route, such as diversions from the course and inexplicable obstructions. These are usually signs of illegal activity, such as poaching and dark fishing. The second phenomenon can be explained as fishing crews wanting to perform illegal activities by turning off their transponders linked to the AIS. The use of unregistered gear and more vessels than permitted fishing in certain areas both damage wildlife.One example is the use of two vessels in pair trawling. All of the mentioned behaviors are harmful to the environment and cause disturbances in marine life. To solve these problems, vessel track prediction can be used [9; 10; 11]. The purpose of this research was to propose a novel XGBoost-based solution using a PSO optimized LSTM network for vessel classification and trajectory forecasting. Metaheuristics, especially the swarm subfamily, have proven excellent optimizers for non-deterministic polynomial-time hardness (NP-hard) problems, to which LSTM optimization is considered to belong. The method was tested against state-of-the-art hybrid solutions. Classification was performed as the first experiment for vessel identification, while regression was carried out during the second experiment for prediction of the vessel's trajectory. The authors propose a robust framework for vessel classification and trajectory multivariate forecasting, which exploits XGBoost and LSTM tuning based on the BPSO metaheuristic.