Image analysis method, system and storage medium based on variational quantum algorithm
Through the combination of variational quantum algorithm and quantum vision Transformer, the application problem of the traditional vision Transformer model in resource-limited environments is solved, the efficiency and accuracy of image analysis are improved, and a new method of processing complex image analysis is provided.
Patent Information
- Application Number
- CN202411081741.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The traditional visual Transformer model suffers from the problems of huge computing resource consumption, complex model training process, and weak generalization ability, making it difficult to effectively perform image analysis in resource-limited application environments.
The image analysis method based on variational quantum algorithm is adopted, and the image is input into the quantum vision Transformer through the quantum classification model. The parallelism and superposition principle of quantum computing are used to extract and classify image features, and the classical neural network is used for training and optimization of the model. parameter.
It improves the efficiency and accuracy of image analysis, solves the application limitations of traditional visual Transformers in resource-constrained environments, and provides a new way to deal with complex image analysis problems.
Smart Images

Figure CN118628838B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum analysis technology, and in particular to an image analysis method, system and storage medium based on a variational quantum algorithm. Background Art
[0002] Image analysis is widely used in modern technology, such as license plate recognition in self-driving cars and pedestrian tracking. Image analysis is a core task in the field of computer vision, which aims to enable computers to understand and interpret the content in images. It involves various technologies to extract useful information and features from images. Image analysis aims to achieve from simple object recognition to complex scene understanding by deeply analyzing the image content.
[0003] In recent years, visual Transformer models, with their powerful self-attention mechanism, have achieved remarkable results in many image analysis tasks. These models can capture complex visual patterns and contextual information by learning the global dependencies of images, significantly improving the ability to process complex visual information. However, traditional visual Transformer models face several limitations, mainly including huge consumption of computing resources, complex model training process, and weak generalization ability, which limit their performance in specific applications with limited resources. Summary of the invention
[0004] Based on the technical problems existing in the background technology, the present invention proposes an image analysis method, system and storage medium based on a variational quantum algorithm, which improves the efficiency and accuracy of image analysis by integrating the characteristics of quantum computing.
[0005] The image analysis method based on variational quantum algorithm proposed in the present invention inputs the image to be classified into the quantum classification model to output the image classification result;
[0006] The training process of the quantum classification model is as follows:
[0007] Step 1: construct a training data set based on the acquired images, extract features from the images in the training data set to obtain images after feature extraction, and divide the images after feature extraction into blocks to obtain A token sequence consisting of tokens;
[0008] Step 2: Input the token sequence into the quantum visual Transformer, and encode each token in the token sequence into the Hilbert space represented by the quantum state through the data encoding circuit. Each quantum state representation passes through the variational quantum circuit respectively. , and After processing, the variational quantum circuit and Only one bit is measured to get the query corresponding to each token and key , for the variational quantum circuit Measure all bits to get the value corresponding to each token , the variational quantum circuit , and The trainable parameter circuit parts in are The quantum circuit is composed of alternating gates and CZ gates, where is a trainable parameter, Both the gate and the CZ gate are quantum gates;
[0009] Step 3: Calculate The attention score between the token and other tokens is calculated by adding the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer;
[0010] Step 4: Pass the feature vector output by the quantum vision Transformer through the linear classification layer to obtain the image classification result. Construct the loss function based on the image classification result, and optimize the classical parameters and quantum parameters in the quantum classification model based on the back propagation algorithm and parameter shifting rules.
[0011] Further, in step 1, the image after feature extraction is divided into blocks to obtain token sequence, specifically:
[0012] The image size after feature extraction is , the image after feature extraction is divided into Divide into blocks, get block images, the The height and width of the image, respectively, Indicates the number of color channels, Respectively represent the height and width of the block image, ;
[0013] Flatten the feature vector in each block image into a dimensional vector to obtain A token sequence consisting of tokens.
[0014] Furthermore, in step 2, each token in the token sequence is encoded into the Hilbert space represented by the quantum state through the data encoding circuit, specifically: calculation , for the first Tokens Compress to between, through The goalkeeper's compressed token Encoded into the Hilbert space of quantum state representation, The gate is a quantum gate.
[0015] Further, in step 2, in the variational quantum circuit A CNOT gate is set before the measurement output, so that the variational quantum circuit Perform sufficient entanglement before measurement so that only one bit is measured to get the query corresponding to each token and key .
[0016] Further, in step three, calculate The attention score between the token and other tokens is calculated by adding the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer, as follows:
[0017] ;
[0018] ;
[0019] ;
[0020] in, Indicates The token is relative to the The attention score of tokens, Indicates Token query, Indicates The transpose of the keys of the tokens, Indicates The vector obtained by the attention mechanism for each token is Indicates The value of a token, Indicates The feature vector of the token output by the quantum visual Transformer, Indicates tokens.
[0021] Further, in step 2, the variable quantum circuit , and The parameters of the quantum gates are determined through training and learning, and the variational quantum circuits , and The optimization of the corresponding quantum circuit is to calculate the gradient of the output of the corresponding quantum circuit relative to each parameter in the corresponding quantum circuit. The optimization process of the quantum circuit is as follows:
[0022] Given a parameterized quantum circuit, by applying a shift to each parameter , we get the quantum circuit after the parameter offset is applied;
[0023] Calculating the expected value error of the objective function on a given quantum circuit and a quantum circuit with a parameter applied offset to estimate the gradient of the corresponding parameter, wherein the objective function is a function constructed during quantum gate training in the quantum circuit;
[0024] No. The gradient of the parameters is estimated as follows:
[0025] ;
[0026] in, The objective function is in the parameter The value of under the quantum circuit, For the parameters, For the unit vectors, Indicates that the objective function is in the parameter The value of under the quantum circuit, The objective function is in the parameter The value of under the quantum circuit, For parameters Apply offset The parameters formed, For parameters Apply offset The parameters formed.
[0027] The image analysis system based on the variational quantum algorithm inputs the image to be classified into the quantum classification model to output the image classification result;
[0028] The quantum classification model includes a network feature extraction layer, an image segmentation layer, a quantum visual transformer, a network classification layer, and a loss construction module; a training data set is constructed based on the acquired images to train the quantum classification model, and the training process is as follows:
[0029] The network feature extraction layer is used to extract features from images in the training data set to obtain images after feature extraction;
[0030] The image segmentation layer is used to segment the image after feature extraction. A token sequence consisting of tokens;
[0031] The quantum visual transformer is used to encode each token in the token sequence into the Hilbert space of quantum state representation through the data encoding circuit. Each quantum state representation passes through the variational quantum circuit respectively. , and After processing, the variational quantum circuit and Only one bit is measured to get the query corresponding to each token and key , for the variational quantum circuit Measure all bits to get the value corresponding to each token , the variational quantum circuit , and The trainable parameter circuit parts in are The quantum circuit is composed of alternating gates and CZ gates, where is a trainable parameter; for token, calculate the attention score between the token and other tokens, and add the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer ;
[0032] The network classification layer is used to pass the feature vector output by the quantum vision Transformer through the linear classification layer to obtain the image classification result;
[0033] The loss construction module is used to construct the loss function through the image classification results, and optimize the classical parameters and quantum parameters in the classification model based on the back propagation algorithm and parameter shifting rules.
[0034] A computer-readable storage medium stores a plurality of classification programs, wherein the plurality of classification programs are used to be called by a processor and execute the image analysis method as described above.
[0035] The advantages of the image analysis method, system and storage medium based on variational quantum algorithm provided by the present invention are: a classical-quantum hybrid visual Transformer method based on variational quantum circuits is proposed, which realizes the integration of classical neural networks and quantum machine learning in processing image analysis problems; at the same time, it has a wide range of application scenarios and can be applied to various complex image analysis problems; the proposed quantum visual Transformer provides a new way to use the parallelism of quantum computing and the principle of quantum state superposition to process complex problems, and provides a new feasible solution for the application of visual Transformer in more scenarios; it solves the application limitations of traditional visual Transformer models in resource-constrained environments, and improves the efficiency and accuracy of image analysis by integrating quantum computing characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the process of the present invention;
[0037] Figure 2 This is a schematic diagram of the training process of the quantum classification model;
[0038] Figure 3 Variational quantum circuit Schematic diagram of the circuit structure;
[0039] Figure 4 Variational quantum circuit , Schematic diagram of the circuit structure. DETAILED DESCRIPTION
[0040] Below, the technical solution of the present invention is described in detail through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific implementation disclosed below.
[0041] like Figure 1 As shown, the image analysis method based on variational quantum algorithm proposed by the present invention inputs the image to be classified into the quantum classification model to output the image classification result;
[0042] The training process of the quantum classification model is as follows:
[0043] Step 1: construct a training data set based on the acquired images, extract features from the images in the training data set to obtain images after feature extraction, and divide the images after feature extraction into blocks to obtain A token sequence consisting of tokens;
[0044] Images in the training dataset , whose size is ,in and Represents the height and width of the image respectively. Images with higher pixels have higher and . is the number of color channels. C is usually 3 for RGB images and 1 for grayscale images.
[0045] In the feature extraction step of the network feature extraction layer, a classic neural network architecture is used to extract the input image. Perform feature extraction tasks. This process is mainly achieved by combining convolutional layers and pooling layers. The convolutional layer is responsible for extracting local features from the image. It captures image features at different spatial locations by applying a series of learnable filters (or convolution kernels) to the input image. The pooling layer that follows is responsible for reducing the spatial dimension of the feature map. By performing the maximum pooling or average pooling operation, it further compresses the data and reduces the computational burden of subsequent processing. By alternately applying convolutional layers and pooling layers, the image after feature extraction is obtained. The network feature extraction layer can effectively extract useful feature representations from complex image data, laying the foundation for the next stage of quantum network processing. The network feature extraction layer can use the existing classical feature extraction network to obtain the image after feature extraction.
[0046] The image extracted by the classic network feature extraction layer is divided into blocks. Assume that the image size after feature extraction is , are the height and width of the image respectively, and the images are arranged according to Blocks, where yes An integer multiple of yes The image is divided into integer multiples of Block. Each block image can be regarded as a feature representation in a local area.
[0047] Next, the feature vectors in each block image are flattened to form dimensional vector. In this way, each block image is transformed into a dimensional vector, with a total Token. Indicates the total number of tokens, Represents the dimension of each token.
[0048] Therefore, the image after feature extraction is divided into indivual Dimensional tokens, i.e. token sequences , ,in Indicates Tokens, Indicates tokens.
[0049] Step 2: Input the token sequence into the quantum visual Transformer, and encode each token in the token sequence into the Hilbert space represented by the quantum state through the data encoding circuit. Each quantum state representation passes through the variational quantum circuit respectively. , and After processing, the variational quantum circuit and Only one bit is measured to get the query corresponding to each token and key , for the variational quantum circuit Measure all bits to get the value corresponding to each token , the variational quantum circuit , and The trainable parameter circuit parts in are The quantum circuit is composed of alternating gates and CZ gates, where is a trainable parameter, Both the gate and the CZ gate are quantum gates.
[0050] The first Tokens Variational quantum circuits , and After measuring the results of the line multiple times and finding its expectation, we get the query corresponding to the token ,key Sum .
[0051] In the variational quantum algorithm of this embodiment, the design of quantum circuits usually consists of three parts: data encoding, parameter circuits and quantum measurement; variational quantum circuits , and The data encoding and parameter circuit designs of the corresponding quantum circuits are similar. and Similar to quantum measurement, variational quantum circuits Quantum measurement and variational quantum circuits and The quantum measurements are inconsistent, as explained below.
[0052] The input token is first encoded into the Hilbert space represented by the quantum state through the data encoding circuit, and then passes through a series of quantum circuits composed of parameterized quantum gates. The parameters of these quantum gates are learned through training. Finally, through quantum measurement, the quantum state processed by the parameter circuit is mapped to the classical data space. The quantum bits are measured to obtain the output of the classical bits. These outputs are used to calculate the loss function in the subsequent process to update the parameter circuit.
[0053] Variational quantum circuit , and The data encoding and parameter circuit of the corresponding quantum circuit are as follows: , first calculate Compress the input to between, through The gate is encoded into the quantum state. The parameter circuit layer is an alternating arrangement of gates and CZ gates, where is a trainable parameter, Door, Both the gate and the CZ gate are quantum gates. The CZ gate is used to increase the quantum entanglement of the system. In order to make the circuit not too complicated while maintaining the quantum entanglement characteristics, the circuit adopts a CZ gate structure with alternating odd and even layers. It is understandable that The parameter circuit layer is obtained by alternating gates and CZ gates. The number of layers of the trainable parameter part in the parameter circuit layer is depth layer (for example, 5 layers). The number of layers of depth layer can be set according to the complexity of the problem to be solved. In the depth layer (5 layers), the output of the previous layer is used as the input of the current layer, and the output of the depth layer (5th layer) is used as the variational quantum circuit. , and The output of the corresponding quantum circuit.
[0054] Variational quantum circuit and The quantum measurement of the corresponding quantum circuit only measures one bit, such as Figure 4 As shown, the query corresponding to each token is obtained and key , which makes the calculation and The score is simplified from the vector inner product to the multiplication of two numbers. and Corresponding to the The query of the token and the In order to obtain sufficient entanglement before measurement, it is necessary to pass through a CNOT gate for sufficient entanglement before measurement. CNOT gate (Controlled-NOT gate): The CNOT gate is a two-bit gate, one of which is called the control bit and the other is called the target bit. If the control bit is in the |1> state, the CNOT gate flips the state of the target bit. It is used to create and manipulate quantum entanglement.
[0055] Variational quantum circuit The quantum measurement of the corresponding quantum circuit requires measuring all bits, such as Figure 3 As shown, get the value corresponding to the token Measuring all bits is to facilitate the subsequent residual connection to take effect.
[0056] Variational quantum circuit , and The optimization of the corresponding quantum circuit is to calculate the gradient of the output of the quantum circuit relative to each parameter. This embodiment will use the parameter offset rule to calculate the gradient. Specifically:
[0057] Given a parameterized quantum circuit, by applying a small offset to each parameter , and measure the change of the corresponding objective function to estimate the gradient, where the objective function is the function constructed when training the quantum gates in the quantum circuit. Specifically, suppose there is a parameterized quantum circuit ,in is a parameter vector. Parameters , which can be offset by a small amount , and obtain a new quantum circuit ,as well as ,in It is unit vectors.
[0058] Then, the difference between the expected values of the objective function on the two quantum circuits is calculated, and the gradient of the corresponding parameters is estimated. Specifically, assuming that the objective function is , then for the parameters, whose gradient can be estimated as:
[0059] ;
[0060] in, The objective function is in the parameter The value of under the quantum circuit, For the parameters, For the unit vectors, Indicates that the objective function is in the parameter The value of under the quantum circuit, The objective function is in the parameter The value of under the quantum circuit, For parameters Apply offset The parameters formed, For parameters Apply offset The parameters formed.
[0061] Step 3: Calculate The attention score between the token and other tokens is calculated by adding the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer;
[0062] Afterwards, tokens and The attention score between tokens is calculated by the dot product function: ; This score reflects the The token position is relative to the The relevance or importance of each token position helps to fully understand the context within the input sequence. Represents the product.
[0063] Finally, the attention mechanism calculates the value of all token positions It can be represented by the weighted sum of vectors:
[0064] ;
[0065] Then apply the residual connection as the output:
[0066] ;
[0067] in, Indicates The token is relative to the The attention score of tokens, Indicates Token query, Indicates The transpose of the keys of the tokens, Indicates The vector obtained by the attention mechanism for each token is Indicates The value of a token, Indicates The feature vector of the token output by the quantum visual Transformer, Indicates tokens.
[0068] Step 4: Pass the feature vector output by the quantum vision Transformer through the linear classification layer to obtain the image classification result, construct the loss function through the image classification result, and optimize the classical parameters and quantum parameters in the quantum classification model based on the back propagation algorithm and parameter shifting rules;
[0069] The output of the quantum vision Transformer is indivual The output feature vector is compressed into a single dimension by implementing the maximum pooling or average pooling technique. dimensional vector. Assume that this task is For the classification problem of the category, the linear classification layer can be set as VI dimensional fully connected classification layer to obtain the classification result.
[0070] Through steps one to four, this embodiment proposes a classical-quantum hybrid visual Transformer method based on variational quantum circuits, which realizes the integration of classical neural networks and quantum machine learning in processing image analysis problems; this embodiment has a wide range of application scenarios and can be applied to various complex image analysis problems; the quantum visual Transformer proposed in this embodiment provides a new way to use the parallelism of quantum computing and the principle of quantum state superposition to deal with complex problems, and provides a new feasible solution for the application of visual Transformer in more scenarios; it solves the application limitations of traditional visual Transformer models in resource-constrained environments, and improves the efficiency and accuracy of image analysis by integrating quantum computing characteristics.
[0071] Embodiment 1:
[0072] MNIST is a classic machine learning dataset. Because it is moderately sized and easy to handle, and contains enough variations to reflect the challenges of the real world, the MNIST dataset is one of the most commonly used benchmark datasets in the field of computer vision to compare the performance and accuracy of different algorithms.
[0073] In this task, the first 100 images in the MNIST dataset with labels of 0 or 1 were selected as the training set, totaling 200 images. The test set selected all the test images in the entire MNIST dataset with labels of 0 or 1, totaling 4157 images.
[0074] The method of this task is Figure 2 As shown, the input of the quantum classification model is a series of grayscale images with pixels ; The output is the image classification result. The implementation process of the image analysis method of the above embodiment is as follows:
[0075] (1) Extract features through the network feature extraction layer: This step involves a convolution operation and a pooling operation. The convolution operation is a convolution kernel with a size of , the step length is , filled with "valid", the number of filters is 1. The pooling operation is a window size of , the step length is The maximum pooling layer, the image after feature extraction is extracted into within the dimension.
[0076] (2) Image segmentation layer and quantum vision Transformer: The image after feature extraction is segmented into 6 tokens, each of which is a 4-dimensional vector. Each token is then passed through a variational quantum circuit. , and , run the quantum circuit and measure 2000 shots to find its expectation, and we get , and Finally, according to the above as well as The output of the quantum visual Transformer is calculated using the calculation method.
[0077] (3) Classic network classification layer: The six 4-dimensional feature vectors outputted above are averaged to form a 4-dimensional vector. In order to obtain the classification result, a 4-dimensional to 2-dimensional fully connected layer is added after the 4-dimensional vector as a classification layer to obtain the category of the input image.
[0078] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An image analysis method based on a variational quantum algorithm, characterized in that: Input the image to be classified into the quantum classification model to output the image classification result; The training process of the quantum classification model is as follows: Step 1: construct a training data set based on the acquired images, extract features from the images in the training data set to obtain images after feature extraction, and divide the images after feature extraction into blocks to obtain A token sequence consisting of tokens; Step 2: Input the token sequence into the quantum visual Transformer, and encode each token in the token sequence into the Hilbert space represented by the quantum state through the data encoding circuit. Each quantum state representation passes through the variational quantum circuit respectively. , and After processing, the variational quantum circuit and Only one bit is measured to get the query corresponding to each token and key , for the variational quantum circuit Measure all bits to get the value corresponding to each token , the variational quantum circuit , and The trainable parameter circuit parts in are The quantum circuit is composed of alternating gates and CZ gates, where is a trainable parameter, Both the gate and the CZ gate are quantum gates; Step 3: Calculate The attention score between the token and other tokens is calculated by adding the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer. The specific formula is as follows: in, Indicates The token is relative to the The attention score of tokens, Indicates Token query, Indicates The transpose of the keys of the tokens, Indicates The vector obtained by the attention mechanism for each token is Indicates The value of a token, Indicates The feature vector of the token output by the quantum visual Transformer, Indicates Tokens; Step 4: Pass the feature vector output by the quantum vision Transformer through the linear classification layer to obtain the image classification result. Construct the loss function based on the image classification result, and optimize the classical parameters and quantum parameters in the quantum classification model based on the back propagation algorithm and parameter shifting rules.
2. The image analysis method based on variational quantum algorithm according to claim 1, characterized in that: In step 1, the image after feature extraction is divided into blocks, and the token sequence, specifically: The image size after feature extraction is , the image after feature extraction is divided into Divide into blocks, get block images, the are the height and width of the image, Indicates the number of color channels, Respectively represent the height and width of the block image, ; Flatten the feature vector in each block image into a dimensional vector to obtain A token sequence consisting of tokens.
3. The image analysis method based on variational quantum algorithm according to claim 1, characterized in that: In step 2, each token in the token sequence is encoded into the Hilbert space represented by the quantum state through the data encoding circuit, specifically: calculation , for the first Tokens Compress to between, through The goalkeeper's compressed token Encoded into the Hilbert space of quantum state representation, The gate is a quantum gate.
4. The image analysis method based on variational quantum algorithm according to claim 1, characterized in that: In step 2, in the variational quantum circuit A CNOT gate is set before the measurement output, so that the variational quantum circuit Perform sufficient entanglement before measurement so that only one bit is measured to get the query corresponding to each token and key .
5. The image analysis method based on variational quantum algorithm according to claim 1, characterized in that: In step 2, the variational quantum circuit , and The parameters of the quantum gates are determined through training and learning, and the variational quantum circuits , and The optimization of the corresponding quantum circuit is to calculate the gradient of the output of the corresponding quantum circuit relative to each parameter in the corresponding quantum circuit. The optimization process of the quantum circuit is as follows: Given a parameterized quantum circuit, by applying a shift to each parameter , we get the quantum circuit after the parameter offset is applied; Calculating the expected value error of the objective function on a given quantum circuit and a quantum circuit with a parameter applied offset to estimate the gradient of the corresponding parameter, wherein the objective function is a function constructed during quantum gate training in the quantum circuit; No. The gradient of the parameters is estimated as follows: in, The objective function is in the parameter The value of under the quantum circuit, For the parameters, For the unit vectors, Indicates that the objective function is in the parameter The value of under the quantum circuit, The objective function is in the parameter The value of under the quantum circuit, For parameters Apply offset The parameters formed, For parameters Apply offset The parameters formed.
6. An image analysis system based on a variational quantum algorithm, characterized in that: Input the image to be classified into the quantum classification model to output the image classification result; The quantum classification model includes a network feature extraction layer, an image segmentation layer, a quantum visual transformer, a network classification layer, and a loss construction module; a training data set is constructed based on the acquired images to train the quantum classification model, and the training process is as follows: The network feature extraction layer is used to extract features from images in the training data set to obtain images after feature extraction; The image segmentation layer is used to segment the image after feature extraction. A token sequence consisting of tokens; The quantum visual transformer is used to encode each token in the token sequence into the Hilbert space of quantum state representation through the data encoding circuit. Each quantum state representation passes through the variational quantum circuit respectively. , and After processing, the variational quantum circuit and Only one bit is measured to get the query corresponding to each token and key , for the variational quantum circuit Measure all bits to get the value corresponding to each token , the variational quantum circuit , and The trainable parameter circuit parts in are The quantum circuit is composed of alternating gates and CZ gates, where is a trainable parameter; for token, calculate the attention score between the token and other tokens, and add the attention score to the value of all tokens. After weighted summation, residual connection is applied as the output of quantum visual Transformer ; The network classification layer is used to pass the feature vector output by the quantum vision Transformer through the linear classification layer to obtain the image classification result; The loss construction module is used to construct the loss function through the image classification results, and optimize the classical parameters and quantum parameters in the classification model based on the back propagation algorithm and parameter shifting rules; The following formula is set in the quantum vision Transformer to calculate : in, Indicates The token is relative to the The attention score of tokens, Indicates Token query, Indicates The transpose of the keys of the tokens, Indicates The vector obtained by the attention mechanism for each token is Indicates The value of a token, Indicates The feature vector of the token output by the quantum visual Transformer, Indicates tokens.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of classification programs, and the plurality of classification programs are used to be called by a processor and execute the image analysis method as described in any one of claims 1 to 5.
