Picture description method based on pulse transformer model

By designing spiking neurons with multi-level learnable membrane potential time constants and thresholds and a spiking self-attention mechanism, the problems of gradient vanishing and network degradation in image captioning of spiking neural networks are solved, achieving a highly efficient and energy-saving image captioning task.

CN116701696BActive Publication Date: 2026-01-02ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310682762.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2026-01-02
Estimated Expiration
2043-06-09

AI Technical Summary

Technical Problem

In existing technologies, spiking neural networks suffer from gradient vanishing and network degradation problems in image captioning tasks, and the membrane potential time constant and threshold need to be manually set as hyperparameters, which violates the biodiversity of neurons.

Method used

A pulse Transformer model is designed, which uses multiple parallel LIF units with different membrane potential time constants and voltage thresholds. Combined with the pulse self-attention mechanism, an encoder-decoder framework is constructed. The membrane potential and threshold are optimized through learnable parameters, replacing the traditional ReLU unit, and realizing the pulse self-attention mechanism and multimodal interaction.

Benefits of technology

It effectively mitigates the vanishing gradient problem, reduces computational load, improves training efficiency, and generates high-quality image descriptions, thus realizing the energy-efficient application of spiking neural networks in the field of image description.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116701696B_ABST
    Figure CN116701696B_ABST
Patent Text Reader

Abstract

The application discloses a picture description method based on a pulse Transformer model, and the scheme is as follows: firstly, a new pulse neuron PLMP with a learnable membrane potential time constant and a voltage threshold is designed, the neuron can optimize the problem of gradient disappearance in pulse model training; the ordinary self-attention mechanism in the Transformer is transformed into a pulse attention mechanism by using the PLMP neuron; a pulse Transformer is built by using the pulse self-attention mechanism for picture description model training; and finally, a pulse Transformer model suitable for the picture description field, energy-saving and capable of generating high-quality picture descriptions is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the application of a pulse neural network in the field of picture description, and in particular to a picture description method based on a pulse Transformer model. BACKGROUND

[0002] In April 2022, Google released a language model PaLM based on a general AI architecture, and on November 30, 2022, OpenAI announced a new conversational AI model ChatGPT that is fine-tuned from the GPT-3.5 series large voice model. It can not only carry out natural multi-round conversation and efficient and accurate question and answer, but also generate programming code, emails, papers, novels and various texts. The popularity of ChatGPT has sparked enthusiasm for exploring large models at home and abroad. With the maturity of language large models, more and more technology companies and researchers are focusing on the research of multi-modal large models. Google launched the largest visual language multi-modal model PaLM-E in history on March 6, 2023, which demonstrated extraordinary performance in the field of robot operation, visual question and answer, picture description and pure language tasks. OpenAI launched a multi-modal large language model ChatGPT-4 with a larger model size, a richer knowledge base and stronger context understanding ability on March 14, 2023. The popularity of ChatGPT has sparked enthusiasm for exploring large models at home and abroad. Domestic academia and technology companies have also announced or will launch similar robot conversation models such as Baidu's Ernie, Ali's Tongyiqian, Huawei's Pangugu large model and Tencent's Hunyuan large model. Large models have become the trend of the times. However, training a large model is very expensive, and with the continuous increase in the size of the parameter, the computing power and training cost still have bottlenecks. At the Artificial Intelligence Large Model Technology Summit held on April 8, 2023, Tian Qi, the person in charge of Huawei's large model, said that the development and training of a large model requires 12 million US dollars, of which 7.2 million US dollars is spent on electricity. There are two aspects to the cost reduction and efficiency improvement of large models, one is to optimize computing power and the other is to optimize electricity, and there is a huge space for electricity cost reduction and efficiency improvement.

[0003] Spiking Neuron Networks (SNNs) as the third generation of artificial neural networks have the advantages of small amount of calculation, low power consumption, fast information transmission speed, etc. The traditional Artificial Neural Networks (ANNs) is a computational model based on the information processing mode of the biological nervous system. As a subfield of multimodal, picture description is a subtask of multimodal large models, which can provide useful information for visually impaired people, can be used for automatic labeling of images and videos, etc., and has great research value. Future neuromorphic computing as an efficient way may become possible through the collaborative evolution of neuromorphic chips and SNNs algorithms to achieve cost reduction and efficiency increase of multimodal large model training. The present application studies an energy-saving pulse picture description model, which is an exploration and application of energy-saving multimodal models. However, due to the binary and non-differentiable characteristics of peak activity, direct training of SNNs may cause serious gradient disappearance and network degradation. Moreover, the current commonly used pulse neurons are single, and the membrane potential time constant and membrane voltage threshold need to be specified as hyperparameters according to experience or optimization methods, which violates the biological diversity of neurons. SUMMARY

