Maritime ship energy management method and system based on pyramid diversified attention
By constructing a pyramid-based diversified attention network classification model, the problems of signal redundancy response and inaccurate energy allocation in traditional ship energy management systems are solved, achieving efficient energy management under complex operating conditions and ensuring the stability and reliability of ship power systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANTONG UNIV
- Filing Date
- 2025-04-07
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional ship energy management systems face problems such as redundant response in signal areas, low accuracy of energy distribution, and high requirements for generator power regulation precision, which makes it impossible to achieve efficient and stable energy management, especially in different operating conditions.
A marine vessel energy management method based on pyramid-based diversified attention is adopted. By constructing a pyramid-based diversified attention network classification model, including a backbone CNN, local CNN, global CNN and energy management pattern classification layer, and combining squeezing and excitation operations, data fusion and power allocation are performed. The multi-level structure is used to identify different signal regions and perform pattern matching.
It improves the rationality and accuracy of the energy management system, ensures optimal energy distribution for ships under complex operating conditions, optimizes generator output power, and guarantees system reliability and stability.
Smart Images

Figure CN120409896B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of ship energy management, and particularly relates to a method and system for marine ship energy management based on pyramidal diversified attention. Background Technology
[0002] Traditional shipboard power distribution systems face numerous challenges, including aging infrastructure, integration of distributed power distribution systems, and frequent natural disasters. Existing shipboard energy management methods often suffer from issues such as redundant response in signal areas and low accuracy in energy allocation, particularly failing to achieve efficient and stable energy management under varying operating conditions. Furthermore, existing shipboard energy management systems typically optimize the power output of shipboard generator sets, which places high demands on the generator's power regulation accuracy and threatens the stability and reliability of the ship's electrical system, making them unsuitable for general shipboard situations. Summary of the Invention
[0003] Purpose of the Invention: The purpose of this invention is to provide a method and system for marine energy management based on pyramid-shaped diversified attention. It categorizes and summarizes various typical operating conditions that ships may encounter during maritime operations and determines the optimal energy allocation method for each condition.
[0004] Technical solution: The present invention provides a method for marine vessel energy management based on pyramid-shaped diversified attention, comprising the following steps:
[0005] Step 1: Collect ship operation data and perform data fusion processing;
[0006] Step 2: Perform the squeezing and activation initialization operations based on the convolutional neural network;
[0007] Step 3: Using the data fused in Step 1 as input and the power output mode of the ship at sea as output, construct a pyramid-shaped diversified attention network classification model, including a backbone CNN, local CNN, global CNN, and an energy management mode classification layer; the local CNN includes a pyramid attention module, a diversified learning module, and a hierarchical bilinear pooling module.
[0008] Step 4: Power distribution is performed by executing the electronic converter operation through the power output mode of the marine vessel.
[0009] Furthermore, step 1 specifically involves: the system acquiring ship operation data through sensors; constructing a global array input model for information fusion to obtain a global array; and fusing all sensor outputs into an array A(m,n) using an inter-sensor array, where S... g Let S represent the g-th sensor, where g = 0, 1, ..., (G-1), G is the number of sensors, and S is the number of sensors. g The output is Sgm This means that m = 0, 1, ..., (m G -1), where m G The number of sensor outputs, n = 0, 1, ..., (N-1), where N is the duration of each sensor output. Each row of A(m,n) represents the output of one sensor; therefore, the global input array is thus given:
[0010]
[0011] in, It is the gradient operator; the final output of the global array input model will be used as the input data for the pyramid diversification attention network classification model.
[0012] Furthermore, step 2 specifically includes the following steps:
[0013] Step 2.1: Perform a squeezing operation on the input features; for any given transform F tr Map the input X to the feature map U, where U∈R H×W×C For convolution, a squeezed and excited (SE) block is constructed to perform feature recalibration; the feature U is first squeezed through the squeeze operation F. sq (·), aggregate feature matrices on its spatial dimension H to generate channel descriptors W; generate embeddings of the global distribution of channel feature responses, thereby allowing information from the network's global receptive field to be used by all its layers;
[0014] Step 2.2: Apply an activation operation to the output of Step 2.1; after aggregation, the activation operation F is performed. ex (·,W), the excitation operation takes the form of a self-selecting channel mechanism, which takes the embedding as input and generates a set of modulation weights per channel; these weights are multiplied by the channel product F. scale (·,·) maps the features to U to generate the output of the SE block. The output is fed directly into subsequent layers of the network.
[0015] Furthermore, in step 3, the construction of the pyramid attention module is as follows: Let X∈R h×w×c Let R represent the input to the pyramid attention function, where R represents the three-dimensional space, and h, w, and c represent the height, width, and number of channels in the feature matrix, respectively. First, the feature matrix is segmented into feature outputs of different scales [X1, X2, ..., X...]. S ], where S is the number of scales; It is the output of the i-th layer, where h i ×w iLet represent the spatial size, and c be the number of channels in the feature matrix. The finest layer has the same size as the input feature X, while other layers divide the feature matrix into different sub-regions and then perform pooling on the corresponding sub-regions. Secondly, for the i-th scale, the goal is to output diverse attention masks. Where B is the number of local branches; the j-th output attention mask in the i-th scale has the same characteristics as the input X. i Same space size, i.e.
[0016] A Local Attention Network (LANet) was used to construct a spatial modeling feature matrix, and the weights of different spatial locations were regressed through two consecutive convolutional layers; the first layer has The first layer generates a feature matrix, followed by a Rectified Linear Unit (ReLU) layer to add nonlinearity, where r is the channel reduction ratio and c is the number of channels in the feature matrix; the second layer generates a feature matrix i, e, ..., i.e., ...
[0017] Bilinear interpolation is used to upsample different attention masks for multiple local branches at different scales, so that they are approximated with the input features X∈R. h×w×c Having the same size; the refined feature matrix of the j-th local branch in the i-th scale. Through attention masking Aggregate with the Hadamard product of input X:
[0018]
[0019] in, This represents element-wise multiplication; ultimately, the output of the i-th scale is obtained by first concatenating B local branches, and then outputting c feature matrices through a 1×1 convolutional layer. Feature matrices at different scales are concatenated and used as the output of the pyramid attention module.
[0020] Furthermore, in step 3, the construction of the diversified learning module is specifically as follows: the diversified learning module proposes a divergence loss L... D This is used to guide multiple local branches to learn different attention masks i, e, This allows for the localization of different sensors and the achievement of robust recognition through diverse local learning methods, as defined by the following formula:
[0021]
[0022] Where t is a hyperparameter boundary, S represents the number of scales, and B represents the number of local branches. and Let represent the attention masks learned by local branches j and k in the i-th layer, respectively. ∑ represents summation, and max(·,·) represents finding the maximum value. Diversified learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention masks.
[0023] Furthermore, in step 3, the construction of the hierarchical bilinear pooling module is as follows: Let X, Y ∈ R h×w×c These are the outputs of two different layers, where R is a three-dimensional space, and h, w, and c represent the height, width, and number of channels in the feature matrix, respectively; a c-dimensional feature at spatial position i on X is represented as x. i =(X1,X2,…,X) c ) T The c-dimensional feature in Y is y i =(Y1,Y2,…,Y) c ) T Use cross-layer interactions to capture more comprehensive local features, as defined below:
[0024]
[0025] Among them, z i It is a projection output, w i ∈R c×c It is a projection matrix. Represents element-wise multiplication; Represents the matrix U i V i The transpose operation, U i V i ∈R c The projection matrix is decomposed into two rank-1 vectors. To encode local information, the features should be extended to a high-dimensional space through a linear mapping, and a weight matrix w = (w1, w2, ..., w...) is defined. d ), to obtain d-dimensional features z:
[0026]
[0027] Where ° denotes element-wise multiplication, U,V∈R c×d , This represents the transpose operation on matrices U and V, where c is the number of channels in the feature matrix and d is the dimension of the projected features. It aggregates features from more layers to capture more discriminative local features. Let X... 1 ,X 2 ,X 3 It is the output from three different layers, and the above z can be expanded to connect multiple cross-layer representations:
[0028]
[0029] Where U,V,S∈R c×d , This represents the transpose operation on matrices U, V, S, where c is the number of channels in the feature matrix and d is the dimension of the projected feature.
[0030] Furthermore, in step 3, the global CNN consists of a global average pooling layer and a fully connected layer. It extracts the data features of the entire sensor through continuous global average pooling (GAP) and a fully connected (FC) layer with 512 units.
[0031] Furthermore, in step 3, the energy management pattern classification layer combines the outputs of the local CNN and the global CNN to obtain 1024 output units, and adds a fully connected layer for energy management pattern recognition.
[0032] The present invention also discloses a marine vessel energy management system based on pyramidal diversified attention, including multiple sensors, controllers and power electronic converters;
[0033] The multi-sensor collects ship operation data and transmits the data to the controller for processing.
[0034] The controller incorporates a pyramid-based diverse attention network classification model, including a backbone CNN, local CNN, global CNN, and an energy management mode classification layer. The local CNN includes a pyramid attention module, a diverse learning module, and a hierarchical bilinear pooling module. It also determines the operating mode of the power electronic converter.
[0035] After the operating mode is determined, the operating mode of each group of electronic converters corresponds to a power output mode of the ship's power system.
[0036] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.
[0037] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0038] This invention introduces a pyramid-shaped diverse attention network, which adaptively and automatically extracts local features from different levels, avoiding the drawbacks of redundant responses caused by similar signal regions in traditional methods. The multi-layered structure of the system effectively identifies and focuses on different signal regions, thereby significantly improving the rationality and accuracy of the energy management system. Combined with a hierarchical bilinear pooling method, the system integrates information from different levels, achieving an effective combination of high-level abstract information and low-level residual information, thus further enhancing the ship's ability to select the optimal energy allocation mode under complex operating conditions.
[0039] This invention proposes a mode-matching power allocation method. A list of available generator set operating modes is pre-set, and the current operating condition is matched with the optimal operating mode based on the proposed attention network. This optimizes the output power of the ship's generator set while ensuring the reliability and stability of the system. Attached Figure Description
[0040] Figure 1 This is a system workflow diagram;
[0041] Figure 2 A hierarchical pyramid-shaped diverse attention network framework diagram;
[0042] Figure 3 A schematic diagram of the input model for the global array;
[0043] Figure 4 This is a schematic diagram of the extrusion and excitation module;
[0044] Figure 5 A pyramid-shaped attention framework diagram;
[0045] Figure 6 This is a schematic diagram of a local attention network.
[0046] Figure 7 This is a schematic diagram of the operation of an electronic converter. Detailed Implementation
[0047] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0048] like Figure 1 The diagram shows the workflow of a marine energy management system based on pyramidal diversified attention proposed in this invention. This energy management system obtains operational information of key loads during marine operation, such as motor speed and battery charging and discharging status, through sensors. The information obtained by the sensors is preprocessed through a global array input model. The processed data is used as input data for a hierarchical pyramidal diversified attention network. This neural network judges the ship's current operating conditions and selects an optimal energy management mode to improve the electrical reliability of key loads. After the energy management mode is determined, the corresponding electronic converter is executed, effectively improving the electrical reliability of key loads and ensuring stable ship operation.
[0049] like Figure 2The diagram illustrates a hierarchical pyramid-based diversified attention network framework, comprising four parts: a backbone CNN, local CNNs, a global CNN, and a classification layer. The local CNNs are further composed of a pyramid attention module, a diversified learning module, and a hierarchical bilinear pooling module. A key technology of this invention for a marine ship energy management system based on pyramid-based diversified attention is the establishment of a hierarchical pyramid-based diversified attention network. This network can adaptively and automatically describe local feature matrices at different scales from different levels, pooling the feature matrices to various scales, thus enabling pattern judgment using feature matrices of different scales. Simultaneously, since attention modules often generate redundant responses around certain similar signal regions, this invention proposes a diversified learning method to guide multiple local branches at each scale to automatically focus on different signal regions, thus independent of signal markers. Secondly, this invention proposes a hierarchical bilinear pooling method to combine information from different levels. Specifically, it uses different cross-layer bilinear modules to integrate high-level abstract information and low-level residual information. The global convolutional neural network (CNN) extracts data features from the entire sensor through continuous global average pooling (GAP) and a fully connected (FC) layer with 512 units, outputting 512 units. Meanwhile, the local CNN outputs 512 units, thus obtaining 1024 units that jointly represent local and global features, which are then classified through a fully connected layer.
[0050] To ensure the stable operation of ships at sea and the safety of life and property of personnel on board, it is necessary to rationally allocate the ship's power output energy and guarantee the electrical reliability of the ship's critical loads. The technical solution of the invention will be described in detail below with reference to the accompanying drawings:
[0051] 1. Preprocessing of ship operation data information fusion
[0052] like Figure 3 The diagram illustrates a global array input model. For the data preprocessing module, this invention employs a global array input model. A classification system utilizing information from multiple sensors can significantly improve performance compared to a single-sensor classifier. However, due to the complex structure of multi-sensor classifiers, a fusion method is needed to integrate information from multiple sensors. Fusion methods can be divided into "input-level fusion" and "output-level fusion." This invention employs output-level fusion.
[0053] All sensor signals are fused into a global array to classify all single-axis sensor signals. The inter-sensor array fuses all sensor outputs into an array A(m,n), where S... g Let S represent the g-th sensor, where g = 0, 1, ..., (G-1), G is the number of sensors, and S is the number of sensors. g The output is Sgm This means that m = 0, 1, ..., (m G -1), where m G The number of sensor outputs is n = 0, 1, ..., (N-1), where N is the duration of each sensor output (assuming they are equal). That is, each row of A(m,n) represents the output of one sensor. Thus, the global input array is given.
[0054]
[0055] in, It is the gradient operator; the final output of the global array input model will be used as input data for the hierarchical pyramid-based diversified attention network classification model.
[0056] 2. Perform the squeezing activation initialization operation for the convolutional neural network.
[0057] like Figure 3 The diagram illustrates the Squeeze and Activate (SE) block. In constructing a hierarchical pyramid-based diverse attention network classification model, the first step is the backbone CNN, the initial part of the convolutional neural network. The core building block of the CNN is the convolution operator, which enables the network to construct informative features by fusing spatial and channel information within the local receptive fields of each layer. This invention focuses on the relationships between channels and proposes a Squeeze and Activate architecture block whose adaptive recalibration of the channel's functional response determines the modeling of interdependencies between channels. Stacking these blocks together forms the Squeeze and Activate Network (SENet). The Squeeze and Activate block significantly improves the performance of CNNs with a slight increase in computational cost.
[0058] SE improves the representation quality generated by the network by revealing the interdependencies between convolutional feature channels. To this end, this invention proposes a mechanism that allows the network to perform feature recalibration, through which the network can learn to selectively emphasize informative features and suppress irrelevant features using global information. For any given transform F... tr Map the input X to the feature map U, where U∈R H×W×C For convolutions, corresponding SE blocks can be constructed to perform feature recalibration. Features U are first processed by a squeezing operation F. sq (·), which aggregates feature matrices along its spatial dimension H to generate channel descriptors W. The function's purpose is to generate an embedding of the global distribution of channel-based feature responses, thus allowing information from the network's global receptive field to be used by all its layers.
[0059] After aggregation comes the stimulus operation F. exThe excitation operation (·,W) takes the form of a simple self-selecting channel mechanism, which takes the embedding as input and generates a set of per-channel modulation weights. These weights are then multiplied by the channel product F. scale (·,·) maps the features to U to generate the output of the SE block. The output can be directly fed into subsequent layers of the network. While the constructed SE block is general, it plays different roles at different depths throughout the network. In earlier layers, it stimulates informative features in a class-independent manner, thereby reinforcing shared low-level representations. In later layers, the SE module becomes increasingly specialized and responds to different inputs in a highly class-specific way. Therefore, the benefits of feature recalibration performed by the SE block can be accumulated through SENet.
[0060] 3. Construct a pyramid attention module
[0061] like Figure 5 The diagram shows a pyramid attention module framework. A single layer encodes local representations at multiple scales, thus requiring calibration of features at different scales. The pyramid scale refers to the scale of these different features. Let X∈R h×w×c Let R represent the input to the pyramid attention function, where R represents the three-dimensional space, and h, w, and c represent the height, width, and number of channels in the feature matrix, respectively. First, the feature matrix is segmented into feature outputs of different scales [X1, X2, ..., X...]. S ], where S is the number of scales. It is the output of the i-th layer, where h i ×w i The spatial size is represented by c, the number of channels in the feature matrix. The finest layer has the same size as the input X. Other layers segment the feature matrix into different sub-regions and then pool the corresponding sub-regions. Secondly, for the i-th scale, the goal is to output a diverse range of attention masks. Where B is the number of local branches. The j-th output attention mask in the i-th scale has the same characteristics as the input X. i Same space size, i.e. To construct the spatial modeling feature matrix, a Local Attention Network (LANet) was employed, such as... Figure 6 As shown. Weights at different spatial locations are regressed using two consecutive convolutional layers. The first layer has... The first layer generates a feature matrix (i, e, M) followed by a Rectified Linear Unit (ReLU) layer to add nonlinearity, where r is the channel reduction ratio and c is the number of channels in the feature matrix. The second layer generates a feature matrix (i, e, M) using the Sigmoid function. i j The third step is to use bilinear interpolation on different scales (i∈1,2,…,S). iUpsample the different attention masks of multiple local branches (j∈1,2,…,B) in the input X∈R, so that they are similar to the input X∈R. h ×w×c They have the same size. Then, the refined feature matrix of the j-th local branch in the i-th scale. Through attention mask M i j Aggregate with the Hadamard product of input X:
[0062]
[0063] Here, ° denotes element-wise multiplication. Finally, the output at the i-th scale is obtained by first concatenating B local branches, then passing them through a 1×1 convolutional layer to output c feature matrices. The feature matrices from different scales are then concatenated as the output of the pyramid attention. However, it can be difficult to get multiple local branches at the same scale to simultaneously find different discriminative regions. To address this issue, a diversification learning method is proposed to guide different local branches to learn complementary information.
[0064] 4. Construct diverse learning modules
[0065] The diversified learning module proposes a divergence loss L D This is used to guide multiple local branches to learn different attention masks. This allows for the localization of different sensors and the achievement of robust recognition through diverse local learning methods, as defined by the following formula:
[0066]
[0067] Where t is a hyperparameter boundary, S represents the number of scales, and B represents the number of local branches. and Let represent the attention masks learned by local branches j and k in the i-th layer, respectively. ∑ represents summation, and max(·,·) represents maximization. Diversified learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention masks and the target attention masks. Since each attention mask is applied to the same feature matrix, different attention masks can locate different local matrix blocks. Therefore, some less important information, such as noise or other interference, may be present in the output data of multiple sensors. This can lead to inaccurate judgments of the ship's operating condition by the energy management system. To address this issue, this invention employs a combination of classification loss and divergence loss. By selecting discriminative local feature matrix blocks, only discriminative local feature matrix blocks are emphasized.
[0068] 5. Construct a hierarchical bilinear pooling module
[0069] Most existing works learn features starting from the last convolutional layer; however, the feature representation learned from a single layer is not comprehensive. Therefore, this invention considers fusing feature matrices learned from multiple layers. Figure 4 As shown, the Squeeze and Activate (SE) module network has five layers. Pyramid-style diversification attention is applied between every two layers to extract complementary local information across layers. Each individual layer contains three parallel paths, with the deepest path containing three convolutional layers. Therefore, different features can be extracted hierarchically between every two layers, aggregating information from different layers through cross-layer interactions, rather than simple concatenation or addition. Assume X, Y∈R h×w×c These are the outputs of two different layers, where h, w, and c represent the height, width, and number of channels in the feature matrix, respectively. A c-dimensional feature at spatial location i on X is represented as x. i =(X1,X2,...,X) c ) T Similarly, the c-dimensional feature in Y is y i =(Y1,Y2,...,Y c ) T To capture more comprehensive local features, cross-layer interactions were used, defined as follows:
[0070]
[0071] Among them, z i It is a projection output, w i ∈R c×c It is a projection matrix. Represents element-wise multiplication. Represents the matrix U i V i The transpose operation, U i V i ∈R c The projection matrix is decomposed into two rank-1 vectors. To encode local information, the features should be extended to a high-dimensional space through a linear mapping. Therefore, a weight matrix w = (w1, w2, ..., w...) is defined. d ), to obtain d-dimensional features z:
[0072]
[0073] Where U,V∈R c×d , This represents the transpose operation on matrices U and V, where c is the number of channels in the feature matrix and d is the dimension of the projected features. It aggregates features from more layers to capture more discriminative local features. Let X... 1 ,X 2 ,X 3It is the output from three different layers, and the above z can be expanded to connect multiple cross-layer representations:
[0074]
[0075] Where U,V,S∈R c×d , This represents the transpose operation on matrices U, V, S, where c is the number of channels in the feature matrix and d is the dimension of the projected feature.
[0076] 6. Construct a global CNN
[0077] The Global CNN consists of Global Average Pooling and Fully Connected Layers. It extracts data features from the entire sensor through continuous Global Average Pooling (GAP) and a fully connected (FC) layer with 512 units.
[0078] 7. Construct a classification layer for energy management models
[0079] The global neural network and the local neural network each output 512 units. The output units of the local neural network and the global neural network are combined to obtain 1024 output units, which are then connected to a fully connected layer for pattern classification in the ship energy management system.
[0080] This invention lists seven energy management strategies suitable for different operating conditions based on various situations that ships may encounter during actual operation. However, the actual operating conditions of ships at sea are far more than the seven listed in the table. The seven operating conditions listed here are only representative of many conditions. The seven operating conditions and their corresponding energy management modes are shown in Table 1. After the above operations, a classification model based on hierarchical pyramid diversified attention assigns the most suitable energy management mode to the ship according to its actual operating conditions, thereby improving the electrical reliability of the ship's critical loads.
[0081] Table 1 Energy Management Model
[0082]
[0083]
[0084] 8. Perform power distribution operation
[0085] like Figure 7 The diagram illustrates the operation of the electronic converter. The energy management system determines the operating mode of each protected conductor module within the multi-port power electronic interface (MPEI) or microgrid to achieve optimal results. Each MPEI consists of four different converters, one for the grid, one for batteries, one for distributed energy resources, and one for load interfaces. These converters are controlled using voltage-mode controllers, current-mode controllers, and cascaded voltage-current-mode controllers.
[0086] After determining the operating mode of each electronic converter, the corresponding electronic converter action is executed. Each group of electronic converter operating modes corresponds to a power output mode of the ship's propulsion system. If the converted mode achieves the expected goal, i.e., improves the electrical availability stability of the ship's critical loads, it indicates that the marine energy management system based on pyramidal diversified attention is working effectively; otherwise, the system feeds the results back to the hierarchical pyramidal diversified attention network for further training.
Claims
1. A method for marine vessel energy management based on pyramid-shaped diversified attention, characterized in that, Includes the following steps: Step 1: Collect ship operation data and perform data fusion processing; Step 1 specifically involves: the system acquiring ship operation data through sensors; constructing a global array input model for information fusion to obtain a global array; and fusing all sensor outputs into a single array using an inter-sensor array. ,in, Indicates the first One sensor, G is the number of sensors. Output express, ,in, It is the number of sensor outputs. ,here It is the duration of the output of each sensor. Each row represents the output of a sensor; therefore, the global input array is thus given: ; in, It is the gradient operator; the final output of the global array input model will be used as the input data for the pyramid diversification attention network classification model; Step 2: Perform the squeezing and activation initialization operations based on the convolutional neural network; Step 3: Using the data fused in Step 1 as input and the power output mode of the ship at sea as output, construct a pyramid-shaped diversified attention network classification model, including a backbone CNN, local CNN, global CNN, and an energy management mode classification layer. CNN is an abbreviation for Convolutional Neural Network. The local CNN includes a pyramid attention module, a diversified learning module, and a hierarchical bilinear pooling module. In step 3, the construction of the diversified learning module is as follows: The diversified learning module proposes a divergence loss. This is used to guide multiple local branches to learn different attention masks. , ,…, This allows for the localization of different sensors and the achievement of robust recognition through diverse local learning methods. The formula is defined as follows: ; Where t is a hyperparameter boundary, S represents the number of scales, and B represents the number of local branches. and Let these represent the attention masks learned by local branches j and k in the i-th layer, respectively. Represents seeking a settlement. This represents finding the maximum value; diversified learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention mask and the attention mask. Step 4: Power distribution is performed by executing the electronic converter operation through the power output mode of the marine vessel.
2. The marine vessel energy management method based on pyramid-shaped diversified attention as described in claim 1, characterized in that, Step 2 specifically includes the following steps: Step 2.1: Perform a squeezing operation on the input features; for any given transform Input features Mapping to feature mapping ,in Where R represents three-dimensional space. , , These represent the height, width, and number of channels in the feature matrix, respectively. For convolution, squeezed and excitation (SE) blocks are constructed to perform feature recalibration; mapping First, through the squeezing operation In its spatial dimension Aggregate feature matrices to generate channel descriptors ; The embedding of a globally distributed channel-like feature response allows information from the network’s global receptive field to be used by all its layers; Step 2.2: Perform activation operations on the output of Step 2.1; activation operations follow aggregation. The incentive operation takes the form of a self-selecting channel mechanism, which takes the embedding as input and generates a set of modulation weights per channel; these weights are multiplied by the channels. Map elements Output of the generated SE block This output is directly fed into subsequent layers of the network.
3. The marine vessel energy management method based on pyramid-shaped diversified attention as described in claim 1, characterized in that, In step 3, the construction of the pyramid attention module is as follows: Let... The input to the pyramid attention algorithm is represented by R, which represents three-dimensional space. , , These represent the height, width, and number of channels in the feature matrix, respectively. First, the feature matrix is segmented into outputs of different scales. ,in It is the quantity of scale; It is the first The output of the layer, where Indicates spatial size; the finest layer and input. The feature matrices are of the same size, and other layers divide the feature matrix into different sub-regions, then perform pooling on the corresponding sub-regions; secondly, for the first... Each scale aims to output diverse attention masks. ,in It is the number of local branches; the first The first of the scales Each output attention mask has the same characteristics as the input. Same space size, i.e. ; A local attention network (LANet) is used to construct a spatial modeling feature matrix, and the weights of different spatial locations are regressed through two consecutive convolutional layers; the first layer has A feature matrix, followed by a Rectified Linear Unit (ReLU) layer to add nonlinearity, where The number of channels in the feature matrix, It is the rate of reduction in channels; The second layer generates a feature matrix using the Sigmoid function, i.e. ; Bilinear interpolation is used to upsample different attention masks for multiple local branches at different scales, making them consistent with the input. Having the same size; The first of the scales Refined feature matrix of each local branch Through attention masking and input Aggregate the Hadamard product: ; Where ∘ represents element-wise multiplication; ultimately, the first... The output of each scale is obtained by first... The local branches are connected together, and then output through a 1×1 convolutional layer. A feature matrix of different scales is concatenated and used as the output of the pyramid attention module.
4. The marine vessel energy management method based on pyramid-shaped diversified attention as described in claim 1, characterized in that, In step 3, the construction of the hierarchical bilinear pooling module is as follows: Let... These are the outputs of two different layers, where , , These represent the height, width, and number of channels in the feature matrix, respectively; Upper spatial position One - dimensional features are represented as The c-dimensional features in Y are Use cross-layer interactions to capture more comprehensive local features, as defined below: ; in, It is a projection output. It is a projection matrix, where ∘ represents element-wise multiplication; Represents a matrix The transpose operation, The projection matrix is decomposed into two rank-1 vectors. To encode local information, the features should be extended to a high-dimensional space through a linear mapping, and a weight matrix is defined. To obtain the d-dimensional feature z: ; Where ∘ represents element-wise multiplication, , Represents a matrix The transpose operation, Let be the number of channels in the feature matrix, and d be the dimension of the projected features. This allows for the aggregation of features from more layers, capturing more discriminative local features. It is the output from three different layers, and the above z can be expanded to connect multiple cross-layer representations: ; Where ∘ represents element-wise multiplication, and the matrix , Represents a matrix The transpose operation, d is the number of channels in the feature matrix, and d is the dimension of the projected feature.
5. The marine vessel energy management method based on pyramid-shaped diversified attention as described in claim 1, characterized in that, In step 3, the global CNN consists of a global average pooling layer and a fully connected layer. It extracts the data features of the entire sensor through continuous global average pooling (GAP) and a fully connected (FC) layer with 512 units.
6. The marine vessel energy management method based on pyramid-shaped diversified attention as described in claim 1, characterized in that, In step 3, the energy management pattern classification layer combines the outputs of the local CNN and the global CNN to obtain 1024 output units, and adds a fully connected layer for energy management pattern recognition.
7. A marine vessel energy management system based on pyramid-shaped diversified attention, used to implement the method as described in claim 1, characterized in that, Includes multiple sensors, controllers, and power electronic converters; The multi-sensor collects ship operation data and transmits the data to the controller for processing. The controller incorporates a pyramid-based diverse attention network classification model, including a backbone CNN, local CNN, global CNN, and an energy management mode classification layer; the local CNN includes a pyramid attention module, a diverse learning module, and a hierarchical bilinear pooling module; and determines the operating mode of the power electronic converter. After the operating mode is determined, the operating mode of each group of electronic converters corresponds to a power output mode of the ship's power system.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.