Marine ship energy management method and system based on pyramid diversified attention
By constructing a pyramid-diverse attention network classification model, the inaccuracy of energy distribution in traditional ship energy management systems under complex working conditions is solved, efficient and stable energy management is achieved, and the reliability and stability of the ship power system is ensured.
Patent Information
- Application Number
- CN202510424112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-07
AI Technical Summary
When traditional ship energy management systems face challenges such as infrastructure aging, distributed distribution system integration and frequent natural disasters, they cannot achieve efficient and stable energy management, especially under different working conditions, the accuracy of energy distribution is not high, and the generator's power regulation accuracy is high, which affects the stability and reliability of the ship's power system.
The energy management method of offshore ships based on pyramid diversified attention is adopted. By collecting ship operation data, a pyramid diversified attention network classification model is constructed, including backbone CNN, local CNN, global CNN and energy management mode classification layer. The multi-level structure is used to identify different signal areas, and combined with the hierarchical bilinear pooling method, the effective combination of advanced abstract information and underlying retention information is achieved to perform power distribution.
It improves the rationality and accuracy of the energy management system, ensures the optimal energy distribution of the ship under complex working conditions, optimizes the output power of the generator set while ensuring the reliability and stability of the system.
Smart Images

Figure CN120409896A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ship energy management, and particularly relates to a maritime ship energy management method and system based on pyramid diversified attention. Background Art
[0002] Traditional ship power distribution systems face many challenges such as aging infrastructure, integration of distributed power distribution systems, and frequent natural disasters. Existing ship energy management methods mostly face problems such as redundant response in signal areas and low accuracy of energy distribution, especially being unable to achieve efficient and stable energy management under different working conditions. In addition, in existing ship energy management system inventions, power optimization of ship generator sets is usually carried out, which has high requirements for the power regulation accuracy of generators, and at the same time poses a threat to the stability and reliability of the ship power system and is not applicable to general ship situations. Summary of the Invention
[0003] Object of the Invention: The object of the present invention is to provide a maritime ship energy management method and system based on pyramid diversified attention. Classify and summarize various typical working conditions that a ship may encounter during sea operation, and determine the best energy distribution method for the ship under the corresponding working conditions.
[0004] Technical Solution: A maritime ship energy management method based on pyramid diversified attention of the present invention includes the following steps:
[0005] Step 1: Collect ship operation data and perform data fusion processing;
[0006] Step 2: Perform squeeze-and-excitation initialization operation based on a convolutional neural network;
[0007] Step 3: Using the data fused in Step 1 as input and the power output mode of the maritime ship as output, construct a pyramid diversified attention network classification model, including a backbone CNN, a local CNN, a 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: Through the power output mode of the maritime ship, perform electronic converter actions for power distribution.
[0009] Further, Step 1 is specifically: the system obtains ship operation data through sensors; constructs a global array input model for information fusion to obtain a global array; the sensor inter-array fuses the outputs of all sensors into an array A(m,n), where S g represents the g-th sensor, g = 0, 1, …, (G - 1), G is the number of sensors, and the output of sensor S g is represented by Sgm It is represented that m = 0, 1, …, (m G - 1), where m G is the number of sensor outputs, n = 0, 1, …, (N - 1), where N is the duration of each sensor output, and each row of A(m, n) is the output of one sensor; thus, the global input array is given by:
[0010]
[0011] where is the gradient operator; the final output result of the global array input model will be used as the input data of the pyramid diversified 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 transformation F tr , map the input X to the feature map U, where U ∈ R H×W×C , for convolution, construct a squeeze-and-excitation (SE) block to perform feature recalibration; the feature U first passes through the squeezing operation F sq (·), aggregates the feature matrix in its spatial dimension H to generate the channel descriptor W; generates the embedding of the global distribution of the channel-wise feature responses, thus allowing the information from the global receptive field of the network to be used by all its layers;
[0014] Step 2.2, perform an excitation operation on the output result of step 2.1; after aggregation is the excitation operation F ex (·, W), the excitation operation takes the form of a self-selection channel mechanism, which takes the embedding as the input and generates a set of per-channel modulation weights; these weights generate the output of the SE block for the feature map U through the channel product F scale (·, ·) This output is directly fed to the subsequent layers of the network.
[0015] Furthermore, in step 3, the construction of the pyramid attention module is specifically as follows: Let X ∈ R h×w×c represent the input of the pyramid attention, R represents the three-dimensional space, and h, w, c represent the height, width, and the number of channels of the feature matrix respectively; first, divide the feature matrix into feature outputs of different scales [X1, X2, ..., X S , where S is the number of scales; is the output of the i-th layer, where h i × w idenotes the spatial size, and c is the number of channels of the feature matrix; the finest layer has the same size as the input feature X, and the 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 spatial size as the input X i i.e.,
[0016] The Local Attention Network (LANet) is adopted to construct the spatial modeling feature matrix, and the weights at different spatial positions are regressed through two consecutive convolutional layers; the first layer has feature matrices, followed by a Rectified Linear Unit (ReLU) layer to increase non-linearity, where r is the channel reduction ratio and c is the number of channels of the feature matrix; the second layer generates a feature matrix through the Sigmoid function, i.e.,
[0017] Bilinear interpolation is used to upsample the different attention masks of multiple local branches at different scales to make them have the same size as the input feature X ∈ R h×w×c ; the refined feature matrix of the j-th local branch in the i-th scale is aggregated through the Hadamard product of the attention mask and the input X:
[0018]
[0019] where denotes element-wise multiplication; finally, the output of the i-th scale is obtained by first concatenating the B local branches and then outputting c feature matrices through a 1×1 convolutional layer, and the feature matrices of different scales are concatenated as the output of the pyramid attention module.
[0020] Furthermore, in step 3, the construction of the diversification learning module is as follows: the diversification learning module proposes a divergence loss L D to guide multiple local branches to learn different attention masks, i.e., so as to locate different sensors and achieve robust recognition through diversified local learning. Its formula is defined as follows:
[0021]
[0022] where t is a hyperparameter boundary, S represents the number of scales, B represents the number of local branches, and They respectively represent the attention masks learned by local branches j and k in the i-th layer. ∑ represents summation, and max(·,·) represents finding the maximum value. Diverse learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention masks.
[0023] Further, in step 3, the construction of the hierarchical bilinear pooling module is specifically as follows: Let X,Y∈R h×w×c be the outputs of two different layers, where R is a three-dimensional space, and h, w, and c respectively represent the height, width, and number of channels of the feature matrix. Represent a c-dimensional feature at spatial position i on X as x i =(X1,X2,…,X c ) T , and the c-dimensional feature in Y is y i =(Y1,Y2,…,Y c ) T ; Use cross-layer interaction to capture more comprehensive local features, which is defined as follows:
[0024]
[0025] where z i is the projection output, w i ∈R c×c is the projection matrix, represents element-wise multiplication; represents the transpose operation on matrices U i ,V i , and U i ,V i ∈R c are projection matrices decomposed into two rank-1 vectors. To encode local information, the features should be extended to a high-dimensional space through a linear mapping. A weight matrix w=(w1,w2,…,w d ) is defined to obtain the d-dimensional feature z:
[0026]
[0027] where ° represents element-wise multiplication, U,V∈R c×d , represents the transpose operation on matrices U and V, c is the number of channels of the feature matrix, and d is the dimension of the projected features. Aggregate features from more layers to capture more discriminative local features. Let X 1 ,X 2 ,X 3 be the outputs from three different layers. The above z can be extended to connect multiple cross-layer representations:
[0028]
[0029] where \(U, V, S\in R\) c×d , denotes the transpose operation of matrices \(U, V, S\), \(c\) is the number of channels of the feature matrix, and \(d\) is the dimension of the projected features.
[0030] Furthermore, in step 3, the global CNN consists of a global average pooling layer and a fully connected layer, and extracts the data features of the entire sensor through successive global average pooling (GAP) and a fully connected (FC) layer with 512 units.
[0031] Furthermore, in step 3, the energy management mode 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 the recognition of energy management modes.
[0032] The present invention also discloses a maritime ship energy management system based on pyramid diversified attention, including a multi-sensor, a controller, and a power electronic converter;
[0033] The multi-sensor collects the ship operation data and transmits the data to the controller for processing;
[0034] The controller is built with a pyramid diversified attention network classification model, including a backbone CNN, a local CNN, a 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; and determines the working mode of the power electronic converter
[0035] After determining the operation mode, the operation mode of each group of electronic converters corresponds to a power output mode of the ship power system.
[0036] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored on the memory, and 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 remarkable advantages:
[0038] By introducing a pyramid diversified attention network, the present invention adaptively extracts local features from different levels automatically, avoiding the drawback of redundant responses caused by similar signal regions in traditional methods. The multi-level structure in the system can effectively identify and focus on different signal regions, thus greatly improving the rationality and accuracy of the energy management system. Combining with the hierarchical bilinear pooling method, the system integrates information from different levels, realizes the effective combination of high-level abstract information and low-level retained information, and further improves the ability of the ship to select the best energy distribution mode under complex working conditions.
[0039] The present invention proposes a power distribution method for pattern matching. A list of available operating modes of the generator set is set in advance, and based on the proposed attention network, the current working condition is matched with the optimal operating mode, while optimizing the output power of the ship's generator set, ensuring the reliability and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is the system working flowchart;
[0041] Figure 2 is the hierarchical pyramid diversified attention network framework diagram;
[0042] Figure 3 is the global array input model schematic diagram;
[0043] Figure 4 is the squeeze and excitation module schematic diagram;
[0044] Figure 5 is the pyramid diversified attention framework diagram;
[0045] Figure 6 is the local attention network schematic diagram;
[0046] Figure 7 is the electronic converter operation schematic diagram. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0048] As Figure 1 shown is the working flowchart of a marine ship energy management system based on pyramid diversified attention proposed by the present invention. The energy management system obtains the operating information of key loads during the operation of the marine ship through sensors, such as the rotational speed of the motor and the charge and discharge conditions of the battery. The information obtained by the sensors is subjected to preliminary data preprocessing operations through the global array input model, and the processed data is used as the input data of the hierarchical pyramid diversified attention network. The neural network judges the existing operating conditions of the ship and selects an energy management mode that best improves the power reliability of the key loads for the ship. After determining the energy management mode, the corresponding actions of the electronic converter are executed, effectively improving the power reliability of the ship's key loads and ensuring the stable operation of the ship.
[0049] As Figure 2The figure shows a hierarchical pyramid diversified attention network framework, which includes four parts: the backbone CNN, the local CNN, the global CNN, and the classification layer. The local CNN is composed of a pyramid attention module, a diversified learning module, and a hierarchical bilinear pooling module. The key technology of a marine ship energy management system based on pyramid diversified attention proposed by the present invention is to establish a hierarchical pyramid diversity attention network. This network can adaptively describe local feature matrices of different scales automatically from different levels, pool the feature matrices into various different ratios, so that feature matrices of different ratios can be used for pattern judgment. At the same time, since the attention module often generates redundant responses around some similar signal regions, the present invention proposes a diversified learning method to guide multiple local branches in each scale to automatically focus on different signal regions, thus not relying on signal landmark points. Secondly, the present invention proposes a hierarchical bilinear pooling method for combining information from different hierarchies. Specifically, it uses different cross-layer bilinear modules to integrate high-level abstract information and low-level retained information. The global convolutional neural network (CNN) extracts the data features of the entire sensor through continuous global average pooling (GAP) and a fully connected (FC) layer with 512 units, and outputs 512 units. At the same time, the local CNN outputs 512 units, and thus 1024 units representing joint local and global features can be obtained. Finally, classification is performed through a fully connected layer.
[0050] To ensure the stable operation of a marine ship and the safety of the lives and property of the crew on board, it is necessary to reasonably allocate the power output energy of the ship and ensure the power reliability of the key loads of the ship. The technical solution of the invention will be described in detail below with reference to the accompanying drawings:
[0051] 1. Preprocessing of the fusion of ship operation data information
[0052] As Figure 3 shown in the figure is the schematic diagram of the global array input model. For the data preprocessing module, the present invention adopts the global array input model. The classification system using multiple sensor information can significantly improve the performance compared with a single-sensor classifier. However, due to the complex structure of the multi-sensor classifier, a fusion method is needed to integrate the information from multiple sensors. The fusion method can be divided into "input-level fusion" and "output-level fusion". In the present invention, output-level fusion information is adopted.
[0053] All sensor signals are fused into a global array to classify all single-axis sensor signals. The inter-sensor array fuses the outputs of all sensors into an array A(m,n), where S g represents the g-th sensor, g = 0, 1, …, (G - 1), G is the number of sensors, and the output of sensor S g is denoted as Sgm It is represented that m = 0, 1, …, (m G - 1), where m G is the number of sensor outputs, n = 0, 1, ..., (N - 1), where N is the duration of each sensor output (assumed to be equal), that is, each row of A(m, n) is the output of one sensor. Thus, the global input array is given hereby.
[0054]
[0055] wherein, is the gradient operator; the final output result of the global array input model will be used as the input data of the classification model based on the hierarchical pyramid diversified attention network.
[0056] 2. Perform the squeeze-and-excitation initialization operation of the convolutional neural network
[0057] As Figure 3 shown in the schematic diagram of the squeeze-and-excitation (SE) block, in the process of constructing the classification model based on the hierarchical pyramid diversified attention network, first is the backbone CNN, that is, the initial part of the convolutional neural network. The core building block of the convolutional neural network is the convolutional operator, which enables the network to construct information features by fusing the spatial and channel information within the local receptive field of each layer. The present invention focuses on the relationship between channels and proposes a squeeze-and-excitation architecture unit block, whose function of adaptively recalibrating the channel response determines the modeling of the interdependence between channels. Stacking these blocks together can form a squeeze-and-excitation network (SENet). The squeeze-and-excitation block significantly improves the performance of the CNN with a slightly increased computational cost.
[0058] SE improves the quality of the representation generated by the network by revealing the interdependence between convolutional feature channels. For this purpose, the present invention proposes a mechanism that allows the network to perform feature recalibration. Through this mechanism, the network can learn to use global information to selectively emphasize informative features and suppress irrelevant features. For any given transformation F tr , mapping the input X to the feature map U, where U ∈ R H×W×C . For convolution, the corresponding SE block can be constructed to perform feature recalibration. The feature U is first passed through the squeeze operation F sq (·), aggregating the feature matrix in its spatial dimension H to generate the channel descriptor W. The function of this function is to generate an embedding of the global distribution of the channel-wise feature response, thereby allowing the information from the global receptive field of the network to be used by all its layers.
[0059] After aggregation is the excitation operation F ex(·, W), the excitation operation takes the form of a simple self-selection channel mechanism that embeds the input and generates a set of per-channel modulation weights. These weights are multiplied by the channel F scale (·, ·) generates the output of the SE block from the feature map U This output can be directly fed into the subsequent layers of the network. Although the constructed SE block is general, the roles it plays at different depths throughout the network are different. In the earlier layers, it stimulates information features in a class-independent manner, thus strengthening the shared low-level representations. In the later layers, the SE module becomes increasingly specialized and responds to different inputs in a highly class-specific manner. Therefore, the benefits of feature recalibration performed by the SE blocks can be accumulated through SENet.
[0060] 3. Construct the Pyramid Attention Module
[0061] As Figure 5 shown in the schematic diagram of the Pyramid Attention Module framework, multi-scale local representations are encoded in a single layer. Therefore, it is necessary to calibrate features at different scales, and the pyramid scale refers to the scales of different features. Let X ∈ R h×w×c represent the input of the pyramid attention, where R represents the three-dimensional space, and h, w, and c represent the height, width, and the number of channels of the feature matrix respectively. First, the feature matrix is divided into feature outputs at different scales [X1, X2, …, X S , where S is the number of scales. is the output of the i-th layer, where h[[ID=]19] i × w i represents the spatial size, and c is the number of channels of the feature matrix. The finest layer has the same size as the input X. 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 spatial size as the input X i , that is To construct the spatial modeling feature matrix, a Local Attention Network (LANet) is adopted, as Figure 6 shown. The weights at different spatial positions are regressed through two consecutive convolutional layers. The first layer has feature matrices, followed by a Rectified Linear Unit (ReLU) layer to increase non-linearity, where r is the channel reduction ratio and c is the number of channels of the feature matrix. The second layer generates a feature matrix through the Sigmoid function (i.e., i, e, M i j ). Thirdly, bilinear interpolation is used for different scales (i ∈ 1, 2, …, S i)Upsample the different attention masks of multiple local branches (j ∈ 1, 2, …, B) so that they have the same size as the input X ∈ R h ×w×c The refined feature matrix of the j-th local branch in the i-th scale is aggregated through the Hadamard product of the attention mask M i j and the input X:
[0062]
[0063] where ° represents element-wise multiplication. Finally, the output of the i-th scale is obtained by first concatenating the B local branches and then outputting c feature matrices through a 1×1 convolutional layer. Then, the feature matrices of different scales are concatenated as the output of the pyramid attention. However, it may be difficult for multiple local branches at the same scale to simultaneously find different discriminative regions. To solve this problem, a diversification learning method is proposed to guide different local branches to learn complementary information.
[0064] 4. Construct a diversification learning module
[0065] The diversification learning module proposes a divergence loss L D to guide multiple local branches to learn different attention masks so as to locate different sensors and achieve robust recognition through diversified local learning. Its formula is defined as follows:
[0066]
[0067] where t is a hyperparameter boundary, S represents the number of scales, B represents the number of local branches, and represent the attention masks learned by local branches j and k in the i-th layer respectively, ∑ represents summation, and max(·,·) represents taking the maximum value; diversification learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention masks. Since each attention mask is applied to the same feature matrix, different attention masks can locate different local matrix blocks, so there may be some unimportant information in the output data of multiple sensors, such as noise and other interference information. This will lead to inaccurate judgment of the ship's working conditions by the energy management system. To solve this problem, the present invention combines the classification loss and the divergence loss, and only the discriminative local feature matrix blocks will be emphasized by selecting the discriminative local feature matrix blocks.
[0068] 5. Construct a hierarchical bilinear pooling module
[0069] Most existing works start learning features from the last convolutional layer. However, the learned feature representation of a single layer is not comprehensive, so the present invention considers fusing learned feature matrices from multiple layers. Figure 4 As shown, the squeeze and excitation (SE) module network has a total of five network layers, and pyramid diversified attention is applied between every two layers to extract complementary local information across layers. Each individual layer contains three parallel paths, the deepest of which has three convolutional layers. Therefore, different features can be hierarchically extracted between every two layers, and information from different layers can be aggregated through cross-layer interaction instead of simple connection or addition. Assume X, Y∈R h×w×c are the outputs of two different layers, where h, w, c represent the height, width, and number of channels of the feature matrix, respectively. A c-dimensional feature at spatial position 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 In order to capture more comprehensive local features, cross-layer interactions are used, which are defined as follows:
[0070]
[0071] Among them, z i is the projection output, w i ∈R c×c is the 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. In order to encode local information, the features should be expanded to a high-dimensional space through linear mapping. Therefore, a weight matrix w=(w1,w2,...,w d ), to obtain the d-dimensional feature z:
[0072]
[0073] where U,V∈R c×d , represents the transpose operation of the matrix U, V, c is the number of channels of the feature matrix, and d is the dimension of the projected feature, aggregating features from more layers to capture more discriminative local features. Let X 1 ,X 2 ,X 3is the output from three different layers, and the above z can be extended to connect multiple cross-layer representations:
[0074]
[0075] where U, V, S ∈ R c×d , represents the transpose operation of matrices U, V, S, c is the number of channels of the feature matrix, and d is the dimension of the projected features.
[0076] 6. Construct the global CNN
[0077] The global CNN consists of a global average pooling layer and a fully connected layer, and extracts the data features of the entire sensor through successive global average pooling (GAP) and a fully connected (FC) layer with 512 units.
[0078] 7. Construct the energy management mode classification layer
[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, and then a fully connected layer is connected for the mode classification of the ship energy management system.
[0080] According to various situations that a marine ship may encounter during actual operation, the present invention lists 7 energy management strategies suitable for different working conditions. However, the actual working conditions of a ship during sea operation are far more than the 7 types shown in the table. The 7 working conditions listed here are only representative ones selected from numerous working conditions. The 7 working condition scenarios and their corresponding energy management modes are shown in Table 1. After the above operations, the classification model based on hierarchical pyramid diverse attention assigns a most suitable energy management mode to the marine ship according to its actual working conditions to improve the power reliability of the ship's critical loads.
[0081] Table 1 Energy management modes
[0082]
[0083]
[0084] 8. Perform power distribution operations
[0085] As Figure 7 shown is a schematic diagram of the electronic converter operation. The role of the energy management system is to determine the operation mode of each protection conductor module in a multi-port power electronic interface (MPEI) or a microgrid to obtain the best results. Each MPEI consists of four different converters, which are used for the grid, battery, distributed energy resource, and load interfaces respectively. These converters are controlled by using a voltage mode controller, a current mode controller, and a cascaded voltage-current mode controller.
[0086] After determining the operating mode of each electronic converter, the corresponding actions of the electronic converter are executed, and the operating mode of each group of electronic converters corresponds to a power output mode of the ship power system. If the converted mode achieves the expected goal, that is, improves the power availability stability of the ship's critical load, it indicates that the maritime ship energy management system based on pyramid diversified attention works effectively. Otherwise, the system feeds back the results to the hierarchical pyramid diversified attention network part for continued training.
Claims
1. A maritime ship energy management method based on pyramid diversified attention, characterized in that It includes the following steps: Step 1: Collect the operation data of the ship and perform data fusion processing; Step 2: Perform the squeeze-and-excitation initialization operation based on the convolutional neural network; Step 3: Using the data fused in Step 1 as the input and the power output mode of the marine ship as the output, construct a pyramid diversified attention network classification model, including a backbone CNN, a local CNN, a global CNN, and an energy management mode classification layer, where CNN is the abbreviation of the convolutional neural network; the local CNN includes a pyramid attention module, a diversified learning module, and a hierarchical bilinear pooling module; Step 4: Through the power output mode of the marine ship, perform the action of the electronic converter for power distribution.
2. The method for managing the energy of a marine vessel based on pyramid diversified attention according to claim 1, wherein Step 1 is specifically as follows: The system obtains the ship operation data through sensors; constructs a global array input model for information fusion to obtain a global array; the sensor inter-array fuses the outputs of all sensors into an array A(m,n), where S g represents the g-th sensor, g = 0, 1, …, (G-1), G is the number of sensors, and the output of sensor S g is represented by S gm , m = 0, 1, …, (m G -1), where m G is the number of sensor outputs, n = 0, 1, …, (N-1), here N is the duration of each sensor output, and each row of A(m,n) is the output of a sensor; thus, the global input array is given as follows: Among them, is the gradient operator; the final output result of the global array input model will be used as the input data for the pyramid diversified attention network classification model.
3. A method for energy management of maritime ships based on pyramid diversified attention according to 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 transformation F tr , map the input feature X to the feature map U, where U ∈ R H×W×C , where R represents the three-dimensional space, and H, W, and C represent the height, width, and the number of channels of the feature matrix respectively. For convolution, construct a squeeze-and-excitation (SE) block to perform feature recalibration; the mapped U first passes through the squeezing operation F sq (·), aggregates the feature matrix in its spatial dimension H to generate the channel descriptor W; generates an embedding of the global distribution of the channel-wise feature responses, thus allowing information from the global receptive field of the network to be used by all its layers; Step 2.2: Perform an excitation operation on the output result of Step 2.1; after aggregation is the excitation operation F ex (·, W), the excitation operation takes the form of a self-selection channel mechanism, which takes the embedding as input and generates a set of per-channel modulation weights; these weights generate the output of the SE block for the feature map U through the channel product F scale (·, ·) This output is directly fed to the subsequent layers of the network.
4. The method for energy management of maritime ships based on pyramid diversified attention according to claim 1, wherein In step 3, the construction of the pyramid attention module is specifically as follows: Let X ∈ R h×w×c represent the input of the pyramid attention, R represents the three-dimensional space, and h, w, and c represent the height, width, and the number of channels of the feature matrix respectively; First, the feature matrix is divided into outputs of different scales [X1, X2, …, X S , where S is the number of scales; is the output of the i-th layer, where h i × w i represents the spatial size; The finest layer has the same size as the input X, and 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 spatial size as the input X i , that is The local attention network (LANet) is adopted to construct a spatial modeling feature matrix, and the weights at different spatial positions are regressed through two consecutive convolutional layers; the first layer has feature matrices, followed by a rectified linear unit (ReLU) layer to increase non-linearity, where c is the number of channels of the feature matrix and r is the channel reduction ratio; The second layer generates a feature matrix through the Sigmoid function, that is Upsample different attention masks of multiple local branches at different scales using bilinear interpolation to have the same size as the input \(X\in\mathbb{R}\) h×w×c The refined feature matrix of the \(j\)-th local branch at the \(i\)-th scale is aggregated by the Hadamard product of the attention mask and the input \(X\): Among them, represents element-wise multiplication; finally, the output of the i-th scale is obtained by first connecting B local branches and then outputting c feature matrices through a 1×1 convolutional layer. The feature matrices of different scales are concatenated as the output of the pyramid attention module.
5. A method for energy management of maritime ships based on pyramid diversified attention according to claim 1, characterized in that, In step 3, the construction of the diversification learning module is specifically as follows: The diversification learning module proposes a divergence loss L D , which is used to guide multiple local branches to learn different attention masks so as to locate different sensors and achieve robust recognition through diversified local learning. Its 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 respectively represent the attention masks learned by local branches j and k in the i-th layer, ∑ represents summation, and max(·, ·) represents taking the maximum value; diverse learning encourages each local branch to learn different attention masks by increasing the distance between the learned attention masks.
6. The marine ship energy management method based on pyramid diversified attention according to claim 1, characterized in that In step 3, the construction of the hierarchical bilinear pooling module is specifically as follows: Let X, Y ∈ R h×w×c be the outputs of two different layers, where h, w, and c represent the height, width, and the number of channels of the feature matrix respectively; represent a c-dimensional feature at spatial position i on X as x i =(X1, X2, …, X c ) T , and the c-dimensional feature in Y is y i =(Y1, Y2, ..., Y c ) T ; use cross-layer interaction to capture more comprehensive local features, and its definition is as follows: Among them, z i is the projection output, w i ∈R c×c is the projection matrix, denotes element-wise multiplication; denotes the transpose operation on matrices U i , V i , U i , V i ∈R c is the projection matrix decomposed into two rank-1 vectors. To encode local information, the feature should be extended to a high-dimensional space through a linear mapping. A weight matrix w = (w1, w2, …, w d ) is defined to obtain the d-dimensional feature z: Among them, represents element-wise multiplication, where \(U, V\in\mathbb{R}\) c×d , represents the transpose operation on matrices \(U\) and \(V\), \(c\) is the number of channels of the feature matrix, and \(d\) is the dimension of the projected features. Aggregate features from more layers to capture more discriminative local features. Let \(X\) 1 , \(X\) 2 , \(X\) 3 be the outputs from three different layers. The above \(z\) can be extended to concatenate multiple cross-layer representations: Among them, represents element-wise multiplication, and the matrices U, V, S ∈ R c×d , represents the transpose operation on the matrices U, V, S. c is the number of channels of the feature matrix, and d is the dimension of the projected features.
7. The method for managing the energy of a marine ship based on pyramid diversified attention according to claim 1, characterized in that, In Step 3, the global CNN consists of a global average pooling and a fully connected layer, and extracts the data features of the entire sensor through consecutive global average pooling (GAP) and a fully connected (FC) layer with 512 units.
8. The method for managing the energy of a marine vessel based on pyramid diversified attention according to claim 1, characterized in that, In Step 3, the energy management mode 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 the identification of the energy management mode.
9. An energy management system for maritime vessels based on pyramid diverse attention, characterized in that, It includes a multi-sensor, a controller, and a power electronic converter; The multi-sensor collects the operation data of the ship and transmits the data to the controller for processing; The controller has a built-in pyramid diversified attention network classification model, including a backbone CNN, a local CNN, a 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; and determines the working mode of the power electronic converter After determining the operation mode, the operation mode of each group of electronic converters corresponds to a power output mode of the ship's power system.
10. A computer device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the steps of the method described in Claim 1.
Citation Information
Patent Citations
Fine-grained pressure sore grade classification method based on attention pyramid
CN117853771A
Information extraction method of offshore raft culture based on multi-temporal optical remote sensing images
US20230306730A1