Homomorphic image-text matching method and device based on quantum hybrid neural network
By using quantum hybrid neural networks to reduce the dimensionality and encode image and text information, and encrypting it, a quantum neural network model is constructed, which solves the problems of data security and computational efficiency, and achieves efficient and secure image-text matching.
Patent Information
- Application Number
- CN202510984548.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-11-04
AI Technical Summary
Existing technologies have shortcomings in terms of data security and computational efficiency. Classical encryption algorithms pose a risk of data leakage, classical neural networks consume too many computational resources when processing high-dimensional data, and quantum computing lacks effective solutions for image and text feature fusion.
A quantum hybrid neural network is used to reduce the dimensionality of image and text information. Quantum amplitude coding and homomorphic encryption algorithms are used to encode and encrypt the data, and a quantum neural network model is constructed for analysis to achieve image-text matching.
It improves data processing efficiency and security, solves the problem of computational complexity growing superlinearly with the number of operations, and meets real-time requirements.
Smart Images

Figure CN120892829A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum communication security technology, and in particular to a method and apparatus for homomorphic image-text matching based on quantum hybrid neural networks. Background Technology
[0002] With the rapid development of quantum information technology, quantum computing has shown great potential in the field of data processing. In the field of multimedia information processing, image-text matching technology has become a core requirement for applications such as intelligent security, medical diagnosis, and e-commerce. However, traditional image-text matching methods based on classical computing face key technical bottlenecks:
[0003] First, regarding data security, existing technologies using classic encryption algorithms to process sensitive data must undergo a "decryption-computation-re-encryption" process, which carries a significant risk of data leakage. This is especially true in cloud computing environments, where security vulnerabilities in data transmission and processing are even more pronounced. While homomorphic encryption allows direct computation on ciphertext, its computational complexity increases superlinearly with the number of operations, making it difficult to meet real-time requirements.
[0004] Secondly, regarding computational efficiency, classical neural networks face the "curse of dimensionality" problem as data dimensionality increases. This is especially true when processing high-resolution images and long text sequences, where computational resource consumption grows exponentially. Furthermore, performing neural network calculations directly on encrypted data further exacerbates the computational burden, leading to a significant increase in system response latency.
[0005] Quantum computing technology offers a new technological path to solve the aforementioned problems. Theoretically, the characteristics of quantum parallel computing can exponentially improve data processing efficiency; quantum entanglement provides a physical basis for establishing deep relationships between images and text; and quantum homomorphic encryption technology can address the problem that computational complexity increases superlinearly with the number of operations, making it difficult to meet real-time requirements. However, existing quantum machine learning solutions mostly focus on single-modal data processing, and image-text feature fusion under encrypted quantum states remains a pressing technical challenge. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this application provides a method and apparatus for homomorphic image-text matching based on quantum hybrid neural networks.
[0007] In a first aspect, this application provides a homomorphic image-text matching method based on a quantum hybrid neural network, the method comprising:
[0008] The system receives image and text information to be processed, performs dimensionality reduction on the image information to obtain a dimensionality-reduced image vector, and extracts word vectors from the text information to obtain text word vectors.
[0009] The dimensionality-reduced image vector and the text word vector are concatenated to obtain the concatenated vector to be processed.
[0010] Quantum amplitude encoding is used to encode the spliced vector to be processed into quantum state data;
[0011] The quantum state data is encrypted using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data;
[0012] Construct and train a quantum neural network model;
[0013] The encrypted quantum state data is input into the trained quantum neural network model for analysis to obtain matching results.
[0014] Optionally, the step of dimensionality reduction processing of the image information to obtain a dimensionality-reduced image vector includes:
[0015] The original data matrix corresponding to the image information is centered, and the covariance matrix is calculated based on the centered data matrix.
[0016] Perform eigenvalue decomposition on the covariance matrix and construct the projection matrix based on the eigenvectors corresponding to the first k largest eigenvalues;
[0017] Multiplying the original data matrix by the projection matrix yields the reduced-dimensional image vector.
[0018] Optionally, the step of extracting word vectors from the text information to obtain text word vectors includes:
[0019] The text information is preprocessed, and the preprocessed text information is input into a pre-trained teacher model for analysis and processing to obtain the first text word vector. The teacher model is a BERT model.
[0020] The first text word vectors are used as soft labels to train the student model, and the student model is optimized based on a preset optimization objective. The student model is a lightweight language model, and the optimization objective is to minimize the error between the output results of the teacher model and the student model.
[0021] The word vectors of the second text are obtained by extracting word vectors from the text information based on the trained and optimized student model.
[0022] Optionally, the step of encoding the concatenated vector to be processed into quantum state data using quantum amplitude encoding includes:
[0023] The number of qubits is determined based on the dimension of the vector to be processed;
[0024] The values of the vector to be processed are normalized to obtain normalized values;
[0025] When the number of qubits is 1, quantum state data is constructed based on normalized values;
[0026] When the number of qubits is greater than 1, quantum state data is constructed through tensor product operations.
[0027] Optionally, the step of encrypting the quantum state data using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data includes:
[0028] Generate an entangled key state for the public key, and use half of the qubits as the private key after unitary transformation;
[0029] The input quantum state data is encrypted using a cryptographic unitary transformation based on the entangled key state of the public key, resulting in encrypted quantum state data.
[0030] Optionally, the quantum neural network model includes: a quantum convolutional layer and a quantum perceptron layer, wherein the quantum convolutional layer is used to perform convolution operations on encrypted quantum state data, and the quantum perceptron layer includes multiple quantum perceptrons, wherein the quantum perceptron includes a unitary operator;
[0031] The convolution operation U of the quantum convolution layer conv It satisfies the following formula:
[0032]
[0033] Among them, U first CNOT represents the first unitary transform in the convolution operation. ij This represents a controlled NOT gate in quantum computing, where ij and ij represent the position indices of the control bit and the target bit, respectively; U last Π represents the last unitary transformation in the convolution operation, and Π represents the continuous multiplication of multiple CNOT operations.
[0034] unitary operator of quantum perception Satisfy the following formula:
[0035]
[0036] Among them, R X R Y R Z Let be the matrix representing the rotation operation, corresponding to the rotation transformations along the X, Y, and Z axes. Represents the first rotation angle. Represents the second rotation angle. Represents the third rotation angle, CONT img→text This represents a continuous image-to-text conversion, using the image state as the control bits and the text state as the target bits, performing a controlled NOT gate operation. (CONT) text→imgThis represents the conversion from text to image, performing a controlled NOT gate operation with the text state as the control bits and the image state as the target bits.
[0037] Optionally, the step of inputting the encrypted quantum state data into the trained quantum neural network for analysis to obtain matching results includes:
[0038] The encrypted quantum-encoded data is input into the trained quantum neural network for feature extraction and analysis to obtain the final output quantum state;
[0039] The final output quantum state is subjected to multiple projection measurements, and the probability values corresponding to different labels are statistically analyzed.
[0040] The tag with the highest probability value is used as the matching result.
[0041] Secondly, this application provides a homomorphic image-text matching device based on a quantum hybrid neural network, comprising:
[0042] The first processing module is used to receive image information and text information to be processed, perform dimensionality reduction processing on the image information to obtain dimensionality reduction image vectors, and extract word vectors from the text information to obtain text word vectors.
[0043] The second processing module is used to concatenate the dimensionality-reduced image vector and the text word vector to obtain the concatenated vector to be processed.
[0044] The encoding module is used to encode the spliced vector to be processed into quantum state data using quantum amplitude encoding;
[0045] The encryption module is used to encrypt quantum state data using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data;
[0046] Construct a training module to build and train a quantum neural network model;
[0047] The third processing module is used to input encrypted quantum state data into the trained quantum neural network model for analysis and to obtain matching results.
[0048] This application provides a homomorphic image-text matching method and apparatus based on a quantum hybrid neural network. The method receives image and text information to be processed, performs dimensionality reduction on the image information to obtain a dimensionality-reduced image vector, and extracts word vectors from the text information to obtain text word vectors. The dimensionality-reduced image vector and text word vectors are concatenated to obtain a concatenated vector to be processed. Quantum amplitude encoding is used to encode the concatenated vector into quantum state data. The quantum state data is encrypted using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data. A quantum neural network model is constructed and trained. The encrypted quantum state data is input into the trained quantum neural network model for analysis to obtain the matching result, thus improving processing efficiency and data transmission security. Attached Figure Description
[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0050] Figure 1 A flowchart illustrating the homomorphic image-text matching method based on a quantum hybrid neural network provided in this application embodiment;
[0051] Figure 2 This is a schematic diagram of the structure of the homomorphic image-text matching device based on a quantum hybrid neural network provided in an embodiment of this application.
[0052] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein.
[0055] In this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0056] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0057] Figure 1 This is a flowchart illustrating a homomorphic image-text matching method based on a quantum hybrid neural network, provided as an embodiment of this application. Figure 1 As shown, the homomorphic image-text matching method based on quantum hybrid neural networks provided in this embodiment includes:
[0058] S1: Receive image information and text information to be processed, perform dimensionality reduction processing on the image information to obtain dimensionality-reduced image vectors, and extract word vectors from the text information to obtain text word vectors.
[0059] The image information is dimensionality reduced to obtain a dimensionality-reduced image vector, including:
[0060] A1: Center the original data matrix corresponding to the image information, and calculate the covariance matrix based on the centered data matrix.
[0061] Specifically, the mean value of each pixel feature in the original data matrix is calculated, forming a mean vector μ. Each element μ of the mean vector μ... j Calculated using the following formula:
[0062]
[0063] Where n is the total number of samples, X ij This represents the element in the i-th row and j-th column of the image vector matrix X, where i is the sample number representing the i-th sample and j is the pixel feature number representing the j-th feature;
[0064] Centralized processing satisfies the following formula:
[0065] X centered,ij =X ij -μ j
[0066] Among them, X centered,ijIt is the centered value of the i-th sample and the j-th pixel, which is the original value minus the average value.
[0067] A2: Perform eigenvalue decomposition on the covariance matrix and construct the projection matrix based on the eigenvectors corresponding to the first k largest eigenvalues.
[0068] Specifically, the covariance matrix satisfies the following formula:
[0069]
[0070] Among them, C k X represents the covariance matrix corresponding to the k-th feature subset, describing the correlation between features, where n is the total number of samples. centered,ik Let X be the centered value of the i-th sample and the k-th feature. centered,il Let be the centering value of the i-th sample and the l-th feature.
[0071] A3: Multiply the original data matrix by the projection matrix to obtain the dimensionality-reduced image vector.
[0072] Word vectors are extracted from the text information to obtain text word vectors, including:
[0073] B1: Preprocess the text information, input the preprocessed text information into the pre-trained teacher model for analysis and processing, and obtain the first text word vector.
[0074] The teacher model is the BERT model.
[0075] Specifically, text preprocessing includes: cleaning the input raw text, removing irrelevant characters and punctuation marks, and performing word segmentation to generate word sequences; standardizing the segmented text (e.g., converting it to lowercase) and filtering stop words.
[0076] Furthermore, the preprocessed text is converted into the standard input format of the BERT model. Specifically, a [CLS] marker is added at the beginning of the text and a [SEP] marker is added at the end. The input sequence is padded or truncated to make its length meet the maximum input limit of the BERT model.
[0077] The encoded text is input into the pre-trained BERT model to obtain the context-related vector representation of each word; for the semantic representation of the entire text, the vector corresponding to the [CLS] label is used as the global feature vector.
[0078] B2: Train the student model using the word vectors of the first text as soft labels, and optimize the student model based on the preset optimization objective.
[0079] The student model is a lightweight language model, and the optimization objective is to minimize the error between the outputs of the teacher model and the student model.
[0080] Specifically, a knowledge distillation technique is employed, using a high-performance teacher model to generate high-precision word vectors as soft labels for the input text; a lightweight student model is trained so that its output word vectors approximate the prediction results of the teacher model, with the optimization objective being to minimize the mean squared error between the two.
[0081] B3: Based on the trained and optimized student model, word vectors are extracted from the text information to obtain the second text word vectors.
[0082] Specifically, the final text word vector representation is generated based on the optimized student model. For out-of-vocabulary words, dynamic vectors are generated directly using the contextual reasoning ability of the student model to avoid semantic bias caused by random initialization.
[0083] S2: Concatenate the reduced image vector and the text word vector to obtain the concatenated vector.
[0084] S3: Quantum amplitude encoding is used to encode the spliced vector into quantum state data.
[0085] Specifically, quantum amplitude encoding is used to encode the spliced vector to be processed into quantum state data. Includes the following steps:
[0086] S31: Determine the required number of qubits based on the dimension of the splicing vector.
[0087] Specifically, the required number of qubits k = log₂N is determined based on the dimension of the concatenated vector to be processed, where N refers to the total amount of data involved.
[0088] S32: Normalize the values of the concatenated vectors to obtain normalized values.
[0089] Specifically, normalization is performed as follows: the value x of the vector to be processed lies within the interval [a, b], where [a, b] is the boundary of the interval. The interval range within which vector x is normalized or normalized is defined. Here, a and b are the lower and upper bounds of the interval, respectively. Normalizing x yields... y∈[0,1], where y is the value obtained after normalization.
[0090] S33: Construct a quantum state based on the normalized value when the number of qubits is 1.
[0091] Understandably, when the number of qubits is 1, the mapping is performed using an amplitude-based encoding method based on the normalized value.
[0092] Specifically, for a quantum bit, let The state of the qubit is then:
[0093]
[0094] Where θ represents the angular parameter of the qubit, which is the polar angle on the Bloch sphere and is used to describe the rotation angle of the quantum state;
[0095] S34: When the number of qubits is greater than 1, construct a quantum state through tensor product operation.
[0096] Understandably, for multiple qubits, quantum states are constructed through tensor products.
[0097] Specifically, it satisfies the following formula:
[0098]
[0099] in, This is a composite quantum state constructed from two qubits through a tensor product operation. The quantum state of the first qubit. For the quantum state of the second qubit, This represents the tensor product operation.
[0100] S4: Use a quantum homomorphic encryption algorithm to encrypt the quantum state data to obtain encrypted quantum state data.
[0101] Specifically, the following steps are included:
[0102] S41: Generate the entangled key state of the public key, and use half of the qubits as the private key after unitary transformation.
[0103] Specifically, the entangled key state that generates the public key. With private key | φ d >, satisfying the following formula:
[0104]
[0105] Where k represents the number of qubits to be generated, and the numerator represents the tensor product of the first two bits being |00> and the last k / 2 bits being |1>;
[0106]
[0107]
[0108] in, For half the number of qubits, H represents the Hadamard transform, which is used to provide superposition states and increase the complexity of quantum information, and U(θ) represents the unitary transform, which is used to adjust the phase, where θ is the phase rotation angle, providing additional protection for the generation of the private key.
[0109] S42: Encrypt the input quantum state data using a cryptographic unitary transformation based on the entangled key state of the public key to obtain encrypted quantum state data.
[0110] Specifically, the encrypted unitary transformation satisfies the following formula:
[0111]
[0112] Where the rotation angle θ ~ U[0,π / 2] and the phase φ ~ U[0,2π], it means that θ and φ are random variables uniformly distributed on the interval [0,π / 2].
[0113] R x (θ i The gate is a rotation on the X-axis, used to introduce randomness, disrupt the phase of quantum states, and enhance the key space;
[0114]
[0115] R z (φ j The gate is a rotation on the Z-axis used to adjust the global phase, in conjunction with R. x This allows for the implementation of a general single-bit unitary transform.
[0116]
[0117] This represents the tensor product of k CNOT gates, used to establish entanglement between key bits and data bits;
[0118] Generate the final encrypted state Among them, U e This refers to the encrypted unitary transform described above; It is the entangled key state of the public key; This represents the quantum state corresponding to the original data, in the form described above; Let represent the tensor product of m qubits in the ground state 0.
[0119] In an optional embodiment, it further includes: constructing a homomorphic linear filter and a controlled rotary gate.
[0120] Understandably, constructing linear filters based on quantum homomorphisms can be used in quantum convolutional layers to address the problem that computational complexity grows superlinearly with the number of operations, making it difficult to meet real-time requirements, while ensuring data privacy.
[0121] Specifically, homomorphic linear filtering satisfies the following formula:
[0122]
[0123] Among them, U i For local pixel transformation, w i Let be the i-th weight of the filter kernel, and M be the total number of weights in the filter kernel;
[0124] A controlled spin gate can perform conditional rotation operations on a target qubit based on the state of the control qubit. The controlled spin gate satisfies the following formula:
[0125]
[0126] S5: Construct and train a quantum neural network model.
[0127] The quantum neural network includes a quantum convolutional layer and a quantum perceptron layer. The quantum convolutional layer is used to perform convolution operations on encrypted quantum state data, and the quantum perceptron layer includes multiple quantum perceptrons. The unitary operator of the quantum perceptron is used to perform unitary transformation on the input quantum state.
[0128] Specifically, constructing a quantum convolutional layer involves: using local regions as the basic units of quantum convolution operations, with each window simultaneously covering the qubits of both the image and text; applying rotation gates in parallel to the image and text bits; and then applying cross-modal CNOT gates according to the adjacent connection pattern, ultimately forming a quantum convolution kernel operation U. conv It satisfies the following formula:
[0129]
[0130] Among them, U first The symbol represents the first unitary transformation in the convolution operation, used for preprocessing quantum states; CNOT ij Representing the controlled-NOT gate in quantum computing, it has a control bit and a target bit. When the control bit is 1, the target bit is flipped; otherwise, the target bit remains unchanged. The subscripts indicate the position indices of the control bit and the target bit. last The last unitary transformation in the convolution operation is used to adjust the phase and amplitude of the quantum state. The ellipsis indicates that there are multiple different CNOT operations, and ∏ indicates that a series of operations are multiplied consecutively.
[0131] unitary operator of quantum perception Satisfy the following formula:
[0132]
[0133] Among them, R X R Y R Z The matrix representing rotation operations corresponds to rotation transformations along the X, Y, and Z axes, used to adjust the state of the qubit. Represents the first rotation angle. Represents the second rotation angle. Represents the third rotation angle, CONT img→text This represents a continuous image-to-text conversion, using the image state as the control bits and the text state as the target bits, performing a controlled NOT gate operation. (CONT) text→img This represents the conversion from text to image, and the operation is similar to that of image to text conversion.
[0134] Understandably, the output quantum state of the quantum perceptron layer serves as the input to the next layer, and inter-layer information transfer is achieved through operations such as the tensor product of quantum states.
[0135] The operation of inter-layer connections is as follows:
[0136]
[0137] in, This represents the input quantum state of the (j+1)th layer, which is the input to the next layer. Represents the first output substate. This represents the second output substate. This represents the j-th output sub-state.
[0138] Understandably, the training process of a quantum neural network includes: forward propagation of input samples, calculation of the cross-entropy loss function L, calculation of the gradient through quantum backpropagation, and updating of the network parameters θ.
[0139] The cross-entropy loss function L satisfies the following formula:
[0140]
[0141] Where y represents the category label, and q(y) is the probability distribution of the true label. This represents the probability distribution output by the model. These are the parameters for the model's output layer, used to generate class probabilities.
[0142] The formula for calculating the quantum backpropagation gradient is shown below:
[0143]
[0144] in, The partial derivative of the loss function L with respect to the network parameters represents the impact of parameter changes on the loss and is used for parameter updates. This represents the partial derivative of the loss function L with respect to the model output parameters, indicating the impact of changes in the parameters of the model output layer on the loss. θ represents the partial derivatives of the model output parameters with respect to the network parameters, describing the chain relationship in which the model parameters indirectly affect the loss through the output; j This represents the j-th network parameter.
[0145] S6: Input the encrypted quantum state data into the trained quantum neural network for analysis to obtain the matching results.
[0146] The encrypted quantum state data is input into the trained quantum neural network for analysis to obtain matching results, including:
[0147] S61: Input the encrypted quantum-encoded data into the trained quantum neural network for feature extraction and analysis to obtain the final output quantum state.
[0148] S62: Perform multiple projection measurements on the final output quantum state and statistically analyze the probability values corresponding to different labels.
[0149] S63: Use the tag with the highest probability value as the matching result.
[0150] This application provides a homomorphic image-text matching method based on a quantum hybrid neural network. The method receives image and text information to be processed, performs dimensionality reduction on the image information to obtain a dimensionality-reduced image vector, and extracts word vectors from the text information to obtain text word vectors. The dimensionality-reduced image vector and text word vectors are concatenated to obtain a concatenated vector to be processed. Quantum amplitude encoding is used to encode the concatenated vector into quantum state data. A quantum homomorphic encryption algorithm is used to encrypt the quantum state data to obtain encrypted quantum state data. A quantum neural network model is constructed and trained. The encrypted quantum state data is input into the trained quantum neural network model for analysis to obtain matching results, thus improving processing efficiency and data transmission security.
[0151] Figure 2 This is a schematic diagram of the structure of a homomorphic image-text matching device based on a quantum hybrid neural network provided in an embodiment of this application. Figure 2 As shown, the homomorphic image-text matching device 200 based on a quantum hybrid neural network provided in this embodiment includes:
[0152] The first processing module 201 is used to receive image information and text information to be processed, perform dimensionality reduction processing on the image information to obtain dimensionality reduction image vectors, and extract word vectors from the text information to obtain text word vectors.
[0153] The second processing module 202 is used to concatenate the dimensionality-reduced image vector and the text word vector to obtain the concatenated vector to be processed.
[0154] Encoding module 203 is used to encode the spliced vector to be processed into quantum state data using quantum amplitude encoding;
[0155] Encryption module 204 is used to encrypt quantum state data using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data;
[0156] Build training model 205 to build and train a quantum neural network model;
[0157] The third processing module 206 is used to input encrypted quantum state data into the trained quantum neural network model for analysis and obtain matching results.
[0158] The homomorphic image-text matching device based on quantum hybrid neural network provided in this embodiment can execute the homomorphic image-text matching method based on quantum hybrid neural network provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0159] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0160] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A homomorphic image-text matching method based on quantum hybrid neural networks, characterized in that, The method includes: The system receives image and text information to be processed, performs dimensionality reduction on the image information to obtain a dimensionality-reduced image vector, and extracts word vectors from the text information to obtain text word vectors. The dimensionality-reduced image vector and the text word vector are concatenated to obtain the concatenated vector to be processed. Quantum amplitude encoding is used to encode the spliced vector to be processed into quantum state data; The quantum state data is encrypted using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data; Construct and train a quantum neural network model; The encrypted quantum state data is input into the trained quantum neural network model for analysis to obtain matching results.
2. The method according to claim 1, characterized in that, The step of dimensionality reduction processing of image information to obtain a dimensionality-reduced image vector includes: The original data matrix corresponding to the image information is centered, and the covariance matrix is calculated based on the centered data matrix. Perform eigenvalue decomposition on the covariance matrix and construct the projection matrix based on the eigenvectors corresponding to the first k largest eigenvalues; Multiplying the original data matrix by the projection matrix yields the reduced-dimensional image vector.
3. The method according to claim 1, characterized in that, The step of extracting word vectors from text information to obtain text word vectors includes: The text information is preprocessed, and the preprocessed text information is input into a pre-trained teacher model for analysis and processing to obtain the first text word vector. The teacher model is a BERT model. The first text word vectors are used as soft labels to train the student model, and the student model is optimized based on a preset optimization objective. The student model is a lightweight language model, and the optimization objective is to minimize the error between the output results of the teacher model and the student model. The word vectors of the second text are obtained by extracting word vectors from the text information based on the trained and optimized student model.
4. The method according to claim 1, characterized in that, The process of encoding the concatenated vector into quantum state data using quantum amplitude encoding includes: The number of qubits is determined based on the dimension of the vector to be processed; The values of the vector to be processed are normalized to obtain normalized values; When the number of qubits is 1, quantum state data is constructed based on the normalized value; When the number of qubits is greater than 1, quantum state data is constructed through tensor product operations.
5. The method according to claim 4, characterized in that, The process of encrypting quantum state data using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data includes: Generate an entangled key state for the public key, and use half of the qubits as the private key after unitary transformation; The input quantum state data is encrypted using a cryptographic unitary transformation based on the entangled key state of the public key, resulting in encrypted quantum state data.
6. The method according to claim 1, characterized in that, The quantum neural network model includes a quantum convolutional layer and a quantum perceptron layer. The quantum convolutional layer is used to perform convolution operations on encrypted quantum state data. The quantum perceptron layer includes multiple quantum perceptrons, and each quantum perceptron includes a unitary operator. The convolution operation U of the quantum convolution layer conv It satisfies the following formula: Among them, U first CNOT represents the first unitary transform in the convolution operation. ij This represents a controlled NOT gate in quantum computing, where ij and ij represent the position indices of the control bit and the target bit, respectively; U last Π represents the last unitary transformation in the convolution operation, and Π represents the continuous multiplication of multiple CNOT operations. unitary operator of quantum perception Satisfy the following formula: Among them, R X R Y R Z Let be the matrix representing the rotation operation, corresponding to the rotation transformations along the X, Y, and Z axes. Represents the first rotation angle. Represents the second rotation angle. Represents the third rotation angle, CONT img→text This represents a continuous image-to-text conversion, using the image state as the control bits and the text state as the target bits to perform a controlled NOT gate operation. OCNT text→img This represents the conversion from text to image, performing a controlled NOT gate operation with the text state as the control bits and the image state as the target bits.
7. The method according to claim 1, characterized in that, The process of inputting encrypted quantum state data into a trained quantum neural network for analysis to obtain matching results includes: The encrypted quantum-encoded data is input into the trained quantum neural network for feature extraction and analysis to obtain the final output quantum state; The final output quantum state is subjected to multiple projection measurements, and the probability values corresponding to different labels are statistically analyzed. The tag with the highest probability value is used as the matching result.
8. A homomorphic image-text matching device based on a quantum hybrid neural network, characterized in that, The device includes: The first processing module is used to receive image information and text information to be processed, perform dimensionality reduction processing on the image information to obtain dimensionality reduction image vectors, and extract word vectors from the text information to obtain text word vectors. The second processing module is used to concatenate the dimensionality-reduced image vector and the text word vector to obtain the concatenated vector to be processed. The encoding module is used to encode the spliced vector to be processed into quantum state data using quantum amplitude encoding; The encryption module is used to encrypt quantum state data using a quantum homomorphic encryption algorithm to obtain encrypted quantum state data; Construct a training module to build and train a quantum neural network model; The third processing module is used to input encrypted quantum state data into the trained quantum neural network model for analysis and to obtain matching results.