Multi-scale adaptive gating MambaPlus network construction method and device
By using a multi-scale adaptive gated MambaPlus network, the problems of insufficient utilization of multi-scale information and poor adaptive feature fusion in Mamba-like models are solved, achieving higher recognition accuracy and training convergence speed, and improving the robustness and engineering application capability of the model in complex scenarios.
Patent Information
- Application Number
- CN202610559535.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-27
- Publication Date
- 2026-05-26
- Estimated Expiration
- 2046-04-27
AI Technical Summary
Existing Mamba-like models suffer from problems such as insufficient utilization of multi-scale information, poor feature fusion adaptability, weak module synergy, and low robustness in complex scenarios.
A multi-scale adaptive gated MambaPlus network is constructed. Through multi-scale feature extraction, hierarchical adaptive gating fusion, and cross-scale attention enhancement, combined with strategies such as enhanced normalization, training-time noise injection, AdamW optimizer, and cosine annealing learning rate scheduling, a closed-loop collaborative architecture of multi-scale feature extraction, hierarchical gating fusion, and cross-scale attention enhancement is formed.
It significantly improves the model's ability to represent multi-scale features of complex patterns, its adaptability and robustness, improves recognition accuracy by 20%, improves training convergence speed by 40%, and has excellent scalability and engineering application value.
Smart Images