[0004] The present application aims at the deficiencies of the prior art and provides a picture description method based on a pulse Transformer model.

[0005] The purpose of the present application is achieved by the following technical solution: a picture description method based on a pulse Transformer model, comprising the following steps:

[0006] (1) design a pulse neuron PLMP, each PLMP unit contains multiple parallel LIF units with different membrane potential time constants and voltage thresholds;

[0007] (2) design and implement a pulse self-attention mechanism based on the PLMP unit;

[0008] (3) construct a Transformer model; the Transformer model is implemented in an encoder-decoder framework, wherein the encoder is composed of one Swin Transformer and N refining encoder blocks, and the decoder is composed of N decoder blocks;

[0009] (4) change the Transformer model in step (3) to a pulse Transformer model based on the PLMP unit and the pulse self-attention mechanism;

[0010] (5) Obtain a picture description field dataset, divide the dataset into a training set, a validation set and a test set, the training set is used to train the pulse Transformer model; the validation set is used to select the optimal pulse Transformer model; input the test set into the optimal pulse Transformer model, and output the picture description.

[0011] Further, in step (1), after receiving the input, each parallel LIF unit updates the membrane potential according to the respective membrane potential time constant, and if the membrane potential exceeds the voltage threshold corresponding to the parallel LIF unit, the parallel LIF unit generates a spike; the output of the PLMP is the set of spikes generated by all parallel LIF units.

[0012] Further, the forward process of the pulse neuron PLMP is as follows:

[0013] Vth k = tanh(z k )

[0014]

[0015]

[0016]

[0017]

[0018]

[0019]

[0020] The PLMP unit introduces two trainable parameters m and z, which represent the learnable membrane potential time constant parameter and the learnable membrane voltage parameter, respectively. z k represents the learnable membrane voltage parameter of the kth LIF unit in each PLMP unit, which is obtained by the hyperbolic tangent function Vth k , Vth k is the membrane voltage threshold of the kth LIF unit. m k represents the learnable membrane potential time constant parameter of the kth LIF unit in each PLMP unit, which is calculated by τ k , τ k is the membrane potential time constant of the kth LIF unit in each PLMP unit. p(n-1) represents the number of neurons in the (n-1)th layer. is the presynaptic input of the ith neuron in the nth layer at time t. is the synaptic weight from the jth neuron in the (n-1)th layer to the ith neuron in the nth layer, is the bias. and represent the membrane potential vector and output vector of the k-th LIF unit of the i-th neuron of the n-th layer at time t+1. represents the final output of the i-th PLMP unit of the n-th layer at time t+1, which will participate in the calculation of all neurons connected to the unit in the n+1-th layer.

[0021] Further, in step (2), the Query, Key and Value are converted into spikes by the spiking neuron PLMP, and the formula is as follows:

[0022] Q i = PLMP(BN(XW i Q ))

[0023] K i = PLMP(BN(XW i K ))

[0024] V i = PLMP(BN(XW i V ))

[0025] head i = Q i K i T V i

[0026] S' = Concat(head1,...,head n )

