Abnormal running posture real-time detection method based on wearable inertial sensor
By using a cross-scenario transfer learning framework and wearable inertial sensors, the Transformer model structure is optimized, achieving efficient and accurate running posture detection in a variety of running scenarios. This solves the problem of poor adaptability of running posture detection in multiple scenarios and promotes the prevention and rehabilitation of running posture injuries.
Patent Information
- Application Number
- CN202510570889.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-09-26
AI Technical Summary
In the existing technology, running posture detection methods have poor adaptability in various running scenarios, high time complexity, and difficulty in achieving accurate real-time detection.
A cross-scenario transfer learning framework is adopted, wearable inertial sensors are used to collect data, and running posture prediction is performed through a pre-trained and parameter-fine-tuned Transformer model. The global average pooling layer and the fully connected layer are combined to optimize the model structure to adapt to different running scenarios.
Efficient running posture recognition was achieved in various running scenarios, with the accuracy increased to 95.0%, the training time shortened by 88.1%, and the dependence on large data sets and computing resources was reduced. It is suitable for running posture injury prevention and rehabilitation.
Smart Images

Figure CN120705644A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to computer science and technology, and in particular to a real-time detection method for abnormal running posture based on a wearable inertial sensor. Background Art
[0002] Running is one of the most popular sports, boosting immunity, enhancing cardiopulmonary function, strengthening musculoskeletal function, and improving mood. However, running scenarios are complex, with varying slopes and speeds requiring different runners' postures. Improper running posture can be harmful. Research has shown that an abnormal running posture can increase stress on joints such as the hip, knee, ankle, and foot, accelerating joint wear and leading to chronic pain and sports injuries. Common abnormal running postures can be categorized as follows: 1) excessive forward trunk lean; 2) backward trunk lean; 3) side-to-side trunk sway; and 4) abnormal foot posture. In recent years, the incidence of sports injuries caused by abnormal running posture has reached as high as 19.4%-79.3%. The top two running injuries are patellofemoral pain syndrome (PFPS), accounting for 25% of cases, and iliotibial band syndrome (ITBS), accounting for 1.6%-12% of cases. Research has shown that abnormal running posture significantly increases the risk of PFPS and ITBS. Therefore, accurate and real-time detection of abnormal trunk posture during running is very important for preventing physical injuries caused by various running scenarios. Summary of the Invention
[0003] To address the aforementioned issues in existing technologies, this paper proposes a real-time abnormal running posture detection method based on wearable inertial sensors. This method employs a cross-scenario transfer learning framework, enabling a trained running posture prediction model to detect abnormal running postures in real time based on data collected by wearable inertial sensors. This addresses the challenges of high time complexity and poor adaptability across various running scenarios. The specific technical solution is as follows.
[0004] First, the present disclosure proposes a real-time running posture detection method, which includes the following steps: obtaining historical running posture data, the historical data including scene data at different speeds and slopes, and each scene data including running data with different running postures; using any single scene data to pre-train a Transformer model, the Transformer model is connected to a global average pooling layer and a fully connected layer after the encoder; connecting the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and using all scene data to fine-tune the parameters of the Transformer model; collecting real-time raw running posture data, inputting the fine-tuned running posture prediction model, and outputting the running posture detection results.
[0005] In one implementation of the above technical solution, the scene data is collected by an IMU, and the IMU is composed of a three-axis accelerometer and a three-axis gyroscope.
[0006] In one implementation of the above technical solution, the scene data undergoes data preprocessing, including: first removing part of the data containing outliers at the beginning and end stages of the data, then converting data of different scales into a standard normal distribution, using Z-score normalization to eliminate individual differences, and finally dividing the continuous time series into data segments through a sliding window, and marking each window data.
[0007] In one implementation of the above technical solution, when fine-tuning parameters of the Transformer model, some parameters of the Transformer model are frozen according to a preset freezing ratio.
[0008] In one implementation of the above technical solution, cross loss entropy is used in both pre-training and parameter fine-tuning processes.
[0009] In one implementation of the above technical solution, the encoder structure of the Transformer model is 4 layers.
[0010] In one embodiment of the above technical solution, the running posture includes excessive forward leaning, torso leaning backward, left and right swaying, and normal running posture; the torso of the normal running posture is within a preset range, and the boundary of the preset range is composed of the forward leaning boundary, the backward leaning boundary, and the left and right swaying boundary; the excessive forward leaning is that the torso leans forward exceeding the forward leaning boundary of the normal running posture, and the torso leaning backward is that the torso leans backward exceeding the backward leaning boundary of the normal running posture; the left and right swaying is that the maximum value of the torso shaking exceeds the left and right swaying boundary.
[0011] Secondly, according to the above method and technical solution, the present disclosure also proposes a real-time detection system for abnormal running posture based on wearable inertial sensors, the system including a history module, a pre-training module, a fine-tuning module, and a testing module; the history module is configured to obtain running posture history data, the historical data including scene data at different speeds and slopes, and each scene data includes running data with different running postures; the pre-training module is configured to use any single scene data to pre-train the Transformer model, and the Transformer model is connected to a global average pooling layer and a fully connected layer after the encoder; the fine-tuning module is configured to connect the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and use all scene data to fine-tune the parameters of the Transformer model; the testing module is configured to input the collected real-time original data of running posture into the fine-tuned running posture prediction model, and output the running posture detection result.
[0012] Finally, the present disclosure also proposes a computer-readable storage medium storing a computer program that can be loaded by a processor and execute any of the above methods.
[0013] Beneficial technical effects of the present disclosure: The cross-scenario transfer learning framework of this solution can obtain an accurate running posture prediction model without requiring large datasets and high computing resources. Furthermore, through fine-tuning secondary training, the multi-scenario adaptability of the running posture prediction model is improved, and running posture can be accurately identified in running scenarios with different running speeds and different ground slopes. Furthermore, data collection is convenient, using wearable inertial sensors, making implementation simple and facilitating clinical applications in injury prevention and rehabilitation. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0015] Figure 1 、 one Schematic diagram of the abnormal running posture detection process in this embodiment.
[0016] Figure 2 、 one Schematic diagram of four running postures to be detected in this embodiment.
[0017] Figure 3 、 one Schematic diagram of the Transformer model structure in this implementation method.
[0018] Figure 4 、 one Schematic diagram of the confusion matrix of running posture classification based on the Transformer model in this implementation method. DETAILED DESCRIPTION
[0019] Running is a popular form of exercise and fitness, but incorrect running posture can cause damage to the body. With the development of artificial intelligence and wearable sensor technology, the use of AI-based sensor information processing methods to detect abnormal running posture has become an emerging research direction. However, machine learning-based abnormal running posture detection methods rely heavily on manual feature engineering and have limited adaptability, while deep learning-based abnormal running posture detection methods require large datasets and high computing resources. Furthermore, running scenarios are complex, including varying running speeds and varying ground slopes, posing challenges to the multi-scenario adaptability of running posture anomaly detection models.
[0020] Based on this, this case adopts a cross-scene transfer learning (Cross Scene Transformer Learning, CSTL) framework to detect abnormal running postures and solve the problems of high time complexity and poor adaptability in various running scenarios. In the pre-training stage, this case uses data collected from a single scene to optimize the Transformer model structure to improve recognition accuracy. In the fine-tuning stage, by freezing parameters of different proportions, the running posture anomaly detection model pre-trained in a single scene (fixed speed and slope) is migrated to a more complex scene (five speeds / slopes). In the testing stage, the performance of the model in each running scene is verified by freezing all parameters of the fine-tuning model.
[0021] Compared to non-CSTL methods, the proposed CSTL method achieved an accuracy of 88.0% across five running scenarios, reducing training time by 88.1%. When the fine-tuned model was applied to each running scenario, the average accuracy across the five scenarios reached 89.7% after 10 rounds of training. This average accuracy further improved to 95.0% after 50 rounds. This demonstrates that the proposed CSTL method significantly shortens training time and improves recognition accuracy, outperforming non-transfer learning methods in both efficiency and accuracy, and promoting its clinical application in running posture detection, injury prevention, and rehabilitation.
[0022] The following provides a clear and complete description of how the technical solution of this case is implemented. Obviously, the described implementation methods are only part of the implementation methods of this case, not all of them. Based on the implementation methods of this case, all other implementation methods obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0023] See also Figure 1 Based on the inertial signals collected by the wearable inertial measurement unit (IMU) during running, abnormal running posture detection is achieved through a cross-scene transfer learning model, including: first, preprocessing the collected signals. Then, in the pre-training module, the Transformer model is trained using a small dataset of a single running scene. Next, in the fine-tuning module, some parameters of the pre-trained model are frozen, and a linear classifier is added to its output layer. Subsequently, the pre-trained model is migrated to a large dataset containing five different speed and slope scenes through transfer learning to obtain a comprehensive cross-scene model. Finally, the comprehensive cross-scene model is applied to evaluate the abnormal running posture recognition performance of each running scene in the test module.
[0024] (1) Running data collection and preprocessing
[0025] Using 6-axis IMU data, including 3-axis accelerometer and 3-axis gyroscope signals, with a data sampling rate of 200Hz, running data of 4 running postures in 5 running scenarios with different speeds and slopes are collected.
[0026] The running scene is pre-set, and one setting method is shown in Table 1.
[0027] Table 1
[0028]
[0029] Running posture refers to the overall coordination from head to foot. In one embodiment, running posture is divided into four types according to the relative upright position of the body during running: excessive forward leaning, trunk backward leaning, left and right swaying, and normal running posture. The trunk of a normal running posture is within a preset range, and the boundaries of the preset range are composed of a forward leaning boundary, a backward leaning boundary, and a left and right swaying boundary; the excessive forward leaning refers to the trunk leaning forward exceeding the forward leaning boundary of the normal running posture, the trunk backward leaning refers to the trunk leaning backward exceeding the backward leaning boundary of the normal running posture; the left and right swaying refers to the maximum value of the trunk shaking exceeding the left and right swaying boundary.
[0030] See also Figure 2 As shown in the figure, with the body upright as a reference, the normal running posture is that the whole body naturally leans forward 5°-10°; when it exceeds 10° (not including 10°), the running posture is excessively leaning forward; when the body leans backward, the torso leans backward; when the body sways from side to side, the running posture is swaying from side to side.
[0031] During data preprocessing, the initial and final 30 seconds of the data were removed to avoid data bias caused by outliers at the beginning and end. Data at different scales were then transformed to a standard normal distribution and normalized using Z-scores to eliminate individual differences. Subsequently, a 15-second sliding window was designed to segment the continuous time series into data segments, capturing local temporal patterns and facilitating sequence labeling. Finally, the data in each window was labeled, and the performance of the running posture anomaly detection model was evaluated using a leave-one-out validation method.
[0032] (2) Pre-training
[0033] The Transformer model introduces a multi-head self-attention mechanism, which has the advantages of efficient parallelization, long-range dependency modeling, scalability, and flexibility.
[0034] Multi-headed Self-attention mechanism: It performs multiple self-attention-based processing processes; then, the results of each self-attention-based processing process are concatenated and linearly transformed to obtain the final output result.
[0035] Self-attention mechanism: It is a variant of the attention mechanism. Its essential principle is the same as the attention mechanism. The difference is that, for example, the attention mechanism focuses on the correlation between different images, while the self-attention mechanism focuses more on the intrinsic connection within an image.
[0036] This case uses the Transformer model as the backbone of the CSTL model, see Figure 3 The structure is optimized from the following aspects to better adapt to the IMU time series data for monitoring abnormal running posture ( Figure 3 IMU data in ).
[0037] (2.1) Positional encoding
[0038] The Transformer model abandons the sequential information due to parallel computing, so the position encoding is introduced to supplement the sequential information. Assume that the position encoding matrix can be expressed as w is the number of rows of the position coding matrix, c is the number of columns of the position coding matrix, and the calculation formula for fixed position coding based on sine and cosine functions is:
[0039]
[0040] Among them, i∈(0,w-1) represents the position index and j∈(0,c / 2-1) represents the dimension index.
[0041] The final output after position encoding is expressed as:
[0042] X n ={S n +P n}={s1+p1,s2+p2,...,s w +p w}
[0043] Where: s w Represents the w-th row vector of the output feature of the embedding layer, S n Represents the output features of the embedding layer.
[0044] (2.2) Encoder Optimization
[0045] A 4-layer network structure is introduced to further capture the inherent running characteristics of IMU data. Each encoder layer contains a residual-connected multi-head self-attention and a position-based feedforward network.
[0046] First, each encoder receives the input sequence X n ∈R w×c Generate three vectors, the query matrix Q, the key matrix K, and the value matrix V:
[0047] Q=XW Q , K=XW K , V=XW V
[0048] Among them, W Q , W K , is the projection matrix of the learnable weight parameters, d k is the dimension of (Q, K, V).
[0049] Subsequently, the attention weights are calculated by scaled dot product attention and softmax function:
[0050]
[0051] Finally, a multi-head attention mechanism is used for parallel computation, and each attention head is connected in series according to the following formula:
[0052] MultiHead(Q,K,V)=Concat(head1,...,head h )W o
[0053]
[0054] Where: W o Represents the learnable parameters of multi-head attention, and MultiHead(Q, K, V) is denoted as X enc , as the input of the global average pooling layer.
[0055] (2.3) Aggregation layer and output layer
[0056] In order to classify abnormal running postures, pooling layers and fully connected (FC) layers are used to generate predicted categories.
[0057] Specifically, the dimension of the encoder output is first reduced through the global average pooling layer (Pool), then the Dropout layer is used to prevent overfitting, and finally the output is mapped to four running postures through the FC layer.
[0058] The entire calculation process is as follows:
[0059] X out =FC(Dropout(Pool(X enc )))
[0060] (3) Fine-tuning
[0061] This case proposes an innovative method to migrate a small dataset of a single running scene to a large dataset of five scenes with different speeds and slopes.
[0062] Specifically, we added only fully connected layers to the pre-trained Transformer model and froze a certain percentage of parameters. We conducted a series of comparative experiments to verify the impact of the following variables on the transfer performance, ultimately resulting in a comprehensive cross-scenario model.
[0063] a) Number of epochs: During the fine-tuning phase, increasing the number of training epochs inevitably increases training time. However, its impact on classification performance remains uncertain. For example, we set three different epoch numbers (10, 30, and 50) to evaluate their impact on the classification performance and training time of the CSTL model.
[0064] b) Joint fine-tuning: This refers to fine-tuning all tasks or datasets simultaneously in transfer learning, allowing the model to be trained and optimized simultaneously on all datasets and tasks. To fully leverage the knowledge in the source domain, joint fine-tuning on pre-trained data and new data preserves the data characteristics of both the original and new scenarios.
[0065] c) Freezing ratio: The freezing ratio is a key variable in the fine-tuning process. The bottom layer of the Transformer model generally extracts simple motion features and local time series information, such as the instantaneous values and trends of acceleration and angular velocity. In contrast, the top layer of the model focuses more on complex motion features and global time series information, such as gait cycle and rhythm changes. For example, three different freezing ratios of 0%, 50%, and 90% were designed to flexibly control the specific layer features of the model and compare the convergence speed and transfer performance.
[0066] (4) Testing
[0067] In the testing module, the fine-tuned comprehensive cross-scenario model is used to classify abnormal running postures. All model parameters are frozen to evaluate its performance in each running scenario. Furthermore, three variables—number of rounds, joint fine-tuning, and freezing ratio—not only affect the fine-tuning process but also further influence the comprehensive cross-scenario model's classification performance for each running scenario. Therefore, a set of experiments was designed to evaluate the impact of these three variables on the CSTL model's performance when transferred to a single running scenario.
[0068] (V) Model Verification
[0069] Nine healthy subjects (7 males and 2 females, aged 26 ± 2 years, height 172 ± 5 cm, weight 68 ± 10 kg) with no history of major injuries or illness were recruited and provided written informed consent before the experiment. A single IMU (STT-IWS system) consisting of a triaxial accelerometer and triaxial gyroscope was used to collect real-time raw data at a sampling rate of 200 Hz under four different running postures: excessive forward lean, backward lean, lateral lean, and normal running. First, the IMU was secured to the subject's chest with an elastic strap. Subsequently, the IMU's global reference coordinate system and drift error were calibrated. Then, five running scenarios with different incline and speed were set as shown in Table 1. Each participant was required to complete five running trials under different scenarios. In each trial, the participant ran on a treadmill for 5 minutes at each posture, at the speed and incline specified for each scenario, for a total of 100 minutes across the five trials.
[0070] During the pre-training phase, the raw IMU data from a single running scene on a flat surface at a speed of 6 km / h was pre-processed and input into the Transformer model. The leave-one-out validation method was used to verify the classification effect. The optimized Transformer model served as the backbone of the CSTL model, and the test accuracy reached 87.2%, as shown in Table 2. In addition, the confusion matrix of the Transformer model is shown in Figure 4 As shown in the figure, the model shows high classification accuracy in all four running styles, especially in the "leaning back" category. Other evaluation indicators such as precision, recall, and f1 value all exceed 87%, indicating strong recognition ability for abnormal running styles.
[0071] Table 2 Evaluation results of the pre-trained module Transformer model
[0072]
[0073] During the fine-tuning phase, the comparative experimental results based on different variables are shown below:
[0074] a) Number of epochs: In this experiment, a joint fine-tuning strategy was used, with a freezing ratio set to 0.5. The results in Table 3 show that as the number of training epochs increases, classification accuracy remains unchanged, with minor fluctuations in various metrics. However, the runtime significantly increases. Increasing the number of fine-tuning epochs from 10 to 50 increases runtime by (1818.9 / 388.6 - 1) × 100% ≈ 368.4%, while accuracy decreases by 1.3%. This suggests that while maintaining classification accuracy, selecting a smaller number of 10 epochs significantly reduces runtime.
[0075] Table 3 Evaluation results of CSTL models based on different numbers of rounds in the fine-tuning stage
[0076]
[0077] b) Joint fine-tuning:
[0078] Experiments compared the impact of joint fine-tuning and individual fine-tuning on model performance, with the results shown in Table 4. In this experiment, the freezing ratio was set to 0.5 and the number of training rounds was set to 10. The results show that joint fine-tuning significantly outperforms individual fine-tuning across all metrics, with an accuracy improvement of 5.7%. This further demonstrates that joint fine-tuning can effectively utilize data from multiple running scenarios and improve the model's generalization ability to new scenarios.
[0079] Table 4 Evaluation results of CSTL model in the fine-tuning stage based on different fine-tuning modes
[0080]
[0081] c) Freezing ratio:
[0082] This experiment used joint fine-tuning, with a training epoch number of 10. As shown in Table 5, reducing the freezing ratio from 90% to 50% increased the number of trainable layers and improved test accuracy by 5.3%. Although the time consumption increased by 203 seconds, this was negligible compared to the 1430 seconds added when the number of training epochs increased from 10 to 50. As the freezing ratio continued to decrease, model performance stagnated, and accuracy even began to decline. Results show that a freezing ratio of 50% achieved the best classification performance, with an accuracy of 88%, effectively preventing overfitting.
[0083] Table 5 Evaluation results of CSTL models based on different freezing ratios in the fine-tuning stage
[0084]
[0085] In summary, through a series of comparative experiments on the number of training rounds, joint fine-tuning, and freezing ratio in the fine-tuning phase of the CSTL model, the following conclusions were drawn: a combination of fewer training rounds (10), an appropriate freezing ratio (50%), and joint fine-tuning can achieve the best classification performance, with an accuracy of 88.0%. In addition, the Transformer model takes 650.5 seconds to complete a single running scene, compared to 388.6 seconds for five scenes in the fine-tuning phase. The average time for a single running scene is 388.6 / 5≈77.7 seconds. In other words, the time it takes to classify a single running scene using the CSTL model is shorter than that without the CSTL model by (1-77.7 / 650.5)×100%≈88.1%.
[0086] During the testing phase, Table 6 describes the accuracy of the CSTL model when applied to each running scenario. It can be inferred that the combination of a 50% freeze-scale and joint fine-tuning produced the best classification performance. After 10 rounds of fine-tuning, the average accuracy across the five scenarios reached 89.7%. When the number of training rounds reached 50, the average accuracy further increased to 95.0%. Therefore, it is important to select an appropriate variable combination strategy based on the purpose of the cross-scenario transfer task. Specifically, if accuracy is the primary concern, 50 rounds should be selected. If both accuracy and time consumption are considered, 10 rounds are recommended.
[0087] Table 6 Accuracy of CSTL model applied to a single running scene
[0088]
[0089] (VI) Summary
[0090] In summary, this case effectively reduced computing costs, improved the model's generalization and adaptability, and reduced dependence on large-scale labeled data through cross-scenario transfer learning strategies, optimized Transformer structures, and single-sensor detection technology. It outperformed existing technologies in terms of detection accuracy, training efficiency, and computing resource consumption.
[0091] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that the method disclosed herein includes the following steps: obtaining running posture historical data, the historical data including scene data at different speeds and slopes, and each scene data including running data with different running postures; using any single scene data to pre-train the Transformer model, the Transformer model is connected to a global average pooling layer and a fully connected layer after the encoder; connecting the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and using all scene data to fine-tune the parameters of the Transformer model; collecting real-time raw data of running posture, inputting the fine-tuned running posture prediction model, and outputting the running posture detection results.
[0092] According to the method, a person skilled in the art can implement a corresponding system, comprising a history module, a pre-training module, a fine-tuning module, and a testing module. The history module is configured to acquire historical running posture data, including scenario data at different speeds and slopes, each scenario data including running data of different running postures. The pre-training module is configured to use any single scenario data to pre-train a Transformer model, wherein the Transformer model has a global average pooling layer and a fully connected layer after the encoder. The fine-tuning module is configured to connect the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and fine-tune the parameters of the Transformer model using all scenario data. The testing module is configured to input the collected real-time raw running posture data into the fine-tuned running posture prediction model and output the running posture detection results. The testing module can serve as an application module when the system is applied.
[0093] Furthermore, those skilled in the art will readily appreciate that the aforementioned methods or systems can be implemented using software plus necessary general-purpose hardware, or alternatively, using specialized hardware, including application-specific integrated circuits, dedicated CPUs, dedicated memories, and specialized components. Generally speaking, any function performed by a computer program can be readily implemented using corresponding hardware. Furthermore, the specific hardware structures used to implement the same function can be diverse, such as analog circuits, digital circuits, or specialized circuits. However, for the purposes of this disclosure, software implementation is often the preferred embodiment.
[0094] Although the embodiments of the present disclosure have been described above with reference to the accompanying drawings, the present disclosure is not limited to the specific embodiments and application areas described above. The specific embodiments described above are merely illustrative and instructive, and not restrictive. A person of ordinary skill in the art, guided by this specification and without departing from the scope of protection of the claims of the present disclosure, may devise various other forms, all of which fall within the scope of protection of the present disclosure.
Claims
1. A real-time running posture detection method, characterized in that: The method comprises the following steps: Acquire running posture historical data, wherein the historical data includes scene data at different speeds and slopes, and each scene data includes running data of different running postures; Pre-train a Transformer model with global average pooling and fully connected layers after the encoder using any single scene data; Connect the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and use all scene data to fine-tune the parameters of the Transformer model; Collect real-time raw data of running posture, input it into the fine-tuned running posture prediction model, and output the running posture detection results.
2. The method according to claim 1, characterized in that The scene data is collected by an IMU, which consists of a three-axis accelerometer and a three-axis gyroscope.
3. The method according to claim 1, characterized in that The scene data undergoes data preprocessing, including: first removing some data containing outliers at the beginning and end of the data, then converting data of different scales into a standard normal distribution, using Z-score normalization to eliminate individual differences, and finally dividing the continuous time series into data segments through a sliding window and labeling the data in each window.
4. The method according to claim 1, wherein When fine-tuning the parameters of the Transformer model, freeze some parameters of the Transformer model according to the preset freezing ratio.
5. The method according to claim 1, wherein Cross-loss entropy is used during both pre-training and parameter fine-tuning.
6. The method according to claim 1, wherein The encoder structure of the Transformer model is 4 layers.
7. The method according to claim 1, characterized in that Running posture includes excessive forward leaning, torso leaning backward, left and right swaying, and normal running posture; the torso of normal running posture is within a preset range, and the boundaries of the preset range are composed of the forward leaning boundary, the backward leaning boundary, and the left and right swaying boundary; the excessive forward leaning means that the torso leans forward beyond the forward leaning boundary of the normal running posture, and the torso leaning backward means that the torso leans backward beyond the backward leaning boundary of the normal running posture; the left and right swaying means that the maximum value of the torso shaking exceeds the left and right swaying boundary.
8. A real-time detection system for abnormal running posture based on wearable inertial sensors, characterized in that: The system includes a history module, a pre-training module, a fine-tuning module, and a testing module; The history module is configured to obtain running posture history data, wherein the history data includes scene data at different speeds and slopes, and each scene data includes running data of different running postures; The pre-training module is configured to pre-train a Transformer model using any single scene data, wherein the Transformer model has a global average pooling layer and a fully connected layer after the encoder; The fine-tuning module is configured to connect the pre-trained Transformer model to the fully connected layer to form a running posture prediction model, and fine-tune the parameters of the Transformer model using all scene data; The test module is configured to input the collected real-time raw data of running posture into the fine-tuned running posture prediction model and output the running posture detection result.
9. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.