Ocean wave height prediction method, system and medium based on large language model
By introducing semantic feature coding module based on attention mechanism and large language model prediction module driven by domain prompt word in wave height prediction, the problems of abnormal wave prediction underestimation and information attenuation in the prior art are solved, and accurate prediction of wave wave height is achieved.
Patent Information
- Application Number
- CN202510151859.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-02-12
AI Technical Summary
The existing wave wave high prediction methods have underestimation problems in anomaly wave prediction, and long-term short-term memory networks will experience information attenuation problems when processing long-term information, and cannot effectively capture long-distance time points relationships.
A wave wave high semantic feature encoding module based on attention mechanism and a large language model prediction module driven by wave wave high domain prompt words are designed. The domain-specific spatiotemporal features are aligned with semantic space through a cross-modal attention mechanism, and the domain-specific semantic features are transformed into higher-level domain-specific semantic features, and the domain-specific prompt words are used to guide the interpretation process of features.
It effectively solves the problem of underestimation in anomaly wave prediction, and improves the ability to capture and extract the space-time information of wave changes, achieving accurate prediction of wave wave height.
Smart Images

Figure CN119622275B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of ocean wave height prediction, and in particular relates to an ocean wave height prediction method, system and medium based on a large language model. Background Art
[0002] The task of predicting the wave height is of great significance in many fields such as marine science and marine engineering. The most advanced wave height prediction method currently uses a data-driven neural network model to predict the wave height. This method first uses a convolutional layer to extract the global spatial information of the overall wave physics field, uses an LSTM long short-term memory network to extract the spatiotemporal characteristics of the physical field, and uses a fully connected neural network to perform a matrix transformation on the output features, ultimately achieving the prediction of the wave height, solving the problem that some spaces cannot be predicted by traditional methods.
[0003] However, this approach has the following problems:
[0004] (1) The convolutional layer is used to extract the global spatial information of the overall wave physical field. In this process, since the wave changes in most areas are not significant, the convolutional layer will ignore a few abnormal wave change values during the feature extraction process, resulting in underestimation in the abnormal wave prediction process.
[0005] (2) Long short-term memory networks will have the problem of information attenuation when processing long time series information. They are unable to capture the relationship between distant time points and are therefore unable to effectively model the evolution of waves over time. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a method, system and medium for predicting the wave height based on a large language model, designs a wave height semantic feature encoding module based on an attention mechanism, and a large language model prediction module driven by a wave height domain prompt word, so as to effectively mine the complex spatiotemporal change information of waves. Specifically, in order to solve the problem of underestimation of the traditional data-driven method in the abnormal wave prediction process, a wave height semantic feature encoding module based on an attention mechanism is designed to more effectively express and understand the characteristics of the waves. The domain-specific spatiotemporal features are aligned with the semantic space through a cross-modal attention mechanism and converted into higher-level domain-specific semantic features. Using the domain-specific semantic features as input, firstly, prompt words related to the wave height domain are designed, and then spliced with the domain-specific semantic features and input into the large language model prediction module driven by the wave height domain prompt word for processing, and after processing, decoding and output are performed to obtain the prediction results.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] The wave height prediction method based on large language model includes:
[0009] S1. Steps for geographic location encoding:
[0010] The input wave height data x is encoded with geographic location to generate geographic location information, which is then fused with the original wave height data x to obtain wave height data fused with geographic location information. ;
[0011] S2. Steps for encoding semantic features of wave height based on attention mechanism:
[0012] right Perform autoencoding and output the wave autoencoding features , self-encode the characteristics of the wave physical field and output word vector features , using the cross-modal attention mechanism to realize the wave autoencoding feature And word vector features Interaction between them, outputting domain-specific semantic features ;
[0013] S3. Steps for predicting a large language model driven by prompt words in the field of wave height:
[0014] Domain-specific semantic features Input into a large language model, through domain-specific prompt words The feature interpretation process is guided from the perspective of domain knowledge to achieve in-depth feature analysis based on domain knowledge, output prediction features, and obtain predicted wave heights.
[0015] Furthermore, when encoding the geographic location, the dimension of the wave height data x is T×H×W, where T represents the length of the time series, and H and W represent the height and width of the data in space, respectively;
[0016] First, a two-dimensional coordinate grid is generated. The grid generates the coordinate value of each spatial point by normalizing the spatial position. The coordinate value is linearly distributed from 0 to 1 in the height H and width W directions. The expression is as follows:
[0017] ;
[0018] Among them, i represents the index of the grid in the height direction, j represents the index of the grid in the width direction, , , grid(i,j) represents the coordinate value of the normalized spatial point, thus obtaining the geographic location information geog;
[0019] Then, the generated geographic location information geog is subsequently integrated into the original input data. Specifically, the geographic location information geog is attached to the last dimension of the original data as an additional feature dimension, thereby obtaining enhanced input data after integrating the geographic location information. The fusion process is expressed as:
[0020] .
[0021] Furthermore, step S2 includes: domain-specific spatiotemporal feature self-encoding, word vector self-encoding, and domain-specific semantic feature encoding based on the attention mechanism; the domain-specific spatiotemporal feature self-encoding step is to extract and fusion the feature vectors of the word vectors through a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding features The step of self-encoding the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector characteristics The step of encoding domain-specific semantic features based on the attention mechanism is to use the cross-modal attention mechanism to realize the wave autoencoding feature And word vector features Interaction between them, outputting domain-specific semantic features .
[0022] Furthermore, in the step of domain-specific spatiotemporal feature self-encoding, a multi-scale feature extraction and fusion mechanism is designed, and the final calculation expression is:
[0023] ;
[0024] Among them, Norm represents the data normalization operation, DConv represents the convolution layer used for downsampling, and the number of downsampling is n. The GELU activation function and the ECAAttention operator apply the channel attention mechanism, which is calculated as follows:
[0025] ;
[0026] In the above formula, GAP represents global average pooling, which is used to compress the spatial dimension of the input features while retaining the core information between channels; C1D represents one-dimensional convolution, which is used to capture cross-channel dependencies; For the Sigmoid activation function, through the Sigmoid activation function Adjust the weight of each channel. Finally, combine the wave characteristics and the weight obtained by channel attention to complete the The self-encoding of the output wave self-encoding feature .
[0027] Furthermore, the steps of self-encoding the word vector are:
[0028] The semantic encoder is used to bridge the wave features with the semantic representation in the large language model. Specifically, the word vectors of the large language model are first linearly mapped to output the word vector features. :
[0029] ;
[0030] in is the word vector feature from a large language model, Represents a linear map operation.
[0031] Furthermore, the steps of encoding domain-specific semantic features based on the attention mechanism are:
[0032] First, map the features to a uniform dimension:
[0033] ;
[0034] ;
[0035] in and They are respectively used for the embedding layers of the self-encoding features and the word vector features. Through the embedding layer, the self-encoding features are And word vector features The two features are mapped to the same feature dimension d, and we get and ;
[0036] Then, by introducing the adaptive weight matrix , , , to calculate the query matrix Q, key matrix K and value matrix V respectively:
[0037] ;
[0038] ;
[0039] ;
[0040] Finally, the attention mechanism is used to achieve the fusion of wave features and natural language features, and the final domain-specific semantic features are obtained through the following formula: :
[0041] .
[0042] Furthermore, the steps of predicting a large language model driven by prompt words in the field of wave height are as follows:
[0043] First, use the linear layer FE to Embed the word vector to get ; then and Perform feature splicing to obtain :
[0044] ;
[0045] ;
[0046] Then, Passed as input features to a large language model to get output features :
[0047] ;
[0048] Finally, the features output by the large language model Perform self-decoding to generate predicted features for the next time step.
[0049] Furthermore, for the features The calculation process for self-decoding is:
[0050] ;
[0051] Among them, Norm represents the normalization operation of the data, UConv represents the upsampling convolution, and Represents the GELU activation function, the number of upsampling is n, and through this process, the final prediction result generated is y.
[0052] The present invention also provides a wave height prediction system based on a large language model, which is used to implement the wave height prediction method based on a large language model as described above, wherein the system comprises a geographic location encoding module, a wave height semantic feature encoding module based on an attention mechanism, and a large language model prediction module driven by a wave height domain prompt word;
[0053] The geographic location encoding module is used to perform geographic location encoding on the input original wave height data x to obtain wave height data that incorporates geographic location information. ;
[0054] The wave height semantic feature encoding module based on the attention mechanism is used to convert domain-specific spatiotemporal features into domain-specific semantic features; it includes three parts: domain-specific spatiotemporal feature autoencoding, word vector autoencoding, and domain-specific semantic feature encoding based on the attention mechanism. The domain-specific spatiotemporal feature autoencoding is a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding features ; The self-encoding of the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector characteristics ; The domain-specific semantic feature encoding based on the attention mechanism is to use the cross-modal attention mechanism to realize the wave self-encoding feature And word vector features Interaction between them, outputting domain-specific semantic features ;
[0055] The large language model prediction module driven by the wave height domain prompt words is used to guide the feature interpretation process from the perspective of domain knowledge through detailed domain-specific prompt words and output prediction results.
[0056] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the ocean wave height prediction method based on a large language model as described above.
[0057] Compared with the prior art, the present invention has the following advantages:
[0058] (1) The present invention innovatively applies large language models to the research of wave height prediction and successfully realizes the alignment of ocean physical field modalities with natural language modalities. Through the method of the present invention, the rich domain knowledge in the pre-trained large language model is effectively integrated, thereby realizing the accurate prediction of wave height.
[0059] (2) The present invention proposes a method for extracting spatiotemporal features of ocean waves based on multiple geographic elements, which incorporates ocean wave height data into geographic location encoding and uses an autoencoder to perform multi-scale feature extraction of spatial features. These innovations enable the present invention to more efficiently capture and extract key spatiotemporal features (domain-specific spatiotemporal features) containing geographic information in wave sequences. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0061] Figure 1 It is a schematic diagram of the system structure of the present invention;
[0062] Figure 2 It is a schematic diagram of the structure of the wave height semantic feature encoding module based on the attention mechanism of the present invention;
[0063] Figure 3 It is a schematic diagram of the structure of a large language model prediction module driven by prompt words in the field of wave height of the present invention;
[0064] Figure 4 This is a visualization comparison of the significant wave height prediction results of different methods in 1 hour in the embodiments of the present invention. DETAILED DESCRIPTION
[0065] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0066] Example 1
[0067] This embodiment provides a method for predicting wave height based on a large language model, comprising the following steps:
[0068] S1. Steps for geographic location encoding:
[0069] The input wave height data x is encoded with geographic location to generate geographic location information, which is then fused with the original wave height data x to obtain wave height data fused with geographic location information. .
[0070] When encoding the geographic location, the dimension of the wave height data x is T×H×W, where T represents the length of the time series, and H and W represent the height and width of the data in space, respectively.
[0071] First, a two-dimensional coordinate grid is generated. The grid generates the coordinate value of each spatial point by normalizing the spatial position. The coordinate value is linearly distributed from 0 to 1 in the height H and width W directions. The expression is as follows:
[0072] ;
[0073] Among them, i represents the index of the grid in the height direction, j represents the index of the grid in the width direction, , , grid(i,j) represents the coordinate value of the normalized spatial point, thus obtaining the geographic location information geog;
[0074] Then, the generated geographic location information geog is subsequently integrated into the original input data. Specifically, the geographic location information geog is attached to the last dimension of the original data as an additional feature dimension, thereby obtaining enhanced input data after integrating the geographic location information. The fusion process is expressed as:
[0075] .
[0076] By introducing geospatial information, the model can capture spatial heterogeneity more effectively, thereby improving the accuracy and robustness of wave height prediction.
[0077] S2. Steps for encoding semantic features of wave height based on attention mechanism:
[0078] After obtaining the wave height data with geo-location encoding Then, the present invention adopts an ocean wave height semantic feature encoding module based on the attention mechanism, such as Figure 2 As shown in the figure, these features are effectively converted into representations with semantic meaning. The core of this module is to convert domain-specific spatiotemporal features into domain-specific semantic features that are easier for large models to understand and use by aligning with the semantic space. This approach can enhance the model's explanatory power and the efficiency of using domain knowledge.
[0079] This step uses the cross-modal attention mechanism to realize the wave autoencoding feature And word vector features Interaction between them, outputting domain-specific semantic features It consists of three parts: domain-specific spatiotemporal feature self-encoding, word vector self-encoding, and domain-specific semantic feature encoding based on the attention mechanism.
[0080] The domain-specific spatiotemporal feature autoencoding step is achieved through a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding features .
[0081] Specifically, in the step of domain-specific spatiotemporal feature autoencoding, a multi-scale feature extraction and fusion mechanism is designed, and the final calculation expression is:
[0082] ;
[0083] Among them, Norm represents the data normalization operation, DConv represents the convolution layer used for downsampling, and the number of downsampling is n. The GELU activation function and the ECAAttention operator apply the channel attention mechanism, which is calculated as follows:
[0084] ;
[0085] In the above formula, GAP represents global average pooling, which is used to compress the spatial dimension of the input features while retaining the core information between channels; C1D represents one-dimensional convolution, which is used to capture cross-channel dependencies; For the Sigmoid activation function, through the Sigmoid activation function Adjust the weight of each channel. Finally, combine the wave characteristics and the weight obtained by channel attention to complete the The self-encoding of the output wave self-encoding feature .
[0086] After completing the self-encoding of the wave features, the next step is to align the wave physical field features with the natural language modality. To this end, the present invention uses a semantic encoder to bridge these features with the semantic representation in the large language model.
[0087] The step of self-encoding the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector characteristics. .
[0088] Specifically, the steps of self-encoding of word vectors are:
[0089] The semantic encoder is used to bridge the wave features with the semantic representation in the large language model. Specifically, the word vectors of the large language model are first linearly mapped to output the word vector features. :
[0090] ;
[0091] in is the word vector feature from a large language model, Represents a linear mapping operation, through which the amount of computation required for subsequent modal interactions can be significantly reduced, while strengthening the joint representation between different word vectors. This lays the foundation for feature interactions between different modalities, allowing the model to better exert its potential when aligned.
[0092] Next, we use the cross-modal attention mechanism to implement the wave autoencoding feature. And word vector features The steps of encoding domain-specific semantic features based on the attention mechanism are:
[0093] First, map the features to a uniform dimension:
[0094] ;
[0095] ;
[0096] in and They are respectively used for the embedding layers of the self-encoding features and the word vector features. Through the embedding layer, the self-encoding features are And word vector features The two features are mapped to the same feature dimension d, and we get and ; Map the two features to the same feature dimension d, which ensures that the two features can be represented uniformly in subsequent calculations.
[0097] Then, by introducing the adaptive weight matrix , , , to calculate the query matrix Q, key matrix K and value matrix V respectively:
[0098] ;
[0099] ;
[0100] ;
[0101] Finally, the attention mechanism is used to achieve the fusion of wave features and natural language features, and the final domain-specific semantic features are obtained through the following formula: :
[0102] .
[0103] S3. Steps for predicting a large language model driven by prompt words in the field of wave height:
[0104] Domain-specific features after alignment Then, domain-specific semantic features Input into a large language model, through domain-specific prompt words The feature interpretation process is guided from the perspective of domain knowledge to achieve in-depth feature analysis based on domain knowledge, output prediction features, and obtain predicted wave heights.
[0105] Domain-specific cues are an effective means to activate task-specific capabilities in large language models, thereby helping the model to better understand and interpret input feature information.
[0106] To enhance the large language model Based on the understanding of the domain knowledge, the present invention designs a large language model prediction module driven by prompt words in the field of ocean wave height. Through detailed prompt words, the feature interpretation process is guided from the perspective of domain knowledge.
[0107] As an example, Figure 3 As shown in the figure, the prompt word consists of four main parts: task description, task details, various statistical matrices, and change trends. The task description and task details contain geographically related semantic information, which can effectively activate the specific domain knowledge of large language models (such as LLM models), especially in oceanography-related tasks. At the same time, a variety of statistical matrices (such as maximum, minimum, mean, etc.) and change trends are added to the prompt word to help the model better capture the spatiotemporal sequence characteristics of waves. This information further assists large language models in analyzing When performing deep integration of domain knowledge and features.
[0108] Specifically, the steps of predicting a large language model driven by prompt words in the field of wave height are as follows:
[0109] First, use the linear layer FE to Embed the word vector to get ; then and Perform feature splicing to obtain :
[0110] ;
[0111] ;
[0112] Then, Passed as input features to a large language model to get output features :
[0113] ;
[0114] Finally, the features output by the large language model Perform self-decoding to generate predicted features for the next time step.
[0115] As a preferred embodiment, the feature The calculation process for self-decoding is:
[0116] ;
[0117] Among them, Norm represents the normalization operation of the data, UConv represents the upsampling convolution, and Represents the GELU activation function, the number of upsampling is n, and through this process, the final prediction result generated is y.
[0118] In the training of the model, the mean square error (MSE) was selected as the loss function. MSE is used to quantify the deviation between the model prediction value and the actual observation value. Because it imposes a greater penalty on larger prediction errors, it encourages the model to focus more on reducing major deviations, improving the accuracy of predictions and the overall stability of the model. This penalty mechanism is particularly effective when dealing with wave spatiotemporal sequences with high complexity and nonlinearity. The MSE is used to perform back-propagation operations to update the model parameters.
[0119] Example 2
[0120] As another embodiment of the present invention, a wave height prediction system based on a large language model is also provided, which is used to implement the wave height prediction method based on a large language model as described above. Figure 1-Figure 3 As shown, the system includes a geographic location encoding module, a wave height semantic feature encoding module based on an attention mechanism, and a large language model prediction module driven by wave height domain prompt words.
[0121] The geographic location encoding module is used to perform geographic location encoding on the input original wave height data x to obtain wave height data that incorporates geographic location information. .
[0122] like Figure 2 As shown, the present invention designs a wave height semantic feature encoding module based on the attention mechanism to effectively convert these features into representations with semantic meaning. The core of this module is to convert domain-specific spatiotemporal features into domain-specific semantic features that are easier for large models to understand and use by aligning with the semantic space. This approach can enhance the explanatory power of the model and the efficiency of using domain knowledge. The entire module consists of three main parts: domain-specific spatiotemporal feature autoencoding, word vector autoencoding, and domain-specific semantic feature encoding based on the attention mechanism.
[0123] The domain-specific spatiotemporal feature autoencoding is a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding features ; The self-encoding of the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector characteristics ; The domain-specific semantic feature encoding based on the attention mechanism is to use the cross-modal attention mechanism to realize the wave self-encoding feature And word vector features Interaction between them, outputting domain-specific semantic features .
[0124] like Figure 3 As shown, the large language model prediction module driven by the wave height domain prompt words is used to guide the feature interpretation process from the perspective of domain knowledge through detailed domain-specific prompt words and output prediction results.
[0125] Domain-specific features after alignment After that, it is input into a large language model to achieve deep feature analysis based on domain knowledge. It should be noted that the large language model used in the present invention is an existing model, such as an LLM model. Domain-specific prompt words are an effective means to activate specific task capabilities in LLM, thereby helping the model to better understand and interpret the input feature information.
[0126] To enhance LLM Based on the understanding of the ocean wave height domain, a large language model prediction module is designed, which is driven by prompt words in the ocean wave height domain. Detailed prompt words are used to guide the feature interpretation process from the perspective of domain knowledge.
[0127] The functions and data processing procedures of each module can be found in the detailed steps of the wave height prediction method based on a large language model described above, which will not be repeated here.
[0128] Example 3
[0129] As another embodiment of the present invention, a computer-readable storage medium is also provided, storing a computer program, and when the computer program is executed by a processor, it is used to implement the wave height prediction method based on the large language model as described above.
[0130] In summary, the present invention designs a wave height semantic feature encoding module based on the attention mechanism and a large language model prediction module driven by the wave height domain prompt words to effectively mine the complex spatiotemporal change information of waves. Specifically, in order to solve the underestimation problem of traditional data-driven methods in the abnormal wave prediction process, a wave height semantic feature encoding module based on the attention mechanism is designed to more effectively express and understand the characteristics of waves. The domain-specific spatiotemporal features are aligned with the semantic space through the cross-modal attention mechanism and converted into higher-level domain-specific semantic features. Using the domain-specific semantic features as input, first design the prompt words related to the wave height domain, and then splice them with the domain-specific semantic features and input them into the large language model prediction module driven by the wave height domain prompt words for processing. After processing, the decoding output is performed to obtain the prediction result.
[0131] Experimental verification:
[0132] As an application example, the present invention can be used to predict significant wave heights. This embodiment takes the prediction of significant wave heights as an example, and uses the ERA5 significant wave height reanalysis data as training and test data sets. The ERA5 significant wave height dataset is a comprehensive reanalysis dataset that provides high-resolution wave height information. Many researchers use the ERA5 dataset to train and predict deep learning models for a variety of applications, including extreme wave height prediction, due to its reliability and wide coverage. Specifically, this embodiment focuses on data from offshore areas with a latitude range of 20 to 35.5 degrees north latitude and a longitude range of 116.5 to 131.5 degrees east longitude. The data spans from 2013 to 2022 and has a spatial resolution of 0.25°×0.25°.
[0133] For each data set, this method uses 80% of the samples as the training set, 10% of the samples as the validation set, and the remaining 10% as the test set. The model uses the root mean square error (RMSE), mean absolute error (MAE) and determination coefficient ( ) are used for evaluation. These model evaluation indicators are commonly used technical means in this field and will not be described in detail. The root mean square error (RMSE) measures the predicted value. With the true value The smaller the value, the higher the prediction accuracy. The mean absolute error (MAE) is the average value of the absolute error between the predicted value and the true value. The determination coefficient ( ) represents the model’s ability to explain actual data changes.
[0134] The model receives data from the past 7 days to predict the wave height in the next hour 1, 6, and 12. The experiments are performed on a single NVIDIA 4090 RTX GPU, and the network is trained for 200 epochs using the Adam optimizer with a minimum batch size of 8. During training, the learning rate is adjusted to 1e-4.
[0135] In order to prove the effectiveness of the present invention, U-Net, Conv-LSTM and LSM were selected for comparative experiments with the method proposed in the present invention. The detailed information of the experimental results is shown in Tables 1 to 3 below, which are about RMSE, MAE and comparison.
[0136] Table 1 Comparison of RMSE between the present invention and the existing methods
[0137]
[0138] Table 2 Comparison of MAE between the present invention and the existing method
[0139]
[0140] Table 3 The present invention and the existing method Comparison
[0141]
[0142] Among all prediction time scales, the method of the present invention always shows the lowest RMSE value, especially in the 1-hour and 6-hour predictions, which are 0.0256 and 0.1180 respectively, which are significantly better than U-Net (0.0295 and 0.1328), Conv-LSTM (0.0321 and 0.1581) and LSM (0.0291 and 0.1312). This shows that the method of the present invention has higher accuracy in short-term predictions. The present invention also performs well in the MAE indicator, with MAE values of 0.0144 and 0.0702 for 1 hour and 6 hours respectively, which are lower than other methods. This further proves the effectiveness of the present invention in reducing prediction errors. In terms of indicators, the proposed method also performs best in 1-hour and 6-hour predictions, which are 0.9992 and 0.9833 respectively, showing a good ability to explain data variation. The values are generally low, especially in the longer time forecasts, showing a clear downward trend.
[0143] like Figure 4 As shown in the 1-hour forecast visualization of different methods, it can be seen that in the short-term forecast, the prediction results of the present invention are more consistent with the real data, indicating that the present invention exhibits stronger stability and reliability. In order to comprehensively evaluate the prediction capabilities of various methods, three different methods, including the present invention and Conv-LSTM and LSM, were selected to visualize the prediction results. These visualizations were performed at three different time points and were carefully selected to represent different scenarios, that is, Figure 4 In , each column is 3 visualization graphs corresponding to each method at 3 different time points. Figure 4 The horizontal and vertical coordinates of each picture in the visualization are the latitude and longitude coordinates of the selected area, and different colors represent the numerical values of the prediction results.
[0144] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Any changes, modifications, additions or substitutions made by ordinary technicians in this technical field within the essential scope of the present invention should fall within the protection scope of the present invention.
Claims
1. A method for predicting sea wave height based on a large language model, characterized in that: The following steps are involved: S1. Steps for geographic location encoding: The input wave height data x is encoded with geographic location to generate geographic location information, which is then fused with the original wave height data x to obtain wave height data fused with geographic location information. S2. Steps for encoding semantic features of wave height based on attention mechanism: right Perform self-encoding and output the wave self-encoding feature F AE , self-encode the characteristics of the wave physical field and output the word vector feature F word , using the cross-modal attention mechanism to realize the wave autoencoder feature F AE And word vector feature F word The interaction between them outputs domain-specific semantic features F SE ; Step S2 specifically includes: domain-specific spatiotemporal feature self-encoding, word vector self-encoding, and domain-specific semantic feature encoding based on the attention mechanism; The domain-specific spatiotemporal feature autoencoding step is achieved through a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding feature F AE The step of self-encoding the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector feature F word The step of encoding domain-specific semantic features based on the attention mechanism is to use the cross-modal attention mechanism to realize the wave autoencoder feature F AE And word vector feature F word The interaction between them outputs domain-specific semantic features F SE ; S3. Steps for predicting a large language model driven by prompt words in the field of wave height: The domain-specific semantic feature F SE Input into a large language model, through the domain-specific cue word F prompt The feature interpretation process is guided from the perspective of domain knowledge to achieve in-depth feature analysis based on domain knowledge, output prediction features, and obtain predicted wave heights.
2. The method for predicting wave height based on a large language model according to claim 1, characterized in that: When encoding the geographic location, the dimension of the wave height data x is T×H×W, where T represents the length of the time series, and H and W represent the height and width of the data in space, respectively; First, a two-dimensional coordinate grid is generated. The grid generates the coordinate value of each spatial point by normalizing the spatial position. The coordinate value is linearly distributed from 0 to 1 in the height H and width W directions. The expression is as follows: Where i represents the index of the grid in the height direction, j represents the index of the grid in the width direction, i∈[0,H-1), j∈[0,W-1), grid(i,j) represents the coordinate value of the normalized spatial point, thus obtaining the geographic location information geog; Then, the generated geographic location information geog is subsequently integrated into the original input data. Specifically, the geographic location information geog is attached to the last dimension of the original data as an additional feature dimension, thereby obtaining enhanced input data after integrating the geographic location information. The fusion process is expressed as:
3. The method for predicting wave height based on a large language model according to claim 1, characterized in that: In the step of domain-specific spatiotemporal feature self-encoding, a multi-scale feature extraction and fusion mechanism is designed, and the final calculation expression is: Among them, Norm represents the data normalization operation, DConv represents the convolution layer used for downsampling, the number of downsampling is n, σ is the GELU activation function, and the ECAAttention operator applies the channel attention mechanism. The calculation process is as follows: In the above formula, GAP represents global average pooling, which is used to compress the spatial dimension of input features while retaining the core information between channels; C1D represents one-dimensional convolution, which is used to capture cross-channel dependencies; sig is the Sigmoid activation function, which adjusts the weight of each channel. Finally, the weight obtained by combining the wave features and the channel attention is completed. The self-encoding of the output wave self-encoding feature F AE .
4. The method for predicting wave height based on a large language model according to claim 1, characterized in that: The steps of self-encoding the word vector are: The semantic encoder is used to bridge the wave feature with the semantic representation in the large language model. Specifically, the word vector of the large language model is first linearly mapped to output the word vector feature F word : F word =Linear(Vocab); Vocab is the word vector feature from a large language model, and Linear represents the linear mapping operation.
5. The method for predicting wave height based on a large language model according to claim 1, characterized in that: The steps of encoding domain-specific semantic features based on the attention mechanism are: First, map the features to a uniform dimension: F′ AE =FE(F AE ); F′ word =WE(F word ); Among them, FE and WE are embedding layers for self-encoding features and word vector features respectively. Through the embedding layer, the self-encoding feature F AE The two features of word vector feature Fword are mapped to the same feature dimension d to obtain F′ AE and F′ word ; Then, by introducing the adaptive weight matrix W Q , W K , W V , to calculate the query matrix Q, key matrix K and value matrix V respectively: K=F′ AE W K ; V=F′ word W V ; Finally, the attention mechanism is used to achieve the fusion of wave features and natural language features, and the final domain-specific semantic feature F is obtained by the following formula: SE :
6. The method for predicting wave height based on a large language model according to claim 1, characterized in that: The steps of large language model prediction driven by wave height domain prompt words are as follows: First, use the linear layer FE to prompt Perform word vector embedding to obtain F′ prompt ; then F′ prompt With F SE Perform feature splicing to obtain F in : F′ prompt =FE(F prompt ); F in =Concat(F′ prompt ,F SE ); Then, F in Passed as input features to a large language model, the output features F out : F out =LLM(F in ); Finally, the feature F output by the large language model out Perform self-decoding to generate predicted features for the next time step.
7. The method for predicting wave height based on a large language model according to claim 6, characterized in that: For feature F out The calculation process for self-decoding is: Among them, Norm represents the normalization operation of the data, UConv represents the upsampling convolution, and σ represents the GELU activation function. The number of upsampling is n. Through this process, the final prediction result generated is y.
8. The wave height prediction system based on a large language model is characterized by: The system is used to implement the wave height prediction method based on a large language model as described in any one of claims 1 to 7, wherein the system comprises a geographic location encoding module, a wave height semantic feature encoding module based on an attention mechanism, and a large language model prediction module driven by a wave height domain prompt word; the geographic location encoding module is used to perform geographic location encoding on the input original wave height data x to obtain wave height data that incorporates geographic location information. The wave height semantic feature encoding module based on the attention mechanism is used to convert domain-specific spatiotemporal features into domain-specific semantic features; It includes three parts: domain-specific spatiotemporal feature autoencoding, word vector autoencoding, and domain-specific semantic feature encoding based on attention mechanism. The domain-specific spatiotemporal feature autoencoding is a multi-scale feature extraction and fusion mechanism. Perform autoencoding, integrate information from different spatial scales, and output the wave autoencoding feature F AE The self-encoding of the word vector is to align the wave physical field characteristics with the natural language mode and output the word vector feature F word The domain-specific semantic feature encoding based on the attention mechanism is to use the cross-modal attention mechanism to realize the wave autoencoding feature F AE And word vector feature F word The interaction between them outputs domain-specific semantic features F SE ; The large language model prediction module driven by the wave height domain prompt words is used to guide the feature interpretation process from the perspective of domain knowledge through detailed domain-specific prompt words and output prediction results.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the wave height prediction method based on a large language model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Wave height prediction model and device
CN115659828A
Semantic segmentation-based sea wave height detection method, medium and system
CN119151974A