[0027] SpikingMSA(Q,K,V) = PLMP(BN(Linear(S')))

[0028] X is the input of the self-attention mechanism, is a learnable linear matrix. i = 1, 2,..., h, h represents that the attention mechanism has h heads. V i represents the input feature vector of the i-th attention head, Q i , K i is the feature vector for calculating the attention weight of the i-th attention head. BN is the Batch Normalization operation. head i represents the output of the i-th attention head. S' is the result of concatenating the outputs of the h attention heads. SpikingMSA is the improved spiking self-attention mechanism.

[0029] Further, in the step (3), the Swin Transformer is used to extract grid features from the input image, and average pooling is performed on the grid features to obtain global features; the refinement encoder is used to capture the internal relationship between the grid features and the grid features, and the internal relationship between the grid features and the global features; the relationship between the grid features and the grid features is captured by SW / W-MSA; the relationship between the grid features and the global features is captured by MSA, wherein the global features are used as the Key in the self-attention mechanism; each refinement encoder block in the encoder first inputs the obtained grid features and global features into the self-attention mechanism, sums the input and output of each self-attention mechanism, and then inputs the normalized result into the feedforward neural network, and finally outputs the normalized residual sum to obtain the refined global features and grid features.

[0030] Further, the formula of each refinement encoder block in the encoder is as follows:

[0031]

[0032]

[0033] FeedForward(x)=W2ReLU(W1x)

[0034]

[0035]

[0036] and respectively represent the output grid features and global features of the lth Encoder block. W1 and W2 are learnable parameters. represents the concate operation on the grid features and the global features. is the result of adding the input and output of the sliding window multi-head self-attention mechanism and then performing layer normalization. is the result of adding the input and output of the ordinary multi-head self-attention mechanism and then performing layer normalization.

[0037] Further, the refined global features are first fused into the input of the decoder, and the global visual context information is captured through the first multi-modal interaction to obtain Then, the Language Masked MSA module is used to capture the intra-modal relationship between words to obtain

[0038]

[0039]

[0040] represents the input of the (l-1)th refinement encoder, the output of the (l-1)th refinement encoder will be used as the input of the lth refinement encoder at time t, W f is a learnable parameter of the linear layer; and is a learnable parameter, represents the embedding vector corresponding to the generated word at time (t-1), and the attention mapping of each word is calculated based on the previously generated words;

[0041] Finally, the Cross MSA Module module is used to model the multi-modal relationship between and the refined grid features, capture local visual context information to generate picture descriptions.

[0042] Further, the implementation formula of the Cross MSA Module module is as follows:

[0043]

[0044]

[0045] wherein, and W x is a learnable parameter. is the output of the Cross MSA, wherein as the Query of the Cross MSA, as the Key and Value of the Cross MSA. is the final output of the Cross MSA Module.

[0046] Further, in the step (4), the pulse self-attention mechanism is used to replace the self-attention mechanism, and the PLMP unit is used to replace the ReLU unit in the FeedForward unit, and the implementation of the pulse FeedForward unit is as follows:

[0047] SpikingFeedForward(x)=W2PLMP(W1x).

[0048] Further, the data sets in the picture description field include MSCOCO 2014, Flickr30K and Flickr8K, Flickr30K and Flickr8K, VizWiz, TextCaps, Fashion Captioning and CUB-200.

[0049] The beneficial effects of the present application are:

[0050] 1. A new pulse activation unit PLMP is proposed. Compared with the LIF unit commonly used in SNN model, it has a multi-stage learnable membrane potential time constant and threshold. This method can effectively alleviate the gradient vanishing problem, weaken the influence of parameter initial value setting, accelerate the training process, and has better activation effect.

[0051] 2. A new spike self-attention mechanism Spiking-MSA / W-MSA / SW-MSA is realized based on PLMP. Query, Key and Value in sparse spike form are used to avoid multiplication in the calculation process and effectively reduce the calculation amount.

[0052] 3. The pulse neural network and the Transformer model are innovatively combined and applied in the picture description field and competitive results are achieved, which is a pulse Transformer model suitable for the picture description field, energy-saving and capable of generating high-quality picture description. Moreover, it is the first time that the pulse neural network is applied in the picture description field. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 is the overall flowchart of the present application;

[0054] Figure 2 the structure diagram of the pulse self-attention mechanism;

[0055] Figure 3 the structure diagram of the pulse Transformer model. DETAILED DESCRIPTION

[0056] The specific embodiments of the present application will be further described in detail below in combination with the drawings and specific embodiments. The following drawings are used to illustrate the present application, but not to limit the scope of the present application.

[0057] Example 1

[0058] Please refer to Figure 1 , Figure 2 and Figure 3 , Figure 1 is a picture description algorithm flowchart based on the pulse Transformer model provided by the present application. It includes the following steps:

[0059] Step 1: design a new type of pulse neuron PLMP (Parallel LIF with Multistage Learnable Parameters);

[0060] Each PLMP unit contains multiple parallel LIF units with different membrane potential time constants and thresholds. Upon receiving input, each LIF unit updates its membrane potential according to its own membrane potential time constant. If the membrane potential exceeds the threshold corresponding to that unit, the LIF unit generates a peak value. The output of PLMP is the set of peak values ​​generated by all parallel LIF units. During this process, the membrane potential time constant and threshold are automatically optimized during training, eliminating the need for manual setting of hyperparameters before training. The forward feedforward process of the PLMP neuron is as follows:

[0061] Vth k =tanh(z) k )

[0062]

[0063]

[0064]

[0065]

[0066]

[0067]

[0068] The PLMP unit introduces two trainable parameters, m and z, representing the learnable membrane potential time constant parameter and the learnable membrane voltage threshold parameter, respectively. k The learnable membrane voltage parameter representing the k-th LIF cell in each PLMP cell is obtained by using a hyperbolic tangent function, Vth. k Vth k It is the membrane voltage threshold of the k-th LIF unit. k The parameter representing the learnable membrane potential time constant of the k-th LIF cell in each PLMP cell is given by τ. k τ is calculated to be... k It is the membrane potential time constant of the k-th LIF unit in each PLMP unit. n and p(n-1) represent the number of neurons in the n-th and (n-1)-th layers, respectively. It is the presynaptic input of the i-th neuron in the n-th layer at time t. These are the synaptic weights from the j-th neuron in the (n-1)-th layer to the i-th neuron in the n-th layer. It is a bias. and Let represent the membrane potential vector and output vector of the k-th LIF unit of the i-th neuron in the n-th layer at time t, respectively, where K is the total number of LIF units. The final output of the nth layer i-th PLMP unit at time t, which will participate in the calculation of all neurons connected to the unit in the n+1 layer.

[0069] This embodiment takes each PLMP unit containing three LIF units as an example. The initial membrane voltage threshold values of each LIF unit are 0.6, 1.6, and 2.6, respectively; the initial membrane potential time constant is 0.25; and TimeStep is 4.

[0070] Step 2: Design and implement pulse self-attention mechanism based on PLMP unit

[0071] By converting Query, Key and Value into pulses through PLMP spiking neurons, floating-point multiplication of matrices is avoided, and operations between matrices can be completed through logical AND operation and addition. Since the attention matrix calculated by Q, K, and V in pulse form has natural non-negativity, Softmax is not needed to maintain the non-negative value of the attention matrix. The specific formula is as follows:

[0072] Q i =PLMP(BN(XW i Q ))

[0073] K i =PLMP(BN(XW i K ))

[0074] V i =PLMP(BN(XW i V ))

[0075] head i =Q i K i T V i

[0076] S'=Concat(head1,...,head n )

[0077] SpikingMSA(Q,K,V)=PLMP(BN(Linear(S')))

[0078] X is the input of the self-attention mechanism, is a learnable linear matrix. i = 1, 2,..., h, h represents that the attention mechanism has h heads. V i represents the input feature vector of the i-th attention head, Q i , K iis the feature vector of the i-th attention head to calculate the attention weight. BN is the Batch Normalization operation. head i is the output of the i-th attention head. S' is the result of concatenating the outputs of the h attention heads. SpikingMSA is the modified Spiking Self-Attention mechanism.

[0079] Step 3: Building the Transformer model

[0080] The widely used encoder-decoder framework is adopted. The encoder is composed of one Swin Transformer and three refinement encoder blocks, and the decoder is composed of three decoder blocks. The pre-trained Swin Transformer is responsible for extracting grid features from the input image, and the global feature is obtained by average pooling the grid features. The refinement encoder is responsible for capturing the internal relationship between the grid features and the grid features, and the grid features and the global features. The relationship between the grid features and the grid features is captured by SW / W-MSA. The relationship between the grid features and the global features is captured by MSA, and the global features are used as the Key in the self-attention mechanism. Each refinement encoder block of the encoder first sends the obtained grid features and global features to the self-attention mechanism. Here, a residual structure is introduced to solve the gradient vanishing problem in deep networks. The input is summed with the output of the attention mechanism, normalized and passed into the feedforward neural network, and finally the residual is summed and normalized to output. The decoder uses the refined image grid features to generate captions word by word by capturing the mutual relationship between the text and the image grid features. The formula of each refinement encoder block in the encoder is as follows:

[0081]

[0082]

[0083] FeedForward(x)=W2ReLU(W1x)

[0084]

[0085]

[0086] and respectively represent the output grid features and global features of the L-th Encoder block. W1, W2 are learnable parameters. represents the concate operation on the grid features and the global features. is the result of adding the input and output of the sliding window multi-head self-attention mechanism and then performing layer normalization. is the result of adding the input and output of the common multi-head self-attention mechanism and then performing layer normalization.

[0087] The refined Global Feature is first fused into the input of the decoder in the Decoder, and the global visual context information is captured through the first multimodal interaction to obtain Then, the Language Masked MSA module is used to capture the intra-modal relationship between words in

[0088]

[0089]

[0090] represents the input of the (l-1)th refined encoder, and the output of the (l-1)th refined encoder will be used as the input of the lth refined encoder at time t, W f is a learnable parameter of the linear layer; and are learnable parameters, represents the embedding vector of the generated word at time (t-1), and each word is only allowed to calculate the attention mapping of the word generated before it;

[0091] Finally, the Cross MSA Module module is used to model the multimodal relationship between and Grid Feature, and capture the local visual context information to generate the picture description. Through the two multimodal interactions between Global Feature and Grid Feature and the sentence, the reasoning ability is enhanced. The implementation formula of the Cross MSA Module module is as follows:

[0092]

[0093]

[0094] wherein, and W x are learnable parameters. is the output of Cross MSA, wherein serves as the Query of Cross MSA, serves as the Key and Value of Cross MSA. is the final output of the Cross MSA Module, which is calculated according to the formula above.

[0095] Step 4: change the Transformer model in step (3) into a spiking Transformer model based on the PLMP unit and the spiking self-attention mechanism;

[0096] Based on the spiking self-attention mechanism, the entire Transformer model is spiking. Replace the self-attention mechanism with the spiking self-attention mechanism in step 2, replace the ReLU unit in the FeedForward unit with the PLMP unit in step 1, and represent image information and words as event-driven spikes. Then train the entire network to obtain a spiking Transformer model suitable for the picture description field, energy-saving, and capable of generating high-quality picture descriptions. The implementation of the spiking self-attention mechanism is referred to in step 2, and the implementation of the spiking FeedForward unit is as follows:

[0097] SpikingFeedForward(x)=W2PLMP(W1x)

[0098] Step 5: obtain a data set, divide the data set into a training set, a validation set, and a test set, the training set is used to train the spiking Transformer model; the validation set is used to select the optimal spiking Transformer model; input the test set into the optimal spiking Transformer model, and output the picture description.

[0099] Train the spiking Transformer model. Train on the MSCOCO 2014 dataset, which contains 123287 images, each image has 5 reference titles, and follow the "Karpathy" segmentation to redivide MSCOCO, of which 113287 images are used for training; 5000 images are used to select hyperparameters to select the optimal spiking Transformer model; 5000 images are used for offline evaluation to output descriptions about pictures. The present application can also use the commonly used data sets in the picture description field, such as Flickr30K and Flickr8K, Flickr30K and Flickr8K, VizWiz, TextCaps, Fashion Captioning, CUB-200, etc. to train.

[0100] The final effect of the present application is to input a picture and obtain a textual description of the picture, and the effect is as shown in Figure 3 .

[0101] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A picture description method based on a pulse Transformer model, characterized in that, The method comprises the following steps: (1) designing a pulse neuron PLMP, each PLMP unit comprising a plurality of parallel LIF units with different membrane potential time constants and voltage thresholds; (2) implementing a pulse self-attention mechanism based on the PLMP unit design; In the step (2), the Query, Key and Value are converted into pulses by the pulse neuron PLMP, and the formula is as follows: Q i = PLMP(BN(XW i Q )) K i = PLMP(BN(XW i K )) V i = PLMP(BN(XW i V )) head i = Q i K i T V i S' = Concat(head1,...,head n ) SpikingMSA(Q,K,V)=PLMP(BN(Linear(S'))) X is the input of the self-attention mechanism, is a learnable linear matrix; i = 1, 2,..., h, h represents that the attention mechanism has h heads; V i represents the vector of the input feature of the i-th attention head, Q i , K i is the feature vector for the i-th attention head to calculate the attention weight; B N is a Batch Normalization operation; head i represents the output of the i-th attention head; S' is the result of splicing the outputs of h attention heads; SpikingMSA is the improved pulse self-attention mechanism; (3) constructing a Transformer model; the Transformer model adopts an encoder-decoder framework, wherein the encoder comprises an Swin Transformer and N refining encoder blocks, and the decoder comprises N decoder blocks; (4) replacing the Transformer model in the step (3) with a pulse Transformer model based on the PLMP unit and the pulse self-attention mechanism; (5) obtaining a picture description domain dataset, dividing the dataset into a training set, a validation set and a test set, wherein the training set is used to train the pulse Transformer model; the validation set is used to select an optimal pulse Transformer model; and the test set is input into the optimal pulse Transformer model to output a picture description.

2. The picture description method based on the pulse Transformer model according to claim 1, characterized in that, In the step (1), after receiving an input, each parallel LIF unit will update the membrane potential according to the respective membrane potential time constant, and if the membrane potential exceeds the voltage threshold corresponding to the parallel LIF unit, the parallel LIF unit will generate a peak value; the output of the PLMP is the set of peak values generated by all parallel LIF units.

3. The picture description method based on the pulse Transformer model according to claim 1, characterized in that, The forward process of the pulse neuron PLMP is as follows: Vth k = tanh(z k ) The PLMP unit introduces two trainable parameters m and z, representing the learnable membrane potential time constant parameter and the learnable membrane voltage parameter, respectively; z k represents the learnable membrane voltage parameter of the kth LIF unit in each PLMP unit, obtained by the hyperbolic tangent function Vth k , Vth k is the membrane voltage threshold of the kth LIF unit; m k represents the learnable membrane potential time constant parameter of the kth LIF unit in each PLMP unit, calculated by τ k , τ k is the membrane potential time constant of the kth LIF unit in each PLMP unit; p(n-1) represents the number of neurons in the n-1th layer; is the presynaptic input of the ith neuron in the nth layer at time t; is the synaptic weight from the jth neuron in the n-1th layer to the ith neuron in the nth layer, is the bias; and represent the membrane potential vector and the output vector of the kth LIF unit of the ith neuron in the nth layer at time t+1, respectively; represents the final output of the ith PLMP unit in the nth layer at time t+1, which will participate in the calculation of all neurons connected to this unit in the n+1th layer.

4. The picture description method based on the pulse Transformer model according to claim 1, characterized in that, In the step (3), the Swin Transformer is used to extract grid features from the input image, and the grid features are averaged and pooled to obtain global features; the refining encoder is used to capture the internal relationship between the grid features and the grid features, and the internal relationship between the grid features and the global features; the relationship between the grid features is captured by SW / W-MSA; the relationship between the grid features and the global features is captured by MSA, wherein the global features are used as the Key in the self-attention mechanism; each refining encoder block in the encoder first sends the obtained grid features and global features into the self-attention mechanism, sums the input and output of each self-attention mechanism, normalizes and transmits into the feedforward neural network, and finally outputs the residual sum after normalization, to obtain the refined global features and grid features.

5. The picture description method based on the pulse Transformer model according to claim 4, characterized in that, The formula of each refining encoder block in the encoder is as follows: and represents the output grid feature and global feature of the lth Encoder block, respectively; W2 is a learnable parameter; represents the concate operation on the grid feature and global feature; is the result of adding the input and output of the sliding window multi-head self-attention mechanism and then performing layer normalization; is the result of adding the input and output of the ordinary multi-head self-attention mechanism and then performing layer normalization.

6. The picture description method based on the pulse Transformer model according to claim 4, characterized in that, The refined global feature is first fused into the input of the decoder to capture global visual context information through first multimodal interaction to obtain Then the Language Masked MSA module is used to capture The intra-modal relationship between words in the Chinese sentence to obtain represents the input of the (l-1)th refinement encoder, the output of the (l-1)th refinement encoder will be used as the input of the lth refinement encoder at time t, W f is a learnable parameter of the linear layer; and is a learnable parameter, represents the embedding vector corresponding to the generated word at time (t-1), and the attention mapping of the word generated before each word is calculated; Finally, the Cross MSA Module module models the multi-modal relationship between the image and the refined grid features, capturing local visual context information to generate the image description. and the refined grid features, capturing local visual context information to generate the image description.

7. The picture description method based on the pulse Transformer model according to claim 6, characterized in that, The implementation formula of the Cross MSA Module module is as follows: wherein, and W x are learnable parameters; is the output of Cross MSA, where is the Query of Cross MSA, is the Key and Value of Cross MSA; is the final output of Cross MSA Module.

8. The picture description method based on the pulse Transformer model according to claim 1, characterized in that, In the step (4), the pulse self-attention mechanism is used to replace the self-attention mechanism, and the PLMP unit is used to replace the ReLU unit in the FeedForward unit, and the implementation of the pulse FeedForward unit is as follows: SpikingFeedForward(x)=W2PLMP(W1x).

9. The picture description method based on the pulse Transformer model according to claim 1, characterized in that, The dataset in the field of picture description includes MSCOCO 2014, Flickr30K and Flickr8K, Flickr30K and Flickr8K, VizWiz, TextCaps, Fashion Captioning and CUB-200.

Citation Information

Patent Citations

  • Attention mechanism-based image classification method of pulse convolutional neural network

    CN111858989A

  • Trapezoidal accumulation nuclear pulse identification method based on deep learning Transform model

    CN114897004A