ST-Transform-based vibrio parahaemolyticus detection rate prediction method
Through the ST-Transformer model, the problems of dynamic spatiotemporal dependence modeling and multi-source data fusion are solved, and efficient detection rate prediction of Vibrio parahaemolytic is achieved, which improves the accuracy and robustness of the model.
Patent Information
- Application Number
- CN202510428852.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-18
AI Technical Summary
The existing technology cannot effectively solve the problems of dynamic spatio-temporal dependence modeling, multi-source data fusion and accuracy, and there are defects of low information utilization and insufficient detection robustness.
Using the ST-Transformer model, through data preprocessing, embedding layer design, parallel spatiotemporal attention layer and multi-scale gating fusion, dynamic features of time and space are captured, dynamically adjusted feature weights are realized, and efficient spatiotemporal sequence prediction is achieved.
The modeling ability of the model to depend on complex space-time is improved, the accuracy and robustness of predicting the detection rate of Vibrio parahaemolyticus is improved, and it can adapt to the needs of different scenarios and tasks.
Smart Images

Figure CN120336716A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spatio-temporal sequences, and particularly relates to a method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer. Background Art
[0002] At present, the specific implementation schemes of the method for predicting the detection rate of Vibrio parahaemolyticus mainly include traditional statistical models, machine learning-based models, and deep learning models
[0003] 1. Traditional statistical models (such as ARIMA, SIR models): Traditional statistical models are prediction methods constructed based on mathematical and statistical principles. They usually assume that the data follows a certain distribution and perform modeling through parameter estimation.
[0004] Limitations: It is difficult to capture the non-linear spatio-temporal dependence relationships in disease transmission, and it has poor adaptability to emergencies.
[0005] 2. Machine learning-based models (such as random forest, support vector machine): Machine learning-based models learn the relationship between input features and target variables in a data-driven manner and are suitable for high-dimensional and non-linear data.
[0006] Limitations: Although they can handle multi-dimensional features, they cannot effectively model the dynamic interactions of spatio-temporal data, and their generalization ability for high-dimensional data is limited.
[0007] 3. Traditional deep learning models (such as LSTM, CNN): Deep learning models automatically extract hierarchical features of data through multi-layer neural networks and are suitable for large-scale complex data.
[0008] Limitations: Although LSTM can model time dependence, it cannot effectively capture spatial associations; although CNN can process spatial data, it is limited by the Euclidean structure and is difficult to model non-Euclidean spatial relationships (such as cross-regional disease transmission).
[0009] In summary, the existing technical solutions cannot effectively solve problems such as dynamic spatio-temporal dependence modeling, multi-source data fusion, and accurate precision, and have defects such as low information utilization rate and insufficient detection robustness. Summary of the Invention
[0010] The main object of the present invention is to provide a method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer, which can effectively solve the problems in the background art.
[0011] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0012] A method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer, the method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer includes the following steps:
[0013] S1. Data preprocessing, the data preprocessing includes the following sub-steps:
[0014] (1) Data collection: Collect multi-source data related to Vibrio parahaemolyticus, including historical detection rates, environmental factors (such as temperature, humidity), economic data (such as regional GDP, population density), etc.;
[0015] (2) Missing value processing: For missing data, interpolation, mean filling or other data filling methods can be used for processing to ensure the integrity of the data;
[0016] (3) Outlier detection: Identify and process outliers through statistical analysis methods (such as Z-score or IQR methods) to avoid negative impacts on model training;
[0017] (4) Standardization / Normalization: Standardize (such as Z-score standardization) or normalize (such as Min-Max normalization) numerical features to make different features on the same scale and avoid the impact of dimensional differences between features on model training;
[0018] (5) Categorical feature encoding: One-hot encode or label encode categorical features (such as regions, seasons, etc.) and convert them into numerical data for model processing;
[0019] S2. Embedding layer design: First, perform feature embedding on the input data, map the original data to a high-dimensional feature space through a fully connected layer to learn richer representations, then construct a time embedding to capture the periodic information of the time series, such as the time of day or the time point of the week, and finally, adopt spatio-temporal adaptive embedding to fuse time and space information. Through a learnable weight matrix, the model can dynamically adjust the importance of time and space features, making it more adaptable in different scenarios;
[0020] S3. Parallel spatio-temporal attention layer, the specific implementation of the parallel spatio-temporal attention layer is divided into three steps:
[0021] (1) Spatial attention: Unfold the input data along the time dimension, calculate the spatial correlation between nodes through multi-head attention, and output dynamic spatial features.
[0022] (2) Time attention: Unfold the input data along the node dimension, calculate the dependency between time steps through multi-head attention, and output dynamic time features.
[0023] (3) Gated fusion: Concatenate the spatial and temporal features, and dynamically adjust the weights through a gating mechanism (such as the Sigmoid function)
[0024] to generate a fused feature representation, and finally input it into the regression layer for prediction.
[0025] S4. Multi-scale gated fusion. The specific implementation of the multi-scale gated fusion is divided into three steps:
[0026] (1) Multi-scale feature extraction: Use convolutional kernels of different scales (such as step sizes of 3 / 5 / 7) to extract multi-level features of the time series in parallel.
[0027] (2) Gating mechanism: Generate gating weights through a fully connected layer and the Sigmoid function to dynamically adjust the contributions of features at each scale.
[0028] (3) Feature fusion: Multiply the multi-scale features by the gating weights and then concatenate or perform weighted summation to generate a comprehensive feature representation, and finally input it into the regression layer for prediction.
[0029] S5. Model training and optimization: To improve the detection rate of Vibrio parahaemolyticus, the model uses the mean absolute error function and continuously optimizes the weight parameters using backpropagation. For the loss function, the mean absolute error is used to measure the gap between the prediction result and the true label. The optimization method continuously updates the network parameters through the gradient descent method to improve the detection accuracy of the model. The ultimate goal is to obtain a model that can predict the detection rate of Vibrio parahaemolyticus through an efficient training strategy.
[0030] Preferably, in S2, the core feature of the embedding layer is to efficiently fuse features, periodic information, and adaptive spatio-temporal relationships, enabling the ST-Transformer to achieve high-precision spatio-temporal sequence prediction without relying on complex graph structures.
[0031] Preferably, in S3, the parallel spatio-temporal attention mechanism captures the spatial correlations between nodes and the long-term dependencies in the time series through independent spatial and temporal attention modules respectively, avoiding information loss in traditional sequential designs. Its core advantages lie in parallel processing and dynamic feature fusion: The spatial attention module dynamically assigns node weights to highlight the influence of important regions; the temporal attention module captures the patterns at key time steps; the two are adaptively fused through a gating mechanism to enhance the model's ability to model complex spatio-temporal dependencies.
[0032] Preferably, in S4, multi-scale gated fusion extracts local and global features in the time series through multi-scale convolutional kernels, capturing short-term fluctuations (such as sudden traffic changes) and long-term trends (such as periodic patterns). Its core advantage lies in dynamic feature weight allocation: through a gating mechanism (such as the Sigmoid function), the weights of features at different scales are adaptively adjusted to adapt to the changes in the input data, thereby enhancing the model's expressive ability and robustness.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] (1) In the present invention, the spatial attention module can capture the disease transmission paths in adjacent regions, and the temporal attention module can model the impact of seasonal climate on disease outbreaks. The spatial and temporal attention modules operate independently, avoiding information transmission deviation and improving computational efficiency.
[0035] (2) In the present invention, multi-scale gated fusion aims to dynamically balance the weights of different features through multi-scale feature extraction and a gating mechanism, thereby enhancing the model's expressive ability and robustness. The weights of features at different scales are dynamically adjusted through the gating mechanism to adapt to the changes in the input data. During the stable period, the model may rely more on long-term trend features; during the peak period, the model may pay more attention to short-term fluctuation features.
[0036] (3) In the present invention, external factor fusion encodes external factors such as economy, regional area, and population into vectors, and fuses them with spatio-temporal features through a gating mechanism, enhancing the model's ability to model multi-source data. External factors such as economy, regional area, and population provide additional background information, enabling the model to more comprehensively understand the features of spatio-temporal data, reducing data ambiguity, and helping the model better explore the driving factors behind the data.
[0037] (4) In the present invention, spatio-temporal adaptive embedding generates embedding representations in a data-driven manner, which can adapt to the requirements of different scenarios and tasks, and is used to capture complex spatio-temporal relationships. The adaptive embedding can learn the dynamic relationships of temporal sequence information. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a technical roadmap of a method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer of the present invention.
[0039] In the figure: 1, support base; 2, lifting frame; 3, telescopic shaft; 4, fastening knob; 5, reinforcing cross bar; 6, fixed frame; 7, LCD display screen; 8, audio interface; 9, control box; 10, light sensor; 11, light sensing probe; 12, distance sensor; 13, distance sensing probe; 14, loudspeaker; 15, heat dissipation slot; 16, heat dissipation fan; 17, protective shell; 18, rotating shaft. Detailed Implementation Modes
[0040] To make the technical means, creative features, achieved purposes and effects of the present invention easy to understand, the present invention will be further described below in conjunction with specific implementation modes.
[0041] As Figure 1 shown, a method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer, the method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer includes the following steps:
[0042] S1. Data preprocessing, the data preprocessing includes the following sub-steps:
[0043] (1) Data collection: Collect multi-source data related to Vibrio parahaemolyticus, including historical detection rates, environmental factors (such as temperature, humidity), economic data (such as regional GDP, population density), etc.;
[0044] (2) Missing value processing: For missing data, interpolation method, mean filling or other data filling methods can be used for processing to ensure the integrity of the data;
[0045] (3) Outlier detection: Identify and process outliers through statistical analysis methods (such as Z-score or IQR methods) to avoid negative impacts on model training;
[0046] (4) Standardization / normalization: Standardize (such as Z-score standardization) or normalize (such as Min-Max normalization) numerical features to make different features on the same scale and avoid the impact of dimensional differences between features on model training;
[0047] (5) Categorical feature encoding: One-hot encode or label encode categorical features (such as regions, seasons, etc.) and convert them into numerical data for model processing;
[0048] S2. Embedding layer design: First, perform feature embedding on the input data, map the original data to a high-dimensional feature space through a fully connected layer to learn richer representations, then construct a time embedding to capture the periodic information of the time series, such as the time of day or the time point of the week, and finally, adopt spatio-temporal adaptive embedding to fuse time and space information. Through a learnable weight matrix, the model can dynamically adjust the importance of time and space features, making it more adaptable in different scenarios; the core feature of the embedding layer lies in the efficient fusion of features, periodic information and adaptive spatio-temporal relationships, enabling ST-Transformer to achieve high-precision spatio-temporal sequence prediction without relying on complex graph structures;
[0049] S3. Parallel spatio-temporal attention layer, and the specific implementation of the parallel spatio-temporal attention layer is divided into three steps:
[0050] (1) Spatial attention: Unfold the input data along the time dimension, calculate the spatial correlation between nodes through multi-head attention, and output dynamic spatial features.
[0051] (2) Temporal attention: Unfold the input data along the node dimension, calculate the dependency relationship between time steps through multi-head attention, and output dynamic temporal features.
[0052] (3) Gated fusion: Concatenate the spatial and temporal features, and dynamically adjust the weights through a gated mechanism (such as the Sigmoid function)
[0053] to generate a fused feature representation, and finally input it into the regression layer for prediction.
[0054] Among them, the parallel spatio-temporal attention mechanism captures the spatial correlation between nodes and the long-term dependencies in the time series through independent spatial and temporal attention modules, avoiding information loss in traditional sequential designs. Its core advantages lie in parallel processing and dynamic feature fusion: the spatial attention module dynamically assigns node weights to highlight the influence of important regions; the temporal attention module captures the patterns of key time steps; the two are adaptively fused through a gated mechanism to enhance the model's ability to model complex spatio-temporal dependencies
[0055] S4. Multi-scale gated fusion, and the specific implementation of the multi-scale gated fusion is divided into three steps:
[0056] (1) Multi-scale feature extraction: Use convolutional kernels of different scales (such as stride 3 / 5 / 7) to parallelly extract multi-level features of the time series.
[0057] (2) Gated mechanism: Generate gated weights through a fully connected layer and the Sigmoid function to dynamically adjust the contribution of each scale feature.
[0058] (3) Feature fusion: Multiply the multi-scale features by the gated weights and then concatenate or weighted sum them to generate a comprehensive feature representation, and finally input it into the regression layer for prediction.
[0059] Among them, the multi-scale gated fusion extracts local and global features in the time series through multi-scale convolutional kernels, capturing short-term fluctuations (such as sudden traffic changes) and long-term trends (such as periodic patterns). Its core advantage lies in dynamic feature weight allocation: adaptively adjusting the weights of different scale features through a gated mechanism (such as the Sigmoid function) to adapt to the changes in the input data, thereby enhancing the model's expressive ability and robustness;
[0060] S5. Model Training and Optimization: To improve the detection rate prediction of Vibrio parahaemolyticus, the model uses the mean absolute error function and continuously optimizes the weight parameters using backpropagation. For the loss function, the mean absolute error is adopted to measure the gap between the prediction result and the true label. The optimization method continuously updates the network parameters through the gradient descent method to improve the detection accuracy of the model. The ultimate goal is to obtain a model that can predict the detection rate of Vibrio parahaemolyticus through an efficient training strategy;
[0061] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer, and the method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer includes the following steps: S1. Data preprocessing, and the data preprocessing includes the following sub-steps: (1) Data collection: Collect multi-source data related to Vibrio parahaemolyticus, including historical detection rates, environmental factors (such as temperature, humidity), economic data (such as regional GDP, population density), etc.; (2) Missing value processing: For missing data, interpolation methods, mean filling, or other data filling methods can be used to ensure the integrity of the data; (3) Outlier detection: Identify and process outliers through statistical analysis methods (such as Z-score or IQR methods) to avoid negative impacts on model training; (4) Standardization / normalization: Standardize (such as Z-score standardization) or normalize (such as Min-Max normalization) numerical features to put different features on the same scale and avoid the influence of dimensional differences between features on model training; (5) Categorical feature encoding: One-hot encode or label encode categorical features (such as regions, seasons, etc.) and convert them into numerical data for model processing; S2. Embedding layer design: First, perform feature embedding on the input data, map the original data to a high-dimensional feature space through a fully connected layer to learn richer representations. Then, construct a time embedding to capture the periodic information of the time series, such as the time of day or the time point in a week. Finally, adopt spatio-temporal adaptive embedding to fuse time and space information. Through a learnable weight matrix, the model can dynamically adjust the importance of time and space features, making it more adaptable in different scenarios; S3. Parallel spatio-temporal attention layer, and the specific implementation of the parallel spatio-temporal attention layer is divided into three steps: (1) Spatial attention: Unfold the input data along the time dimension and calculate the spatial correlation between nodes through multi-head attention to output dynamic spatial features. (2) Time attention: Unfold the input data along the node dimension and calculate the dependency relationship between time steps through multi-head attention to output dynamic time features. (3) Gated fusion: Concatenate the spatial and time features, dynamically adjust the weights through a gated mechanism (such as the Sigmoid function), generate a fused feature representation, and finally input it into the regression layer for prediction. S4. Multi-scale gated fusion, and the specific implementation of the multi-scale gated fusion is divided into three steps: (1) Multi-scale feature extraction: Use convolutional kernels of different scales (such as stride 3 / 5 / 7) to extract multi-level features of the time series in parallel. (2) Gated mechanism: Generate gated weights through a fully connected layer and the Sigmoid function to dynamically adjust the contributions of features at each scale. (3) Feature fusion: Multiply the multi-scale features by the gated weights and then concatenate or weighted sum them to generate a comprehensive feature representation, and finally input it into the regression layer for prediction. S5. Model Training and Optimization: To improve the detection rate prediction of Vibrio parahaemolyticus, the model uses the mean absolute error function and continuously optimizes the weight parameters using backpropagation. The mean absolute error is used for the loss function to measure the gap between the prediction results and the true labels. The optimization method continuously updates the network parameters through the gradient descent method to improve the detection accuracy of the model. The ultimate goal is to obtain a model that can predict the detection rate of Vibrio parahaemolyticus through an efficient training strategy.
2. A method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer according to claim 1, in S2, the core feature of the embedding layer is to efficiently fuse features, periodic information, and adaptive spatio-temporal relationships, enabling ST-Transformer to achieve high-precision spatio-temporal sequence prediction without relying on complex graph structures.
3. A method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer according to claim 1, in S3, the parallel spatio-temporal attention mechanism captures the spatial correlations between nodes and the long-term dependencies in the time series through independent spatial and temporal attention modules respectively, avoiding information loss in the traditional serial design. Its core advantages lie in parallel processing and dynamic feature fusion: the spatial attention module dynamically assigns node weights to highlight the influence of important regions; the temporal attention module captures the patterns of key time steps; the two are adaptively fused through a gating mechanism to enhance the model's ability to model complex spatio-temporal dependencies.
4. A method for predicting the detection rate of Vibrio parahaemolyticus based on ST-Transformer according to claim 1, in S4, multi-scale gated fusion extracts local and global features in the time series through multi-scale convolutional kernels, capturing short-term fluctuations (such as sudden traffic changes) and long-term trends (such as periodic patterns). Its core advantage lies in dynamic feature weight assignment: the weights of different scale features are adaptively adjusted through a gating mechanism (such as the Sigmoid function) to adapt to the changes in the input data, thereby enhancing the model's expressive ability and robustness.