CN117745512A - Quantum computation-based image processing method, device, electronic equipment and medium - Google Patents
Quantum computation-based image processing method, device, electronic equipment and medium Download PDFInfo
- Publication number
- CN117745512A CN117745512A CN202311767682.4A CN202311767682A CN117745512A CN 117745512 A CN117745512 A CN 117745512A CN 202311767682 A CN202311767682 A CN 202311767682A CN 117745512 A CN117745512 A CN 117745512A
- Authority
- CN
- China
- Prior art keywords
- target
- sub
- input
- image
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000012545 processing Methods 0.000 claims abstract description 536
- 238000005259 measurement Methods 0.000 claims abstract description 128
- 238000012549 training Methods 0.000 claims description 130
- 238000000034 method Methods 0.000 claims description 96
- 230000008569 process Effects 0.000 claims description 44
- 230000004044 response Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 12
- 230000003247 decreasing effect Effects 0.000 claims description 4
- 238000013473 artificial intelligence Methods 0.000 abstract description 9
- 238000013135 deep learning Methods 0.000 abstract description 3
- 239000011159 matrix material Substances 0.000 description 35
- 238000010586 diagram Methods 0.000 description 20
- 238000013527 convolutional neural network Methods 0.000 description 16
- 238000004891 communication Methods 0.000 description 8
- 238000004148 unit process Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 238000010191 image analysis Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 238000000605 extraction Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000003058 natural language processing Methods 0.000 description 2
- 238000012805 post-processing Methods 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 102000004169 proteins and genes Human genes 0.000 description 1
- 108090000623 proteins and genes Proteins 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010977 unit operation Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Image Analysis (AREA)
Abstract
The disclosure provides an image processing method, relates to the technical field of artificial intelligence, and particularly relates to the technical fields of quantum computing, deep learning, computer vision, large models and the like. The specific implementation scheme is as follows: dividing an input image to obtain N input image blocks; respectively processing at least one input image block by utilizing a plurality of quantum processing units according to target indication information to obtain a plurality of measurement results, wherein the target indication information comprises a plurality of target indication sub-information which is used for indicating at least one input image block corresponding to the quantum processing units; and determining a processing result of the input image according to the plurality of measurement results. The present disclosure also provides an image processing apparatus, an electronic device, and a storage medium.
Description
Technical Field
The disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of quantum computing, deep learning, computer vision, large models and the like, and can be applied to scenes such as social media image analysis, intelligent traffic monitoring, face recognition, medical image analysis and the like. More specifically, the present disclosure provides an image processing method, apparatus, electronic device, and storage medium.
Background
With the development of artificial intelligence and quantum computing technology, quantum computing technology can be introduced into artificial intelligence tasks to improve the execution efficiency of the artificial intelligence tasks.
Disclosure of Invention
The present disclosure provides an image processing method, apparatus, device, and storage medium.
According to an aspect of the present disclosure, there is provided an image processing method including: dividing an input image to obtain N input image blocks, wherein N is an integer greater than 1; according to target indication information, at least one input image block is processed by utilizing a plurality of quantum processing units to obtain a plurality of measurement results, wherein the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on initial prompt texts, the prompt texts of the target adjustment periods in the at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of reference images and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by utilizing the plurality of quantum processing units to process at least one reference image block of the reference images respectively.
According to another aspect of the present disclosure, there is provided a training method of an image processing model including a plurality of quantum processing units, the method including: dividing an input sample image to obtain N input sample image blocks, wherein N is an integer greater than 1; respectively processing at least one input sample image block by utilizing a plurality of quantum processing units according to target sample indication information to obtain a plurality of sample measurement results, wherein the target sample indication information comprises a plurality of target sample indication sub-information, the target sample indication sub-information is used for indicating at least one input sample image block corresponding to the quantum processing units, and the number of the input sample image blocks processed by the at least one quantum processing unit is smaller than N; and adjusting respective parameter information of the plurality of quantum processing units according to labels of the input sample image and a plurality of sample measurement results to train the image processing model, wherein target sample indication information is determined according to target sample prompt texts, the target sample prompt texts are determined after at least one pre-training period of initial sample prompt texts is performed, the prompt texts of the target pre-training period in the at least one pre-training period are obtained according to the initial sample prompt texts, the indication information of the target pre-training period is adjusted according to the labels of the reference image and output results of the target pre-training period, and the output results of the target pre-training period are obtained by respectively processing at least one reference image block of the reference image by utilizing the plurality of quantum processing units.
According to another aspect of the present disclosure, there is provided a quantum processing apparatus, the apparatus comprising: the quantum execution units are configured to respectively process at least one input image block to obtain a plurality of measurement results, wherein the at least one input image block is determined from N input image blocks according to target indication information, the input image blocks are obtained by dividing an input image, and N is an integer greater than 1; and the output unit is configured to determine processing results of the input image according to a plurality of measurement results, wherein the number of the input image blocks processed by the at least one quantum processing unit is smaller than N, the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on the initial prompt texts, the prompt texts of the target adjustment periods in the at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of the reference image and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by respectively processing at least one reference image block of the reference image by utilizing the plurality of quantum processing units.
According to another aspect of the present disclosure, there is provided a quantum processing apparatus, the apparatus comprising: the present disclosure provides a quantum processing apparatus.
According to another aspect of the present disclosure, there is provided an image processing apparatus including: the first dividing module is used for dividing the input image to obtain N input image blocks, wherein N is an integer greater than 1; the first quantum processing module is used for respectively processing at least one input image block by utilizing a plurality of quantum processing units according to target indication information to obtain a plurality of measurement results, wherein the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on initial prompt texts, the prompt texts of the target adjustment periods in the at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of reference images and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by respectively processing at least one reference image block of the reference images by utilizing the plurality of quantum processing units.
According to another aspect of the present disclosure, there is provided a training apparatus of an image processing model including a plurality of quantum processing units, the apparatus including: the second dividing module is used for dividing the input sample image to obtain N input sample image blocks, wherein N is an integer greater than 1; the second quantum processing module is used for respectively processing at least one input sample image block by utilizing a plurality of quantum processing units according to target sample indication information to obtain a plurality of sample measurement results, wherein the target sample indication information comprises a plurality of target sample indication sub-information, the target sample indication sub-information is used for indicating at least one input sample image block corresponding to the quantum processing units, and the number of the input sample image blocks processed by the at least one quantum processing unit is smaller than N; and the training module is used for adjusting the parameter information of each of the plurality of quantum processing units according to the labels of the input sample images and the plurality of sample measurement results so as to train the image processing model, wherein the target sample indication information is determined according to target sample prompt texts, the target sample prompt texts are determined after at least one pre-training period of pre-training is carried out on initial sample prompt texts, the prompt texts of the target pre-training period in the at least one pre-training period are obtained according to the initial sample prompt texts, the indication information of the target pre-training period is adjusted according to the labels of the reference images and the output results of the target pre-training period, and the output results of the target pre-training period are obtained by respectively processing at least one reference image block of the reference images by the plurality of quantum processing units.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method provided in accordance with the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method provided according to the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method provided according to the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic flow chart of an image processing method according to one embodiment of the disclosure;
FIG. 2A is a schematic diagram of an input image according to one embodiment of the present disclosure;
FIG. 2B is a schematic illustration of an input image according to another embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a quantum processing unit according to one embodiment of the present disclosure;
FIG. 4 is a schematic diagram of determining target indication information according to one embodiment of the present disclosure;
FIG. 5 is a schematic flow chart diagram of a training method of an image processing model according to one embodiment of the disclosure;
fig. 6 is a schematic diagram of a quantum processing device according to one embodiment of the present disclosure;
FIG. 7 is a schematic block diagram of a quantum processing device according to one embodiment of the present disclosure;
fig. 8 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure;
FIG. 9 is a block diagram of a training apparatus of an image processing model according to one embodiment of the present disclosure; and
fig. 10 is a block diagram of an electronic device to which an image processing method may be applied according to one embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The artificial intelligence technology can be applied to the technical field of computer vision, the technical field of natural language processing and the technical field of audio processing. Taking the computer vision field as an example, image classification is a critical task in the computer vision field. The purpose of the image classification task is: the category of the input image is automatically determined. The category may be user-defined. With the continued development of deep learning and Convolutional Neural Networks (CNNs), image classification is widely used in many subdivision areas. For example, the subdivision domain may include image recognition of social media, intelligent traffic monitoring, face recognition techniques, medical image analysis, and so forth. These applications make image classification more and more important. Image classification helps people better understand and interpret various visual information in the real world.
With the continuous development of quantum computing technology, researchers begin to introduce quantum computing into image classification tasks, and quantum neural network models (QNNs) are proposed. Among quantum convolutional neural network models, quantum convolutional neural networks (qnns) are an important model. Under the inspired of a classical convolutional neural network, a quantum convolutional neural network can use a quantum convolutional kernel to extract characteristic information of an image. However, unlike the accelerated training of classical convolutional neural networks with Graphics Processing Units (GPUs), it is difficult to significantly accelerate the operation of quantum convolutional neural networks with hardware devices. In addition, running a Quantum convolutional neural network on a noisy mesoscale Quantum (NISQ) device can be very time consuming. The reason is that the operation of the quantum convolutional neural network requires a large number of quantum circuit operations and obtains a correspondingly large number of quantum measurement results. For example, for a 28x28 pixel gray scale image, a 4 qubit quantum convolution kernel may be used to process a 2x2 local area at a time with a sliding step of 2. Thus, a single quantum convolution layer would need to run 196 quantum circuits and obtain corresponding 196 quantum measurements.
Furthermore, the graphics processing unit may implement parallel data processing. In the case of acceleration with a graphics processing unit, multiple convolution kernels may each process all of the run-time regions of an image in parallel to obtain features of different scales for the image. The resource cost of the graphic processing unit is lower, and the resource cost of the quantum device is higher. In order to realize efficient and low-cost image processing, parameters of the quantum convolution kernel can be adjusted in the field of quantum computation so as to reduce resource overhead required by the quantum convolution kernel. For example, quantum convolution kernels with greater expressive power may be developed, and the total number of quantum convolution kernels may be reduced.
In addition, quantum hardware resources limit the application of large-scale parameterized quantum circuits (Parameterized Quantum Circuit, PQC) and also limit the number of quantum measurement operations performed, resulting in limited performance of the quantum convolutional neural network. In the image classification task, there is a local similarity of images. Thus, in the case where the quantum convolution kernel processes the entire image, redundant information may be generated. This presents challenges for both model performance and efficiency.
In some embodiments, a plurality of image blocks of an input image may be determined. All image blocks may be processed sequentially. In processing each image block, a plurality of pixels of a sub-image block of the image block may be encoded into a quantum state, which is processed with a parameterized quantum circuit to obtain a measurement feature. Then, the measurement characteristics of the plurality of image blocks of each of the plurality of parameterized quantum circuits are processed by using the full connection layer, and an image processing result can be obtained. For example, taking an example in which the size of the input image is 12×12, the number of parameterized quantum circuits of 4 qubits may be 4, and the number of image blocks may be 3. To process the entire image block, the number of runs of each parameterized quantum circuit may be 36. The number of parameters of the full connection layer may be 288.
However, the parameterized quantum circuit needs to be operated for multiple times to process all sub-image blocks of the image, and the number of obtained measurement features is large, so that the resource cost is high and the operation efficiency is low. In addition, as described above, when the parameterized quantum circuit processes the whole image, redundant information is generated, and some same or similar characteristics are obtained, so that parameters of the full connection layer are too many, and the accuracy of the processing result cannot be effectively improved.
In the field of artificial intelligence, the application of large models is also increasing. The large models may include Large Language Models (LLMs), large Visual Models (LVMs), and the like. The large model can be used for weather prediction and also can be used for predicting protein structure.
Accordingly, in order to effectively utilize the resources of the quantum hardware device, the present disclosure provides an image processing method, which will be described below.
Fig. 1 is a schematic flow chart of an image processing method according to one embodiment of the present disclosure.
As shown in fig. 1, the method 100 may include operations S110 to S130.
In operation S110, an input image is divided to obtain N input image blocks.
In the disclosed embodiments, the input image may be divided in various ways. N may be an integer greater than 1. The N input image blocks may include input image blocks P1, … … input image blocks PN. For example, taking n=3 as an example, if the size of the input image is 12×12, the input image may be divided into 3 input image blocks. The size of the input image block may be 12×4. The 3 input image blocks may include an input image block P1, an input image block P2, and an input image block P3.
In operation S120, at least one input image block is processed by a plurality of quantum processing units according to the target instruction information, respectively, to obtain a plurality of measurement results.
In an embodiment of the present disclosure, the plurality of quantum processing units may be K. K may be an integer greater than 1. For example, K may be 4.
In embodiments of the present disclosure, the quantum processing unit may be a parameterized quantum circuit. For example, the quantum processing unit may be a parameterized quantum circuit comprising 4 quantum bits (qubits). The quantum processing unit may process 2 x 2 image blocks.
In the embodiment of the present disclosure, the target indication information may include target indication sub-information. The target indication sub-information may indicate at least one input image block corresponding to the quantum processing unit. For example, first target indicating sub-information among the plurality of target indicating sub-information may indicate that the first quantum processing unit corresponds to the input image block P1 and the input image block P2. The input image block P1 and the input image block P2 may be processed using a first quantum processing unit. As another example, taking k=4 as an example, the plurality of target-indicating sub-information may include 4 target-indicating sub-information.
In an embodiment of the present disclosure, the number of input image blocks processed by the at least one quantum processing unit is less than N. For example, if the target instruction sub-information may indicate M input image blocks corresponding to the quantum processing unit, the plurality of measurement results may be k×m measurement results. M may be an integer greater than or equal to 1 and less than N. For example, taking m=2 as an example, after the input image block P1 and the input image block P2 are processed by the first quantum processing unit, a measurement result corresponding to the input image block P1 may be obtained, or a measurement result corresponding to the input image block P2 may be obtained. It will be appreciated that the number of input image blocks indicated by the different target indicator sub-information may be different or the same, which is not limited by the present disclosure.
In an embodiment of the present disclosure, the target indication information is determined based on the target prompt text. For example, a large language model may process prompt text (prompt). The target prompt text can be input into a large language model to obtain target indication information. The large language model may be, for example, a text-to-speech model.
In an embodiment of the present disclosure, the target prompt text is determined after an adjustment of the initial prompt text by at least one adjustment period. For example, the initial prompt text may describe a reference image, or may describe a quantum processing unit.
In an embodiment of the present disclosure, the prompt text for the target adjustment period of the at least one adjustment period is derived from the initial prompt text. For example, if the target adjustment period is the 1 st adjustment period of the at least one adjustment period, the initial prompt text may be regarded as the prompt text of the target adjustment period. For another example, if the target adjustment period is not the 1 st adjustment period, the prompt text of the target adjustment period may be obtained by at least one adjustment of the initial prompt text.
In the embodiment of the disclosure, the prompt text of the target adjustment period is adjusted according to the label of the reference image and the output result of the target adjustment period, wherein the output result of the target adjustment period is obtained by respectively processing at least one reference image block of the reference image by utilizing a plurality of quantum processing units. For example, each quantum processing unit may process at least one reference image block. The hint text of the target adjustment period may be adjusted based on a difference between the tag of the reference image and the output result of the target adjustment period. The number of reference image blocks processed by each quantum processing unit may be less than or equal to N. The number of reference image blocks processed by the different amount sub-processing units may be the same or different, and the present disclosure is not limited thereto.
In operation S130, a processing result of the input image is determined according to the plurality of measurement results.
In the embodiments of the present disclosure, from a plurality of measurement results, a classification result of an input image may be determined.
According to the embodiment of the disclosure, the quantum processing unit processes at least one image block, so that the operation times of the quantum processing unit can be reduced, the resource cost required by image processing is further reduced, and the image processing efficiency is improved. In addition, the target prompt text is obtained after at least one adjustment period of the initial prompt text is adjusted. Therefore, the target indication information determined by the target prompt text can effectively indicate important areas in the image, so that the quantum processing unit can process the important areas in the image to improve the image processing precision, the probability of processing similar image blocks by the same quantum processing unit can be reduced, the information redundancy can be reduced, the image processing efficiency can be further improved under the condition of ensuring the image processing precision, and the resource cost of the quantum equipment can be obviously reduced.
It will be appreciated that, as described above, with a graphics processing unit, multiple convolution kernels may process all areas of an image in parallel, as well as all image blocks of an input image. The resource cost of the graphics processing unit is low. The resource overhead required for the multiple convolution kernels deployed in the graphics processing unit to process all image blocks separately is still low compared to quantum processing devices. In the case where the resource cost of the quantum processing units is high, it is difficult to improve the efficiency of processing images by the plurality of quantum processing units by using the parallel processing technique. According to the embodiment of the disclosure, the number of the image blocks processed by the at least one quantum processing unit is smaller than N, so that the resource cost required by image processing can be effectively reduced, and the image processing efficiency is improved.
It will also be appreciated that in the case of parallel processing of all image blocks using multiple convolution kernels, the convolution kernels may make full use of all information of the image to achieve higher image processing accuracy. However, in order to increase the efficiency of the quantum processing unit to process an image, the quantum processing unit may not process all image blocks. According to the embodiment of the disclosure, based on the target prompt text obtained after at least one adjustment, the large language model can accurately determine the indication information so as to reasonably utilize limited quantum computing resources to process the image block, and the image processing precision can be remarkably improved. Under the condition of improving the image processing efficiency, the method is also beneficial to improving the image processing precision and reducing the resource cost of the quantum equipment.
It will be appreciated that the quantum processing unit described above may implement convolution processing. That is, the quantum processing unit may act as a quantum convolution kernel for the quantum convolution neural network. It will also be appreciated that other operations in the field of artificial intelligence may also be implemented by the quantum processing unit, which is not limited by the present disclosure.
It will be appreciated that, while the image processing method of the present disclosure is described above, the manner of dividing the input image will be further described below.
In the disclosed embodiments, the input image may be divided in various ways. For example, taking n=3 as an example, if the size of the input image is 12×12, the input image may be divided into 3 input image blocks. The size of the input image block may be 4×12 or 12×4. For another example, taking n=4 as an example, if the size of the input image is 12×12, the input image may be divided into 3 input image blocks. The size of the input image block may be 12×3 or 6×6. Next, a division manner of an input image will be described in one step with reference to fig. 2A and 2B taking n=3 and the size of an input image block as an example of 12×4.
Fig. 2A is a schematic diagram of an input image according to one embodiment of the present disclosure.
As shown in fig. 2A, the image I200 may be an input image, and may be divided into 3 input image blocks. The 3 input image blocks may include an input image block P201, an input image block P202, and an input image block P203.
Fig. 2B is a schematic diagram of an input image according to another embodiment of the present disclosure.
As shown in fig. 2B, the input image I210 may also be an input image, and may be divided into 3 input image blocks. The 3 input image blocks may include an input image block P211, an input image block P212, and an input image block P213. The input image block P211 may be the above-described input image block P1. The input image block P212 may be the input image block P2 described above. The input image block P213 may be the above-described input image block P3.
It will be appreciated that the input image of the present disclosure is described above, and the target instruction information of the present disclosure will be described below.
In some embodiments, the target indication information may include a target matrix. The target indication sub-information may be target row data of a target matrix.
In the disclosed embodiments, the number of rows of the target matrix may be consistent with the number of quantum processing units. The number of columns of the target matrix may be consistent with the number of input image blocks. For example, as described above, the number of quantum processing units may be K, and the number of input image blocks may be N. Thus, the target matrix may be a kxn matrix.
For another example, taking k=4 and n=3 as an example, the target matrix B may be:
in an embodiment of the present disclosure, the plurality of target-indicating sub-information may include first to fourth target-indicating sub-information. The first, second, third and fourth target-indicating sub-information may be row 1, row 2, row 3 and row 4, respectively, of the target matrix B. Row 1 of the target matrix B may indicate: the at least one input image block corresponding to the first quantum processing unit includes the above-described input image block P1 and the above-described input image block P2. Thereby, the input image block P1 and the input image block P2 can be processed by the first quantum processing unit. Row 2 of the target matrix B may indicate: the at least one input image block corresponding to the second quantum processing unit includes the above-described input image block P1 and the above-described input image block P2. Thereby, the input image block P1 and the input image block P2 can be processed by the second quantum processing unit. Row 3 of the target matrix B may indicate: the at least one input image block corresponding to the third quantum processing unit includes the above-described input image block P2 and the above-described input image block P3. Thereby, the input image block P2 and the input image block P3 can be processed by the third quantum processing unit. Row 4 of the target matrix B may indicate: at least one input image block corresponding to the fourth quantum processing unit includes the above-described input image block P2 and the above-described input image block P3. Thereby, the input image block P2 and the input image block P3 can be processed by the fourth quantum processing unit.
It will be appreciated that the target matrix B may be obtained from target prompt text using various natural language processing models. According to the embodiment of the disclosure, at least one image block to be processed by the quantum processing unit is indicated by the data in the target matrix, so that information redundancy can be reduced, the accuracy of image processing cannot be affected, limited quantum computing resources can be fully utilized, and the image processing efficiency is improved.
It will be appreciated that the target indication information of the present disclosure is described above, and the quantum processing unit of the present disclosure will be further described below.
In some embodiments, processing the at least one input image block with the plurality of quantum processing units, respectively, according to the target indication information, to obtain a plurality of measurement results includes: and processing at least one input image block indicated by the target indicator information by utilizing a quantum processing unit corresponding to the target indicator information to obtain at least one measurement result.
In an embodiment of the disclosure, the quantum processing unit processes at least one input image block, and at least one measurement result may be obtained.
For example, as described above, row 1 of the target matrix B may indicate that the first quantum processing unit corresponds to the input image block P1 and the input image block P2. Taking the above-described input image block P1 as an example, the size of the input image block P1 may be 12×4. In the case of a parameterized quantum circuit with 4 qubits for the quantum processing unit, the size of the input sub-image block may be 2 x 2. The number of input sub-picture blocks in the input picture block P1 may be 12. The input image block P2 may also include 12 input sub-image blocks. The following will explain in conjunction with fig. 3 and taking a manner in which the first quantum processing unit processes the input image block P1 as an example.
Fig. 3 is a schematic diagram of a quantum processing unit according to one embodiment of the present disclosure.
The quantum processing unit PQC310 as shown in fig. 3 may be the first quantum processing unit described above. The input image block P311 shown in fig. 3 may be the above-described input image block P1.
In an embodiment of the present disclosure, processing at least one input image block indicated by target instruction sub-information using a quantum processing unit corresponding to the target instruction sub-information includes: the plurality of input sub-image blocks are sequentially processed using a quantum processing unit corresponding to the target instruction sub-information. As shown in fig. 3, the input image block P311 may include an input sub-image block P3111, input sub-image blocks P3112, … …, and input sub-image block P31112. The quantum processing unit PQC310 may sequentially process the input sub-picture block P3111, the input sub-picture blocks P3112, … …, and the input sub-picture block P31112. According to the embodiment of the disclosure, the quantum processing unit can be accurately utilized to process the image, the effective information in the image block is fully utilized, and the accuracy of image processing can be improved.
In an embodiment of the present disclosure, a quantum processing unit may include an encoding module including a plurality of single bit rotator gates and a processing module. As shown in fig. 3, the quantum processing unit PQC310 may include a coding module QE311 and a processing module QP312. The encoding module QE311 may include a plurality of single bit rotation gates.
In an embodiment of the present disclosure, sequentially processing a plurality of input sub-image blocks using a quantum processing unit corresponding to target instruction sub-information includes: and respectively inputting a plurality of pixels of the target input sub-image block into a plurality of single-bit rotating gates, so that a plurality of encoding results of the target input sub-image block can be obtained. The target input sub-image block is from a plurality of input sub-image blocks. For example, the input sub-image block P3111 may be set as a target input sub-image block. The pixels of the input sub-image block P3111 are input to the single-bit rotation gates of the encoding module QE311 to encode the pixels into quantum states, resulting in encoding results of the input sub-image block P311. The plurality of pixels may be 4 pixels. Taking the example that the pixel values of 4 pixels are 0.1, 0.3, 0.5, and 0.2, respectively, the rotation angles of 4 single bit rotation gates of the encoding module QE311 can be taken as 4 pixels, respectively. Thereby, a single bit rotary door R can be obtained y (0.1), one-bit rotary door R y (0.3), one-bit rotary door R y (0.5), one-bit rotary door R y (0.2) to obtain 4 encoding results. Through the embodiment of the disclosure, the pixels can be quickly and efficiently encoded into quantum states by utilizing a plurality of single-bit rotating gates, which is helpful for Further improving the image processing efficiency.
In an embodiment of the present disclosure, sequentially processing a plurality of input sub-image blocks using a quantum processing unit corresponding to target instruction sub-information includes: and processing a plurality of encoding results of the target input sub-image block by using the processing module, so that the output state of the target input sub-image block can be obtained.
In the disclosed embodiments, the processing module may include a plurality of cascaded processing sub-modules. As shown in fig. 3, the processing module QP312 may include a processing sub-module QP3121, a processing sub-module QP3122, and a processing sub-module QP3123. The processing submodule QP3121 may be a first-level processing submodule. The post-processing sub-module of the processing sub-module QP3121 may be a processing sub-module QP3122. The preceding processing sub-module of processing sub-module QP3122 may be QP3121. The post-processing sub-module of the processing sub-module QP3122 may be a processing sub-module QP3123. The processing submodule QP3123 may be a last-stage processing submodule.
In the disclosed embodiments, the processing sub-module may include a plurality of controlled NOT gates and a plurality of single bit rotator gates. As shown in fig. 3, the processing sub-modules QP3121, QP3122, and QP3123 may include multiple controlled not gates and multiple single-bit rotation gates, respectively. The plurality of single-bit rotation gates of the processing sub-module QP3121 may include a single-bit rotation gate R y (θ 1 ) Single-bit rotary door R y (θ 2 ) Single-bit rotary door R y (θ 3 ) One-bit rotary gate R y (θ 4 ). The plurality of single-bit rotation gates of the processing sub-module QP3122 may include a single-bit rotation gate R y (θ 5 ) Single-bit rotary door R y (θ 6 ) Single-bit rotary door R y (θ 7 ) One-bit rotary gate R y (θ 8 ). The plurality of single-bit rotation gates of the processing sub-module QP3123 may include a single-bit rotation gate R y (θ 9 ) Single-bit rotary door R y (θ 10 ) Single-bit rotary door R y (θ 11 ) One-bit rotary gate R y (θ 12 )。
In an embodiment of the present disclosure, processing, by a processing module, a plurality of encoding results of a target input sub-image block, and obtaining an output state of the target input sub-image block includes: and inputting the plurality of to-be-processed data of the target input sub-image block into a plurality of controlled NOT gates of the processing sub-module to obtain a plurality of first processed data. The plurality of data to be processed of the target input sub-image block is determined based on a plurality of encoding results of the target input sub-image block. And inputting the first processed data into a plurality of single-bit turngates of the processing submodule to obtain second processed data.
In the embodiments of the present disclosure, the data to be processed may include the encoding result. For example, for the processing sub-module QP3121, multiple encoding results of the target input sub-image block may be treated as multiple pieces of data to be processed. The plurality of encoding results are input to the plurality of controlled NOT gates of the processing sub-module QP3121 resulting in a plurality of first processed data of the processing sub-module QP 3121. The plurality of first processed data of the processing sub-module QP3121 is input to the plurality of single-bit rotation gates of the processing sub-module QP3121, and the plurality of second processed data of the processing sub-module QP3121 can be obtained.
In an embodiment of the disclosure, the data to be processed may further include second processed data output by a preceding processing sub-module of the processing sub-module. For example, for the processing sub-module QP3122, a plurality of second processed data of the processing sub-module QP3121 may be taken as a plurality of data to be processed. The plurality of second processed data of the processing sub-module QP3121 is input to the plurality of controlled not gates of the processing sub-module QP3121, resulting in a plurality of first processed data of the processing sub-module QP 3122. The plurality of first processed data of the processing sub-module QP3122 is input to the plurality of single-bit rotation gates of the processing sub-module QP3122, and the plurality of second processed data of the processing sub-module QP3122 can be obtained. For another example, for the processing sub-module QP3123, a plurality of second processed data of the processing sub-module QP3122 may be used as a plurality of data to be processed. The plurality of second processed data of the processing sub-module QP3122 is input to the plurality of controlled not gates of the processing sub-module QP3123 resulting in a plurality of first processed data of the processing sub-module QP 3123. The plurality of first processed data of the processing sub-module QP3123 is input to the plurality of single-bit rotation gates of the processing sub-module QP3123, and the plurality of second processed data of the processing sub-module QP3123 can be obtained.
In the embodiment of the disclosure, the output state is a plurality of second processed data output by the last stage processing sub-module. For example, the plurality of second processed data of the processing sub-module QP3123 may be the output state of the input sub-picture block P3111. By embodiments of the present disclosure, quantum convolution processing may be implemented using multiple controlled NOT gates and multiple single bit rotator gates. By using a plurality of cascaded processing sub-modules, effective information can be extracted from the input sub-image blocks more effectively, and further, the image processing precision is improved.
In an embodiment of the present disclosure, sequentially processing a plurality of input sub-image blocks using a quantum processing unit corresponding to target instruction sub-information includes: and measuring the output state of the target input sub-image block to obtain a measurement sub-result of the target input sub-image block. For example, the output state of the target input sub-image block P3111 is measured along the Pauli Z operator (Pauli-Z), a measurement sub-result ((ψ|Z|ψ >) v3111 of the target input sub-image block P3111 may be obtained, the measurement sub-result v3111 may be a value greater than-1 and less than 1.
In an embodiment of the present disclosure, sequentially processing the plurality of input sub-image blocks using the quantum processing unit corresponding to the target instruction sub-information further includes: in response to the measurement sub-result of the determined target input sub-image block, a plurality of pixels of a subsequent input sub-image block of the target input sub-image block may be processed. For example, in response to having determined the measurement sub-result v3111 of the input sub-image block P3111, a plurality of pixels of the input sub-image block P3112 may be processed, resulting in the measurement sub-result v3112 of the input image block P3112. After the input sub-image block P3111, the input sub-image blocks P3112, … …, and the input sub-image block P31112 are sequentially processed by the quantum processing unit PQC310, the corresponding measurement sub-result v3111, measurement sub-result v3112, … …, and measurement sub-result v31112 can be obtained. It is understood that the manner in which the quantum processing unit PQC310 processes the input sub-image block P3112 to the input sub-image block P31112 is the same as or similar to the manner in which the input sub-image block P3111 is processed, and this disclosure will not be repeated here. According to the embodiment of the disclosure, all input sub-image blocks are processed in sequence, so that image processing can be performed accurately and comprehensively, the performance of a quantum processing unit can be fully utilized, and the image processing efficiency and accuracy are improved.
In an embodiment of the present disclosure, sequentially processing a plurality of input sub-image blocks using a quantum processing unit corresponding to target instruction sub-information includes: and obtaining a measurement result according to the plurality of measurement sub-results. For example, the measurement result V311 of the input image block P311 can be obtained by measuring the sub-result V31112 from the measurement sub-results V3111, V3112, … ….
It is understood that the quantum processing unit PQC310 may be operated 12 times in order to process the input sub-picture block P3111, the input sub-picture blocks P3112, … …, and the input sub-picture block P31112. As described above, the quantum processing unit PQC310 may be the first processing unit described above. The input image block P311 may be the above-described input image block P1. The first quantum computing unit may also be run 12 times in order to process 12 input sub-image blocks of the input image block P2. Thus, the first quantum processing unit may be run 24 times in total.
In the embodiment of the disclosure, according to the target matrix B, the second quantum processing unit may be used to sequentially process the input image block P1 and the input sub-image blocks of the input image block P2, so as to obtain a measurement result of the input image block P1 and a measurement result of the input image block P2. The third quantum processing unit may be used to sequentially process the input image block P2 and the input image block P3 to obtain a measurement result of the input image block P2 and a measurement result of the input image block P3. The fourth quantum processing unit may be used to sequentially process the input image block P2 and the input image block P3 to obtain a measurement result of the input image block P2 and a measurement result of the input image block P3. Thus, 8 measurement results can be obtained in total. Each measurement may include 12 measurement sub-results. It can be appreciated that the manner in which the second quantum processing unit to the fourth quantum processing unit process the input image block is the same as or similar to the manner in which the first quantum processing unit processes the input image block, and this disclosure is not repeated here.
It will be appreciated that while the quantum processing unit of the present disclosure is described above, some ways of determining the image processing result of the present disclosure will be described below.
In some embodiments, determining the processing result of the input image from the plurality of measurement results comprises: from the plurality of measurement results, image features of the input image can be obtained. And performing full connection processing on the image characteristics to obtain a processing result of the input image. For example, the 8 measurements described above (96 measurement sub-results total) may be expanded into 96-dimensional image features. The image features may be fully connected to perform image classification tasks. The result of the full join process may be two-dimensional. The parameters of the full connection process may be 192.
With the embodiments of the present disclosure, each quantum operation unit may be run 24 times in order to process at least one input image block corresponding to the target indicator information. The parameters of the full connection process may be 192. Compared with the parameterized quantum circuit for processing 3 image blocks, the quantum processing unit disclosed by the disclosure can process at least one input image block corresponding to the target indicator information, the operation times are reduced by 33%, and the corresponding full-connection processing parameters are also reduced by 33%.
It will be appreciated that some ways of determining the image processing result are described above, and ways of obtaining the target instruction information using the reference image will be further described below.
In some embodiments, the reference picture may correspond to a plurality of reference picture blocks. The plurality of reference image blocks are obtained by dividing the reference image. For example, the similarity between the reference image and the input image may be greater than or equal to a preset similarity threshold. If the image I210 is used as an input image, the image I200 may be used as a reference image. The reference image and the input image may be from multiple images of the same batch. The reference image may be one or more.
In the disclosed embodiments, the reference image may be divided in various ways. The plurality of reference picture blocks may be N reference picture blocks. The N reference tiles may include reference tile Pr1, … … input tile PrN. For example, taking n=3 as an example, if the reference image has a size of 12×12, the reference image may be divided into 3 reference image blocks. The reference image block may be 12×4 in size. The 3 reference image blocks may include a reference image block Pr1, a reference image block Pr2, and a reference image block Pr3. It is understood that the dividing manner of the reference image may be the same as or similar to the dividing manner of the input image, which is not described herein.
It will be appreciated that the reference image block of the present disclosure is described above, and that initial prompt text used when obtaining target indication information will be described below.
In some embodiments, the initial indication information may be derived from the initial prompt text using a large model. In the case where the target adjustment period is the 1 st adjustment period of the at least one adjustment period, the initial prompt text may be taken as the prompt text of the target adjustment period. The hint text of the target adjustment period may include: constraint sub-text of indication information of the target adjustment period. The constraint sub-text of the indication information of the target adjustment period may characterize a relationship between the indication information and performance index information of the target adjustment period. According to the embodiment of the disclosure, the prompt text is adjusted based on the constraint sub-text, so that the natural language understanding capability of the large language model can be fully utilized, and the indication information can be effectively and rapidly acquired. In addition, the prompt text is close to the natural language text, so that the cost of obtaining the indication information is reduced.
In an embodiment of the present disclosure, the performance index information of the target adjustment period includes at least one of first performance index sub-information and second performance index sub-information. The first performance index sub-information of the target adjustment period includes a first performance index value of the target adjustment period to be increased, and the second performance index sub-information of the target adjustment period includes a second performance index value of the target adjustment period to be decreased. For example, the first performance index value may be one or more. The first performance index value may be a classification accuracy value. The second performance index value may also be one or more. At least one of the number of iterations and the computational complexity may be used as the second performance index value. According to the indication information of the target adjustment period, the iteration times can be training times required by loss convergence, and the calculation complexity can be the total times of the quantum operation unit operation. By the embodiment of the disclosure, constraint is set by using the first performance index to be improved and the second performance index to be reduced, so that the accuracy of quantum computing can be fully improved, and the resource cost of quantum computing can be effectively reduced.
In an embodiment of the present disclosure, the indication sub-information of the target adjustment period may include a plurality of indication values. The indication value may correspond to an image block. The plurality of indicator values may include at least one first indicator value and at least one second indicator value. For example, the first indication value may be 1. The first indication value may correspond to a reference image block to be processed by a respective quantum processing unit. The second indicator value may be 0. The second indicator value corresponds to a reference image block that does not require processing by the respective quantum processing unit. It will be appreciated that the total number of instruction values may be determined based on the number of quantum processing units and the number of image blocks. Using the hint text, the large model may determine the number of first indicator values and the number of second indicator values.
In an embodiment of the present disclosure, the constraint sub-text of the target adjustment period is further used to indicate at least one of: a first relationship between the number of first index values and the first performance index sub-information; a second relationship between the number of first index values and the second performance index sub-information; and adjusting the target. For example, the first relationship may include: the number of the first indication values and the first performance index value are in positive correlation. That is, the greater the number of first indication values, the greater the first performance index value. The second relationship may include: the number of the first indication values and the second performance index value are in positive correlation. That is, the larger the number of the first indication values, the larger the second performance index value. Thus, based on the first relationship and the second relationship, adjusting the target may include: the large model is caused to adjust the number of first indicator values to increase the first performance indicator value and decrease the second performance indicator value. For another example, the instruction information constraint sub-text of the target adjustment period may include "the greater the number of 1 s in the instruction information, the higher the classification accuracy but the greater the computation complexity; conversely, the smaller the number of 1's, the lower the classification accuracy but the smaller the computational complexity. It is therefore desirable to find a suitable indicator that allows a quantum convolutional neural network with a high classification accuracy and at the same time a low computational complexity. The constraint sub-text may indicate a first relationship, a second relationship, and an adjustment target. The adjustment target may be "it is now desired to find a suitable indication information, so that the quantum convolutional neural network has higher classification accuracy and smaller computational complexity at the same time. According to the embodiment of the disclosure, the constraint sub-text is utilized, so that the natural language understanding capability and the generating capability of the large model can be fully utilized, and the large model can efficiently generate accurate indication information.
In an embodiment of the present disclosure, in a case where the hint text of the target adjustment period is the initial hint text, the hint text of the target adjustment period may further include at least one of: reference descriptor text of reference image and operation descriptor text of quantum processing unit. The reference descriptor text is used for indicating the size of the reference image, and the operation descriptor text is used for indicating the operation performed by the quantum processing unit on the reference image. For example, for the above-described image I200 or image I210, the reference descriptor text may be "a digital image of size 12×12". For another example, the operation descriptor text may include "training a quantum convolutional neural network to perform efficient feature extraction on a digital image with a size of 12×12, where the extracted features classify the image by an input classical full-connected layer, and the images are classified into two categories. Thus, the operation descriptor text may indicate the following operations to be performed on the reference image: convolving to extract features, fully connected to sort.
In embodiments of the present disclosure, the reference descriptor text may also indicate at least one of: pixel distribution of the reference image, shape of target reference pixels in the reference image, symmetry of the reference image. For example, the reference descriptor text may be "an image with content of digital 0 and an image with content of digital 1". The digital pixels are black and the background pixels are white. "the digital pixels are black and the background pixels are white" may indicate the pixel distribution of the reference image. "an image with a content of digital 0 and an image with a content of digital 1" may indicate the shape and symmetry of the reference pattern.
In the embodiment of the present disclosure, in the case that the target adjustment period prompt text is the initial prompt text, the target adjustment period prompt text may include "we want to train a quantum convolutional neural network to perform efficient feature extraction on a digital image with a size of 12×12, where the extracted features classify the input classical full-connection layer into two types of images, that is, an image with a content of digital 0 and an image with a content of digital 1. The digital pixels are black and the background pixels are white. The more the number of 1 s in the instruction information is, the higher the classification accuracy is, but the calculation complexity is also increased; conversely, the smaller the number of 1's, the lower the classification accuracy but the smaller the computational complexity. It is therefore desirable to find a suitable indicator that allows a quantum convolutional neural network with a high classification accuracy and at the same time a low computational complexity. According to the embodiment of the disclosure, based on the reference descriptor text and the operation descriptor text, the large model is facilitated to generate accurate indication information, and the acquisition cost of the indication information can be further reduced.
It will be appreciated that the initial prompt text is described above and the manner in which the corresponding operations are performed using the initial prompt text will be described below in connection with fig. 4.
Fig. 4 is a schematic diagram of determining target indication information according to one embodiment of the present disclosure.
In the embodiment of the disclosure, the prompt text of the target adjustment period can be processed by using the large model to obtain the indication information of the target adjustment period. As shown in fig. 4, initial indication information can be obtained by inputting an initial prompt text into the large model L40. In the case where the target adjustment period is the 1 st adjustment period, the initial instruction information may be regarded as the instruction information of the target adjustment period. Next, operations S401 to S402 may be performed before operation S110 described above, which will be described below.
In operation S401, at least one reference image block is processed by a plurality of quantum processing units, respectively, according to indication information of a target adjustment period.
In an embodiment of the present disclosure, the output result of the target adjustment period is obtained by processing at least one reference image block of the reference image with the plurality of quantum processing units, respectively, by: and respectively processing at least one reference image block by utilizing a plurality of quantum processing units according to the indication information of the target adjustment period to obtain a plurality of measurement characteristics of the target adjustment period. For example, according to the initial indicator information of the initial indicator information, the quantum processing unit corresponding to the initial indicator information may be used to process at least one parameter test image block to obtain at least one reference measurement result as at least one measurement feature. After the respective processing by the plurality of quantum processing units is completed, a plurality of measurement features can be obtained.
In an embodiment of the present disclosure, the output result of the target adjustment period is obtained by processing at least one reference image block of the reference image with the plurality of quantum processing units, respectively, by: and performing full connection processing on the plurality of measurement features to obtain an output result of the target adjustment period. For example, multiple measurement features may be processed using the full connection layer to obtain an output result of a first iteration of the target adjustment period.
In the embodiment of the disclosure, the pre-adjustment loss may be determined according to the output result of the target adjustment period and the label of the reference image. For example, from the cross entropy loss function, a pre-alignment loss may be determined. If it is determined that the pre-tuning loss does not converge, parameters of the plurality of quantum processing units and the fully-connected layer may be adjusted according to the pre-tuning loss to perform a next iteration. Thus, after a number of iterations, if the pre-tuning loss converges, performance index information for the target tuning period may be determined. The number of iterations may be used as a second performance index value. The number of runs (i.e. the computational complexity) of the plurality of quantum processing units per iteration may also be determined as a further second performance index value. In addition, a plurality of test images can be input into a plurality of quantum processing units and the full connection layer, and output results of the plurality of test images can be obtained. Based on the output results of the plurality of test images and the labels of the plurality of test images, classification accuracy values of the plurality of quantum processing units and the full-connection layer can be determined as the first performance index value. The first performance index value and the two second performance index values may be regarded as performance index information of the target adjustment period.
In operation S402, it is determined whether the performance index information of the target adjustment period satisfies a preset termination condition.
In an embodiment of the present disclosure, the preset termination condition includes at least one of: the first performance index value of the target adjustment period is greater than or equal to a first preset performance threshold, and the second performance index value of the target adjustment period is less than or equal to a second preset performance threshold. For example, the first preset performance threshold may be one or more. The first preset performance threshold may include a preset classification accuracy threshold. The second preset performance threshold may be one or more. The second preset performance threshold may include a preset iteration number threshold and a preset complexity threshold.
In the embodiment of the disclosure, in response to determining that the performance index information of the target adjustment period does not meet the preset termination condition, the prompt text of the target adjustment period may be adjusted according to the performance descriptor text corresponding to the performance index information of the target adjustment period, so as to obtain the prompt text of the subsequent adjustment period.
For example, if it is determined that the classification accuracy value of the 1 st adjustment period is smaller than the preset classification accuracy threshold, the iteration number is greater than the preset iteration number threshold, or the calculation complexity is greater than the preset complexity threshold, the performance descriptor text may be determined according to the performance index information of the target adjustment period. The prompting text of the 1 st adjustment period can be adjusted by utilizing the performance descriptor text, and the prompting text of the 2 nd adjustment period is obtained. The indication information of the 1 st adjustment period may be a matrix of 4 rows and 3 columns. Taking the example that the indication information of the 1 st adjustment period only includes the first indication value (1), the calculation complexity of the 1 st adjustment period may be 144, which is greater than the preset complexity threshold. The performance descriptor text for the 1 st adjustment period may include "the computational complexity of quantum convolution through x iterations and 144 times, achieving # # percent classification accuracy". The performance descriptor text can be utilized to adjust the prompt text of the 1 st adjustment period, so as to obtain the prompt text of the 2 nd adjustment period.
It will be appreciated that the above description of the present disclosure has been made taking the example where the prompt text for the target adjustment period is the initial prompt text. The present disclosure is described below taking the example that the hint text of the target adjustment period is not the initial hint text.
In an embodiment of the present disclosure, in a case where the hint text of the target adjustment period is not the initial hint text, the hint text of the target adjustment period further includes: information descriptor text of indication information of a previous adjustment period and performance descriptor text corresponding to performance index information of the previous adjustment period. For example, the 2 nd adjustment period hint text may include "by using the matrix you output," we have performed a quantum simulation of this problem, with a # # classification accuracy achieved by the computational complexity of the x iterations and 144 quantum convolutions. Next you want to adjust this matrix so that the number of iterations and the complexity of the quantum convolution operation are as low as possible while the model has better classification performance. "by using the [ matrix ] of you output" can be the information descriptive text of the instruction information of the 1 st adjustment period. "the classification accuracy of # # is achieved by the computational complexity of the number of iterations and 144 quantum convolutions" may be the performance descriptor text for the 1 st adjustment period. The matrix is adjusted, so that the model has better classification performance, and the iteration times and the quantum convolution operation complexity are as low as possible, and can be constraint sub-texts of the indication information of the 2 nd adjustment period. The 2 nd adjustment period prompt text may be input into the large model L40 to obtain the 2 nd adjustment period indication information. And the above operation S402 is performed to obtain performance index information of the 2 nd adjustment period. It can be appreciated that the manner of determining the performance index information of the 2 nd adjustment period is the same as or similar to the manner of determining the index information of the 1 st adjustment period, and this disclosure will not be repeated here. Through the embodiment of the disclosure, the prompt text can be efficiently adjusted, and the indication information can be rapidly and accurately obtained.
Taking the indication information of the 2 nd adjustment period as the first formula as an example, the classification precision value of the 2 nd adjustment period may be 80% and greater than the preset classification precision threshold. The number of iterations of the 2 nd adjustment period may be 50, less than a preset iteration number threshold. The computational complexity of the 2 nd adjustment period may be 96 times, less than a preset complexity threshold. It may be determined that the performance index information of the 2 nd adjustment period satisfies the preset termination condition.
In an embodiment of the present disclosure, in response to determining that the performance index information of the target adjustment period satisfies a preset termination condition, target indication information is determined according to the indication information of the target adjustment period. For example, the above formula one may be used as the target instruction information. Parameters (rotation angles) of the plurality of quantum processing units at the end of the 2 nd adjustment period may also be obtained so as to perform operations S110 to S130 described above.
It will be appreciated that the above-described sub-text may be obtained using various deep learning models. For example, the reference descriptor text may be obtained using a trained comparative teletext pre-training model (CLIP).
It will be appreciated that while the image processing method of the present disclosure is described above, the training method of the image processing model of the present disclosure will be described below.
Fig. 5 is a schematic flow chart diagram of a training method of an image processing model according to one embodiment of the present disclosure.
As shown in fig. 5, the method 500 may include operations S510 to S530.
In embodiments of the present disclosure, the image processing model may include a plurality of quantum processing units. For example, the plurality of quantum processing units may be the first quantum processing unit to the fourth quantum processing unit described above.
In operation S510, an input sample image is divided to obtain N input sample image blocks.
In the disclosed embodiments, the input sample image may be partitioned in various ways. N may be an integer greater than 1. For example, taking n=3 as an example, if the size of the input sample image is 12×12, the input sample image may be divided into 3 input sample image blocks. The size of the input sample image block may be 12×4. The 3 input image blocks may include an input image block Ps1, an input image block Ps2, and an input image block Ps3.
In operation S520, at least one input sample image block is processed by a plurality of quantum processing units according to the target sample indication information, respectively, to obtain a plurality of sample measurement results.
In an embodiment of the disclosure, the target sample indication information includes a plurality of target sample indication sub-information for indicating at least one input sample image block corresponding to the quantum processing unit. For example, a first target sample indication sub-information of the plurality of target sample indication sub-information may indicate that the first quantum processing unit corresponds to the input sample image block Ps1 and the input image block Ps2. The input image block Ps1 and the input image block Ps2 may be processed using the first quantum processing unit. As another example, taking k=4 as an example, the plurality of target sample indication sub-information may include 4 target sample indication sub-information.
In an embodiment of the present disclosure, the number of input image blocks processed by the at least one quantum processing unit is less than N. For example, if the target instruction sub-information may indicate M input sample image blocks corresponding to the quantum processing unit, the plurality of sample measurement results may be k×m sample measurement results. M may be an integer greater than or equal to 1. For example, taking m=2 as an example, after the input sample image block P1 and the input sample image block P2 are processed by the first quantum processing unit, a sample measurement result corresponding to the input sample image block P1 may be obtained, or a sample measurement result corresponding to the input sample image block P2 may be obtained. It will be appreciated that the number of input sample image blocks indicated by the different target sample indication sub-information may be different or the same, which is not limited by the present disclosure.
In an embodiment of the present disclosure, the target sample indication information is determined from the target sample prompt text. The target sample prompt text is determined after at least one pre-training period of pre-training the initial sample prompt text. For example, the target prompt text may be entered into a large language model to obtain target indication information. The large language model may be, for example, a text-to-speech model. The initial sample prompt text can describe a reference image or a quantum processing unit
In an embodiment of the present disclosure, the prompt text for the target pre-training period of the at least one pre-training period is derived from the initial prompt text. For example, if the target pretraining period is the 1 st pretraining period of the at least one pretraining period, the initial sample prompt text may be used as the prompt text for the target pretraining period. For another example, if the target pretraining period is not the 1 st pretraining period, the prompt text of the target pretraining period may be obtained by at least one adjustment to the initial prompt text.
In the embodiment of the disclosure, the prompt text of the target pre-training period is adjusted according to the label of the reference image and the output result of the target pre-training period, and the output result of the target pre-training period is obtained by respectively processing at least one reference image block of the reference image by utilizing a plurality of quantum processing units. For example, each quantum processing unit may process at least one reference image block. The hint text of the target adjustment period may be adjusted based on a difference between the tag of the reference image and the output result of the target adjustment period. The number of reference image blocks processed by each quantum processing unit may be less than or equal to N. The number of reference image blocks processed by the different amount sub-processing units may be the same or different, and the present disclosure is not limited thereto.
In operation S530, respective parameter information of the plurality of quantum processing units is adjusted according to the tag of the input sample image and the plurality of sample measurement results to train the image processing model.
For example, the label of the input sample image includes a category label value (0 or 1). According to the difference between the sample measurement results and the class label values, the parameter information of each quantum processing unit can be adjusted.
Through the embodiment of the disclosure, parameters of a plurality of quantum processing units can be adjusted, and further improvement of image processing precision is facilitated. The quantum processing unit processes at least one image block, so that the operation times can be reduced, the resource cost required by model training is reduced, and the model training efficiency is improved. In addition, the target sample prompt text is obtained after at least one pre-training period of pre-training the initial prompt text. Therefore, the target sample indication information determined by the target prompt text can effectively indicate important areas in the image, so that the quantum processing unit can process the important areas in the image to improve the image processing precision, the probability of processing similar image blocks by the same quantum processing unit can be reduced, the information redundancy can be reduced, the model training efficiency can be further improved under the condition of ensuring the model precision, and the resource cost of the quantum equipment can be obviously reduced.
It can be appreciated that the input sample image is divided in the same or similar manner as the above-mentioned input image, and this disclosure will not be repeated here.
In some embodiments, the target sample indication information may include a target sample matrix. The target sample indication sub-information may be target sample row data of the target sample matrix.
In the disclosed embodiments, the number of rows of the target sample matrix may be consistent with the number of quantum processing units. The number of columns of the target sample matrix may be consistent with the number of input sample image blocks. It will be appreciated that the target sample matrix is the same as or similar to the target matrix described above, and this disclosure is not repeated here.
In an embodiment of the present disclosure, the plurality of target sample indication sub-information may include first to fourth target sample indication sub-information. In the embodiment of the present disclosure, the target sample indicator information is the same as or similar to the target indicator information described above, and the disclosure is not repeated here.
In some embodiments, processing the at least one input sample image block with the plurality of quantum processing units, respectively, according to the target sample indication information, to obtain a plurality of sample measurements includes: and processing at least one input sample image block indicated by the target sample indication sub-information by utilizing a quantum processing unit corresponding to the target sample indication sub-information to obtain at least one sample measurement result.
In some embodiments, the at least one input sample image block comprises a plurality of input sample sub-image blocks. Processing, with a quantum processing unit corresponding to the target sample indication sub-information, at least one input sample image block indicated by the target sample indication sub-information includes: the plurality of input sample sub-image blocks are sequentially processed using a quantum processing unit corresponding to the target sample instruction sub-information.
In some embodiments, a quantum processing unit includes an encoding module and a processing module, the encoding module including a plurality of single bit rotator gates. Sequentially processing a plurality of input sample sub-image blocks using a quantum processing unit corresponding to target sample instruction sub-information includes: and respectively inputting a plurality of pixels of the target input sample sub-image block into a plurality of single-bit rotating gates to obtain a plurality of coding results of the target input sample sub-image block. The target input sample sub-image block is from a plurality of input sample sub-image blocks. And processing a plurality of coding results of the target input sample sub-image block by using a processing module to obtain the output state of the target input sample sub-image block. And measuring the output state of the target input sample sub-image block along the Brix Z operator to obtain a sample measurement sub-result of the target input sample sub-image block.
In some embodiments, the processing module includes a cascade of multiple processing sub-modules including multiple controlled NOT gates and multiple single bit rotator gates. Processing, by the processing module, a plurality of encoding results of the target input sample sub-image block, the output state of the target input sample sub-image block including: and inputting the plurality of to-be-processed data of the target input sample sub-image block into a plurality of controlled NOT gates of the processing sub-module to obtain a plurality of first processed data. The plurality of data to be processed for the target input sample sub-image block is determined based on a plurality of encoding results for the target input sample sub-image block. And inputting the first processed data into a plurality of single-bit turngates of the processing submodule to obtain second processed data.
In some embodiments, the data to be processed includes the encoded result and second processed data output by a preceding processing sub-module of the processing sub-module. The output state is a plurality of second processed data output by the last stage processing sub-module.
In some embodiments, sequentially processing the plurality of input samples with the quantum processing unit corresponding to the target sample indicator information further comprises: in response to the determined sample measurement sub-result for the target input sample sub-image block, a plurality of pixels of a subsequent input sample sub-image block of the target input sample sub-image block are processed.
In some embodiments, sequentially processing the plurality of input sample sub-image blocks using a quantum processing unit corresponding to the target sample indication sub-information comprises: and obtaining a sample measurement result according to the plurality of sample measurement sub-results.
It can be understood that the manner of sequentially processing the plurality of input sample sub-image blocks by using the quantum processing units corresponding to the target sample instruction sub-information is the same as or similar to the manner of sequentially processing the input sub-image blocks by using the quantum processing units corresponding to the target sample instruction sub-information, and the disclosure is not repeated herein.
It will be appreciated that some of the ways in which sample measurements are obtained are described above and some of the ways in which sample loss is determined are described below.
In some embodiments, adjusting the parameter information of each of the plurality of quantum processing units based on the tag of the input sample image and the plurality of sample measurements comprises: sample loss is determined from the tag of the input sample image and the plurality of sample measurements. And adjusting the parameter information of each of the plurality of quantum processing units according to the sample loss. For example, a plurality of sample measurement results are input to the full connection layer, and an output result of an input sample image is obtained.
For example, taking k=4 and n=3 as an example, the sample Loss can be determined by the following equation:
i may represent the i-th input sample image and j may represent the number of categories of images. If the image is to be displayedI200 and image I210 are taken as input sample images, and j may have a value of 0 or 1.Can be a label, and has a value of 0 or 1, ">It may be indicated that the i-th input sample image belongs to the j-th class. />It may be indicated that the i-th input sample image does not belong to the j-th class. />Representing the probability that the ith input sample image belongs to the jth class, and outputting the result from the ith input sample image.
It will be appreciated that while the sample loss is described above, some ways of pre-training the initial sample indication information for at least one pre-training period will be described below.
In some embodiments, the N reference image blocks are divided from the reference image. The method may further include: and respectively processing at least one reference image block by utilizing a plurality of quantum processing units according to the indication information of the target pre-training period to obtain a plurality of measurement characteristics of the target pre-training period. The indication information of the target pre-training period includes indication sub-information of a plurality of target pre-training periods, the indication sub-information of the target pre-training period being used to indicate at least one reference image block corresponding to the quantum processing unit. And performing full-connection processing on a plurality of measurement features of the target pre-training period to obtain an output result of the target pre-training period.
In some embodiments, the above method may further comprise: and determining the performance index information of the target pre-training period according to the label of the reference image and the output result of the target pre-training period. And determining target sample indication information according to the indication information of the target pre-training period in response to determining that the performance index information pre-adjustment loss of the target pre-training period meets a preset termination condition.
In some embodiments, the above method may further comprise: and in response to determining that the performance index information of the target pre-training period does not meet the preset termination condition, adjusting the prompt text of the target pre-training period according to the performance descriptor text corresponding to the performance index information of the target pre-training period, and obtaining the prompt text of the subsequent pre-training period.
In some embodiments, the performance index information of the target pre-training period includes at least one of the first performance index sub-information and the second performance index sub-information. The first performance indicator sub-information of the target pre-training period includes a first performance indicator value of the target pre-training period to be enhanced. The second performance indicator sub-information of the target pre-training period includes a second performance indicator value of the target pre-training period to be reduced.
In some embodiments, the preset termination condition includes at least one of: the first performance index value of the target pre-training period is greater than or equal to a first preset performance threshold, and the second performance index value of the target pre-training period is less than or equal to a second preset performance threshold.
In some embodiments, the prompt text for the target pre-training period includes: and the constraint sub-text of the indication information of the target pre-training period is used for indicating the relation between the performance index information and the indication information of the target pre-training period.
In some embodiments, where the prompt text of the target pre-training period is the initial prompt text, the prompt text of the target pre-training period further includes at least one of: reference descriptor text of the reference image and operation descriptor text of the quantum processing unit, the reference descriptor text indicating a size of the reference image, and the operation descriptor text indicating an operation performed by the quantum processing unit on the reference image.
In some embodiments, in the event that the prompt text of the target pre-training period is not the initial prompt text, the prompt text of the target pre-training period further comprises: information descriptive text of indication information of a previous pre-training period and performance descriptive text corresponding to performance index information of the previous pre-training period.
In some embodiments, the reference descriptor text is further used to indicate at least one of: pixel distribution of the reference image, shape of target reference pixels in the reference image, symmetry of the reference image.
In some embodiments, the indication sub-information of the target pre-training period includes at least one first indication value, and the constraint sub-text of the target pre-training period is further used to indicate at least one of: a first relationship between the number of first index values and the first performance index sub-information; a second relationship between the number of first index values and the second performance index sub-information.
It can be appreciated that the manner of determining the target sample indication information is the same as or similar to the manner of determining the target indication information described above, and this disclosure will not be repeated here.
It will be appreciated that the training method of the image processing model of the present disclosure is described above, and the quantum processing apparatus of the present disclosure will be described below.
Fig. 6 is a schematic diagram of a quantum processing device according to one embodiment of the present disclosure.
As shown in fig. 6, the apparatus 60 may include a plurality of quantum execution units 61 and an output unit 62.
The plurality of quantum execution units 61 may be configured to process at least one input image block, respectively, resulting in a plurality of measurement results. At least one input image block is determined from N input image blocks, which are obtained by dividing an input image, according to the target indication information.
The output unit 62 may be configured to determine a processing result of the input image from the plurality of measurement results.
In an embodiment of the present disclosure, the number of input image blocks processed by the at least one quantum processing unit is less than N.
In the embodiment of the disclosure, the target indication information is determined according to a target prompt text, the target prompt text is determined after at least one adjustment period is performed on an initial prompt text, the prompt text of the target adjustment period in the at least one adjustment period is obtained according to the initial prompt text, the prompt text of the target adjustment period is adjusted according to a label of a reference image and an output result of the target adjustment period, and the output result of the target adjustment period is obtained by respectively processing at least one reference image block of the reference image by using a plurality of quantum processing units.
It is understood that the plurality of quantum execution units may correspond to the first quantum processing unit to the fourth quantum processing unit described above. For the description of the quantum execution unit, reference may be made to the above quantum processing unit, and this disclosure is not repeated here.
In some embodiments, the quantum execution unit includes: and the encoding module is configured to encode a plurality of pixels of the target input sub-image block to obtain a plurality of encoding results of the target input sub-image block. The target input sub-image block is from a plurality of input sub-image blocks, the plurality of input sub-image blocks being from at least one input image block. And the processing module is configured to process a plurality of encoding results of the target input sub-image block to obtain an output state of the target input sub-image block. And the measurement module is configured to measure the output state of the target input sub-image block to obtain a measurement sub-result of the target input sub-image block. The coding module may be the coding module QE311 described above. The processing module may be the processing module QP312 described above.
In some embodiments, the encoding module includes a plurality of single bit rotator gates configured to: and obtaining a plurality of coding results of the target input sub-image block according to the plurality of pixels of the target input sub-image block.
In some embodiments, the processing module comprises a plurality of processing sub-modules in cascade, the processing sub-modules comprising: and the controlled NOT gates are configured to obtain a plurality of first processed data according to the plurality of to-be-processed data of the target input sub-image block. The plurality of data to be processed of the target input sub-image block is determined based on a plurality of encoding results of the target input sub-image block. And the single-bit revolving doors are configured to obtain a plurality of second processed data according to the plurality of first processed data. It is appreciated that the plurality of processing sub-modules may include the processing sub-module QP3121 through the processing sub-module QP3123 described above.
In some embodiments, the data to be processed includes the encoding result and the second processed data output by the preceding processing sub-module of the processing sub-module, where the output state is a plurality of second processed data output by the processing sub-module of the last stage.
In some embodiments, the measurement module is configured to perform the following operations to measure the output state of the target input sub-image block: the output states of the target input sub-image block are measured along the berlite Z operator.
In some embodiments, the quantum execution unit is further configured to process a plurality of pixels of a subsequent input sub-image block of the target input sub-image block in response to the measured sub-result of the determined target input sub-image block.
It will be appreciated that the target prompt text may be determined after at least one adjustment period of the initial prompt text, as will be described below.
In some embodiments, the target indication information includes a target matrix, and the target indication sub-information is target row data of the target matrix. The number of rows of the target matrix is consistent with the number of quantum execution units, and the number of columns of the target matrix is consistent with the number of input image blocks.
In some embodiments, the reference picture corresponds to N reference picture blocks, which are obtained by dividing the reference picture.
In some embodiments, the output result of the target adjustment period is obtained by processing at least one reference image block of the reference image with the plurality of quantum processing units, respectively: and respectively processing at least one reference image block by utilizing a plurality of quantum processing units according to the indication information of the target adjustment period to obtain a plurality of measurement characteristics of the target adjustment period. The indication information of the target adjustment period includes indication sub-information of a plurality of target adjustment periods for indicating at least one reference image block corresponding to the quantum processing unit. And performing full connection processing on the plurality of measurement characteristics of the target adjustment period to obtain an output result of the target adjustment period.
In some embodiments, the indication message hint text of the target adjustment period is adjusted according to the label of the reference image and the output result of the target adjustment period by: and determining the performance index information of the target adjustment period according to the label of the reference image and the output result of the target adjustment period. And determining target indication information according to the indication information of the target adjustment period in response to determining that the performance index information pre-adjustment loss of the target adjustment period meets a preset termination condition.
In some embodiments, the hint text of the target adjustment period is also adjusted based on the label of the reference image and the output result of the target adjustment period by: and in response to determining that the performance index information of the target adjustment period does not meet the preset termination condition, adjusting the prompt text of the target adjustment period according to the performance descriptor text corresponding to the performance index information of the target adjustment period, and obtaining the prompt text of the subsequent adjustment period.
In some embodiments, the performance indicator information of the target adjustment period includes at least one of first performance indicator sub-information including a first performance indicator value of the target adjustment period to be increased and second performance indicator sub-information including a second performance indicator value of the target adjustment period to be decreased.
In some embodiments, the preset termination condition includes at least one of: the first performance index value of the target adjustment period is greater than or equal to a first preset performance threshold, and the second performance index value of the target adjustment period is less than or equal to a second preset performance threshold.
In some embodiments, the prompt text for the target adjustment period includes: and the constraint sub-text of the indication information of the target adjustment period is used for indicating the relation between the performance index information and the indication information of the target adjustment period.
In some embodiments, in the case where the target adjustment period of the prompt text is the initial prompt text, the target adjustment period of the prompt text further includes at least one of: reference descriptor text of the reference image and operation descriptor text of the quantum processing unit, the reference descriptor text indicating a size of the reference image, and the operation descriptor text indicating an operation performed by the quantum processing unit on the reference image.
In some embodiments, in the case where the target adjustment period of the prompt text is not the initial prompt text, the target adjustment period of the prompt text further includes: information descriptor text of indication information of a previous adjustment period and performance descriptor text corresponding to performance index information of the previous adjustment period.
In some embodiments, the reference descriptor text is further used to indicate at least one of: pixel distribution of the reference image, shape of target reference pixels in the reference image, symmetry of the reference image.
In some embodiments, the indication sub-information of the target adjustment period includes at least one first indication value, and the constraint sub-text of the target adjustment period is further used to indicate at least one of: a first relationship between the number of first index values and the first performance index sub-information; a second relationship between the number of first index values and the second performance index sub-information.
It will be appreciated that the quantum processing apparatus of the present disclosure is described above and the quantum processing device of the present disclosure will be described below.
Fig. 7 is a schematic block diagram of a quantum processing device according to one embodiment of the present disclosure.
As shown in fig. 7, device 7000 may include quantum processing apparatus 70. The quantum processing device 70 may be the device 60 described above.
It will be appreciated that the quantum device of the present disclosure is described above, and that the image processing apparatus and the training apparatus of the image processing model of the present disclosure will be described below.
Fig. 8 is a block diagram of an image processing apparatus according to one embodiment of the present disclosure.
As shown in fig. 8, the apparatus 800 may include a first partitioning module 810, a first quantum processing module 820, and a first determining module 830.
The first dividing module 810 is configured to divide an input image to obtain N input image blocks. N is an integer greater than 1.
The first quantum processing module 820 is configured to process at least one input image block by using a plurality of quantum processing units according to the target indication information, so as to obtain a plurality of measurement results. The target instruction information includes a plurality of target instruction sub-information for instructing at least one input image block corresponding to the quantum processing unit. The number of input image blocks processed by the at least one quantum processing unit is less than N.
The first determining module 830 is configured to determine a processing result of the input image according to the plurality of measurement results.
In some embodiments, the target indication information is determined according to a target prompt text, the target prompt text is determined after at least one adjustment period is performed on the initial prompt text, the prompt text of the target adjustment period in the at least one adjustment period is obtained according to the initial prompt text, the prompt text of the target adjustment period is adjusted according to the label of the reference image and the output result of the target adjustment period, and the output result of the target adjustment period is obtained by respectively processing at least one reference image block of the reference image by using a plurality of quantum processing units.
In some embodiments, the target indication information includes a target matrix, and the target indication sub-information is target row data of the target matrix. The number of rows of the target matrix is consistent with the number of quantum processing units, and the number of columns of the target matrix is consistent with the number of input image blocks.
In some embodiments, the reference picture corresponds to N reference picture blocks, which are obtained by dividing the reference picture.
In some embodiments, the apparatus 800 may further include: the first obtaining module is used for respectively processing at least one reference image block by utilizing the plurality of quantum processing units according to the indication information of the target adjustment period to obtain a plurality of measurement characteristics of the target adjustment period. The indication information of the target adjustment period includes indication sub-information of a plurality of target adjustment periods for indicating at least one reference image block corresponding to the quantum processing unit. And the first full-connection processing module is used for carrying out full-connection processing on the plurality of measurement characteristics of the target adjustment period to obtain an output result of the target adjustment period.
In some embodiments, the apparatus 800 may further include: and the second determining module is used for determining the performance index information of the target adjustment period according to the label of the reference image and the output result of the target adjustment period. And a third determining module, configured to determine target indication information according to the indication information of the target adjustment period in response to determining that the performance index information pre-adjustment loss of the target adjustment period meets a preset termination condition.
In some embodiments, the apparatus 800 may further include: and the fourth determining module is used for adjusting the prompt text of the target adjustment period according to the performance descriptor text corresponding to the performance index information of the target adjustment period to obtain the prompt text of the subsequent adjustment period in response to determining that the performance index information of the target adjustment period does not meet the preset termination condition.
In some embodiments, the performance indicator information of the target adjustment period includes at least one of first performance indicator sub-information including a first performance indicator value of the target adjustment period to be increased and second performance indicator sub-information including a second performance indicator value of the target adjustment period to be decreased.
In some embodiments, the preset termination condition includes at least one of: the first performance index value of the target adjustment period is greater than or equal to a first preset performance threshold, and the second performance index value of the target adjustment period is less than or equal to a second preset performance threshold.
In some embodiments, the prompt text for the target adjustment period includes: and the constraint sub-text of the indication information of the target adjustment period is used for indicating the relation between the performance index information and the indication information of the target adjustment period.
In some embodiments, in the case where the target adjustment period of the prompt text is the initial prompt text, the target adjustment period of the prompt text further includes at least one of: reference descriptor text of the reference image and operation descriptor text of the quantum processing unit, the reference descriptor text indicating a size of the reference image, and the operation descriptor text indicating an operation performed by the quantum processing unit on the reference image.
In some embodiments, in the case where the target adjustment period of the prompt text is not the initial prompt text, the target adjustment period of the prompt text further includes: information descriptor text of indication information of a previous adjustment period and performance descriptor text corresponding to performance index information of the previous adjustment period.
In some embodiments, the reference descriptor text is further used to indicate at least one of: pixel distribution of the reference image, shape of target reference pixels in the reference image, symmetry of the reference image.
In some embodiments, the indication sub-information of the target adjustment period includes at least one first indication value, and the constraint sub-text of the target adjustment period is further used to indicate at least one of: a first relationship between the number of first index values and the first performance index sub-information; a second relationship between the number of first index values and the second performance index sub-information.
In some embodiments, the at least one input image block comprises a plurality of input sub-image blocks. The first quantum processing sub-module is further configured to: the plurality of input sub-image blocks are sequentially processed using a quantum processing unit corresponding to the target instruction sub-information.
In some embodiments, a quantum processing unit includes an encoding module and a processing module, the encoding module including a plurality of single bit rotator gates. The first quantum processing submodule includes: the first obtaining unit is used for respectively inputting a plurality of pixels of the target input sub-image block into a plurality of single-bit rotating gates to obtain a plurality of encoding results of the target input sub-image block. The target input sub-image block is from a plurality of input sub-image blocks. And the second obtaining unit is used for processing a plurality of encoding results of the target input sub-image block by utilizing the processing module to obtain the output state of the target input sub-image block. And the third obtaining unit is used for measuring the output state of the target input sub-image block along the Brix Z operator to obtain a measurement sub-result of the target input sub-image block.
In some embodiments, the processing module includes a cascade of multiple processing sub-modules including multiple controlled NOT gates and multiple single bit rotator gates. The second obtaining unit includes: the first obtaining subunit is used for inputting the plurality of to-be-processed data of the target input sub-image block into the plurality of controlled NOT gates of the processing sub-module to obtain a plurality of first processed data. The plurality of data to be processed of the target input sub-image block is determined based on a plurality of encoding results of the target input sub-image block. The second obtaining subunit is configured to input the plurality of first processed data into the plurality of single-bit turnstiles of the processing submodule to obtain a plurality of second processed data.
In some embodiments, the data to be processed includes the encoding result and the second processed data output by the preceding processing sub-module of the processing sub-module, where the output state is a plurality of second processed data output by the processing sub-module of the last stage.
In some embodiments, the first quantum processing sub-module further comprises: and a fourth obtaining unit for processing a plurality of pixels of a subsequent input sub-image block of the target input sub-image block in response to the measurement sub-result of the determined target input sub-image block.
In some embodiments, the first quantum processing submodule includes: and a fifth obtaining unit, configured to obtain a measurement result according to the plurality of measurement sub-results.
In some embodiments, the fifth obtaining unit comprises: and obtaining the image characteristics of the input image according to the plurality of measurement results. And performing full connection processing on the image characteristics to obtain a processing result of the input image.
Fig. 9 is a block diagram of a training apparatus of an image processing model according to one embodiment of the present disclosure.
As shown in fig. 9, the apparatus 900 may include a second partitioning module 910, a second quantum processing module 920, and a training module 930. The image processing model includes a plurality of quantum processing units.
The second dividing module 910 is configured to divide the input sample image to obtain N input sample image blocks.
The second quantum processing module 920 is configured to process at least one input sample image block by using a plurality of quantum processing units according to the target sample indication information, so as to obtain a plurality of sample measurement results. The target sample indication information includes a plurality of target sample indication sub-information for indicating at least one input sample image block corresponding to the quantum processing unit. The number of input sample image blocks processed by the at least one quantum processing unit is less than N.
The training module 930 is configured to adjust weight data of each of the plurality of quantum processing units according to the label of the input sample image and the plurality of sample measurement results, so as to train the image processing model.
In some embodiments, the N reference image blocks are divided from the reference image. The apparatus 900 may further include: the second obtaining module is used for respectively processing at least one reference image block by utilizing the plurality of quantum processing units according to the indication information of the target pre-training period to obtain a plurality of measurement characteristics of the target pre-training period. The indication information of the target pre-training period includes indication sub-information of a plurality of target pre-training periods, the indication sub-information of the target pre-training period being used to indicate at least one reference image block corresponding to the quantum processing unit. And the second full-connection processing module is used for carrying out full-connection processing on a plurality of measurement features of the target pre-training period to obtain an output result of the target pre-training period.
In some embodiments, apparatus 900 may further comprise: : and the fifth determining module is used for determining the performance index information of the target pre-training period according to the label of the reference image and the output result of the target pre-training period. And a sixth determining module, configured to determine target sample indication information according to the indication information of the target pre-training period, in response to determining that the performance index information pre-adjustment loss of the target pre-training period meets a preset termination condition.
In some embodiments, apparatus 900 may further comprise: and a seventh determining module, configured to adjust a prompt text of the target pre-training period according to the performance descriptor text corresponding to the performance index information of the target pre-training period in response to determining that the performance index information of the target pre-training period does not meet the preset termination condition, so as to obtain a prompt text of a subsequent pre-training period.
In some embodiments, the performance index information of the target pre-training period includes at least one of the first performance index sub-information and the second performance index sub-information. The first performance indicator sub-information of the target pre-training period includes a first performance indicator value of the target pre-training period to be enhanced. The second performance indicator sub-information of the target pre-training period includes a second performance indicator value of the target pre-training period to be reduced.
In some embodiments, the preset termination condition includes at least one of: the first performance index value of the target pre-training period is greater than or equal to a first preset performance threshold, and the second performance index value of the target pre-training period is less than or equal to a second preset performance threshold.
In some embodiments, the prompt text for the target pre-training period includes: and the constraint sub-text of the indication information of the target pre-training period is used for indicating the relation between the performance index information and the indication information of the target pre-training period.
In some embodiments, where the prompt text of the target pre-training period is the initial prompt text, the prompt text of the target pre-training period further includes at least one of: reference descriptor text of the reference image and operation descriptor text of the quantum processing unit, the reference descriptor text indicating a size of the reference image, and the operation descriptor text indicating an operation performed by the quantum processing unit on the reference image.
In some embodiments, in the event that the prompt text of the target pre-training period is not the initial prompt text, the prompt text of the target pre-training period further comprises: information descriptive text of indication information of a previous pre-training period and performance descriptive text corresponding to performance index information of the previous pre-training period.
In some embodiments, the reference descriptor text is further used to indicate at least one of: pixel distribution of the reference image, shape of target reference pixels in the reference image, symmetry of the reference image.
In some embodiments, the indication sub-information of the target pre-training period includes at least one first indication value, and the constraint sub-text of the target pre-training period is further used to indicate at least one of: a first relationship between the number of first index values and the first performance index sub-information; a second relationship between the number of first index values and the second performance index sub-information.
In some embodiments, according to the second quantum processing module, the method comprises: and the second quantum processing sub-module is used for processing at least one input sample image block indicated by the target sample indicating sub-information by utilizing a quantum processing unit corresponding to the target sample indicating sub-information to obtain at least one sample measurement result.
In some embodiments, the at least one input sample image block comprises a plurality of input sample sub-image blocks. The second quantum processing sub-module is further configured to: the plurality of input sample sub-image blocks are sequentially processed using a quantum processing unit corresponding to the target sample instruction sub-information.
In some embodiments, a quantum processing unit includes an encoding module and a processing module, the encoding module including a plurality of single bit rotator gates. The second quantum processing sub-module includes: and a sixth obtaining unit, configured to input a plurality of pixels of the target input sample sub-image block into a plurality of single-bit rotation gates, respectively, to obtain a plurality of encoding results of the target input sample sub-image block. The target input sample sub-image block is from a plurality of input sample sub-image blocks. And a seventh obtaining unit, configured to process the multiple encoding results of the target input sample sub-image block by using the processing module, so as to obtain an output state of the target input sample sub-image block. And an eighth obtaining unit, configured to measure an output state of the target input sample sub-image block along the brix Z operator, and obtain a sample measurement sub-result of the target input sample sub-image block.
In some embodiments, the processing module includes a cascade of multiple processing sub-modules including multiple controlled NOT gates and multiple single bit rotator gates. The seventh obtaining unit includes: and the third obtaining subunit is used for inputting the plurality of to-be-processed data of the target input sample sub-image block into the plurality of controlled NOT gates of the processing sub-module to obtain a plurality of first processed data. The plurality of data to be processed for the target input sample sub-image block is determined based on a plurality of encoding results for the target input sample sub-image block. And the fourth obtaining subunit is used for inputting the first processed data into the single-bit rotating gates of the processing submodule to obtain the second processed data.
In some embodiments, the data to be processed includes the encoded result and second processed data output by a preceding processing sub-module of the processing sub-module. The output state is a plurality of second processed data output by the last stage processing sub-module.
In some embodiments, the second quantum processing sub-module further comprises: a ninth obtaining unit for processing a plurality of pixels of a subsequent input sample sub-image block of the target input sample sub-image block in response to the sample measurement sub-result of the determined target input sample sub-image block.
In some embodiments, the second quantum processing sub-module comprises: and a tenth obtaining unit, configured to obtain a sample measurement result according to the plurality of sample measurement sub-results.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, an image processing method and/or a training method of an image processing model. For example, in some embodiments, the image processing method and/or the training method of the image processing model may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the image processing method and/or the training method of the image processing model described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the image processing method and/or the training method of the image processing model in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) display or an LCD (liquid crystal display)) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (34)
1. An image processing method, comprising:
dividing an input image to obtain N input image blocks, wherein N is an integer greater than 1;
respectively processing at least one input image block by using a plurality of quantum processing units according to target indication information to obtain a plurality of measurement results, wherein the target indication information comprises a plurality of target indication sub-information, the target indication sub-information is used for indicating at least one input image block corresponding to the quantum processing units, and the number of the input image blocks processed by at least one quantum processing unit is smaller than N; and
determining a processing result of the input image based on a plurality of the measurement results,
the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on initial prompt texts, the prompt texts of the target adjustment periods in at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of reference images and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by respectively processing at least one reference image block of the reference images through a plurality of quantum processing units.
2. The method of claim 1, wherein the reference picture corresponds to N reference picture blocks, the N reference picture blocks being obtained by dividing the reference picture,
the method further comprises the steps of:
according to the indication information of the target adjustment period, respectively processing at least one reference image block by using a plurality of quantum processing units to obtain a plurality of measurement characteristics of the target adjustment period, wherein the indication information of the target adjustment period comprises a plurality of indication sub-information of the target adjustment period, and the indication sub-information of the target adjustment period is used for indicating at least one reference image block corresponding to the quantum processing units;
and performing full connection processing on the plurality of measurement features of the target adjustment period to obtain an output result of the target adjustment period.
3. The method of claim 1, further comprising:
determining performance index information of the target adjustment period according to the label of the reference image and the output result of the target adjustment period;
and determining target indication information according to the indication information of the target adjustment period in response to determining that the performance index information of the target adjustment period meets a preset termination condition.
4. A method according to claim 3, further comprising:
and in response to determining that the performance index information of the target adjustment period does not meet the preset termination condition, adjusting the prompt text of the target adjustment period according to the performance descriptor text corresponding to the performance index information of the target adjustment period, and obtaining the prompt text of the later adjustment period.
5. The method of claim 3 or 4, wherein the performance indicator information of the target adjustment period comprises at least one of first performance indicator sub-information comprising a first performance indicator value of the target adjustment period to be increased and second performance indicator sub-information comprising a second performance indicator value of the target adjustment period to be decreased.
6. The method of claim 5, wherein the preset termination condition comprises at least one of: the first performance index value of the target adjustment period is greater than or equal to a first preset performance threshold value, and the second performance index value of the target adjustment period is less than or equal to a second preset performance threshold value.
7. The method of claim 5, wherein the prompt text for the target adjustment period comprises: and the constraint sub-text of the indication information of the target adjustment period is used for indicating the relation between the performance index information and the indication information of the target adjustment period.
8. The method of claim 7, wherein, in the case where the target adjustment period of the prompt text is the initial prompt text, the target adjustment period of the prompt text further comprises at least one of: the quantum processing unit is configured to perform an operation on the reference image, and the reference image includes a reference descriptor text of the reference image and an operation descriptor text of the quantum processing unit, the reference descriptor text being used to indicate a size of the reference image, and the operation descriptor text being used to indicate an operation performed on the reference image by the quantum processing unit.
9. The method of claim 7, wherein, in the event that the target adjustment period of prompt text is not the initial prompt text, the target adjustment period of prompt text further comprises: information descriptive text of indication information of a previous adjustment period and performance descriptive text corresponding to performance index information of the previous adjustment period.
10. The method of claim 8, wherein the reference descriptor text is further used to indicate at least one of: the pixel distribution of the reference image, the shape of the target reference pixel in the reference image, and the symmetry of the reference image.
11. The method of claim 7, wherein the indication sub-information of the target adjustment period includes at least one first indication value, the constraint sub-text of the target adjustment period further being used to indicate at least one of:
a first relationship between the number of first index values and the first performance index sub-information;
a second relationship between the number of first index values and the second performance index sub-information.
12. The method of claim 1, wherein the processing at least one of the input image blocks with a plurality of quantum processing units, respectively, according to the target indication information, to obtain a plurality of measurement results comprises:
and processing at least one input image block indicated by the target indicator information by using the quantum processing unit corresponding to the target indicator information to obtain at least one measurement result.
13. The method of claim 12, wherein at least one of the input image blocks comprises a plurality of input sub-image blocks,
The processing, with the quantum processing unit corresponding to the target instruction sub-information, at least one of the input image blocks indicated by the target instruction sub-information includes:
and sequentially processing a plurality of input sub-image blocks by using the quantum processing units corresponding to the target indicator information.
14. The method of claim 13, wherein the quantum processing unit comprises an encoding module and a processing module, the encoding module comprising a plurality of single bit rotator gates,
the sequentially processing the plurality of input sub-image blocks by using the quantum processing unit corresponding to the target indicator information includes:
respectively inputting a plurality of pixels of a target input sub-image block into a plurality of single-bit rotating gates to obtain a plurality of coding results of the target input sub-image block, wherein the target input sub-image block is from a plurality of input sub-image blocks;
processing a plurality of encoding results of the target input sub-image block by using the processing module to obtain an output state of the target input sub-image block;
and measuring the output state of the target input sub-image block to obtain a measurement sub-result of the target input sub-image block.
15. The method of claim 14, wherein the processing module comprises a cascade of a plurality of processing sub-modules comprising a plurality of controlled NOT gates and a plurality of single bit rotator gates,
the processing, by using the processing module, the plurality of encoding results of the target input sub-image block, and obtaining an output state of the target input sub-image block includes:
inputting a plurality of to-be-processed data of the target input sub-image block into a plurality of controlled NOT gates of the processing sub-module to obtain a plurality of first processed data, wherein the plurality of to-be-processed data of the target input sub-image block is determined according to a plurality of coding results of the target input sub-image block;
and inputting the first processed data into the single-bit turnstiles of the processing submodule to obtain second processed data.
16. The method of claim 15, wherein the data to be processed comprises the encoded result and second processed data output by a preceding processing sub-module of the processing sub-module,
the output state is a plurality of second processed data output by the processing sub-module of the last stage.
17. The method of claim 13, wherein sequentially processing a plurality of the input sub-image blocks with the quantum processing unit corresponding to the target indicator sub-information further comprises:
In response to having determined the measurement sub-result of the target input sub-image block, a plurality of pixels of a subsequent input sub-image block of the target input sub-image block are processed.
18. The method of claim 14, wherein sequentially processing a plurality of the input sub-image blocks using the quantum processing unit corresponding to the target indicator sub-information comprises:
and obtaining the measurement result according to a plurality of measurement sub-results.
19. The method of claim 1, wherein the determining the processing result of the input image from the plurality of measurement results comprises:
obtaining image features of the input image according to a plurality of measurement results;
and performing full connection processing on the image characteristics to obtain a processing result of the input image.
20. A method of training an image processing model, the image processing model comprising a plurality of quantum processing units, comprising:
dividing an input sample image to obtain N input sample image blocks, wherein N is an integer greater than 1;
respectively processing at least one input sample image block by using a plurality of quantum processing units according to target sample indication information to obtain a plurality of sample measurement results, wherein the target sample indication information comprises a plurality of target sample indication sub-information which is used for indicating at least one input sample image block corresponding to the quantum processing units, and the number of the input sample image blocks processed by the at least one quantum processing unit is smaller than N; and
Adjusting respective parameter information of a plurality of the quantum processing units according to the labels of the input sample images and a plurality of the sample measurement results to train the image processing model,
the target sample indication information is determined according to a target sample prompt text, the target sample prompt text is determined after at least one pre-training period of pre-training is performed on an initial sample prompt text, the prompt text of a target pre-training period in at least one pre-training period is obtained according to the initial sample prompt text, the indication information of the target pre-training period is adjusted according to a label of a reference image and an output result of the target pre-training period, and the output result of the target pre-training period is obtained by respectively processing at least one reference image block of the reference image by utilizing a plurality of quantum processing units.
21. The method of claim 20, wherein adjusting the parameter information of each of the plurality of quantum processing units based on the tag of the input sample image and the plurality of sample measurements comprises:
determining a sample loss according to the label of the input sample image and a plurality of sample measurement results;
And adjusting the parameter information of each of the plurality of quantum processing units according to the sample loss.
22. A quantum processing apparatus, comprising:
the quantum execution units are configured to respectively process at least one input image block to obtain a plurality of measurement results, wherein at least one input image block is determined from N input image blocks according to target indication information, the N input image blocks are obtained by dividing the input image, and N is an integer greater than 1; and
an output unit configured to determine a processing result of the input image based on a plurality of the measurement results,
wherein the number of the input image blocks processed by at least one of the quantum processing units is smaller than N,
the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on initial prompt texts, the prompt texts of the target adjustment periods in at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of reference images and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by respectively processing at least one reference image block of the reference images through a plurality of quantum processing units.
23. The apparatus of claim 22, wherein the quantum execution unit comprises:
the encoding module is configured to encode a plurality of pixels of a target input sub-image block to obtain a plurality of encoding results of the target input sub-image block, wherein the target input sub-image block is from a plurality of input sub-image blocks, and the input sub-image blocks are from at least one input image block;
the processing module is configured to process a plurality of encoding results of the target input sub-image block to obtain an output state of the target input sub-image block; and
and the measurement module is configured to measure the output state of the target input sub-image block to obtain a measurement sub-result of the target input sub-image block.
24. The apparatus of claim 23, wherein the encoding module comprises a plurality of single-bit rotator gates, the plurality of single-bit rotator gates configured to:
and obtaining a plurality of coding results of the target input sub-image block according to the plurality of pixels of the target input sub-image block.
25. The apparatus of claim 23, wherein the processing module comprises a plurality of processing sub-modules in cascade, the processing sub-modules comprising:
The controlled NOT gates are configured to obtain a plurality of first processed data according to a plurality of to-be-processed data of the target input sub-image block, wherein the plurality of to-be-processed data of the target input sub-image block is determined according to a plurality of encoding results of the target input sub-image block; and
and the single-bit revolving doors are configured to obtain a plurality of second processed data according to the plurality of first processed data.
26. The apparatus of claim 25, wherein the data to be processed comprises the encoded result and second processed data output by a preceding processing sub-module of the processing sub-module,
the output state is a plurality of second processed data output by the processing sub-module of the last stage.
27. The apparatus of claim 23, wherein the measurement module is configured to measure an output state of the target input sub-image block by:
the output states of the target input sub-image block are measured along a berlite Z operator.
28. The apparatus of claim 23, wherein the quantum execution unit is further configured to process a plurality of pixels of a subsequent input sub-image block of the target input sub-image block in response to having determined a measurement sub-result of the target input sub-image block.
29. A quantum processing apparatus comprising the device of any one of claims 22 to 28.
30. An image processing apparatus comprising:
the first dividing module is used for dividing the input image to obtain N input image blocks, wherein N is an integer greater than 1;
the first quantum processing module is used for respectively processing at least one input image block by utilizing a plurality of quantum processing units according to target indication information to obtain a plurality of measurement results, wherein the target indication information comprises a plurality of target indication sub-information which is used for indicating at least one input image block corresponding to the quantum processing units, and the number of the input image blocks processed by the at least one quantum processing unit is smaller than N;
a first determining module for determining a processing result of the input image according to a plurality of the measurement results,
the target indication information is determined according to target prompt texts, the target prompt texts are determined after at least one adjustment period is carried out on initial prompt texts, the prompt texts of the target adjustment periods in at least one adjustment period are obtained according to the initial prompt texts, the prompt texts of the target adjustment periods are adjusted according to labels of reference images and output results of the target adjustment periods, and the output results of the target adjustment periods are obtained by respectively processing at least one reference image block of the reference images through a plurality of quantum processing units.
31. An image processing model training apparatus, the image processing model including a plurality of quantum processing units, includes
The second dividing module is used for dividing the input sample image to obtain N input sample image blocks, wherein N is an integer greater than 1;
the second quantum processing module is used for respectively processing at least one input sample image block by utilizing a plurality of quantum processing units according to target sample indication information to obtain a plurality of sample measurement results, wherein the target sample indication information comprises a plurality of target sample indication sub-information which is used for indicating at least one input sample image block corresponding to the quantum processing units, and the number of the input sample image blocks processed by the at least one quantum processing unit is smaller than N; and
a training module for adjusting respective parameter information of the plurality of quantum processing units according to the labels of the input sample image and the plurality of sample measurement results to train the image processing model,
the target sample indication information is determined according to a target sample prompt text, the target sample prompt text is determined after at least one pre-training period of pre-training is performed on an initial sample prompt text, the prompt text of a target pre-training period in at least one pre-training period is obtained according to the initial sample prompt text, the indication information of the target pre-training period is adjusted according to a label of a reference image and an output result of the target pre-training period, and the output result of the target pre-training period is obtained by respectively processing at least one reference image block of the reference image by utilizing a plurality of quantum processing units.
32. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 21.
33. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1 to 21.
34. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311767682.4A CN117745512A (en) | 2023-12-20 | 2023-12-20 | Quantum computation-based image processing method, device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311767682.4A CN117745512A (en) | 2023-12-20 | 2023-12-20 | Quantum computation-based image processing method, device, electronic equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117745512A true CN117745512A (en) | 2024-03-22 |
Family
ID=90277226
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311767682.4A Pending CN117745512A (en) | 2023-12-20 | 2023-12-20 | Quantum computation-based image processing method, device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117745512A (en) |
-
2023
- 2023-12-20 CN CN202311767682.4A patent/CN117745512A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020167490A1 (en) | Incremental training of machine learning tools | |
CN113792854A (en) | Model training and word stock establishing method, device, equipment and storage medium | |
CN115374948B (en) | Training method, data processing method, device and medium of quantum neural network | |
US20230162477A1 (en) | Method for training model based on knowledge distillation, and electronic device | |
CN113642583B (en) | Deep learning model training method for text detection and text detection method | |
US20220374678A1 (en) | Method for determining pre-training model, electronic device and storage medium | |
CN113379059B (en) | Model training method for quantum data classification and quantum data classification method | |
WO2021012263A1 (en) | Systems and methods for end-to-end deep reinforcement learning based coreference resolution | |
CN109787958A (en) | Network flow real-time detection method and detection terminal, computer readable storage medium | |
CN115293149A (en) | Entity relationship identification method, device, equipment and storage medium | |
CN114863229A (en) | Image classification method and training method and device of image classification model | |
CN116109004A (en) | Insulator leakage current prediction method, device, equipment and medium | |
CN115454706A (en) | System abnormity determining method and device, electronic equipment and storage medium | |
CN113989152A (en) | Image enhancement method, device, equipment and storage medium | |
CN114973333B (en) | Character interaction detection method, device, equipment and storage medium | |
CN111723186A (en) | Knowledge graph generation method based on artificial intelligence for dialog system and electronic equipment | |
CN116310643A (en) | Video processing model training method, device and equipment | |
CN113361621B (en) | Method and device for training model | |
CN115879004A (en) | Target model training method, apparatus, electronic device, medium, and program product | |
CN117745512A (en) | Quantum computation-based image processing method, device, electronic equipment and medium | |
CN112784967B (en) | Information processing method and device and electronic equipment | |
CN115496916A (en) | Training method of image recognition model, image recognition method and related device | |
CN114610953A (en) | Data classification method, device, equipment and storage medium | |
CN117522883A (en) | Quantum computation-based image processing method, device, electronic equipment and medium | |
CN113139483A (en) | Human behavior recognition method, apparatus, device, storage medium, and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |