Analysis of decision support system of basketball sports competition based on machine learning and IoT Authors: Muren Bao Published: 2026 ABSTRACT This study develops a machine learning-based decision support system for offensive and defensive tactical analysis in basketball games within an Internet of Things (IoT) environment. By integrating multi-source data collection, spatiotemporal feature encoding, and the Multi-Task Attention Long Short-Term Memory (MT-AttLSTM) model, the system simultaneously addresses offensive-defensive state classification and shooting percentage prediction. The system is evaluated using NBA SportVU tracking data from the 2018–2023 seasons. The results demonstrate that MT-AttLSTM achieves a test set accuracy of 0.897 in offensive-defensive state classification and significantly outperforms traditional baseline models in shooting percentage prediction, as reflected by a lower Mean Absolute Percentage Error (MAPE). These findings highlight the system’s high accuracy and strong generalization capability. Moreover, the system facilitates real-time data processing and tactical decision support, offering coaches scientific insights and a technical framework for optimizing game strategies and personalized training. Introduction As a highly dynamic team sport, basketball game outcomes often hinge on players’ real-time decision-making and tactical execution. Traditional tactical analysis primarily relies on manual observation and empirical judgment, which are frequently subjective and inefficient1,2. The integration of machine learning and Internet of Things (IoT) technology has transformed sports data analysis in recent years, particularly in data collection, real-time processing, and intelligent prediction3,4. However, most existing studies focus on isolated aspects, such as offensive strategies or scoring detection, and lack comprehensive decision support systems spanning the entire offense-defense process5,6. Furthermore, the effective integration of IoT data with machine learning models remains an area requiring improvement7,8. The contributions of this study are primarily reflected in the following three aspects: (1) Theoretical Contribution: A dynamic decision-making model that integrates cognitive theory and action execution is proposed, offering a novel theoretical framework for offense-defense analysis in basketball games. (2) Technical Contribution: The Multi-Task Attention Long Short-Term Memory (MT-AttLSTM) model is developed. By leveraging multi-task learning and the attention mechanism, the model significantly enhances the accuracy of both classification and prediction tasks. (3) Practical Contribution: A comprehensive IoT data collection and processing workflow is established, providing a viable solution for real-time tactical adjustments and personalized training. Literature review In recent years, IoT and machine learning technologies have gradually converged in research on decision support for team sports such as basketball, forming a research direction centred on multi-source data collection, intelligent analysis, and tactical prediction. At the level of cognitive and motor control theory, Wakatsuki et al. (2024) explored the dynamic decision-making mechanism of basketball players switching from shooting to passing during a jump shot through on-site simulation experiments, confirming that parallel processing theory is also applicable to decisions involving motor effectors9. In terms of the integrated application of IoT and computer vision, Ćirić et al. (2024) proposed an intelligent scoring detection subsystem architecture. This system improved the accuracy and real-time performance of scoring recognition through camera configuration optimization and machine learning algorithms, while considering the reliability and cost-effectiveness of Radio Frequency Identification (RFID) technology10. In cross-sport strategy analysis research, Chang et al. (2025) constructed a deep learning-driven decision tree ensemble algorithm to analyze table tennis serving strategies and the probability of scoring/losing points in the first three strokes. Through video analysis and predictive modeling, this method achieved quantitative evaluation of individual technical preferences and strategy effects, providing targeted training suggestions for athletes11. For basketball-specific tactical recognition, Tian et al. (2019) used full-team spatiotemporal tracking data of National Basketball Association (NBA) players and the ball to develop a classification model that automatically identified multiple defensive strategies against pick-and-roll tactics. The model also achieved analysis of off-ball players’ defensive actions for the first time. This method achieved a classification accuracy of 69% in cross-validation, proving the feasibility and potential of machine learning in complex tactical pattern recognition. This finding is of direct significance for the automated analysis of defensive strategies in offense-defense decision support systems12. In terms of performance prediction and index optimization, Papageorgiou et al. (2024) compared the performance of 14 machine learning models in predicting basketball key performance indicators. The results showed that tree-based models (e.g., Extra Trees and Random Forest) performed best in most indicators, and the Mean Absolute Percentage Error (MAPE) was reduced by 3.6% through a comprehensive prediction method13. In terms of constructing a hierarchical motor skill evaluation system, Shi et al. (2024) designed a dedicated skill recognition and hierarchical evaluation system for table tennis, providing important methodological references for the quantification of technical and tactical abilities in complex team sports such as basketball. In this study, motion data of table tennis players were collected through improved wearable devices. A feature database for six types of basic actions was constructed using sliding window segmentation and feature engineering, and a hierarchical evaluation system based on pattern recognition methods was established to achieve accurate assessment of athletes’ professional skill levels (p < 0.01)14. Overall, existing research has established a relatively solid foundation for the application of IoT and machine learning technologies in basketball game analysis and tactical decision support. Relevant achievements have made certain progress in player trajectory tracking, action recognition, scoring prediction, defensive strategy identification, and athletic performance evaluation, demonstrating that data-driven methods can enhance the objectivity and efficiency of basketball tactical analysis. However, further refinement remains necessary. First, existing studies predominantly focus on singular analytical tasks, such as trajectory processing, action recognition, defensive pattern classification, or shot outcome prediction, without forming a complete decision support chain spanning “offensive-defensive state recognition—shot probability prediction—tactical feedback.” Consequently, models struggle to fully reveal the dynamic associations among offensive-defensive states, player spatial relationships, tactical execution processes, and game outcomes in basketball competitions. Second, although some studies have introduced IoT sensing devices or machine learning models, they tend to treat data acquisition, feature extraction, temporal modeling, and decision output as relatively independent stages, lacking systematic elaboration of information transmission relationships and collaborative mechanisms among modules. This limitation constrains model interpretability and practical application value. Third, regarding multi-source data fusion, existing methods predominantly employ static concatenation or unified encoding approaches, which inadequately accommodate dynamic variations in player movement speed, defensive pressure, tactical rhythm, data modality weights, and noise interference during basketball games. Particularly under critical scenarios such as fast-break transitions, defensive rotations, pick-and-roll coordination, and high-pressure defense, the capacity of models to depict complex offensive-defensive processes remains insufficient. To address the aforementioned limitations, this study further constructs a multi-source spatiotemporal decision support framework for basketball games under IoT environments, building upon existing research. The innovation of this study does not lie in the simple superposition of existing algorithmic modules. Rather, it resides in the systematic integration of multi-modal data acquisition, differentiated feature encoding, bidirectional temporal modeling, attention weight allocation, and multi-task collaborative learning around the specific scenario of basketball offensive-defensive decision-making. Specifically, this study first acquires multi-source data through an IoT architecture. These data include player positions, basketball trajectories, kinematic features, physiological information, and game contexts. The study then performs differentiated encoding according to the structural characteristics of different modal data. This approach reduces information conflicts arising from direct fusion of heterogeneous data. Second, this study introduces Bidirectional Long Short-Term Memory (Bi-LSTM) networks. These networks capture forward and backward temporal dependencies during offensive-defensive transition processes. The model can thus recognize current game states. It can also comprehend tactical evolution by integrating preceding action preparations and subsequent behavioral changes. Simultaneously, this study assigns higher weights to critical temporal segments and important tactical actions through a multi-head attention mechanism, enabling the model to focus on segments that exert significant influence on game decisions, such as fast-break initiation, defensive rotations, pick-and-roll formation, and shot release. Furthermore, this study incorporates offensive-defensive state classification and shot probability prediction into a unified multi-task learning framework for joint optimization, enabling the two tasks to share spatiotemporal representations and form complementary relationships. On the one hand, the offensive-defensive state classification task can provide tactical context priors for shot probability prediction, assisting the model in understanding variations in scoring opportunities under different offensive-defensive states. On the other hand, the shot probability prediction task can reversely guide the model to attend to key actions and spatial relationships closely associated with game outcomes, thereby enhancing the accuracy and stability of offensive-defensive state recognition. Previous studies emphasized singular tactical identification or independent performance prediction. This study constructs a complete analytical chain. It extends from multi-source data perception and spatiotemporal feature modeling to offensive-defensive decision output. This approach further strengthens the collaborative relationship between IoT data and machine learning models. This framework contributes to improving the accuracy of basketball offensive-defensive state recognition and shot prediction, and provides more interpretable and practically valuable technical support for coaches’ real-time tactical adjustments, post-game review analysis, and athletes’ personalized training. Research model Multimodal data acquisition architecture in IoT environment This study constructs a three-layer IoT technical architecture, namely the perception layer, network layer, and application layer. Perception layer: Six Basler acA2000-50gc industrial cameras (50 fps, 2048 × 1088 resolution) are deployed on the venue ceiling to transmit image streams via the GigE Vision protocol. Players wear Polar H10 heart rate belts (1 Hz sampling) and Catapult OptimEye S5 inertial sensors (100 Hz, including accelerometer and gyroscope), which communicate with the edge gateway through Bluetooth 5.0/BLE (Bluetooth Low Energy). All sensors achieve sub-millisecond synchronization (error < 1 ms) via PTP (Precision Time Protocol). Network layer: The edge gateway (NVIDIA Jetson AGX Orin) runs ROS (Robot Operating System) 2 nodes to perform real-time object detection and trajectory extraction, and uploads 25 Hz player/basketball coordinate data to the cloud via the Message Queuing Telemetry Transport (MQTT) protocol. Application layer: The cloud server aligns timestamps of multi-source data and constructs multimodal feature vectors including spatial trajectories, kinematic features, physiological features, and game context, providing standardized inputs for subsequent deep learning models. Multimodal feature coding Basketball match data exhibit spatiotemporal heterogeneity, containing multiple modalities such as player position (continuous), offensive-defensive state (categorical), and physiological signals (time-series)15. Substantial differences in scale, type, and information density across modal data mean that direct input into the model may result in feature conflicts or information loss. This study designs modality-specific encoders: spatial trajectory coordinates (x, y, z) of players and the ball are mapped to 64-dimensional vectors via linear projection; kinematic features such as velocity and acceleration are embedded into 32-dimensional vectors after LayerNorm normalization. Categorical features such as offensive-defensive labels and game periods are converted into 16-dimensional vectors through learnable embedding layers; physiological signals are aligned from original sampling rates (1–100 Hz) to the SportVU sampling rate (25 Hz) via linear interpolation to achieve temporal consistency. Subsequently, aligned modal features are concatenated and fused through a fully connected layer to generate a 128-dimensional comprehensive feature vector at each time step, providing a unified and informative input representation for subsequent temporal modeling16. Bidirectional temporal modeling and attention mechanism Bi-LSTM for temporal dependency capture Basketball is a highly dynamic team sport characterized by significant temporal dependencies in players’ action sequences17. Basketball action decisions exhibit remarkable bidirectional dependence: at the moment of shooting, players must simultaneously consider historical action preparation (past context) and defensive reaction prediction (future context). This study adopts Bi-LSTM rather than traditional unidirectional LSTM to capture complete contextual information through parallel forward and backward propagation18. Bi-LSTM can simultaneously learn action variation patterns from past to future and latent information from future to past, enabling the model to fully comprehend the temporal context of the current action19,20. The forward LSTM processes the sequence in chronological order, while the backward LSTM processes it in reverse order, with each generating hidden state respectively:1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\overrightarrow{{h}_{t}}=\mathrm{L}\mathrm{S}\mathrm{T}\mathrm{M}\left({x}_{t},\overrightarrow{{h}_{t-1}}\right)$$\end{document}2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathop{{{h}_{t}}}\limits^{\leftharpoonup} =\mathrm{L}\mathrm{S}\mathrm{T}\mathrm{M}\left({x}_{t},\overleftarrow{{h}_{t-1}}\right)$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\overrightarrow{{h}_{t}}$$\end{document} represents the hidden state output by the forward LSTM at the\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\:t$$\end{document}-th time step. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}_{t}$$\end{document} represents the multimodal feature vector input at the t-th time step, which includes player position, basketball position, velocity, acceleration, offensive/defensive label, game context, and physiological features. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\overrightarrow{{h}_{t-1}}$$\end{document} represents the hidden state output by the forward LSTM at the t-1-th time step. The complete contextual representation of the final time step is obtained by splicing the forward and backward states:3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{h}_{t}=[\overrightarrow{{h}_{t}};\mathop{{{h}_{t}}}\limits^{\leftharpoonup}]$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:[\overrightarrow{{h}_{t}};\mathop{{{h}_{t}}}\limits^{\leftharpoonup}]$$\end{document} indicates the vector splicing operation, and the final hidden state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{h}_{t}\epsilon{\mathbb{R}}^{256}$$\end{document} contains forward and backward timing information. In the traditional unidirectional LSTM model, sequence information is transmitted solely from past to future in chronological order. Consequently, the hidden state at each time step can only utilize feature information from the current and preceding moments, being unable to directly perceive subsequent actions21. This imposes limitations when processing basketball game data. For example, at the moment when a player is preparing to shoot or launch a defensive counterattack, information regarding subsequent actions, such as the ball’s flight trajectory or teammates’ movements, carries important reference value for current decision-making22. To address this issue, Bi-LSTM is introduced. Bi-LSTM establishes both forward and backward temporal pathways simultaneously: On one hand, it captures the dependence of historical actions from past to future. On the other hand, it captures potential subsequent action trends from future to past23. Through this bidirectional modeling, the hidden state at each time step contains complete contextual information, enabling the model to more accurately understand the relationship between the current action and the overall game environment24. In basketball games, tracking information and prediction tasks are not governed by a simple “input-output” relationship, but rather by a bidirectional coupling mechanism characterized by mutual constraints and reinforcement. From the tracking-to-prediction direction, continuous trajectories of players and the ball, velocity changes, spatial distances, and offensive-defensive positioning collectively form dynamic representations of game states, thereby providing the foundational basis for offensive-defensive state recognition and shot success prediction. Fast breaks, for example, are typically characterized by higher advancing speeds, larger longitudinal displacement, and reduced defensive pressure, whereas set plays often involve increased half-court spatial occupation, pass-and-cut coordination, and defensive rotations. Thus, continuous tracking data reveals the formation and evolution processes of offensive and defensive behaviors, enabling the model to recognize static states at given moments and to comprehend evolutionary trends. From the prediction-to-tracking-representation direction, prediction tasks likewise influence the model’s selection and interpretation of tracking information. Offensive-defensive state classification and shot success prediction guide the model, through error feedback during training, to focus more intensively on trajectory segments and key actions closely associated with game decision outcomes. In shot prediction, for instance, the model places greater emphasis on critical moments such as changes in defensive distance prior to shooting, the ball handler’s sudden stop and jump, and teammates’ spatial stretching. In offensive-defensive state classification, the model concentrates more on spatiotemporal patterns with tactical significance, including fast-break initiation, defensive positioning, pick-and-roll formation, and rotational defense. Consequently, tracking data provides the state foundation for prediction, while prediction tasks, through the training process, prompt the model to filter and reinforce tracking features of greater decision-making value. This study employs Bi-LSTM to capture forward and backward temporal dependencies, combined with an attention mechanism to highlight key trajectory segments, based on the theoretical logic of “tracking representation driving prediction, and prediction objectives reverse-optimizing representation.” Multi-head attention for key feature focusing In basketball games, some actions or events have a greater impact on the outcome, such as shooting motions, breakthrough timing, or pick-and-roll coordination of key players25. Therefore, this study introduces Multi-Head Attention (MHA) on the basis of the output. The structure of multi-head attention is shown in Fig. 1. Fig. 1Multi-head attention structure. Multi-head attention structure. MHA employs parallel computation with H = 4 independent attention heads. Each head projects the input into query \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{Q}_{h}$$\end{document}, key \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{K}_{h}$$\end{document}, and value \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{V}_{h}$$\end{document} with dimension \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{d}_{k}=64$$\end{document}, and calculates scaled dot-product attention as:4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{A}\mathrm{t}\mathrm{t}\mathrm{e}\mathrm{n}\mathrm{t}\mathrm{i}\mathrm{o}\mathrm{n}({Q}_{h},{K}_{h},{V}_{h})=\mathrm{s}\mathrm{o}\mathrm{f}\mathrm{t}\mathrm{m}\mathrm{a}\mathrm{x}\left(\frac{{Q}_{h}{K}_{h}^{T}}{\sqrt{{d}_{k}}}\right){V}_{h}$$\end{document} In the equation, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{A}\mathrm{t}\mathrm{t}\mathrm{e}\mathrm{n}\mathrm{t}\mathrm{i}\mathrm{o}\mathrm{n}({Q}_{h},{K}_{h},{V}_{h})$$\end{document} represents the attention result output by the h-th attention head. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{Q}_{h}$$\end{document} represents the query matrix of the h-th attention head, which is obtained by linearly mapping the input features and is used to represent the information that needs to be focused on at the current time step. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{K}_{h}$$\end{document} represents the key matrix of the h-th attention head, which is used to calculate the correlation score with the query matrix. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{V}_{h}$$\end{document} represents the value matrix of the h-th attention head, which represents the weighted aggregated feature content. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{Q}_{h}{K}_{h}^{T}$$\end{document} represents the dot product between the query matrix and the transposed key matrix, which is used to calculate the similarity between different time steps or different features. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{d}_{k}$$\end{document} represents the dimension of the key vector. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\sqrt{{d}_{k}}$$\end{document} is used to scale the dot product result to avoid gradient instability due to excessive dimensionality. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{s}\mathrm{o}\mathrm{f}\mathrm{t}\mathrm{m}\mathrm{a}\mathrm{x}(\cdot\:)$$\end{document} represents the normalization function, which is used to convert the similarity score into attention weights. h represents the attention head number. The outputs of multiple heads are concatenated and then processed by a linear transformation to obtain the context vector that fuses multi-view information:5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{M}\mathrm{H}\mathrm{A}(Q,K,V)=\mathrm{C}\mathrm{o}\mathrm{n}\mathrm{c}\mathrm{a}\mathrm{t}({\mathrm{h}\mathrm{e}\mathrm{a}\mathrm{d}}_{1},...,{\mathrm{h}\mathrm{e}\mathrm{a}\mathrm{d}}_{H}){W}^{O}$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{M}\mathrm{H}\mathrm{A}(Q,K,V)$$\end{document} represents the final output result of the multi-head attention mechanism. Q, K, and V respectively represent the query matrix, key matrix, and value matrix obtained after the overall input undergoes linear mapping. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:hea{d}_{h}$$\end{document} represents the output result of the h-th attention head. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{h}\mathrm{e}\mathrm{a}{\mathrm{d}}_{1},\dots\:,\mathrm{h}\mathrm{e}\mathrm{a}{\mathrm{d}}_{\mathrm{H}}$$\end{document} represents the output set from the 1st to the Hth attention head. H represents the number of attention heads. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{C}\mathrm{o}\mathrm{n}\mathrm{c}\mathrm{a}\mathrm{t}(\cdot\:)$$\end{document} represents the feature concatenation operation, which is used to merge the outputs of multiple attention heads along the feature dimension. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}^{O}$$\end{document} represents the output linear transformation matrix, which is used to map the concatenated multi-head features to a unified-dimensional context vector. Multi-task joint modeling In this study, a multi-task framework with shared encoding and task-specific decoding is designed to simultaneously optimize offensive-defensive state classification and shooting percentage prediction, and a corresponding multi-dimensional performance evaluation system is established. Model architecture design Shared encoder: Bi-LSTM + MHA for extracting general spatiotemporal features. Task 1: Offensive-defensive state classification (multi-class classification). To map the shared features to the categorical probability distribution, a fully connected layer with Softmax activation is adopted:6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{p}_{class}=Softmax({W}_{c}\cdot\:z+{b}_{c})$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{p}_{class}$$\end{document} represents the probability distribution of categories output by the offensive-defense state classification task. z represents the shared spatiotemporal feature vector extracted by Bi-LSTM and multi-head attention mechanism. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}_{c}$$\end{document} represents the weight matrix of the fully connected layer for the classification task. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{b}_{c}$$\end{document} represents the bias term of the fully connected layer for the classification task. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}_{c}\cdot\:z+{b}_{c}$$\end{document} represents the linear transformation structure of the classification task. The optimization objective of the classification task is to minimize the cross-entropy loss, whose loss function is defined as:7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathcal{L}}_{cls}=-{\sum\:}_{i}{y}_{i}\mathrm{l}\mathrm{o}\mathrm{g}\left({p}_{i}\right)$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}_{cls}$$\end{document} represents the cross-entropy loss for the classification task of attack and defense states. i represents the category number of the attack and defense state. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}$$\end{document} represents the true label of the i-th category, encoded using one-hot encoding method. When the sample belongs to this category, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}=1$$\end{document}, otherwise \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}=0$$\end{document}. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{p}_{i}$$\end{document} represents the probability predicted by the model that the sample belongs to the i-th category. Task 2: Shooting percentage prediction (regression + probability calibration). The shared features are activated by Sigmoid to output the predicted probability:8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\widehat{y}}_{shot}=\sigma\:({W}_{r}\cdot\:z+{b}_{r})$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\widehat{y}}_{shot}$$\end{document} represents the probability of a shot being made as predicted by the model. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\sigma\:(\cdot\:)$$\end{document} represents the Sigmoid activation function, which is used to limit the output values to the range of 0 to 1. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}_{r}$$\end{document} represents the weight matrix of the regression output layer in the shot-making probability prediction task. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{b}_{r}$$\end{document} represents the bias of the regression output layer. To simultaneously optimize prediction accuracy and probability calibration, the regression task adopts a composite loss function that fuses binary cross-entropy and mean squared error:9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathcal{L}}_{reg}=\mathrm{B}\mathrm{C}\mathrm{E}(\widehat{y},y)+\lambda\:\cdot\:\mathrm{M}\mathrm{S}\mathrm{E}(\widehat{y},y)$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}_{reg}$$\end{document} represents the composite regression loss for the shooting percentage prediction task. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{B}\mathrm{C}\mathrm{E}(\widehat{y},y)$$\end{document} represents the binary cross-entropy loss, which is used to measure the classification error between the predicted shooting probability and the actual shooting result. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{M}\mathrm{S}\mathrm{E}(\widehat{y},y)$$\end{document} represents the mean squared error loss, which is used to measure the numerical deviation between the predicted probability and the actual result. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{y}$$\end{document} represents the shooting probability predicted by the model. Joint optimization objective. Multi-task training requires balancing the loss contributions of the two tasks; thus, a total loss function with weighting coefficients is defined as:10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathcal{L}}_{\mathrm{t}\mathrm{o}\mathrm{t}\mathrm{a}\mathrm{l}}={\lambda\:}_{1}{\mathcal{L}}_{\mathrm{c}\mathrm{l}\mathrm{s}}+{\lambda\:}_{2}{\mathcal{L}}_{\mathrm{r}\mathrm{e}\mathrm{g}}$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\lambda\:}_{1}=0.6$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\lambda\:}_{2}=0.4$$\end{document} are tuned via the validation set to balance the contributions of the classification and regression tasks. Task relationship mechanism The two tasks are not optimized independently, but instead realize knowledge transfer through a shared spatiotemporal encoder. The “fast break/half-court offense” features learned by the offensive-defensive state classification task provide contextual prior for shooting percentage prediction. Conversely, the regression gradient of the shooting prediction task is back-propagated through the shared layer to refine the resolution of spatiotemporal features, resulting in more precise classification boundaries. To quantify this synergistic effect, this study designs a dynamic weight adjustment strategy: when classification accuracy on the validation set improves while regression MAPE deteriorates, weights are automatically adjusted to prevent gradient updates from being dominated by a single task. This strategy enables the model to maintain balanced improvement of both tasks during later training stages (after 60 epochs), rather than allowing one task to dominate the other. Experimental design and performance evaluation Datasets collection, experimental environment and parameters setting The dataset used is from the NBA SportVU tracking system26, covering complete tracking data of regular-season and playoff games from the 2018–2023 seasons. The SportVU system deploys six high-speed cameras at the venue, recording the 2D/3D positions (, y, ) of each player and the basketball at a sampling frequency of 25 Hz, while also synchronously generating dynamic information such as velocity and acceleration. Additionally, combined with game event logs (play-by-play data), offense-defense state labels (e.g., set offense, fast break, defensive rotation) and shooting results for each possession are obtained. For certain games, player physiological characteristics, such as heart rate and exercise load, are also collected via RFID and IoT wearable devices. For samples lacking physiological features, a feature masking strategy is adopted during model training: feature values for missing components are set to zero, while the attention mechanism automatically adjusts their contribution weights to the final result, ensuring that all samples can be utilized for training. After data cleaning and window slicing, a total of 42,000 temporal samples is formed, with 70% allocated for training, 15% for validation, and 15% for testing. Among these, 27,360 samples (65.14%) include complete physiological features, while 14,640 samples (34.86%) lack physiological features such as heart rate or exercise load. These missing physiological features primarily result from non-deployment of wearable devices in certain matches, device connectivity interruptions, or anomalous sensor data from individual athletes. To address these missing data issues, this study adopts a strategy combining zero padding with a masking mechanism. During feature fusion and attention calculation, masking information is simultaneously fed into the model, enabling the attention layer to minimize the impact of missing modalities on final prediction results, thereby avoiding feature bias caused by simple zero padding. Detailed summary information of the dataset is shown in Table 1. Table 1Dataset feature summary.Feature categorySpecific characteristicsData typeSample coverageDimension/DescriptionSpatial positionExercise InformationPlayer (x, y, z)Continuous typeAll samples10 people × 3 coordinatesBall (x, y, z)Continuous typeAll samples1 × 3 coordinatesEvent LabelPlayer speed, accelerationContinuous typeAll samplesCalculated based on positionPhysiological characteristicsFeature categoryOffensive and defensive status (such as offensive formation)Categorical typeAll samplesSingle labelShot result (made/missed)Categorical typeAll samplesUsed for regression tasksSpatial positionHeart rate, physical loadContinuous typePartial samplesIf missing, then perform masking processing Table 1Dataset feature summary.Feature categorySpecific characteristicsData typeSample coverageDimension/DescriptionSpatial positionExercise InformationPlayer (x, y, z)Continuous typeAll samples10 people × 3 coordinatesBall (x, y, z)Continuous typeAll samples1 × 3 coordinatesEvent LabelPlayer speed, accelerationContinuous typeAll samplesCalculated based on positionPhysiological characteristicsFeature categoryOffensive and defensive status (such as offensive formation)Categorical typeAll samplesSingle labelShot result (made/missed)Categorical typeAll samplesUsed for regression tasksSpatial positionHeart rate, physical loadContinuous typePartial samplesIf missing, then perform masking processing Dataset feature summary. Spatial position Exercise Information Physiological characteristics Feature category This study further divides the test set into two groups based on the completeness of the physiological features: “samples with complete physiological features” and “samples with missing physiological features.” The accuracy of attack-defense state classification and the Mean Absolute Percentage Error (MAPE) for shot accuracy prediction are then computed for each group. The results are shown in Table 2: Table 2The impact of physiological feature completeness on model performance.Sample typeSample sizeSample proportion (%)Accuracy rate of offensive and defensive state classificationMAPE (%)Samples with complete physiological characteristics27,36065.140.9049.42Samples lacking physiological characteristics, processed using masking14,64034.860.88710.16All samples42,000100.000.8979.80 Table 2The impact of physiological feature completeness on model performance.Sample typeSample sizeSample proportion (%)Accuracy rate of offensive and defensive state classificationMAPE (%)Samples with complete physiological characteristics27,36065.140.9049.42Samples lacking physiological characteristics, processed using masking14,64034.860.88710.16All samples42,000100.000.8979.80 The impact of physiological feature completeness on model performance. The above results indicate that the absence of physiological features slightly reduces model performance, though the impact remains relatively limited. This is because basketball offensive-defensive state recognition and shot accuracy prediction primarily rely on spatiotemporal information such as player position, velocity, acceleration, ball trajectory, and game events, with physiological features serving a more auxiliary role. By introducing a masking mechanism, the model can automatically reduce the weight of missing modalities when physiological data is absent, relying more intensively on complete spatiotemporal trajectories and game context features, thereby ensuring the stability and reproducibility of overall prediction performance. To ensure the efficiency of model training and evaluation, this study conducts experiments in a high-performance hardware environment and adopts experimental parameters suitable for temporal deep learning. The experimental environment and model hyperparameter settings are as follows: Table 3 presents the hardware and software environments used in this study, including the processor, GPU, memory, as well as the deep learning framework and auxiliary libraries. Table 3Hardware and software environment.CategoryConfiguration/parametersExplanationHardwareCPU (Central Processing Unit)Intel Xeon Gold 6338 (2.0 GHz, 32 cores)GPU (Graphics Processing Unit)NVIDIA A100 80GB × 2RAM (Random Access Memory)512 GB DDR4 (Double Data Rate 4th )SoftwareOperating systemUbuntu 22.04 LTSDevelopment languagePython 3.10Deep learning frameworkPyTorch 2.1 + CUDA (Compute Unified Device Architecture) 12.1Auxiliary libraryNumPy, Pandas, Scikit-learn, Matplotlib, Optuna Table 3Hardware and software environment.CategoryConfiguration/parametersExplanationHardwareCPU (Central Processing Unit)Intel Xeon Gold 6338 (2.0 GHz, 32 cores)GPU (Graphics Processing Unit)NVIDIA A100 80GB × 2RAM (Random Access Memory)512 GB DDR4 (Double Data Rate 4th )SoftwareOperating systemUbuntu 22.04 LTSDevelopment languagePython 3.10Deep learning frameworkPyTorch 2.1 + CUDA (Compute Unified Device Architecture) 12.1Auxiliary libraryNumPy, Pandas, Scikit-learn, Matplotlib, Optuna Hardware and software environment. Through this environment, the high-frequency spatial-temporal data of NBA SportVU can be processed quickly, and the multi-task training and attention mechanism calculation of the model can be supported. Table 4 lists the key parameters of this model, including time window, LSTM structure, attention mechanism, optimizer and training rounds. Table 4Key parameters of the model.ParameterSettingTime window W3s (75 frames)LSTM layer number2-layer Bi-LSTMHidden unit128Attention mechanismMulti-Head Self-Attention (4 heads, 64 dimensions)Dropout0.3Batch Size128OptimizerAdamWLearning rate schedulingCosine AnnealingMulti-task loss weightλ1 = 0.6 (classify), λ2 = 0.4(return)Training rounds80 Epoch, early stop (Patience = 10) Table 4Key parameters of the model.ParameterSettingTime window W3s (75 frames)LSTM layer number2-layer Bi-LSTMHidden unit128Attention mechanismMulti-Head Self-Attention (4 heads, 64 dimensions)Dropout0.3Batch Size128OptimizerAdamWLearning rate schedulingCosine AnnealingMulti-task loss weightλ1 = 0.6 (classify), λ2 = 0.4(return)Training rounds80 Epoch, early stop (Patience = 10) Key parameters of the model. By setting the above parameters, the model can make full use of multi-modal spatiotemporal information, achieving high-precision performance in both offensive-defensive state classification and shooting percentage prediction. To evaluate the performance of MT-AttLSTM in the offensive-defensive state classification task, this study divides the NBA SportVU dataset into three subsets: training set, validation set, and test set. For each subset, MT-AttLSTM is compared with three benchmark models (traditional LSTM, Bi-LSTM, and Bi-LSTM + Attention). This study provides a unified explanation of implementation details and key hyperparameters for Random Forest (RF), Convolutional Neural Network (CNN), and Support Vector Machine (SVM). All baseline models use the same training, validation, and test set splits as the MT-AttLSTM model, and follow identical data cleaning, normalization, time-window slicing, and feature input processes. Continuous features are standardized using z-score normalization, categorical features are encoded using one-hot encoding, and missing physiological features are handled with the same masking mechanism as the main model. Hyperparameters for each model are tuned on the validation set, while the test set is used solely for final performance evaluation. For RF, the base learner is a classification tree based on the Gini index. The number of trees is set to 300, the maximum tree depth to 20, the minimum number of samples for splitting nodes to 4, and the minimum number of samples for leaf nodes to 2. The maximum number of features randomly chosen at each split is set to the square root of the total number of features. To mitigate the impact of class imbalance on classification results, class weights in RF are set to “balanced,” with the random seed fixed to 42. For CNN, a one-dimensional temporal convolutional structure is used to extract local spatiotemporal features within the time window. The model includes three 1D convolution layers with 64, 128, and 128 filters, each with a kernel size of 3 and a stride of (1) BatchNormalization and ReLU activation functions are applied after each convolution layer. Max-pooling layers are placed after the first two convolution layers, with a pooling kernel size of (2) The convolution features are globally averaged and then passed through a fully connected layer with 128 hidden units and a dropout rate of 0.3. CNN uses the AdamW optimizer with an initial learning rate of 0.001, a batch size of 128, and 80 training epochs, with an early stopping mechanism and patience set to 10. For SVM, a radial basis function is used for nonlinear classification. The penalty parameter C is set to 10, and the kernel function parameter γ is set to “scale.” Class weights are set to “balanced.” Since SVM cannot directly model long temporal sequences, this study aggregates multimodal features within each time window by calculating statistics such as mean, standard deviation, maximum, minimum, and range. These aggregated features are then used as input for SVM, ensuring that it performs the classification task on an equivalent raw information basis. Performance evaluation Classification task (prediction of attack and defense state) The classification performance metrics include Accuracy, Macro-F1, and Cohen’s Kappa, which are used to comprehensively measure the classification ability of each model on different subsets. The classification results of each model on the three subsets are shown in Fig. 2. Fig. 2Classification results of each model on three subsets. Classification results of each model on three subsets. In Fig. 2, MT-AttLSTM outperforms all benchmark models across subsets. It achieves an accuracy of 0.925 on the training set, while attaining 0.903 and 0.897 on the validation and test sets respectively, demonstrating strong generalization ability. Results for Macro-F1 and Cohen’s Kappa likewise indicate that MT-AttLSTM maintains high-level performance under class imbalance condition. This demonstrates that the introduction of the multi-task attention mechanism can effectively capture spatiotemporal features of player actions, thereby improving both the accuracy and stability of offensive-defensive state classification. Regression task (shooting percentage prediction) For the shooting hit rate prediction task, the training set, validation set, and test set are also used for evaluation. On each subset, the performance of MT-AttLSTM is compared with that of LSTM, Bi-LSTM, and Bi-LSTM +Attention. The evaluation metrics include MAPE, Root Mean Square Error (RMSE), and Brier Score, which are used to measure the prediction accuracy of the model and the calibration of probability output. The regression results of each model on different subsets are displayed in Fig. 3. Fig. 3Regression results of each model on different subsets. Regression results of each model on different subsets. The results in Fig. 3 show that MT-AttLSTM achieves the lowest MAPE and RMSE across all subsets, with its Brier Score also outperforming other models. This indicates that MT-AttLSTM can accurately predict shooting percentage while providing reliable probability estimation. The multi-task attention structure of MT-AttLSTM fully utilizes players’ temporal features and offensive-defensive state information, enhancing the stability and generalization ability of shooting percentage prediction relative to single-task model. This result further verifies the adaptability of MT-AttLSTM to complex basketball movement data within the multi-task learning framework. Comparative experiment of benchmark model To verify the performance advantages of MT-AttLSTM, this study selects several typical machine learning and deep learning models as benchmarks, including RF, CNN, and traditional SVM. The same dataset and preprocessing pipeline are adopted across all models to ensure evaluation fairness. Accuracy, Recall, and F1-score are calculated for each model on the training, validation, and test sets respectively. The performance comparison between MT-AttLSTM and benchmark models across the three subsets is presented in Fig. 4. Fig. 4Performance comparison between this study and the benchmark model on three subsets. Performance comparison between this study and the benchmark model on three subsets. Figure 4 reveals that MT-AttLSTM significantly outperforms RF, CNN, and SVM in terms of Accuracy, Recall, and F1-score across all three subsets, demonstrating its stability and high precision in offensive-defensive state classification. Compared to RF and SVM, CNN performs better in local spatial feature extraction. However, it still falls short of MT-AttLSTM when handling long-term temporal dependencies. While SVM exhibits some classification ability in small-scale feature spaces, it cannot directly process temporal data, resulting in inferior performance across all subsets relative to MT-AttLSTM. These results validate the effectiveness of the multi-task attention mechanism in MT-AttLSTM: by sharing temporal features and dynamically focusing on key player actions, the model achieves high-precision classification in complex basketball game environments. Overall, this experiment underscores the advantages of MT-AttLSTM over both traditional machine learning and deep learning models, providing a reliable technical foundation for offensive-defensive decision support in basketball games. Generalization verification of scene adaptive parameters To address the potential issue of heuristic parameter tuning for scene-adaptive adjustments, this study further designs an experiment to verify cross-scene generalization. Under fixed core model structure, learning rate, batch size, time window, and loss weights, test subsets are divided based on game scenario differences to evaluate model stability across diverse offensive-defensive contexts. The test set is categorized into four typical scenarios: half-court offense, fast-break transition, defensive rotation, and high-pressure defense. Half-court offense corresponds to regular offensive organization after establishing positions in the half court. Fast-break transition refers to quick progression following steals, rebounds, or turnovers. Defensive rotation involves changes in defensive formations during pick-and-roll, help defense, and recovery defense situations. High-pressure defense refers to scenarios with close defensive distances, high confrontation intensity, or limited shooting space. To avoid performance confined to a single scenario, this study adopts a “single-scenario training-cross-scenario testing” validation approach. The results are presented in Table 5. Table 5Verification results of generalization of scene adaptive parameters.Training ScenarioTest scenarioAccuracyMacro-F1MAPE (%)RMSETactical OffensivePositional attack0.9060.8999.540.136Tactical OffensiveFast break transition0.8840.87610.310.145Tactical OffensiveDefensive rotation0.8790.87110.460.148Tactical OffensiveHigh pressure defense0.8720.86510.720.151Fast Break ConversionFast break transition0.9120.9049.370.134Fast Break ConversionPositional attack0.8870.87910.180.143Fast Break ConversionDefensive rotation0.8810.87310.390.147Fast Break ConversionHigh pressure defense0.8740.86610.680.150Defensive RotationDefensive rotation0.9010.8949.620.138Defensive RotationPositional attack0.8830.87510.270.146Defensive RotationFast break transition0.8860.87810.210.144Defensive RotationHigh pressure defense0.8760.86810.590.149High Press DefenseHigh pressure defense0.8950.8879.910.140High Press DefensePositional attack0.8780.87010.480.149High Press DefenseFast break transition0.8820.87410.350.146High Press DefenseDefensive rotation0.8750.86710.630.150 Table 5Verification results of generalization of scene adaptive parameters.Training ScenarioTest scenarioAccuracyMacro-F1MAPE (%)RMSETactical OffensivePositional attack0.9060.8999.540.136Tactical OffensiveFast break transition0.8840.87610.310.145Tactical OffensiveDefensive rotation0.8790.87110.460.148Tactical OffensiveHigh pressure defense0.8720.86510.720.151Fast Break ConversionFast break transition0.9120.9049.370.134Fast Break ConversionPositional attack0.8870.87910.180.143Fast Break ConversionDefensive rotation0.8810.87310.390.147Fast Break ConversionHigh pressure defense0.8740.86610.680.150Defensive RotationDefensive rotation0.9010.8949.620.138Defensive RotationPositional attack0.8830.87510.270.146Defensive RotationFast break transition0.8860.87810.210.144Defensive RotationHigh pressure defense0.8760.86810.590.149High Press DefenseHigh pressure defense0.8950.8879.910.140High Press DefensePositional attack0.8780.87010.480.149High Press DefenseFast break transition0.8820.87410.350.146High Press DefenseDefensive rotation0.8750.86710.630.150 Verification results of generalization of scene adaptive parameters. The results in Table 5 show that the scene-adaptive strategy employed in this study does not rely entirely on fixed heuristic parameters. Instead, it adaptively models key spatiotemporal features across different game scenarios under shared spatiotemporal encoding, attention weight allocation, and multi-task loss constraints. Cross-scene experimental results indicate that the model maintains stable classification and prediction performance across various training-testing scenario combinations. Accuracy is mainly distributed between 0.872 and 0.912, while MAPE is primarily between 9.37% and 10.72%, demonstrating that the method possesses a certain level of cross-scene generalization ability. However, performance degradation is still observed in more complex scenarios, such as high-pressure defense. Future research could further incorporate finer-grained indicators of confrontation intensity, players’ physical condition, and variations in defensive distance to enhance the model’s adaptability in complex game contexts. Multi-task synergy effect ablation experiment To further verify the actual contribution of the multi-task learning mechanism to model performance improvement, this study designs a multi-task synergy ablation experiment under the condition that the main structure of MT-AttLSTM remains unchanged. Three model variants are constructed for comparison: Single-Cls-AttLSTM, which retains only the offensive and defensive state classification task and removes the shot success rate prediction branch;Single-Reg-AttLSTM, which retains only the shot success rate prediction task and removes the offensive and defensive state classification branch;MT-AttLSTM, which simultaneously retains both the offensive and defensive state classification and shot success rate prediction tasks, and performs joint training through a shared spatiotemporal encoder. Single-Cls-AttLSTM, which retains only the offensive and defensive state classification task and removes the shot success rate prediction branch; Single-Cls-AttLSTM, which retains only the offensive and defensive state classification task and removes the shot success rate prediction branch; Single-Reg-AttLSTM, which retains only the shot success rate prediction task and removes the offensive and defensive state classification branch; Single-Reg-AttLSTM, which retains only the shot success rate prediction task and removes the offensive and defensive state classification branch; MT-AttLSTM, which simultaneously retains both the offensive and defensive state classification and shot success rate prediction tasks, and performs joint training through a shared spatiotemporal encoder. MT-AttLSTM, which simultaneously retains both the offensive and defensive state classification and shot success rate prediction tasks, and performs joint training through a shared spatiotemporal encoder. The experimental results are shown in Table 6. Table 6Results of the experiment on disabling the multitask synergy effect.Model setupTraining tasksAccuracyMacro-F1Cohen’s KappaMAPE (%)RMSEBrier ScoreSingle-Cls-AttLSTMState classification (only offensive or defensive)0.8810.8740.856———Single-Reg-AttLSTMShot accuracy prediction only———10.470.1460.071MT-AttLSTMOffense-defense classification + Shot prediction0.8970.8920.8759.800.1370.066 Table 6Results of the experiment on disabling the multitask synergy effect.Model setupTraining tasksAccuracyMacro-F1Cohen’s KappaMAPE (%)RMSEBrier ScoreSingle-Cls-AttLSTMState classification (only offensive or defensive)0.8810.8740.856———Single-Reg-AttLSTMShot accuracy prediction only———10.470.1460.071MT-AttLSTMOffense-defense classification + Shot prediction0.8970.8920.8759.800.1370.066 Results of the experiment on disabling the multitask synergy effect. Compared with single-task training, multi-task joint training achieves better performance in both classification and regression tasks, indicating a clear complementary relationship between offensive-defensive state classification and shot success rate prediction. The classification task enhances the model’s ability to recognize tactical states and spatial organization patterns, while the regression task guides the model to focus on key actions and outcome-oriented features influencing shooting results. Through the shared Bi-LSTM and multi-head attention encoder, both tasks are jointly optimized, enabling the model to simultaneously learn, within the same spatiotemporal representation space, both how game states are formed and how these states affect shooting outcomes. Summary of experimental results To visually demonstrate the comprehensive advantages of the MT-AttLSTM model, this study summarizes the results of all the comparative experiments on the test set in Fig. 5. Fig. 5Summary of the performance of all models on the test set. Summary of the performance of all models on the test set. To evaluate the stability of each model’s performance more rigorously and address the impact of inherent noise in real sports data on experimental results, this study conducts a statistical analysis on the multiple runs of the models on the test set. Specifically, each model is independently run five times with the same hyperparameter settings and initialized with different random seeds. The mean ± standard deviation of each metric is calculated, and the 95% confidence interval is reported. Tables 7 and 8 present the performance statistics (mean ± standard deviation and 95% confidence interval) of each model on the test set. Table 7Performance statistics (mean ± standard deviation) of each model on the test set.ModelAccuracyMacro-F1Cohen’s KappaMAPE (%)RMSEBrier ScoreLSTM0.825 ± 0.0080.814 ± 0.0090.798 ± 0.01012.1 ± 0.320.157 ± 0.0040.079 ± 0.002Bi-LSTM0.842 ± 0.0070.835 ± 0.0080.821 ± 0.00911.5 ± 0.280.150 ± 0.0030.075 ± 0.002Bi-LSTM+Attention0.871 ± 0.0060.861 ± 0.0070.846 ± 0.00810.8 ± 0.240.144 ± 0.0030.072 ± 0.001MT-AttLSTM0.897 ± 0.0050.892 ± 0.0060.875 ± 0.0079.8 ± 0.190.137 ± 0.0020.066 ± 0.001 Table 7Performance statistics (mean ± standard deviation) of each model on the test set.ModelAccuracyMacro-F1Cohen’s KappaMAPE (%)RMSEBrier ScoreLSTM0.825 ± 0.0080.814 ± 0.0090.798 ± 0.01012.1 ± 0.320.157 ± 0.0040.079 ± 0.002Bi-LSTM0.842 ± 0.0070.835 ± 0.0080.821 ± 0.00911.5 ± 0.280.150 ± 0.0030.075 ± 0.002Bi-LSTM+Attention0.871 ± 0.0060.861 ± 0.0070.846 ± 0.00810.8 ± 0.240.144 ± 0.0030.072 ± 0.001MT-AttLSTM0.897 ± 0.0050.892 ± 0.0060.875 ± 0.0079.8 ± 0.190.137 ± 0.0020.066 ± 0.001 Performance statistics (mean ± standard deviation) of each model on the test set. The statistical results in Fig. 5; Table 7 show that: First, model stability increases as complexity improves. MT-AttLSTM exhibits smaller standard deviations across all metrics than other baseline models. For example, in terms of accuracy, the standard deviation of LSTM is ± 0.008, while that of MT-AttLSTM decreases to ± 0.005. This indicates that the multi-task attention mechanism not only improves prediction accuracy but also enhances model robustness against data noise and random initialization. In the regression task, the MAPE standard deviation of MT-AttLSTM is only ± 0.19%, which is significantly lower than ± 0.32% for LSTM, further verifying its prediction stability. Second, performance differences among various models are statistically significant. Table 8Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval).ModelAccuracy95%CI (accuracy)MAPE (%)95%CI (MAPE)LSTM0.825 ± 0.008[0.817,0.833]12.1 ± 0.32[11.78,12.42]Bi-LSTM0.842 ± 0.007[0.835,0.849]11.5 ± 0.28[11.22,11.78]Bi-LSTM+Attention0.871 ± 0.006[0.865,0.877]10.8 ± 0.24[10.56,11.04]MT-AttLSTM0.897 ± 0.005[0.892,0.902]9.8 ± 0.19[9.61,9.99] Table 8Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval).ModelAccuracy95%CI (accuracy)MAPE (%)95%CI (MAPE)LSTM0.825 ± 0.008[0.817,0.833]12.1 ± 0.32[11.78,12.42]Bi-LSTM0.842 ± 0.007[0.835,0.849]11.5 ± 0.28[11.22,11.78]Bi-LSTM+Attention0.871 ± 0.006[0.865,0.877]10.8 ± 0.24[10.56,11.04]MT-AttLSTM0.897 ± 0.005[0.892,0.902]9.8 ± 0.19[9.61,9.99] Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval). By calculating the 95% confidence interval, it is found that the accuracy interval of MT-AttLSTM is [0.892, 0.902], which does not overlap with the interval [0.865, 0.877] of Bi-LSTM+Attention, demonstrating that the performance improvement is statistically significant. Similarly, for the MAPE metric, the confidence interval of MT-AttLSTM [9.61, 9.99] is completely lower than the minimum intervals of other models, indicating that its advantage in the shooting percentage prediction task is statistically significant. Based on the results of five independent runs, a two-tailed t-test was conducted to compare MT-AttLSTM with the current best-performing benchmark model, Bi-LSTM+Attention. Considering that the standard deviations of different models across multiple runs are not exactly the same, Welch’s t-test is employed for model comparison. The significance level was set at 0.05, with a p<0.05 indicating statistical significance between the two models, and a p<0.01 indicating a highly statistically significant difference. The test results are shown in Table 9. Table 9Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval).IndicatorBi-LSTM+AttentionMT-AttLSTMt valuep valueSignificant conclusionAccuracy0.871 ± 0.0060.897 ± 0.0057.44< 0.001SignificanceMacro-F10.861 ± 0.0070.892 ± 0.0067.52< 0.001SignificanceCohen’s Kappa0.846 ± 0.0080.875 ± 0.0076.10< 0.001SignificanceMAPE(%)10.8 ± 0.249.8 ± 0.197.31< 0.001SignificanceRMSE0.144 ± 0.0030.137 ± 0.0024.340.003SignificanceBrier Score0.072 ± 0.0010.066 ± 0.0019.49< 0.001Significance Table 9Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval).IndicatorBi-LSTM+AttentionMT-AttLSTMt valuep valueSignificant conclusionAccuracy0.871 ± 0.0060.897 ± 0.0057.44< 0.001SignificanceMacro-F10.861 ± 0.0070.892 ± 0.0067.52< 0.001SignificanceCohen’s Kappa0.846 ± 0.0080.875 ± 0.0076.10< 0.001SignificanceMAPE(%)10.8 ± 0.249.8 ± 0.197.31< 0.001SignificanceRMSE0.144 ± 0.0030.137 ± 0.0024.340.003SignificanceBrier Score0.072 ± 0.0010.066 ± 0.0019.49< 0.001Significance Performance statistics of each model on the test set (mean standard deviation and 95% confidence interval). Table 9 shows that the differences between MT-AttLSTM and Bi-LSTM+Attention in terms of Accuracy, Macro-F1, Cohen’s Kappa, MAPE, RMSE, and Brier Score all reach statistical significance. Specifically, the p-values for Accuracy, Macro-F1, Cohen’s Kappa, MAPE, and Brier Score are all less than 0.001, indicating that the performance improvement of MT-AttLSTM in both attack-defense state classification and shooting accuracy prediction tasks is not due to random initialization or fluctuations from a single experiment. For the RMSE metric, the p-value is 0.003, which is also less than 0.01, suggesting that MT-AttLSTM also demonstrates a significant advantage over Bi-LSTM+Attention in controlling regression errors. Analysis of the impact of occlusion scenes In the real-world data collection of basketball games, physical confrontations between players, dense positioning under the basket, and rapid cross-running movements often cause short-term occlusions in the camera’s view, leading to the loss of player trajectories, ID switches, or temporary coordinate fluctuations. This section further analyzes the occlusion scenarios in the test set and compares the model performance under occluded and non-occluded frames. Occlusion is defined in this study as the following three situations: High overlap of player detection boxes, causing the trajectories of two or more players to temporarily coincide.Missing coordinates of a player over consecutive frames, requiring interpolation or trajectory smoothing to fill in the gaps.ID switching of players in adjacent time windows by the tracking system. High overlap of player detection boxes, causing the trajectories of two or more players to temporarily coincide. High overlap of player detection boxes, causing the trajectories of two or more players to temporarily coincide. Missing coordinates of a player over consecutive frames, requiring interpolation or trajectory smoothing to fill in the gaps. Missing coordinates of a player over consecutive frames, requiring interpolation or trajectory smoothing to fill in the gaps. ID switching of players in adjacent time windows by the tracking system. ID switching of players in adjacent time windows by the tracking system. Based on these criteria, this study labels and statistically analyzes the time series samples in the test set. The occlusion frequency statistics are shown in Table 10. Table 10Frequency statistics of occluded scenes in the test set.Scene typeSample sizeProportion of test set (%)Average occlusion duration (s)ID switching rate (%)Non-occluded sample4,98679.14—0.00Mild occlusion sample81212.890.121.36Moderate occlusion sample3645.780.273.85Severe occlusion sample1382.190.467.97Total6,300100.00—— Table 10Frequency statistics of occluded scenes in the test set.Scene typeSample sizeProportion of test set (%)Average occlusion duration (s)ID switching rate (%)Non-occluded sample4,98679.14—0.00Mild occlusion sample81212.890.121.36Moderate occlusion sample3645.780.273.85Severe occlusion sample1382.190.467.97Total6,300100.00—— Frequency statistics of occluded scenes in the test set. Table 10 shows that out of the 6,300 test samples, non-occluded samples account for 79.14%, while samples with varying degrees of occlusion total 1,314, making up 20.86%. Among these, mild occlusion samples account for 12.89%, moderate occlusion samples account for 5.78%, and severe occlusion samples account for 2.19%. In terms of occlusion duration, mild occlusion usually lasts for a shorter time, with an average duration of 0.12s, causing minimal impact on trajectory continuity. In contrast, severe occlusion lasts for an average of 0.46s and is associated with a higher ID-switching rate, indicating that scenarios like crowded areas under the basket, multi-player screens, and low post confrontations are more prone to tracking errors. To further analyze the impact of occlusion on model performance, we separately calculated Accuracy, Macro-F1, MAPE, and RMSE for non-occluded samples and samples with different degrees of occlusion. The results are shown in Table 11. Table 11The Impact of obstruction degree on model performance.Scene typeAccuracyMacro-F1MAPE (%)RMSEUnobstructed sample0.9030.8989.550.135Mild obstruction sample0.8910.88410.020.141Moderate obstruction sample0.8760.86810.740.149Severe obstruction sample0.8510.84211.630.158All test samples0.8970.8929.800.137 Table 11The Impact of obstruction degree on model performance.Scene typeAccuracyMacro-F1MAPE (%)RMSEUnobstructed sample0.9030.8989.550.135Mild obstruction sample0.8910.88410.020.141Moderate obstruction sample0.8760.86810.740.149Severe obstruction sample0.8510.84211.630.158All test samples0.8970.8929.800.137 The Impact of obstruction degree on model performance. It shows that occlusion does not completely undermine the model’s predictive ability, but it does have a significant impact on the model’s performance in high-contact, dense under-the-basket, and multi-player defensive scenarios. Future research could further introduce multi-view trajectory reconstruction, player identity consistency constraints, and occlusion-robust training strategies to enhance the model’s stability and engineering deploy ability in complex game data collection environments. Edge scenario error analysis In addition to player occlusion, basketball games feature several edge scenarios subject to special rule constraints and high-pressure decision-making characteristics, such as critical possessions near the end of the 24-second shot clock, key plays during close scores, and rushed shots under defensive pressure. Although these scenarios account for a small percentage of the overall sample, they can introduce additional errors in shooting accuracy prediction and offensive-defensive state identification due to their more complex decision-making processes and less stable action rhythms. The previous discussion provided a qualitative analysis of 24-second shot clock pressure. This section further quantifies it from both frequency of occurrence and prediction error perspectives. This study specifically focuses on analyzing pressure scenarios near the 24-second shot clock limit. Based on game rules and actual tactical features, offensive possessions with shots taken within 2 s of the shot clock expiration are defined as “time-pressure samples”; shots taken within 2–6 s are defined as “moderate-pressure samples”. Shots taken with more than 6 s remaining are defined as “regular-shot samples.” The sample distribution under different shot clock time-pressure conditions is presented in Tables 12, 13 and 14: Table 12Distribution of samples under different attack time pressure conditions.Timing conditions for actionSample typeSample sizeProportion of test set (%)Remaining time > 6 sRegular sample4,22167.002 s < Remaining time ≤ 6 sMedium pressure sample1,45323.06Remaining time ≤ 2 sTime limit pressure sample6269.94TotalAll samples6,300100.00 Table 12Distribution of samples under different attack time pressure conditions.Timing conditions for actionSample typeSample sizeProportion of test set (%)Remaining time > 6 sRegular sample4,22167.002 s < Remaining time ≤ 6 sMedium pressure sample1,45323.06Remaining time ≤ 2 sTime limit pressure sample6269.94TotalAll samples6,300100.00 Distribution of samples under different attack time pressure conditions. Table 13The impact of attack time limit pressure on model performance.Timing conditions for actionAccuracyMAPE (%)RMSERemaining time > 6 s0.9049.410.1342 s < Remaining time ≤ 6 s0.89110.180.142Remaining time ≤ 2 s0.86211.760.160All test samples0.8979.800.137 Table 13The impact of attack time limit pressure on model performance.Timing conditions for actionAccuracyMAPE (%)RMSERemaining time > 6 s0.9049.410.1342 s < Remaining time ≤ 6 s0.89110.180.142Remaining time ≤ 2 s0.86211.760.160All test samples0.8979.800.137 The impact of attack time limit pressure on model performance. Table 14Contribution of pressure samples of different time limits to the prediction error of shot attempts.Sample typeSample proportion (%)MAPE (%)Error contribution ratio (%)Regular sample67.009.4161.82Medium pressure sample23.0610.1824.76Time limit pressure sample9.9411.7613.42All samples100.009.80100.00 Table 14Contribution of pressure samples of different time limits to the prediction error of shot attempts.Sample typeSample proportion (%)MAPE (%)Error contribution ratio (%)Regular sample67.009.4161.82Medium pressure sample23.0610.1824.76Time limit pressure sample9.9411.7613.42All samples100.009.80100.00 Contribution of pressure samples of different time limits to the prediction error of shot attempts. The analysis of edge scenarios shows that MT-AttLSTM performs with relatively stable predictive ability under regular game conditions, but its performance decreases in special scenarios with higher offensive time pressure. The primary reason for this is that, in such scenarios, player decisions are influenced by a combination of rule pressure, time pressure, and defensive pressure. This results in more abrupt movement patterns and shot choices that are more random in nature. Discussion This study addresses basketball offensive-defensive decision support in IoT environments, and constructs a multi-task temporal modeling framework based on MT-AttLSTM. The framework is experimentally validated for two tasks: offensive-defensive state classification and shot accuracy prediction. Compared to traditional machine learning models, the advantage of MT-AttLSTM primarily lies in its ability to capture continuous temporal relationships. RF and SVM primarily rely on fixed-length features aggregated from statistical data, which, although effective for classification to some extent, struggle to express dynamic processes in player movements, offensive-defensive transitions, passing, and defensive rotations. CNN is capable of extracting motion patterns within local time windows, but its ability to model long-range dependencies remains relatively limited. In contrast, MT-AttLSTM uses Bi-LSTM to capture forward and backward temporal dependencies and integrates multi-head attention mechanisms to focus on key action segments. This enables it to better recognize state transitions in basketball games triggered by continuous trajectory changes. This constitutes one of the key reasons why the proposed model achieves higher Accuracy and Macro-F1 scores on the test set. Compared to LSTM, Bi-LSTM, and Bi-LSTM+Attention, the improvement of MT-AttLSTM is derived from both the attention mechanism and the collaborative learning effect brought about by multi-task shared representation. Ablation experiments show that Single-Cls-AttLSTM, which performs only offensive-defensive state classification, achieves lower Accuracy, Macro-F1, and Cohen’s Kappa compared to the joint training model. Similarly, Single-Reg-AttLSTM, which predicts only shot accuracy, performs worse in terms of MAPE, RMSE, and Brier Score compared to MT-AttLSTM. This demonstrates that the offensive-defensive state classification task provides tactical context priors for shot prediction, while the shot prediction task, in turn, guides the model to focus on key spatiotemporal segments related to the outcome. The two tasks complement each other through the shared temporal encoder, enabling the model to simultaneously learn information from both “how the game state is formed” and “how this state influences shot outcomes.” From the perspective of research progress in the field, existing studies on intelligent basketball analysis mostly focus on single tasks, such as offensive strategy recognition, defensive tactic classification, shot outcome prediction, or score detection. In contrast, this study attempts to integrate offensive and defensive state recognition with shot outcome prediction into a unified framework, by incorporating multi-source data from the IoT to construct spatiotemporal feature inputs. This expands, to some extent, the analytical dimensions of basketball game decision support systems. This framework outputs the assessment of the offensive and defensive states at a given moment and further estimates the probability of shot outcomes. As a result, it provides more detailed reference points for coaches’ real-time tactical adjustments, players’ training feedback, and game review analysis. Therefore, the main contribution of this study is not in proposing entirely new neural network units, but rather in integrating and validating multi-source spatiotemporal features, bidirectional sequential modeling, attention focusing, and multi-task learning for the specific context of basketball decision-making. The experimental results also highlight certain limitations of the model in complex scenarios. First, the scene generalization experiment shows that the model’s performance drops when the training and testing scenes are misaligned, particularly in high-pressure defense scenarios. This suggests that factors such as defensive intensity, physical confrontation, shot space, and tactical tempo in basketball games alter the data distribution, posing challenges for the model’s cross-scenario transfer performance. Second, the occlusion analysis reveals that player occlusion leads to short-term trajectory loss, coordinate fluctuations, and ID switching, which affect the model’s judgment of both offensive and defensive states and shot outcomes. In severe occlusion samples, accuracy significantly drops compared to non-occluded samples, and MAPE increases, indicating that real-world game data collection conditions remain a critical factor impacting model deployment performance. Additionally, edge case analysis shows that although samples taken within the last 2 s of the 24-second shot clock are not frequent, they contribute significantly to overall prediction errors. These samples are typically associated with rushed shots, strong defensive pressure, and unconventional decision-making, thereby making shot outcome prediction more challenging when relying solely on conventional spatiotemporal trajectory features. The proposed MT-AttLSTM model primarily relies on the spatiotemporal trajectory features of players and the ball, kinematic features, game context features, and some physiological features. The model does not explicitly incorporate a knowledge graph module. The previous discussion about incorporating basketball domain expert rules through knowledge graphs was intended to suggest potential directions for future research, rather than a component of the current study. To avoid overstating the scope of the current work, the related statements have been revised in this version of the paper to reflect future research prospects. In other words, the current model does not include explicit basketball rule reasoning, expert knowledge graphs, or physical constraint layers. Its predictive capability primarily stems from data-driven spatiotemporal representation learning. Overall, the results of this study demonstrate that MT-AttLSTM, supported by IoT multi-source data, effectively enhances basketball offensive and defensive state classification and shot accuracy prediction performance, showcasing significant potential for decision support. However, performance degradation is observed under conditions such as occlusion, high-pressure defense, time limit pressure, and cross-scenario transfer. Future research can further improve the model in three key areas: Introducing more granular features related to defensive pressure intensity, shot space, player roles, and tactical types to enhance the model’s understanding of complex game contexts.Combining multi-view trajectory reconstruction and identity consistency constraints to improve data quality and tracking stability under occlusion conditions.Exploring the integration of basketball rules, offensive time limit logic, court boundary constraints, and expert tactical knowledge into the model through knowledge graphs or rule-based modules. However, this should be treated as a future extension and designed and verified independently, rather than as part of the current model. Introducing more granular features related to defensive pressure intensity, shot space, player roles, and tactical types to enhance the model’s understanding of complex game contexts. Introducing more granular features related to defensive pressure intensity, shot space, player roles, and tactical types to enhance the model’s understanding of complex game contexts. Combining multi-view trajectory reconstruction and identity consistency constraints to improve data quality and tracking stability under occlusion conditions. Combining multi-view trajectory reconstruction and identity consistency constraints to improve data quality and tracking stability under occlusion conditions. Exploring the integration of basketball rules, offensive time limit logic, court boundary constraints, and expert tactical knowledge into the model through knowledge graphs or rule-based modules. However, this should be treated as a future extension and designed and verified independently, rather than as part of the current model. Exploring the integration of basketball rules, offensive time limit logic, court boundary constraints, and expert tactical knowledge into the model through knowledge graphs or rule-based modules. However, this should be treated as a future extension and designed and verified independently, rather than as part of the current model. Conclusion Research contribution In response to the practical demands of offensive and defensive tactical analysis in basketball games, this study integrates IoT technology and deep learning methods to construct a comprehensive decision support system for basketball offensive and defensive strategies. The system performs multi-task joint modeling of offensive-defensive state classification and shot outcome prediction, thereby providing a novel technical solution and a practical benchmark for tactical analysis and real-time decision-making in basketball competitions. The core research contributions are reflected in three dimensions: theory, technology, and application. Theoretical implications: This study overcomes the limitation of most existing sports data analysis, which focuses only on single-task learning. It develops a dynamic decision-making analysis framework by integrating motor cognition theory and action execution logic. This framework reveals the coupling mechanism of multimodal spatiotemporal features in basketball offensive and defensive behavior modeling and demonstrates the effectiveness of the multi-task learning paradigm in dynamic and complex team sports scenarios, thereby providing a new perspective and support for theoretical research on basketball offensive and defensive analysis. Technical contributions: This study designs and introduces the MT-AttLSTM model. It effectively integrates multi-source heterogeneous data such as player position, kinematics, physiological characteristics, and game context through modality-specific encoders. It adopts Bi-LSTM to capture bidirectional temporal dependencies during the game and introduce the multi-head attention mechanism to accurately focus on key player actions and core tactical scenarios. Meanwhile, a multi-task optimization framework with shared encoding and task-specific decoding is constructed to enable the collaborative optimization of offensive-defensive state classification and shooting percentage prediction, thereby significantly improving the model’s prediction accuracy and robustness. Experimental validation based on NBA SportVU high-precision tracking data shows that the model achieves a test set accuracy of 0.897 in the offensive-defensive state classification task. Its MAPE in the shooting percentage prediction task is significantly lower than that of traditional LSTM, Bi-LSTM, and single attention-based models, with all improvements being statistically significant. Practical applications: This study builds a three-layer IoT multimodal data acquisition architecture, including the perception layer, network layer, and application layer, which enables sub-millisecond synchronous acquisition, real-time transmission, and standardized processing of court vision data, player kinematics data, and physiological data. It also constructs a complete end-to-end technical pipeline, from multi-source data acquisition and deep learning modeling to tactical prediction. The system effectively addresses the problems of high subjectivity and low efficiency in traditional basketball tactical analysis. It provides coaches with a scientific basis for offensive and defensive state judgment and shooting percentage prediction, while also supporting personalized player training and real-time in-game tactical adjustments. This study fills the research gap in existing decision support systems by covering the entire offensive and defensive chain of basketball and promotes the deeper application and deployment of machine learning and IoT technologies in the intelligent analysis of sports events. Future works and research limitations Even though this study produces some encouraging outcomes, there are still certain limitations. First, the model is heavily reliant on computing resources and data quality during training and inference. This may lead to problems such as data scarcity and hardware constraints in non-professional game or training settings. Second, the research tasks focus on offense-defense state classification and shooting accuracy prediction but do not yet cover broader tactical and physiological indicators, such as player fatigue assessment and tactical evolution analysis. This restricts the application scope of the model in multi-dimensional decision support. Future research could explore directions such as reducing model complexity, achieving lightweight design, and enabling real-time deployment. Future work could also attempt to transfer the method to other team sports (e.g., football, handball) to verify its cross-domain applicability.