Image classification method based on adaptive control state space model
By introducing a ViC model with an adaptive control state space model in the image classification task, the problem of difficulty in capturing long sequence dependence and complex visual patterns in the prior art is solved, and more efficient and accurate image classification is achieved.
Patent Information
- Application Number
- CN202411710062.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
When existing image classification methods process large-scale image datasets, it is difficult to effectively capture long sequence dependencies and complex visual patterns, resulting in insufficient performance in image classification tasks.
A method of image classification based on adaptive control state space model is proposed, called VisionConba(ViC) model. The model constructs an innovative ViC encoder through selective bidirectional state model, dynamic state scaling, bidirectional convolution and adaptive control mechanisms, which can better process image data.
When processing large-scale image datasets, this method can better capture long sequence dependencies and complex visual patterns, thereby improving the accuracy, efficiency and generalization ability of image classification and achieving better performance.
Smart Images

Figure CN119625407A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of pattern recognition, machine learning, artificial intelligence and image processing, and in particular to an image classification method based on an adaptive control state space model. Background Art
[0002] Image classification is a core task in the field of computer vision, and its importance is becoming increasingly prominent with the advancement of technology. This task involves automatically dividing image data into different categories according to its visual content, and is widely used in many fields such as security monitoring, medical diagnosis, autonomous driving, content recommendation, etc. However, traditional image classification methods rely on manual feature extraction, such as edges, corners, textures, etc. These feature extraction methods are not only complex, but also inefficient when processing large-scale image data sets, and are difficult to adapt to the high requirements of real-time and accuracy in modern applications.
[0003] With the rise of deep learning technology, data-driven feature learning has gradually become mainstream. Deep learning models, especially convolutional neural networks (CNNs), have made revolutionary progress in image classification tasks through their powerful feature extraction capabilities. CNNs can effectively capture local features of images and build more complex and abstract feature representations layer by layer, thus achieving unprecedented results in large-scale image recognition competitions such as ImageNet.
[0004] However, despite the great success of CNNs in the field of image classification, they still have limitations in dealing with long sequence dependencies and complex visual patterns. For example, CNNs usually use local receptive fields for feature extraction, which limits their ability to capture long-distance dependencies. In addition, when processing high-dimensional data, CNN models have a large number of parameters and high computational complexity, which to some extent limits their application on resource-constrained devices.
[0005] To solve these problems, researchers began to explore more advanced model structures. As an emerging model, the Visual Transformer (ViT) demonstrates the ability to handle long sequence dependencies by dividing images into small blocks (i.e. tokens) and processing these tokens using a self-attention mechanism. The ViT model has demonstrated comparable or even better performance than CNN in multiple visual tasks, but its computational complexity and ability to handle large-scale datasets still need to be optimized.
[0006] In addition, existing image classification methods also face challenges in generalization ability. How to maintain high accuracy of classification results when facing new and unseen data is an important topic in current research. In order to improve the generalization ability of the model, researchers have tried a variety of methods, including data enhancement, regularization technology, meta-learning, etc., but these methods still have limitations in practical applications. When processing large-scale image datasets, it is difficult to effectively capture long sequence dependencies and complex visual patterns, and it is difficult to improve performance in image classification tasks. Summary of the invention
[0007] The present invention provides an image classification method based on an adaptive control state space model, called VisionConba (ViC, Visual Mamba), which can effectively process image data and improve the accuracy and efficiency of image classification.
[0008] The present invention proposes an image classification method (Vision Conba (ViC) model). The ViC model constructed by the present invention includes an image segmentation module and an innovative ViC encoder; the ViC encoder includes a selective bidirectional state model (SBSM), a dynamic state scaling (DSS), a bidirectional convolution (Bi-Conv) and an adaptive control mechanism (ACM), which can improve the accuracy, efficiency and generalization ability of image classification. The ViC model method provided by the present invention can better capture long sequence dependencies and complex visual patterns when processing large-scale image data sets, thereby achieving better performance in image classification tasks.
[0009] For convenience, the present invention defines the following terms:
[0010] Image Segmentation: Split the input image into small patches and convert these patches into patch tokens.
[0011] ViC Encoder: The block label sequence is bidirectionally processed using the ViC encoder to capture the long-range dependencies in the block label sequence.
[0012] Selective Bidirectional State Model (SBSM): Determine the information related to the current input through a selective state network, and pass or forget information as needed.
[0013] Dynamic State Scaling (DSS) network model: The impact of the image state dimension (one-dimensional dimension) on the output is adjusted through the dynamic state scaling vector.
[0014] Bidirectional Convolution (Bi-Conv) network model: uses separable one-dimensional (1D) convolution kernels to capture local patterns in the sequence.
[0015] Adaptive State Space Network Model (A-SSM): learns the state transition matrix and input mapping matrix to adaptively update the previous and next states.
[0016] Adaptive Control Mechanism (ACM) network model: Dynamically adjust the internal parameters of the model through closed-loop feedback mechanism and adaptive control law.
[0017] The present invention adopts the following technical solutions:
[0018] An image classification method based on an adaptive control state space model comprises the following steps:
[0019] 1) Split the input image into small blocks and convert these blocks into block tokens;
[0020] 2) Perform a linear projection on each block label to expand its dimension;
[0021] 3) Combine the block tags after the expanded dimension with the position embedding (position encoding) to form the initial tag sequence;
[0022] 4) Designing a ViC encoder; inputting the initial tag sequence into the ViC encoder for processing, and outputting a final tag sequence; the processing in the ViC encoder includes steps 5) to 9):
[0023] 5) Determine the information related to the initial token sequence of the current input through the Selective Bidirectional State Model (SBSM) of the ViC encoder, and pass or forget the information as needed;
[0024] 6) for the tag sequence outputted in step 5), using dynamic state scaling (DSS) to adjust the influence of different state dimensions on the output tag sequence;
[0025] 7) Use bidirectional convolution (Bi-Conv) to capture local patterns in the tag sequence output from step 6);
[0026] 8) Design an adaptive state space model A-SSM to learn the state transition matrix and input mapping matrix to adaptively update the previous and next states;
[0027] 9) Using adaptive control mechanism (ACM) to dynamically adjust the internal parameters of the ACM model; obtaining the final label sequence output;
[0029] 10) The final output token sequence from step 9) is input into a multi-layer perceptron (MLP) head to obtain the final classification prediction.
[0030] In specific implementation, the present invention realizes an image classification system based on an adaptive control state space model, including: an image segmentation module and a ViC encoder; the ViC encoder includes a selective bidirectional state model module, a dynamic state scaling module, a bidirectional convolution module, an adaptive control state space model, and an adaptive control mechanism module.
[0031] Furthermore, the working process of the ViC encoder designed by the present invention includes: forward propagating the input label sequence, passing through the network layers of the selective bidirectional state model module, the dynamic state scaling module, the bidirectional convolution module, the adaptive control state space model, and the adaptive control mechanism module in sequence to generate a forward coding sequence; backward propagating the forward coding sequence, passing through the network layers of the selective bidirectional state model module, the dynamic state scaling module, the bidirectional convolution module, the adaptive control state space model, and the adaptive control mechanism module in reverse to generate a backward coding sequence; fusing the forward coding sequence and the backward coding sequence to generate an output sequence of the current network layer.
[0032] Furthermore, the selective bidirectional state model (SBSM) includes a forward selective state network and a backward selective state network, which are:
[0033] The forward selective state network is used to combine the forward state of the image of the current layer with the backward output of the previous layer to generate a vector containing relevant information, namely the selective state vector;
[0034] The backward selective state network is used to combine the backward state of the current layer with the forward output of the next layer to generate a selective state vector containing relevant information.
[0035] Furthermore, a dynamic state scaling (DSS) network model is designed, including:
[0036] The Swish function in the literature (Ramachandran, P., Zoph, B., & Le, Q. V. (2017). Searching for activation functions. arXiv preprint arXiv: 1710.05941) is used to perform element-wise scaling on the selective state vector output by the selective bidirectional state model to generate a dynamic state scaling vector; the dynamic state scaling vector is element-wise multiplied with the selective state vector to generate an adjusted image state vector.
[0037] Furthermore, the bidirectional convolution (Bi-Conv) network model includes:
[0038] The adjusted state vector is forward convolved using a separable 1D convolution kernel to generate a forward convolution output tag sequence; the adjusted state vector is backward convolved using a separable 1D convolution kernel to generate a backward convolution output tag sequence.
[0039] Furthermore, the adaptive control state space model (A-SSM) includes:
[0040] Learn the state transition matrix and input mapping matrix to adaptively update the forward and backward states;
[0041] A dynamic adjustment term is calculated to adaptively adjust the state transition matrix.
[0042] Further, the adaptive control mechanism (ACM) includes:
[0043] Calculate the deviation between the current layer output and the expected output;
[0044] Update the control gain matrix according to the deviation;
[0045] Calculate control inputs to adjust the model outputs to move them closer to the desired targets.
[0046] Compared with the prior art, the image classification method of the present invention has the following technical advantages:
[0047] The present invention provides an image classification technology based on an adaptive control state space model. Through bidirectional processing, adaptive control mechanism, selective state model and dynamic state scaling, it can better capture long sequence dependencies and complex visual patterns when processing large-scale image data sets, thereby achieving better performance in image classification tasks and improving the accuracy, efficiency and generalization ability of image classification. The technical advantages of the present invention include the following aspects:
[0048] Efficient long-range dependency capture: Through bidirectional processing, long-range dependencies in images can be effectively captured.
[0049] Strong adaptability: Through the adaptive control mechanism, the model can dynamically adjust its internal parameters according to the output error, improving the adaptability and generalization ability of the model.
[0050] High computational efficiency: Through selective state models and dynamic state scaling, unnecessary calculations are reduced and the computational efficiency of the model is improved.
[0051] Good generalization ability: It performs well in various image classification tasks and has good generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flowchart of the method provided by the present invention. DETAILED DESCRIPTION
[0053] The present invention will be further described below by way of embodiments in conjunction with the accompanying drawings, but the scope of the present invention is not limited in any way.
[0054] like Figure 1 As shown, the method of the present invention can improve the accuracy, efficiency and generalization ability of image classification through an innovative ViC encoder, as well as a selective bidirectional state model (SBSM), dynamic state scaling (DSS), bidirectional convolution (Bi-Conv) and an adaptive control mechanism (ACM).
[0055] The specific embodiments of the present invention are described in detail below:
[0056] 1. Obtain a block label sequence of the image through image segmentation;
[0057] The input image is first split into small patches, each of size P × P. These patches are converted into patch tokens and linearly projected to expand their dimensions, resulting in a patch token sequence.
[0058] 2. Processing through the ViC encoder to obtain an image block coding sequence;
[0059] The block marker sequence is input to the ViC encoder. The ViC encoder processes it through the following steps:
[0060] Forward propagation: Calculate the forward encoding sequence
[0061] Backward propagation: Calculate the backward encoding sequence
[0062] State fusion: The forward and backward outputs are fused through the SwiGLU gating function to generate the output encoding sequence T of the current layer l The SwiGLU gating function can be found in the literature (Shazeer, N. (2020). Glu variants improve transformer. arXiv preprint arXiv:2002.05202).
[0063] In the Vision Conba image classification model constructed by the present invention, the input image is first segmented into a series of image patches. Where J represents the number of image patches. In order to better utilize the information of these patches, we use linear projection technology to map each image patch into a high-dimensional space to obtain a patch embedding sequence
[0064]
[0065] Among them, W proj is a learnable projection matrix that projects the original image patches to R D space, so that the model can better capture the correlation between patches. is a position embedding sequence, which adds position information to each patch, allowing the model to distinguish patches at different positions and better handle the spatial structure of the image. Inspired by ViT and BERT, we also use class tokens to represent the entire image patch sequence, denoted by t cls .
[0066] After obtaining the patch embedding sequence, we input it into the lth layer of the Vic encoder to obtain the output T l The Vic encoder is a bidirectional sequence modeling module that can effectively capture long-range dependencies in the sequence by performing bidirectional propagation on the input sequence. Specifically, the lth layer of the Vic encoder is defined as follows:
[0067] T l =Vic(T l-1 )+T l-1
[0068] Where Vic represents the Vic encoder, Vic(T l-1 ) represents the forward propagation sequence result of the lth layer, T l-1 represents the output of the l-1th layer. In this way, the Vic encoder can encode the input sequence layer by layer to obtain a higher-level feature representation. Finally, we output the sequence (category token) T of the Vic encoder. l Normalized and input to the multi-layer perceptron (MLP) head to obtain the final prediction p. The normalization layer uses the RMSNorm normalization technique, which can effectively improve the stability and generalization ability of the model by performing square root processing on each eigenvalue. Specifically, the mathematical formula of RMSNorm is as follows:
[0069]
[0070] Where L is the number of network layers, T L Represents the final output category token, and N represents the number of tokens. Through RMS Norm normalization, we can make the model more stable, thereby improving the performance and generalization ability of the model.
[0071] 3. Selective Bidirectional State Network Model (SBSM)
[0072] Through the selective bidirectional state network model, the information related to the current input is determined, and the information is passed on or forgotten as needed.
[0073] The specific formula is as follows:
[0074]
[0075] Selective bidirectional state updates are a key mechanism that and To determine which state information is relevant to the current input and which is redundant. This mechanism enables the model to adaptively pass on or forget information based on the current data, thereby reducing computational complexity and improving efficiency. Specifically, the forward selective state network Responsible for the forward state of the current layer With the reverse output from the previous layer Combined together, a vector containing relevant information is generated Similarly, the reverse selective state network Responsible for the reverse state of the current layer and the forward output from the next layer Combined together, another vector containing relevant information is generated Selective State Networks and Using SwiGLU as the activation function, we can learn to transform the current state and with the output from the adjacent layer and Combined with,selectively retain information relevant to the current input.
[0076] By applying SwiGLU to the current state and the adjacent layer output, and It can learn which information is relevant to the current input, and thus selectively update the state information. This mechanism enables the Vic block to flexibly adapt to different input sequences, improving the performance of the model when processing long sequence tasks. and We can consider them as two fully connected neural networks, each of which contains multiple hidden layers. In each hidden layer, we use SwiGLU as the activation function and take the current state and the adjacent layer output as input. For example, for Its forward state And the reverse output of the previous layer It can be expressed as:
[0077]
[0078] The network is represented as:
[0079]
[0080] in, is a neural network composed of multiple fully connected layers, each of which uses SwiGLU as the activation function. For each hidden layer, its input is the current state and the output of the adjacent layer, and its output is the activation value of the layer. Specifically, assuming Contains L hidden layers, then the mathematical formula of each hidden layer can be expressed as:
[0081]
[0082] in, and is the fully connected weight matrix of this layer, and is the bias vector for this layer.
[0083] For the reverse selective state network Its mathematical formula can be expressed as:
[0084]
[0085] in, It is also a neural network composed of multiple fully connected layers, each of which uses SwiGLU as the activation function. For each hidden layer, its input is the current state and the output of the adjacent layer, and its output is the activation value of the layer. Specifically, Contains L hidden layers, then the mathematical formula of each hidden layer can be expressed as:
[0086]
[0087] in, and is the fully connected weight matrix of this layer, and is the bias vector of the layer. In this way, and It can learn which information is relevant to the current input and selectively update the state information. This mechanism enables the Vic block to flexibly adapt to different input sequences and improves the performance of the model when processing long sequence tasks.
[0088] 4. Dynamic State Scaling (DSS) Module
[0089] The dynamic state scaling vector is used to adjust the impact of different state dimensions on the output. The specific formula is as follows:
[0090]
[0091] Dynamic state scaling by dynamic state scaling vector and For the selective state vector and
[0092] Element-by-element scaling is performed to adjust the impact of different state dimensions on the output. This mechanism enables the model to better adapt to different input distributions and dynamically changing visual sequences. Specifically, dynamic state scaling
[0093]
[0094] Where ⊙ represents the element-by-element product. Dynamic state scaling vector The mathematical formula of the Swish function is as follows:
[0095]
[0096] Smooth and unbounded, it can better capture the important features of the input signal and adaptively scale the signal through the parameter β. By combining the selective state network and dynamic state scaling, we can dynamically adjust the information transmission pathway, further enhancing the model's ability to adapt to complex inputs.
[0097] 5. Bidirectional Convolution (Bi-Conv) Module
[0098] Use a separable 1D convolution kernel to capture local patterns in the sequence. The specific formula is as follows:
[0099]
[0100] The bidirectional convolution update captures local patterns in the sequence by using separable 1D convolution kernels. This mechanism enables the model to effectively learn the spatiotemporal dependencies of sequence data, thereby improving the performance of the model in processing visual tasks. Specifically, the bidirectional convolution update calculates the forward convolution output separately And the deconvolution output
[0101]
[0102] in, and is a separable 1D convolution kernel, and is the dynamically scaled state vector. Separable 1D convolution kernel and The definitions are as follows:
[0103]
[0104] in, represents the combined operation of depthwise convolution and spatial convolution. Specifically, and is a depthwise convolution kernel that convolves the input along the channel dimension; and and is a spatial convolution kernel that convolves the input along the sequence dimension, where K is the kernel size. By using separable convolutions, we can significantly reduce the number of parameters and computational complexity while still effectively capturing local patterns. Convolution output and The local visual features at different scales are integrated to provide rich contextual information for the next adaptive state space update. In practical applications, parameters such as the size of the convolution kernel, the number of channels, and the step size can be adjusted experimentally to obtain the best model performance. In this way, the model can effectively handle the spatiotemporal dependencies in visual tasks, thereby improving the performance and generalization ability of the model.
[0105] 6. Adaptive Control State Space Model (A-SSM)
[0106] Learn the state transition matrix and input mapping matrix to adaptively update the previous and next states. The specific steps are as follows:
[0107] 1) Obtain the state transfer matrix and input mapping matrix through learning:
[0108]
[0109] Among them, A and B are parameter matrices of the state space; A is the learning state transfer matrix, and B is the input mapping matrix; and is a learnable function used to convert the convolution output and Mapped to the corresponding state transfer matrix and input mapping matrix. These learnable functions are usually composed of multi-layer neural networks and are learned through model training.
[0110] 2) Dynamic adjustment items are obtained through MLP calculation:
[0111]
[0112] Among them, MLP stands for multi-layer perceptron;
[0113] The calculation of dynamic adjustment terms is further expressed as:
[0114]
[0115] in, and It is a dynamic adjustment item that adaptively adjusts the state transfer matrix according to the current input, giving the model stronger adaptability. Dynamic adjustment item and is through another learnable network (MLP), according to and Calculated.
[0116] 3) Update the state before and after:
[0117]
[0118] is the state transfer matrix of the current layer, is the input mapping matrix of the current layer, is the dynamic adjustment item of the current layer, u l is the control input of the current layer.
[0119] in, It is the former state. It is the post-state.
[0120] Updating the forward state and reverse state is further expressed as:
[0121]
[0122] in, and is the forward and reverse state of the previous moment. The new forward and reverse states are obtained through the updated state transfer matrix and input mapping matrix. and where u l Represents the control input of the current layer. This control input is based on the output T of the current layer. l and the expected output d l The deviation between l The purpose of the calculation is to guide the model output to approach the desired target (i.e. e l minimum).
[0123] Adaptive state space update adaptively updates the forward state and reverse state by learning the state transition matrix and the input mapping matrix. This mechanism enables the model to adaptively adjust the state transition strategy according to the dynamic changes of the input data, thereby improving the performance of the model when processing complex visual sequences.
[0124] Through the above-mentioned adaptive state space update mechanism, the model can learn the optimal state transition mode and effectively capture the inherent dynamic laws of the input sequence. At the same time, the dynamic adjustment term allows the model to flexibly adjust the state transition strategy to adapt to different inputs, thereby improving the robustness and generalization ability of the model.
[0125] 7. Adaptive Control Mechanism (ACM)
[0126] The internal parameters of the model are dynamically adjusted through the closed-loop feedback mechanism and adaptive control law. The specific steps are as follows:
[0127] 1) Calculate the deviation:
[0128] e l =d l T l
[0129] 2) Update the control gain matrix:
[0130]
[0131] 3) Calculate control input:
[0132] u l =-K l e l +u d ,
[0133] Feedback and adaptive control further improves model performance and achieves adaptive adjustment by introducing closed-loop feedback mechanism and adaptive control law. This mechanism enables the model to dynamically adjust internal parameters according to output error, improve adaptability, and consciously optimize output to achieve active learning. Specifically, the steps of feedback and adaptive control are as follows:
[0134] Calculate the deviation e between the current layer output and the expected output l :
[0135] e l =d l -T l
[0136] Among them, d l is the expected output, T l is the output of the current layer. Deviation e l Reflects the difference between the actual output and the expected output.
[0137] Update the control gain matrix K according to the deviation l :
[0138]
[0139] Among them, α is the learning rate, is the error e l About the control gain matrix K l Through this gradient information, the model can learn how to adjust the control gain matrix to reduce the output error.
[0140] Calculate the control input u l , expressed as:
[0141] u l =-K l e l +u d
[0142] Among them, u d is the expected input. The control input u l is the updated control gain matrix K l and deviation e l Calculated, it reflects how the model should adjust the output to approach the desired target.
[0143] Control input u l Feedback into formula (22) and formula (23) to achieve closed-loop control: By controlling the input u l Feedback is sent to the model, and the model can dynamically adjust internal parameters according to the output error to improve adaptability. d It also provides the model with target information, allowing it to consciously optimize the output and achieve active learning.
[0144] Through this feedback and adaptive control mechanism, the model can dynamically adjust internal parameters according to the output error, improve adaptability, and consciously optimize the output to achieve active learning.
[0145] 8. State fusion and output prediction
[0146] State fusion and output prediction are achieved by fusing the forward state and reverse state To generate the output T of the current layer l This step not only fuses the information in two directions, but also dynamically controls the forward and backward information through the SwiGLU gating function to balance the contextual information in two directions. Specifically, the steps of state fusion and output prediction are as follows: Calculate the forward output and reverse output
[0147]
[0148] in, and is the output mapping matrix, and is the bias vector. These matrices and vectors are learned through model training.
[0149] Use the SwiGLU gating function to fuse the forward and backward outputs to generate the output T of the current layer l :
[0150]
[0151] in, and are the forward and reverse inputs of the current layer, respectively. and is the gating parameter for the forward pass, and is the gating parameter for back propagation. In this way, the SwiGLU gating function can adaptively control the contribution of forward and backward information in the output, thereby balancing the contextual information in both directions.
[0152] Through this state fusion and output prediction mechanism, the Vision Conba model can effectively capture the temporal dependencies in forward and backward propagation, and dynamically adjust the contribution of information in both directions to generate more accurate and comprehensive outputs.
[0153] It should be noted that the purpose of publishing the embodiments is to help further understand the present invention, but those skilled in the art can understand that various substitutions and modifications are possible without departing from the scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the contents disclosed in the embodiments, and the scope of protection claimed by the present invention shall be subject to the scope defined in the claims.
Claims
1. An image classification method based on an adaptive control state space model, characterized in that: The steps include: S1) dividing the input image into image blocks, converting the image blocks into block tags, and processing them to form an initial tag sequence; S2) designing a ViC encoder; using the ViC encoder to perform bidirectional processing on the initial block label sequence to capture the long-range dependency in the initial block label sequence, and obtaining an image block coding sequence; The ViC encoder includes a selective bidirectional state model module, a dynamic state scaling module, a bidirectional convolution module, an adaptive control state space model, and an adaptive control mechanism module; The selective bidirectional state model in the ViC encoder includes: a forward selective state network and a backward selective state network; the forward selective state network is used to combine the forward state of the current network layer with the backward output of the previous network layer to generate a selective state vector containing relevant information; the backward selective state network is used to combine the backward state of the current network layer with the forward output of the next network layer to generate a selective state vector containing relevant information; through the selective bidirectional state model, the input tag sequence is first forward propagated to generate a forward coding sequence; then the forward coding sequence is backward propagated to generate a backward coding sequence; the forward coding sequence and the backward coding sequence are fused to generate the output of the current network layer, that is, the image block coding sequence of the current network layer; The influence of different state dimensions on the output is adjusted by a dynamic state scaling method; including: performing element-level scaling on the selective state vector to generate a dynamic state scaling vector; and then performing element-level multiplication operation on the dynamic state scaling vector and the selective state vector to generate an adjusted state vector; The bidirectional convolution method is used to capture local patterns in the encoding sequence; including: performing forward convolution on the adjusted state vector using a separable 1D convolution kernel to generate a forward convolution output; performing backward convolution on the adjusted state vector using a separable 1D convolution kernel to generate a backward convolution output; The state transition matrix and input mapping matrix are learned through the adaptive control state space model in the ViC encoder to adaptively update the previous state and the next state; Dynamically adjust the internal parameters of the model through an adaptive control mechanism module; the adaptive control mechanism includes: calculating the deviation between the current layer output tag sequence and the expected output tag sequence; updating the control gain matrix according to the deviation; calculating the control input to adjust the model output so that the deviation is minimized, thereby obtaining the final output tag sequence; S3) The final output tag sequence is input into the head of the multi-layer perceptron for prediction to obtain the final image classification.
2. The image classification method based on the adaptive control state space model as claimed in claim 1, characterized in that: Specifically, linear projection technology is used to map each image block to a high-dimensional space to obtain an image block embedding sequence.
3. The image classification method based on the adaptive control state space model as claimed in claim 1, characterized in that: In step S2), the Vic encoder is a bidirectional sequence modeling module, which is used to perform bidirectional propagation on the input sequence; the definition of the first layer of the Vic encoder is expressed as: T l =Vic(T l-1 )+T l-1 Where Vic represents the Vic encoder; Vic(T l-1 ) represents the forward propagation output result sequence of the lth layer, T l-1 Represents the result sequence of the output of layer 1-1.
4. The image classification method based on the adaptive control state space model as claimed in claim 3, characterized in that: Specifically, the RMSNorm normalization technology is used to normalize the image sequence output by the Vic encoder and input it into the head of the multi-layer perceptron to obtain the final image prediction category result.
5. The image classification method based on the adaptive control state space model as claimed in claim 3, characterized in that: In step S2), the selective state vector is specifically scaled element-wise using the Swish function to generate a dynamic state scaling vector.
6. The image classification method based on the adaptive control state space model as claimed in claim 3, characterized in that: The selective bidirectional state network model is expressed as: Among them, the forward selective state network Responsible for the forward state of the current layer With the reverse output from the previous layer Combined together, a vector containing relevant information is generated Reverse Selective State Network Responsible for the reverse state of the current layer and the forward output from the next layer Combined together, another vector containing relevant information is generated 7. The image classification method based on the adaptive control state space model as claimed in claim 6, characterized in that: Specifically, the dynamic state scaling vector is used to adjust the impact of different state dimensions on the output, which is expressed as: Dynamic state scaling by dynamic state scaling vector and For the selective state vector and Perform element-by-element scaling.
8. The image classification method based on the adaptive control state space model as claimed in claim 7, characterized in that: The local patterns in the sequence are captured using a separable 1D convolution kernel, expressed as: Bidirectional convolutional updates capture local patterns in the sequence by using separable 1D convolutional kernels; Bidirectional convolution updates calculate the forward convolution output separately And the deconvolution output It is expressed as: in, and is a separable 1D convolution kernel, and is the dynamically scaled state vector.
9. The image classification method based on the adaptive control state space model as claimed in claim 8, characterized in that: The adaptive control state space model includes: 1) Learn the state transfer matrix and input mapping matrix, expressed as: in, and is a learnable function that converts the convolution output and Mapped to the corresponding state transfer matrix and input mapping matrix; these learnable functions are composed of multi-layer neural networks and are learned through model training; 2) The dynamic adjustment term is obtained through MLP calculation, which is expressed as: Among them, MLP stands for multi-layer perceptron; and is a dynamic adjustment item, which is achieved through the learnable network MLP according to and Calculated; 3) Update the state before and after, expressed as: Further expressed as: in, It is the former state. It is the post-state; and is the forward and reverse state of the previous moment. The new forward and reverse states are obtained through the updated state transfer matrix and input mapping matrix. and u l Represents the control input of the current layer, which is based on the output T of the current layer l and the expected output d l The deviation between l Calculated.
10. The image classification method based on the adaptive control state space model as claimed in claim 8, characterized in that: Specifically, the forward and reverse information are dynamically controlled to balance the context information in both directions; state fusion and output prediction include the following steps: Calculate the forward output separately and reverse output It is expressed as: in, and is the output mapping matrix, and is the bias vector; Use the SwiGLU gating function to fuse the forward and backward outputs to generate the output T of the current layer l , expressed as: in, and are the forward and reverse inputs of the current layer, respectively. and is the gating parameter for the forward pass, and is the gating parameter for back propagation.
Citation Information
Patent Citations
Cervical cell image classification method based on visual converter and graph convolutional network
CN113469119A
Dual-mode image collaborative semantic segmentation method based on neural network architecture search
CN116563528A
Cultivated land extraction method based on bidirectional convolution time self-attention mechanism
CN116844041A
Visual representation method and device based on bidirectional state space model
CN117876845A
Unsupervised interpretation method based on adaptive semantic features
CN118194961A