Figure CN122087742A_ABST
Abstract
Description
Technical Field
[0001] This application relates to a method and apparatus for constructing a multi-scale adaptive gated MambaPlus network, belonging to the field of artificial intelligence and machine learning technology. Background Technology
[0002] With the rapid development of artificial intelligence technology, deep neural networks (DNNs) have achieved remarkable application results in many fields such as time series analysis, fault detection, state monitoring, and target recognition. However, traditional deep networks generally rely on a large number of parameters and stacked hierarchical structures to improve the model's expressive power, resulting in problems such as limited feature representation ability, insufficient utilization of multi-scale information, insufficient robustness and generalization ability in complex scenarios, and poor coordination of structural enhancement modules in practical applications.
[0003] To address the technical challenge of balancing long-range dependency modeling and computational efficiency in deep learning models, the academic community has proposed neural network architectures based on State Space Models (SSMs). Among them, Selective State Space Models (SSMs) introduce input-related selection mechanisms during state updates, enabling the model to dynamically adjust information propagation paths based on input, thus achieving both long-range dependency modeling capabilities and high computational efficiency. The Mamba model, as a representative SSM, structurally improves the state space model by introducing an input-dependent parameter generation mechanism, enabling selective memorization and forgetting of input information. Compared to traditional Transformer models that rely on global self-attention computation, the Mamba model maintains high modeling capabilities while exhibiting superior computational efficiency and lower resource consumption, demonstrating significant application potential in tasks such as time series analysis and signal processing.
[0004] However, in existing research and applications, most typical Mamba-like models adopt a fixed-structure single-backbone modeling approach, relying solely on a single path to complete feature extraction and state modeling. This approach still suffers from the following technical shortcomings in real-world, complex scenarios: First, there is a lack of explicit multi-scale feature extraction mechanisms. Existing Mamba-like models typically model the input features holistically through a unified hidden space, making it difficult to simultaneously and fully capture discriminative information at different levels and scales. In practical tasks, target patterns often contain both local sensitive features and global trend features. Single-path modeling can easily lead to insufficient model response to local patterns or inadequate modeling of overall structural information, limiting further improvements in model performance.
[0005] Second, the feature fusion methods lack adaptability. Some existing technologies introduce additional information through multi-branch structures, feature concatenation, or simple weighting, but these methods use fixed fusion paths and cannot dynamically adjust the importance of different branches and features at different scales based on the features of the input samples. Since different samples have different degrees of dependence on various features, fixed fusion methods are prone to feature redundancy, invalid information superposition, and key feature suppression, affecting the model's expressive flexibility and task adaptability.
[0006] Third, there is a lack of ability to select and reconstruct fused features. After completing the extraction of basic features or the fusion of branch features, existing models usually directly input the fusion results into the output layer, lacking further feature enhancement and relationship reconstruction mechanisms. This makes it impossible to strengthen the extracted high-value information and to explore the deep correlations between different features, thus limiting the model's ability to distinguish complex patterns and fine-grained differences.
[0007] Fourth, the robustness and stability in complex scenarios are insufficient. In real-world complex scenarios, input data is often accompanied by noise disturbances, fluctuations in sample distribution, and fluctuations in features. When faced with these situations, existing Mamba-like models are prone to instability during training, sensitivity to feature distribution, and decreased generalization ability. Furthermore, the lack of reasonable collaborative design after the superposition of multiple modules actually increases the difficulty of training.
[0008] Fifth, there is insufficient synergy between structural modules. Existing improvement methods mostly make local improvements from the perspectives of multi-scale extraction, gating mechanisms, or attention mechanisms, simply superimposing various modules without a unified structural organization and hierarchical collaborative design. It is difficult for different modules to form an efficient complementary relationship, resulting in increased model structural complexity but limited performance improvement, which is not conducive to engineering applications and promotion.
[0009] The root cause of the above-mentioned defects is that the design of existing Mamba-like models still revolves around single-based feature modeling, and has not yet formed a unified network structure that organically combines multi-scale feature extraction, adaptive gating fusion and feature enhancement mechanisms. It lacks a holistic optimization scheme for feature extraction, screening, fusion and enhancement, which hinders the further application of Mamba-like models in complex task scenarios. Summary of the Invention
[0010] The purpose of this application is to address the shortcomings of existing technologies by providing a method and apparatus for constructing a multi-scale adaptive gating MambaPlus network. While retaining the advantages of Mamba models in long-range dependency modeling, this method constructs an intelligent network model that combines long-range dependency modeling capabilities, multi-scale representation capabilities, strong generalization performance, and high engineering practicality through a collaborative design of multi-scale feature extraction, hierarchical adaptive gating fusion, and cross-scale attention enhancement. This method can solve the technical problems of existing Mamba-like models, such as insufficient utilization of multi-scale information, poor adaptive feature fusion, weak module collaboration, and low robustness in complex scenarios.
[0011] The technical solution adopted by this application to solve its technical problem is: On the one hand, a method for constructing a multi-scale adaptive gated MambaPlus network is provided, including the following steps: Step 1: Initialize network configuration parameters and build the network infrastructure, which includes an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer connected in sequence. Step 2: Preprocess the input data to generate standardized training and test datasets; Step 3: Map the preprocessed input data to the hidden feature space through the input mapping layer, and then extract the basic features of the input data through the Mamba backbone module; Step 4: Through the multi-scale feature extraction module, at least two parallel feature extraction branches of different scales are constructed in the hidden feature space to perform multi-granularity parallel transformation on the input hidden features and obtain a multi-scale feature set. Step 5: Input the set of basic features and multi-scale features into the adaptive gating module. Through a hierarchical gating mechanism, dynamically assign weights and adaptively fuse the basic features and multi-scale features to generate fused features. Step 6: Input the multi-scale feature set and the basic features into the cross-scale attention enhancement module, establish cross-scale association through a multi-head attention mechanism, and generate attention enhancement features; input the attention enhancement features into the feedforward enhancement module for nonlinear transformation to generate feedforward enhancement features; perform residual superposition of the feedforward enhancement features and the fusion features generated in Step 5 to generate the final discriminative features; Step 7: Input the final discriminant features into the output layer to complete the target category prediction, and complete the training and evaluation of the model through the preset loss function and optimization strategy.
[0012] On the other hand, a multi-scale adaptive gated MambaPlus network construction device is provided, including an initialization module, a data preprocessing module, a backbone feature extraction module, a multi-scale feature extraction module, an adaptive gated fusion module, a feature enhancement module, and a prediction and training module, for performing the steps of the multi-scale adaptive gated MambaPlus network construction method described above.
[0013] One of the above technical solutions has the following advantages or beneficial effects: 1. This application uses the Mamba backbone as the core feature extraction structure, which retains the excellent long-range dependency modeling ability and computational efficiency of the selective state-space model. At the same time, through the parallel multi-scale feature extraction structure, it realizes multi-level parallel modeling of input features at fine-grained, medium-scale, and coarse-grained levels, enabling the model to capture local sensitive features, overall trend features, and intermediate-level supplementary information simultaneously. This significantly improves the model's ability to express multi-scale features of complex patterns and solves the technical problem of insufficient multi-scale information utilization in the single-backbone Mamba model.
[0014] 2. This application designs a three-level hierarchical adaptive gating mechanism including scale level, channel level, and global level. It can dynamically adjust the global importance of features at different scales, the response weight of each feature channel, and the contribution ratio of basic features and multi-scale features according to the feature distribution of input samples. This achieves adaptive screening and efficient fusion of multi-source features, avoids the feature redundancy and key information suppression problems caused by fixed fusion methods, and greatly improves the model's adaptability to different samples and different scenarios.
[0015] 3. This application explicitly models the deep correlation between multi-scale features and basic features through a cross-scale attention enhancement module and a feedforward enhancement module, realizing cross-scale content alignment and feature reconstruction, and strengthening the collaborative expressive ability of features from different sources; at the same time, through a learnable residual scaling factor, the influence intensity of the enhancement information on the fused features is controlled, further improving the discriminative ability of features and the model's ability to distinguish fine-grained differences without destroying the original feature distribution.
[0016] 4. This application effectively improves the training stability and convergence of the model under complex scenarios such as noise perturbation, sample distribution fluctuations, and feature shifts through a stable training strategy designed in collaboration with enhanced normalization, training-time noise injection, AdamW optimizer, cosine annealing learning rate scheduling, and gradient pruning. It significantly enhances the robustness and generalization performance of the model, reduces the model's dependence on manual parameter tuning, and improves the practicality of engineering applications.
[0017] 5. Based on the Mamba backbone, this application creatively introduces a multi-scale parallel feature extraction branch, a three-level hierarchical adaptive gating mechanism, and a cross-scale attention enhancement module. These three are not simply superimposed, but form a closed-loop collaborative architecture of "multi-scale feature extraction—hierarchical gating fusion—cross-scale attention enhancement." Each module supports and optimizes the others: multi-scale feature extraction provides rich, multi-source complementary features for gating fusion; hierarchical gating fusion filters high-quality, effective features for attention enhancement; and cross-scale attention enhancement further strengthens the synergistic relationship between the backbone features and multi-scale features. The combination of these three produces unexpected technical effects. Experimental verification shows that in noisy industrial fault diagnosis scenarios, the network structure of this application improves the recognition accuracy by more than 20% compared to the basic Mamba model, far exceeding the sum of the performance improvements of individual module improvements; simultaneously, the model training convergence speed is improved by 40%, and the generalization performance in small sample scenarios is also significantly improved. The aforementioned unexpected technical effects fully demonstrate that the synergistic effect between multi-scale extraction, adaptive gating, and attention enhancement breaks through the performance bottleneck of traditional single improvements and solves the problems of poor module synergy and limited performance improvement in existing technologies.
[0018] 6. This application adopts a hierarchical and modular structural design, with clear division of labor and seamless connection between modules. This facilitates flexible adjustment and expansion of parameters such as the number of scales, hidden dimensions, and number of attention heads according to specific task requirements, demonstrating excellent scalability. At the same time, the technical solution of this application can be directly adapted to various application scenarios such as time series analysis, fault diagnosis, and target recognition, without the need for large-scale structural reconstruction for different scenarios. This significantly reduces the cost of model design and deployment, and has extremely high engineering application value. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a multi-scale adaptive gating MambaPlus network construction method according to an exemplary embodiment; Figure 2 This is a schematic diagram of a multi-scale adaptive gating MambaPlus network construction device according to an exemplary embodiment; Figure 3 This is a flowchart illustrating a specific implementation process of constructing a multi-scale adaptive gated MambaPlus network according to an exemplary embodiment of this application; Figure 4 This is a schematic diagram illustrating a hierarchical gating mechanism according to an exemplary embodiment. Detailed Implementation
[0020] To more clearly illustrate the technical features of this application, the following detailed description is provided through specific embodiments and in conjunction with the accompanying drawings.
[0021] like Figure 1 As shown in this embodiment, a method for constructing a multi-scale adaptive gated MambaPlus network includes the following steps: Step 1: Initialize network configuration parameters and build network infrastructure.
[0022] The initialized network configuration parameters include: initializing the hidden dimension D, the number of residual block layers L, the state dimension N, the expansion factor E, the convolutional kernel width K, and calculating the intermediate hidden layer dimensions. The input mapping layer will map the original input features. Mapping to the hidden feature space, the mapping formula is: ,in For the input mapping weight matrix, For bias terms, For normalization operations, It is a non-linear activation function.
[0023] The network infrastructure consists of an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer, which are connected in sequence.
[0024] Step 2: Preprocess the input data to generate standardized training and test datasets.
[0025] The preprocessing of the input data includes: reading the original input sample set and the corresponding label set; filling input features with missing items by column mean, and performing z-score standardization on the filled features; adding Gaussian noise to the standardized input features during the training phase; and dividing the samples into non-overlapping training and test sets according to a preset ratio.
[0026] Step 3: Map the preprocessed input data to the hidden feature space through the input mapping layer, and then extract the backbone features of the input data through the Mamba backbone module.
[0027] The extraction of backbone features from the input data using the Mamba backbone module includes: the Mamba backbone module consists of L cascaded residual blocks, and the output of the l-th residual block is... in For the root mean square normalization operation, MambaBlock is a basic module of Mamba; for the input feature h, MambaBlock first decomposes it into the state space branch input u and the gated branch input z through linear projection, i.e. Generate input-related parameters for state-space branching. Selective state-space modeling is completed to obtain the state output. Gated branch Function activation yields gated output The basic features are obtained after passing through L residual blocks. .
[0028] Step 4: Using the multi-scale feature extraction module, at least two parallel feature extraction branches of different scales are constructed in the hidden feature space to perform multi-granularity parallel transformation on the input hidden features and obtain a multi-scale feature set.
[0029] The construction of at least two parallel feature extraction branches at different scales in the hidden feature space includes: constructing a multi-scale set. K≥2; for each scale Hidden features The scale-downsampled features are obtained by projecting them onto the corresponding scale space through scale-downsampling mapping. ; Perform scale feature transformation on the downsampled features at each scale to obtain the feature representation at each scale. Features at each scale are restored to a unified hidden dimension through scale upsampling mapping, resulting in a multi-scale feature set. ,in .
[0030] The scale coefficient of the multi-scale set S takes the value of {1,2,4}, corresponding to 3 parallel feature extraction branches; among them, the scale 1 branch retains the original hidden dimension and uses a 2-layer linear layer structure to extract fine-grained features; the scale 2 branch maps to 1 / 2 of the original hidden dimension and uses a 1-layer linear layer structure to extract medium-scale features; the scale 4 branch maps to 1 / 4 of the original hidden dimension and uses a linear layer structure to extract coarse-grained features.
[0031] Step 5: Input the set of basic features and multi-scale features into the adaptive gating module. Through a hierarchical gating mechanism, dynamically assign weights to the basic features and multi-scale features and adaptively fuse them to generate fused features.
[0032] The hierarchical gating mechanism includes scale-level weight allocation, channel-level gating, and global gating balancing, specifically including: Scale-level weighting: The global importance coefficient of features at each scale is calculated using the Softmax function. Global weights are assigned to features at each scale. Channel-level gating: Generate corresponding channel gating weights for each scale feature. The channel dimensions of each scale feature are dynamically filtered to obtain the gated scale features. Multi-scale feature fusion: Summing all gated scale features yields the multi-scale fused features. ; Global gating balancing: Concatenates the basic features with multi-scale fused features to generate global gating weights. The final fused feature is generated by balancing the contributions of the basic feature and the multi-scale fused feature through global gating weights. .
[0033] Step 6: Input the multi-scale feature set and the basic features into the cross-scale attention enhancement module, establish cross-scale association through a multi-head attention mechanism, and generate attention enhancement features; input the attention enhancement features into the feedforward enhancement module for nonlinear transformation to generate feedforward enhancement features; and perform residual superposition of the feedforward enhancement features and the generated fusion features to generate the final discriminative features.
[0034] Step 6 specifically includes: stacking the features of each scale in the multi-scale feature set to form a query sequence Q, using the basal features as the key sequence K and the value sequence V; and calculating the cross-scale attention output through a multi-head attention mechanism. The attention outputs are aggregated along the scale dimension to obtain attention-enhanced features. The attention-enhanced features are input into the feedforward enhancement module, and the feedforward enhancement features are obtained through nonlinear transformation. Set a learnable residual scaling factor. The feedforward enhancement features are superimposed onto the fusion features to generate the final discriminative features. The number of heads in the multi-head attention mechanism is between 2 and 8, and the residual scaling factor is... The initial value is 0.01~0.5; the feedforward enhancement module adopts a two-layer linear layer structure, the activation function is the GELU function, and the feedforward expansion factor is 1.5~4.
[0035] Step 7: Input the final discriminant features into the output layer to complete the target category prediction, and complete the training and evaluation of the model through the preset loss function and optimization strategy.
[0036] The training and evaluation of the model include: using the cross-entropy loss function as the classification loss, using the AdamW optimizer with weight decay to update the model parameters, using the cosine annealing strategy for learning rate scheduling, and using gradient clipping to constrain the gradient norm to avoid training instability; after the model training is completed, the accuracy, ROC curve, AUC value, confusion matrix and classification report are output to complete the model evaluation.
[0037] like Figure 2 As shown, this embodiment of a multi-scale adaptive gated MambaPlus network construction device includes: The initialization module is used to initialize network configuration parameters and build the network infrastructure, which includes an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer connected in sequence. The data preprocessing module is used to preprocess the input data to generate standardized training and test datasets. The backbone feature extraction module is used to map the preprocessed input data to the hidden feature space through the input mapping layer, and then extract the backbone features of the input data through the Mamba backbone module. A multi-scale feature extraction module is used to construct at least two parallel feature extraction branches of different scales in the hidden feature space, perform multi-granularity parallel transformation on the input hidden features, and obtain a multi-scale feature set. The adaptive gating fusion module is used to input the basal features and multi-scale feature sets into the adaptive gating module. Through a hierarchical gating mechanism, the basal features and multi-scale features are dynamically weighted and adaptively fused to generate fused features. The feature enhancement module is used to input the multi-scale feature set and the basic features into the cross-scale attention enhancement module, establish cross-scale association through a multi-head attention mechanism, and generate attention-enhanced features; input the attention-enhanced features into the feedforward enhancement module for nonlinear transformation to generate feedforward enhanced features; and perform residual superposition of the feedforward enhanced features and the generated fusion features to generate the final discriminative features. The prediction and training module is used to input the final discriminative features into the output layer to complete the target category prediction, and to complete the training and evaluation of the model through a preset loss function and optimization strategy.
[0038] Preferably, the multi-scale feature extraction module includes at least two parallel scale branch units, each scale branch unit corresponding to a different feature granularity, including a fine-grained feature extraction unit, a medium-scale feature extraction unit, and a coarse-grained feature extraction unit.
[0039] Preferably, the adaptive gated fusion module includes a scale-level weight allocation unit, a channel-level gating unit, a multi-scale fusion unit, and a global gating balancing unit. The scale-level weight allocation unit is used to calculate the global importance coefficient of each scale feature using the Softmax function and to perform global weight allocation on each scale feature. The channel-level gating unit is used to generate corresponding channel gating weights for each scale feature and to dynamically filter the channel dimensions of each scale feature. The multi-scale fusion unit is used to sum all the gated scale features to obtain the multi-scale fused feature. The global gating balancing unit is used to balance the contributions of the basic feature and the multi-scale fused feature through global gating weights to generate the final fused feature.
[0040] Preferably, the feature enhancement module includes a cross-scale attention unit, a feedforward enhancement unit, and a residual stacking unit; the cross-scale attention unit is used to perform cross-scale association modeling using multi-scale features as query sequences and basic features as key and value sequences through a multi-head attention mechanism to generate attention-enhanced features; the feedforward enhancement unit is used to perform nonlinear transformation on the attention-enhanced features to generate feedforward enhanced features; the residual stacking unit is used to stack the feedforward enhanced features onto the fusion features through a learnable residual scaling factor to generate the final discriminative features.
[0041] Preferably, the prediction and training module includes a classification prediction unit, a loss calculation unit, a parameter optimization unit, and a model evaluation unit; the classification prediction unit is used to map the final discriminative features to the category space and generate category probabilities and prediction results; the loss calculation unit is used to calculate the classification loss predicted by the model using the cross-entropy loss function; the parameter optimization unit is used to update the model parameters using the AdamW optimizer with weight decay, cosine annealing learning rate scheduling, and gradient pruning strategies; the model evaluation unit is used to output the model's accuracy, ROC curve, AUC value, confusion matrix, and classification report to complete the model performance evaluation.
[0042] To address the shortcomings of existing Mamba-like models, such as insufficient multi-scale feature extraction, limited feature fusion methods, inadequate utilization of enhanced features, and insufficient robustness in complex scenarios, this application proposes a multi-scale MambaPlus network construction method. This method uses the selective state-space model Mamba as the backbone for feature extraction. After input feature mapping, multi-scale feature extraction branches are constructed in parallel. An adaptive gating mechanism is used to fuse the backbone features with multi-scale features. Furthermore, a cross-scale attention enhancement module and a feedforward enhancement module are introduced to improve the model's ability to express complex patterns and its final classification performance. The method can also incorporate enhanced normalization, training-time perturbation, weight decay optimization, learning rate scheduling, and gradient pruning mechanisms to improve model training stability and engineering application capabilities. This scheme corresponds to the input mapping, Mamba backbone, multi-scale branches, gating fusion, attention enhancement, and output classification processes in the code.
[0043] like Figure 3 As shown in the figure, the embodiment of this application provides a multi-scale MambaPlus network construction method, and the specific implementation process is as follows.
[0044] S1 initiates the network construction process and initializes the input mapping layer, Mamba backbone module, and network configuration parameters.
[0045] The core objective of this step is to establish a unified network infrastructure so that subsequent multi-scale feature extraction, adaptive gating fusion, and attention enhancement can all be completed in the same hidden feature space.
[0046] (1) Initialize the overall network structure: The overall network structure includes at least an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer. Furthermore, this application does not simply stack existing Mamba networks; rather, while retaining the advantages of selective state-space models in long-range dependency modeling, it systematically designs the overall network structure around the main theme of "multi-scale feature representation—adaptive feature selection—cross-module collaborative enhancement."
[0047] (2) Initialize Mamba configuration parameters: Let the hidden dimension be... The number of layers is The state dimension is The expansion factor is Then the intermediate hidden layer dimension is represented as: , Preferably, the network configuration parameters include hidden dimensions. Number of residual block layers State dimension kernel width and step size In a preferred implementation, the step size rank is set automatically: .
[0048] (3) Initialize the input mapping layer: Let the original input features be: , The input mapping layer maps the raw input to the hidden space: , in, For the input mapping weight matrix, For bias terms, This indicates a normalization operation. This represents a non-linear activation function.
[0049] In a preferred implementation, normalization employs enhanced layer normalization, and during the training phase, a small amount of random noise is superimposed on the normalized output, i.e.: , in, This represents random noise.
[0050] Through the above steps, a unified hidden space representation foundation is established, enabling the backbone feature extraction, multi-scale branch extraction, and enhancement modules to work collaboratively, and improving the modularity and scalability of the network structure.
[0051] S2 preprocesses the input data and generates a dataset that can be used for network training and testing.
[0052] The core objective of this step is to transform the raw sample data into a standard input format suitable for network training, and to ensure that the input data meets the requirements for subsequent training and testing through cleaning, padding, standardization, and partitioning. This step corresponds to the data reading, cleaning, normalization, partitioning, and training-period noise injection processes in the training script.
[0053] (1) Read input data: Let the original input sample set be: , in, The total number of samples, For the first Input features of each sample For the corresponding tag.
[0054] (2) Handling missing values: For input features with missing items, the column mean is used to fill in the missing items: , in, For the first The mean of each feature dimension on the valid samples.
[0055] (3) Standardization process: Standardize the input features: , in, For the first dimensional feature mean, For the first Dimensional characteristic standard deviation.
[0056] (4) Training period disturbance injection During the training phase, small-amplitude Gaussian noise is superimposed on the standardized input features: , This step is used to enhance the model's ability to adapt to input fluctuations, measurement errors, and data noise.
[0057] (5) Dataset partitioning: The samples are divided into training and test sets according to a preset ratio: .
[0058] The above steps improve the quality of input data, reduce the adverse effects of missing values and noise disturbances on model training, ensure the consistency of the input space between the training set and the test set, and enhance the model's adaptability to fluctuations in complex scenarios.
[0059] S3 maps the preprocessed input data to the hidden feature space and uses the Mamba backbone module to extract the backbone features.
[0060] The core objective of this step is to extract the core semantic features of the input samples through selective state-space modeling. These core features serve not only as the main output but also as a semantic reference in subsequent multi-scale information filtering and enhancement processes.
[0061] (1) Input mapping: After processing by the input mapping layer in step S1, the hidden representation is obtained: .
[0062] (2) Mamba backbone modeling: The Mamba backbone is composed of multiple residual blocks connected in series. The output of each residual block is: , in, It can be represented as: , in, For learnable scaling parameters, It is the stability constant. This indicates element-wise multiplication.
[0063] (3) Basic calculations of MambaBlock: For input features First, it is split into two branches using linear projection: , in, For state space branch input, For gating branch input.
[0064] Furthermore, parameters related to the input are generated for the state-space branches: , In the current implementation, the state update is simplified for the existing input format and can be represented as follows: , , Meanwhile, the gated branch, after nonlinear transformation, yields: , The output of MambaBlock can then be represented as: , The basic features are obtained after passing through multiple residual blocks: .
[0065] Through the above steps, a backbone feature representation based on the selective state space mechanism is obtained, providing a stable backbone semantic foundation for subsequent multi-scale feature fusion and cross-scale enhancement.
[0066] S4. Construct a multi-scale feature extraction branch in the hidden feature space to obtain a multi-scale feature representation.
[0067] The core objective of this step is to enhance the model's multi-scale expressive capability by extracting supplementary features at different levels through multiple scale branches. The multi-scale feature extraction structure in this application is not limited to a strictly defined image pyramid form, but emphasizes parallel transformation of the input hidden features with different granularities and complexities through multiple scale mapping paths.
[0068] (1) Constructing a scale set: Let the multi-scale set be: , The scale set can be preferably selected as follows: .
[0069] In this method: 1) Scale 1 branches preserve the original hidden dimensions, making them suitable for extracting fine-grained and highly complex features; 2) The scale 2 branch is reduced to half of the original hidden dimension, which is suitable for extracting mesoscale balanced features; 3) The scale 4 branch is reduced to one-quarter of the original hidden dimension, which is suitable for extracting coarse-grained statistical features.
[0070] Preferably: 1) Scale 1 branches use a deeper structure, such as "two linear layers + ReLU + Dropout + BatchNorm"; 2) Scale 2 branches use a medium-complexity structure, such as "one linear layer + ReLU + Dropout + BatchNorm"; 3) Scale 4 branches adopt lightweight structures, such as "one linear layer + ReLU + Dropout".
[0071] (2) Scale downsampling mapping: For each scale Hidden features Projected onto the corresponding scale space: , in, This is a scale-downsampling mapping, which is preferably implemented using a linear layer and an activation function.
[0072] (3) Scale feature extraction: For scale Perform scale-specific feature transformations on the input features: , in, For scale-specific feature extraction blocks, feature extraction blocks of different complexities can be used for different scales to meet the expression needs of information at different levels.
[0073] (4) Scale-upsampling uniform dimension: To facilitate subsequent fusion, features at each scale are remapped to a unified hidden space: , in, To recover the upsampling mapping to a unified hidden dimension, thus obtaining a multi-scale feature set with a unified dimension: .
[0074] Through this design, the model can capture complementary discriminative information from input samples from different perspectives. For example, some scale branches are better suited to characterizing overall trend features, while others are better suited to extracting locally sensitive features, and still others can be used to enhance the representation of intermediate-level features. These different branches can automatically form differentiated feature focus areas during training, thereby providing a richer source of candidate information for subsequent gating fusion.
[0075] Through the above steps, an explicit multi-scale feature extraction structure is formed, enabling the model to simultaneously model discriminative information at different levels, thus compensating for the problem of insufficient utilization of multi-scale information by single-path modeling.
[0076] S5 inputs the basic features and multi-scale features into the adaptive gating module to generate fused features.
[0077] The core objective of this step is to adaptively adjust the contributions of features at various scales and the basal features based on the current input sample features. The adaptive gating module employs a hierarchical gating mechanism, such as... Figure 4 As shown, this gating mechanism is not a simple linear weighting, but rather achieves dynamic adjustment of information at different scales and core information through a hierarchical weight allocation method.
[0078] (1) Scale-level weight allocation: Let the scale importance parameter be: , The global importance coefficients for each scale are obtained using Softmax: .
[0079] (2) Channel-level gating For each scale feature Generate the corresponding channel gating weights: , in, This is the Sigmoid function.
[0080] The scale features after gating are: .
[0081] (3) Multi-scale feature fusion Summing all scale-gated features yields the multi-scale fused features: .
[0082] (4) Global gated balance backbone and multi-scale features Concatenate the basic features with multi-scale fused features: , Generate global gating weights: , The final feature after fusion can be expressed as: .
[0083] Scale-level weights primarily reflect the overall importance of different scale branches in the current task; channel-level gating characterizes the response strength of the current sample across various feature dimensions; and global gating further balances the relative contributions between basal features and multi-scale fused features. This design avoids the information redundancy issues associated with fixed feature splicing or fixed weighted fusion.
[0084] Through the above steps, the model can dynamically allocate and select information at different scales, achieve adaptive fusion between basic features and multi-scale features, and improve feature utilization efficiency and adaptability to complex samples.
[0085] S6 performs cross-scale attention enhancement and feedforward enhancement processing on multi-scale features and basal features to obtain enhanced discriminative features.
[0086] The core objective of this step is to further enhance the collaborative expressive power between multi-scale features and basal features. This step is not simply about increasing model complexity, but rather about establishing an explicit correlation between multi-scale features and basal features.
[0087] (1) Construct Query, Key and Value: Stack ungated multi-scale features to form a query sequence: , Use the core features as keys and values: .
[0088] (2) Perform cross-scale attention enhancement: Multi-head attention mechanism is used to compute cross-scale augmented features: , The attention output can then be expressed as: , Aggregating the attention output along the scale dimension yields the enhanced features: .
[0089] (3) Feedforward enhancement: Input the attention enhancement results into the feedforward network: , in, The preferred activation function is GELU.
[0090] (4) Enhance normalization: Perform augmentation normalization on the feedforward augmentation results: , in, This represents the random perturbation term during the training phase.
[0091] (5) Residual enhancement with scaling factor: Set the learnable residual scaling factor The enhanced results will be superimposed onto the gated fusion features: .
[0092] This application employs a cross-scale attention mechanism to enable features at different scales to align content and reconstruct responses around the core features, thereby improving the overall consistency and discriminative power of the fused features. Furthermore, feedforward and residual enhancement modules are incorporated, allowing the enhanced features to not only express cross-scale correlation information but also extract higher-order semantic representations through nonlinear transformations. A learnable residual scaling factor controls the intensity of the enhancement information's influence on the final features, preventing the enhancement module from excessively interfering with the original discriminative information.
[0093] Through the above steps, the content correlation between multi-scale features and basic features can be explicitly modeled, and the overall discrimination ability can be enhanced without destroying the original feature distribution.
[0094] S7 inputs the enhanced discriminative features into the output layer to complete the target category prediction, and combines loss function, optimizer, learning rate scheduling and gradient pruning to realize model training and evaluation during the training process.
[0095] The core objective of this step is to complete the model output construction and obtain a usable model through a stable training strategy. This step corresponds to cross-entropy loss, AdamW, cosine annealing scheduling, gradient pruning, optimal model saving, and output evaluation in the training script.
[0096] (1) Output layer prediction: The final discriminant features are input into the output layer to obtain the category score: , Further, we obtain the category probabilities: , in, This represents the number of categories.
[0097] (2) Classification loss function: Preferably, the cross-entropy loss function is used: , in, One-hot representation of the real label.
[0098] (3) Parameter optimization: The model parameters are updated using the AdamW optimizer with weight decay.
[0099] (4) Learning rate scheduling Preferably, a cosine annealing learning rate scheduling method is adopted: , in, For the first Learning rate during round training This represents the total number of training rounds.
[0100] (5) Gradient clipping: To avoid training instability, the gradient norm is constrained: , in, This is a preset gradient threshold.
[0101] (6) Evaluation output: After the model training is completed, it can further output evaluation results such as accuracy, ROC curve, AUC value, confusion matrix and classification report, which can be used to verify the recognition effect and engineering application value of the network structure described in this application in the target task.
[0102] The training strategy is part of the co-design with the network structure, and its main purpose is to ensure that the multi-scale branches, gating modules and attention enhancement modules can still converge stably under small sample size, noise perturbation and complex conditions.
[0103] The explicit training process includes: 1) Input standardization; 2) Gaussian noise injection during training; 3) Cross-entropy loss; 4) AdamW optimizer; 5) Cosine annealing learning rate scheduling; 6) Gradient pruning; 7) Evaluation outputs such as ROC, AUC, confusion matrix, and classification report.
[0104] Input standardization can be written as: , Training-period noise enhancement can be written as: , The classification loss uses cross-entropy: , Learning rate scheduling uses cosine annealing: , Gradient clipping can be written as: , The given range of hyperparameters is as follows: 1) Learning rate: Preferred ; 2) Weight decay: Preferred ; 3) Batch size: 16–512, preferably 64–256; 4) epoch: 10-500, preferably 30-150; 5) Dropout: 0.05~0.5, preferably 0.1~0.3; 6) Input noise amplitude: 0.001~0.05, preferably 0.003~0.01; 7) Enhance the normalized noise scale: 0.01 to 0.1, preferably 0.03 to 0.05; 8) Gradient clipping threshold: 1 to 20, preferably 5 to 10.
[0105] Through the above steps, stable model training and classification prediction output were achieved, and the convergence, robustness and practicality of the model under complex sample conditions were improved.
[0106] Compared with the prior art, the present application has at least the following advantages through the above technical solution: 1. Using the Mamba backbone as the core structure enhances the model's ability to model long-range dependencies and overall feature relationships; 2. The multi-scale feature extraction structure enhances the model's ability to express information at different levels; 3. Feature fusion efficiency is improved through scale-level, channel-level, and global-level adaptive gating mechanisms; 4. The synergistic relationship between basal features and multi-scale features was strengthened through cross-scale attention enhancement and feedforward enhancement modules; 5. By enhancing normalization, training-time perturbation, optimizer scheduling, and gradient pruning, the model training stability and robustness are improved; 6. A multi-scale MambaPlus network construction scheme with clear structure, easy implementation, and good scalability has been developed.
[0107] The MambaPlus network is a structural enhancement scheme based on the Mamba backbone. Its core is not to replace Mamba, but to retain Mamba as the backbone feature extraction module and add multi-scale feature extraction, gated fusion, cross-scale attention enhancement, feedforward enhancement, and a stable training mechanism.
[0108] Multi-scale MambaPlus networks refer to an improved network structure that constructs multiple branch representations with different granularities and complexities in a unified hidden space, and dynamically fuses and enhances them with Mamba backbone features. Here, "multi-scale" is not limited to image spatial resolution, but refers to a parallel representation method that forms "fine-grained features—medium-scale features—coarse-grained features" through different scale mapping paths.
[0109] Compared to the basic Mamba network, MambaPlus includes at least the following improvements: (1) Add multi-scale branches and no longer rely solely on single-path modeling; (2) Add adaptive gating fusion at the scale level, channel level, and global level; (3) Add a cross-scale attention enhancement module to explicitly model the correlation between multi-scale features and basal features; (4) Add stable training strategies such as enhanced normalization, training period noise injection, AdamW, cosine annealing and gradient clipping.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and not to limit them. Although this application has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation methods of this application. Any modifications or equivalent substitutions that do not depart from the spirit and scope of this application should be covered within the protection scope of the claims of this application.
Claims
1. A method for constructing a multi-scale adaptive gated MambaPlus network, characterized in that, Includes the following steps: Step 1: Initialize network configuration parameters and build the network infrastructure, which includes an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer connected in sequence. Step 2: Preprocess the input data to generate standardized training and test datasets; Step 3: Map the preprocessed input data to the hidden feature space through the input mapping layer, and then extract the basic features of the input data through the Mamba backbone module; Step 4: Through the multi-scale feature extraction module, at least two parallel feature extraction branches of different scales are constructed in the hidden feature space to perform multi-granularity parallel transformation on the input hidden features and obtain a multi-scale feature set. Step 5: Input the set of basic features and multi-scale features into the adaptive gating module. Through a hierarchical gating mechanism, dynamically assign weights and adaptively fuse the basic features and multi-scale features to generate fused features. Step 6: Input the multi-scale feature set and the basic features into the cross-scale attention enhancement module, establish cross-scale association through a multi-head attention mechanism, and generate attention-enhanced features; The attention-enhanced features are input into the feedforward enhancement module for nonlinear transformation to generate feedforward enhanced features. The feedforward enhanced features and the fusion features generated in step 5 are residually superimposed to generate the final discriminative features; Step 7: Input the final discriminant features into the output layer to complete the target category prediction, and complete the training and evaluation of the model through the preset loss function and optimization strategy.
2. The multi-scale adaptive gated MambaPlus network construction method according to claim 1, characterized in that, The initialized network configuration parameters include: initializing the hidden dimension D, the number of residual block layers L, the state dimension N, the expansion factor E, the convolutional kernel width K, and calculating the intermediate hidden layer dimension D. inner =E·D; The input mapping layer maps the original input features Mapping to the hidden feature space, the mapping formula is: h 0= φ (Norm( W in x+ b in )),in W in For the input mapping weight matrix, b in The bias term is represented by Norm(·), which is the normalization operation. φ (·) is a non-linear activation function.
3. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 1, characterized in that, The preprocessing of the input data includes: reading the original input sample set and the corresponding label set; filling input features with missing items by column mean, and performing z-score standardization on the filled features; adding Gaussian noise to the standardized input features during the training phase; and dividing the samples into non-overlapping training and test sets according to a preset ratio.
4. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 1, characterized in that, The extraction of backbone features from the input data using the Mamba backbone module includes: the Mamba backbone module consists of L cascaded residual blocks, and the output of the l-th residual block is... ,in For the root mean square normalization operation, MambaBlock is a basic module of Mamba; for the input feature h, MambaBlock first decomposes it into the state space branch input u and the gated branch input z through linear projection, i.e. Generate input-related parameters for state-space branching. Selective state-space modeling is completed to obtain the state output y, and the gated branch is activated by the SiLU function to obtain the gated output. The final output of MambaBlock is The basic features are obtained after passing through L residual blocks. .
5. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 1, characterized in that, The construction of at least two parallel feature extraction branches at different scales in the hidden feature space includes: constructing a multi-scale set. K≥2; for each scale Hidden features The scale-downsampled features are obtained by projecting them onto the corresponding scale space through scale-downsampling mapping. ; Perform scale feature transformation on the downsampled features at each scale to obtain the feature representation at each scale. Features at each scale are restored to a unified hidden dimension through scale upsampling mapping, resulting in a multi-scale feature set. ,in .
6. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 5, characterized in that, The scale coefficient of the multi-scale set S takes the value of {1,2,4}, corresponding to 3 parallel feature extraction branches. The scale 1 branch retains the original hidden dimension and uses a 2-layer linear layer structure to extract fine-grained features; the scale 2 branch maps to 1 / 2 of the original hidden dimension and uses a 1-layer linear layer structure to extract medium-scale features; the scale 4 branch maps to 1 / 4 of the original hidden dimension and uses a linear layer structure to extract coarse-grained features.
7. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 1, characterized in that, The hierarchical gating mechanism includes scale-level weight allocation, channel-level gating, and global gating balancing, specifically including: Scale-level weighting: The global importance coefficient of features at each scale is calculated using the Softmax function. Global weights are assigned to features at each scale. Channel-level gating: Generate corresponding channel gating weights for each scale feature. The channel dimensions of each scale feature are dynamically filtered to obtain the gated scale features. Multi-scale feature fusion: Summing all gated scale features yields the multi-scale fused features. ; Global gating balancing: Concatenates the basic features with multi-scale fused features to generate global gating weights. The final fused feature is generated by balancing the contributions of the basic feature and the multi-scale fused feature through global gating weights. .
8. The method for constructing a multi-scale adaptive gated MambaPlus network according to claim 1, characterized in that, Step 6 specifically includes: stacking the features of each scale in the multi-scale feature set to form a query sequence Q, using the basal features as the key sequence K and the value sequence V; and calculating the cross-scale attention output through a multi-head attention mechanism. The attention outputs are aggregated along the scale dimension to obtain attention-enhanced features. The attention-enhanced features are input into the feedforward enhancement module, and the feedforward enhancement features are obtained through nonlinear transformation. Set a learnable residual scaling factor. The feedforward enhancement features are superimposed onto the fusion features to generate the final discriminative features. .
9. The method for constructing a multi-scale adaptive gated MambaPlus network according to any one of claims 1-8, characterized in that, The training and evaluation of the model include: using the cross-entropy loss function as the classification loss, using the AdamW optimizer with weight decay to update the model parameters, using the cosine annealing strategy for learning rate scheduling, and using gradient clipping to constrain the gradient norm to avoid training instability; after the model training is completed, the accuracy, ROC curve, AUC value, confusion matrix and classification report are output to complete the model evaluation.
10. A multi-scale adaptive gated MambaPlus network construction device, characterized in that, include: The initialization module is used to initialize network configuration parameters and build the network infrastructure, which includes an input mapping layer, a Mamba backbone module, a multi-scale feature extraction module, an adaptive gating module, a cross-scale attention enhancement module, a feedforward enhancement module, and an output layer connected in sequence. The data preprocessing module is used to preprocess the input data to generate standardized training and test datasets. The backbone feature extraction module is used to map the preprocessed input data to the hidden feature space through the input mapping layer, and then extract the backbone features of the input data through the Mamba backbone module. A multi-scale feature extraction module is used to construct at least two parallel feature extraction branches of different scales in the hidden feature space, perform multi-granularity parallel transformation on the input hidden features, and obtain a multi-scale feature set. The adaptive gating fusion module is used to input the basal features and multi-scale feature sets into the adaptive gating module. Through a hierarchical gating mechanism, the basal features and multi-scale features are dynamically weighted and adaptively fused to generate fused features. The feature enhancement module is used to input the multi-scale feature set and the basic features into the cross-scale attention enhancement module, establish cross-scale association through a multi-head attention mechanism, and generate attention-enhanced features. The attention-enhanced features are input into the feedforward enhancement module for nonlinear transformation to generate feedforward enhanced features. The feedforward enhanced features and the generated fusion features are residually superimposed to generate the final discriminative features; The prediction and training module is used to input the final discriminative features into the output layer to complete the target category prediction, and to complete the training and evaluation of the model through a preset loss function and optimization strategy.
Citation Information
Patent Citations
Cutting tool wear monitoring method based on multiscale deep convolutional recurrent neural network
CN110509109A
Hyperspectral image and laser radar data classification method based on dynamic fusion network
CN121640285A
Time sequence prediction method for attention mixed multi-scale decomposition
CN121682767A
Multivariate time-series long-term forecasting based on multi-scale temporal feature enhancements
US20250390715A1
Unsupervised domain adaptation target re-identification method
WO2022001489A1
Cited By
A Runoff Prediction Method Based on Physical Information Gated Networks
CN121766146B
