Quantum data set construction method and system oriented to image similarity task, storage medium and terminal
By optimizing quantum circuit design and evolution algorithms, high-quality quantum data sets are solved, and the problems of scarcity of data sets and insufficient algorithm adaptability in quantum image processing are improved, the efficiency and accuracy of image similarity evaluation are promoted, and quantum images are promoted. Advances in processing technology.
Patent Information
- Application Number
- CN202411167466.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-10
AI Technical Summary
Existing quantum image processing technology faces problems such as scarcity of data sets, lack of universality and adaptability of algorithms, limited hardware resources, and high optimization difficulty, resulting in low image similarity detection efficiency and accuracy.
By optimizing quantum circuit design, combining evolution algorithms to perform quantum circuit evolution, generate high-adaptive and diverse quantum circuits, build high-quality quantum data sets, explore global information using quantum entanglement, and improve the efficiency and accuracy of image similarity evaluation. .
It significantly improves the efficiency and accuracy of image similarity evaluation, builds large-scale and high-quality quantum data sets, enhances the adaptability and diversity of algorithms, provides a solid data foundation, and opens up new things for the development of quantum image processing technology. the way.
Smart Images

Figure CN119106746A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a quantum data set construction method, system, storage medium and terminal for image similarity tasks. Background Art
[0002] The rapid development of quantum computing technology has undoubtedly pushed quantum image processing to the forefront of scientific research. With its unique parallel processing capabilities and quantum state superposition characteristics, this technology has shown great application potential in image processing tasks. Although quantum algorithms have been applied to tasks such as image classification, recognition, and similarity comparison, most of the current research is still in the theoretical exploration and preliminary experimental stage, and has not yet formed a complete application system.
[0003] Among them, image similarity detection plays a vital role in many key areas. For example, in medical image analysis, it helps doctors quickly identify lesion patterns; in security monitoring, it can detect abnormal behavior; in e-commerce, it supports recommendation systems to achieve personalized shopping experiences. However, with the surge in data volume and the increase in complexity, classical image processing technology is facing a bottleneck in computing power. Quantum computing, with its advantages in parallel processing and quantum superposition, provides new possibilities for solving this bottleneck. The advantages of quantum algorithms in processing high-dimensional data indicate their potential for application in image similarity detection. The large-scale parallel computing capabilities of quantum computing are particularly critical for areas such as image retrieval, copyright detection, and content recommendation, and are expected to significantly improve the efficiency and accuracy of these tasks.
[0004] However, the development of quantum image processing technology still faces many challenges. The first is the limitation of the data set. A high-quality quantum data set is crucial for the training and verification of the algorithm. It needs to be able to reflect the characteristics of quantum state superposition and entanglement when the quantum algorithm processes images. At present, the construction of quantum data sets faces technical challenges such as data collection, labeling and quantization, resulting in a relative scarcity of high-quality data sets. This scarcity limits the development and application of quantum image processing algorithms, because the lack of sufficient training samples will affect the generalization ability of the algorithm and the training effect.
[0005] In addition, existing quantum image processing algorithms often lack versatility and adaptability to different types of images, which may lead to performance degradation when processing diverse image data. At the same time, the hardware resources of quantum computers, such as the number of quantum bits and the execution depth of quantum gates, are relatively limited, which directly affects the complexity and processing power of quantum algorithms. At the same time, the difficulty of algorithm optimization is also an important issue. The optimization of quantum algorithms relies on complex mathematical models and physical principles, which increases the difficulty of algorithm design and complicates the debugging and verification process. Summary of the invention
[0006] The purpose of the present invention is to overcome the problems existing in the prior art and provide a quantum data set construction method, system, storage medium and terminal for image similarity tasks. By optimizing the design of quantum circuits, the depth and combination of quantum circuits are adjusted through an intelligent evolution process, ensuring the adaptability and diversity of the algorithm, and achieving higher evaluation accuracy when processing image data.
[0007] The objective of the present invention is achieved through the following technical solutions:
[0008] In a first aspect, a method for constructing a quantum dataset for an image similarity task is provided, comprising the following steps:
[0009] S1, obtaining an original image data set, and enhancing the original image therein to obtain an enhanced image; combining the original image and the enhanced image to form a binary data set;
[0010] S2, converting each image in the binary data set into a quantum state by a specific quantum encoding method;
[0011] S3. Performing quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the performing quantum circuit evolution based on the quantum state includes:
[0012] Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits;
[0013] S4, saving the best quantum circuit as a QASM file, and marking each QASM file;
[0014] S5. Store the QASM file and annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
[0015] In some embodiments, the enhancing the original image includes:
[0016] The original image is cropped and / or rotated and / or noise is added.
[0017] In some embodiments, combining the original image and the enhanced image to form a binary data set includes:
[0018] Pairing an original image with its corresponding enhanced image forms a set of images; pairing two different original images forms another set of images.
[0019] In some embodiments, the quantum encoding method is amplitude encoding.
[0020] In some embodiments, the use of an evolutionary algorithm to optimize a quantum circuit includes:
[0021] The quantum circuits are subjected to mutation, crossover and selection operations in sequence.
[0022] Preferably, when selecting quantum circuits, quantum circuits with high fitness are selected through fitness functions.
[0023] In some embodiments, the marking each QASM file includes:
[0024] Annotate the basic properties of the image, correlation labels, and quantum circuit properties.
[0025] Second, a quantum dataset construction system for image similarity tasks is provided, including:
[0026] A binary data set construction module is used to obtain an original image data set, and enhance the original image therein to obtain an enhanced image; the original image and the enhanced image are combined to form a binary data set;
[0027] A quantum coding module, used for converting each image in the binary data set into a quantum state through a specific quantum coding method;
[0028] A quantum circuit evolution module is used to perform quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the quantum circuit evolution according to the quantum state includes:
[0029] Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits;
[0030] The quantum data set construction module is used to save the best quantum circuit as a QASM file and annotate each QASM file; it is also used to store the QASM file and the annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
[0031] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, any one of the methods for constructing a quantum data set for an image similarity task is implemented.
[0032] In a fourth aspect, a terminal is provided, comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, wherein the processor executes any one of the methods for constructing a quantum data set for an image similarity task when executing the computer instructions.
[0033] It should be further explained that the technical features corresponding to the above options can be combined or replaced with each other to form a new technical solution if there is no conflict.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] (1) The present invention combines evolutionary algorithms with quantum computing. Specifically, each image in the binary data set is converted into a quantum state through a specific quantum coding method, and quantum circuit evolution is performed based on the quantum state of each image, wherein an evolutionary algorithm is used to optimize the quantum circuit and select the best quantum circuit. Through the optimization of carefully designed quantum circuits and evolutionary algorithms, the efficiency and accuracy of image similarity evaluation are significantly improved. Evolutionary algorithms are search algorithms based on the principles of natural selection and genetics, and are suitable for large-scale complex optimization problems. After the evolutionary algorithm is combined with quantum computing, the unique advantages of quantum computing can be used to accelerate the optimization process. At the same time, quantum entanglement establishes associations between different quantum states, allowing the quantum evolutionary algorithm to better explore and utilize global information in the solution space. This helps to avoid falling into local optimal solutions, thereby improving the effect of global optimization. The depth and combination of quantum circuits are adjusted through an intelligent evolutionary process, ensuring the adaptability and diversity of the algorithm, thereby achieving higher evaluation accuracy when processing image data.
[0036] (2) The high fitness quantum circuits selected by the present invention are selected by the fitness function, wherein the fitness function adopted is based on the Spearman correlation evaluation index, which comprehensively considers the intuitive differences and statistical correlations between images, and provides a comprehensive and scientific evaluation standard for the selection of quantum circuits. This evaluation method not only improves the accuracy of the evaluation, but also enhances the adaptability of the algorithm to different image data sets.
[0037] (3) The quantum dataset constructed by the present invention is large-scale, high-quality and high-standard, and can accurately evaluate the similarity between different images. The establishment of this dataset has made an important contribution to the line benchmark in the quantum image processing task scenario and provided a solid data foundation for the quantum image similarity task.
[0038] (4) In the image similarity evaluation stage, the present invention uses the optimized quantum circuit to process the image data, demonstrating the advantages of high-fitness quantum circuits in reflecting the similarity between images. Through continuous iterative optimization, the present invention can adapt to different image data sets and similarity evaluation tasks, ensuring the continuous improvement and optimization of quantum circuits. Finally, the implementation of the present invention will open up new paths for the development of quantum image processing technology, and has important scientific significance and broad application prospects. By making full use of the powerful potential of quantum computing, the present invention not only improves the efficiency and accuracy of image similarity evaluation, but also provides an efficient and accurate new tool for the field of quantum image processing, which is expected to promote the progress and innovation of related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flow chart of a method for constructing a quantum data set for an image similarity task shown in an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a quantum circuit optimized by an evolutionary algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various configurations. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0042] It should be noted that the defects existing in the solutions in the above-mentioned prior art are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above-mentioned problems and the solutions proposed in the embodiments of the present application for the above-mentioned problems below should all be the contributions made by the inventor to the present application in the process of invention and creation, and should not be understood as technical contents known to technical personnel in this field.
[0043] In view of the technical problems pointed out in the background technology, the embodiments provided by the present invention are as follows:
[0044] In an exemplary embodiment, a method for constructing a quantum data set for an image similarity task is provided, referring to Figure 1 , the method comprises the following steps:
[0045] S1, obtaining an original image data set, and enhancing the original image therein to obtain an enhanced image; combining the original image and the enhanced image to form a binary data set;
[0046] S2, converting each image in the binary data set into a quantum state by a specific quantum encoding method;
[0047] S3. Performing quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the performing quantum circuit evolution based on the quantum state includes:
[0048] Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits;
[0049] S4, saving the best quantum circuit as a QASM file, and marking each QASM file;
[0050] S5. Store the QASM file and annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
[0051] Evolutionary algorithm is a search algorithm based on the principles of natural selection and genetics, which is suitable for large-scale complex optimization problems. The present invention combines evolutionary algorithm with quantum computing, converts each image in the binary data set into a quantum state through a specific quantum coding method, and performs quantum circuit evolution based on the quantum state of each image. The evolutionary algorithm is used to optimize the quantum circuit and select the best quantum circuit. Through the optimization of carefully designed quantum circuits and evolutionary algorithms, the efficiency and accuracy of image similarity evaluation are significantly improved.
[0052] When evolutionary algorithms are combined with quantum computing, the unique advantages of quantum computing can be used to accelerate the optimization process. At the same time, quantum entanglement establishes connections between different quantum states, allowing quantum evolutionary algorithms to better explore and utilize global information in the solution space. This helps avoid falling into local optimal solutions, thereby improving the effect of global optimization. The depth and combination of quantum circuits are adjusted through the intelligent evolution process, ensuring the adaptability and diversity of the algorithm, thereby achieving higher evaluation accuracy when processing image data.
[0053] In some examples, step S1 involves preprocessing of the image. Specifically, in the implementation of the present invention, the preparation of the data set is a crucial step. First, based on the original data set A series of image preprocessing operations are performed, including image cropping and clarity enhancement, to ensure that the quality of the image data meets the requirements of subsequent analysis. Specifically, for each original image x i , applying a set of image enhancement transformations T:
[0054]
[0055] Among them, T j represents the jth image enhancement operation (such as cropping, rotation, adding noise, etc.), generating a set of enhanced images.
[0056] Next, the processed images are paired in pairs to form image tuples. Image tuples include two categories:
[0057] ① Enhanced image group: {(x i ,x' i )}, where x' i is x i An enhanced version of .
[0058] ②Completely different image groups: (x i ,x k ), where xi and x k come from different original images, and i≠k.
[0059] This method constructs a standard image pair dataset for quantum image similarity assessment tasks.
[0060]
[0061] The dataset It contains all original images and their corresponding enhanced versions, forming a standard image binary dataset, laying the foundation for subsequent image similarity assessment tasks.
[0062] In some examples, each image is converted into a quantum state in step S2 using a specific quantum coding method. This process involves mapping the pixel values or features of the image to quantum bits. Common coding methods include amplitude coding and angle coding. Taking amplitude coding as an example, for an image of size N×N, flattening it to obtain a normalized length of 3N 2 The pixel intensity vector V is encoded into the amplitude of the quantum state:
[0063]
[0064] where |ψ> represents the quantum state obtained by amplitude embedding into a pair of training sets. i Represents the i-th element of the training set vector V.
[0065] In some examples, step S3 involves the design, optimization and screening of quantum circuits. Specifically, the present invention uses a basic quantum gate set {RZ, RY, RX, H, CNOT} to form a quantum circuit. The combination of these gates and the depth of the circuit are intelligently optimized through an evolutionary algorithm to ensure the adaptability and diversity of the algorithm. The representation of a quantum circuit can be defined as Q = {q1, q2, ..., q L}, where q i Represents the i-th quantum gate.
[0066] Further, refer to Figure 2 In the present invention, the adaptive generation process of quantum circuits uses evolutionary algorithms to optimize quantum circuits to achieve the goal of efficiently executing specific quantum image processing tasks. The process involves three key operations: mutation, crossover, and selection. is the current population, where each individual Represents a quantum circuit.
[0067] In order to increase the diversity of the population, random mutations are performed on selected quantum circuits. The mutation operation may include changing the type of quantum gates, adjusting parameters, or rearranging the order of gates. The mutation operation introduces new circuit characteristics by randomly changing certain gates or their parameters in the quantum circuit. i represents a quantum gate in a quantum circuit, and the mutation operation can be expressed as:
[0068] q i →q' i #(2)
[0069] Among them, q' i It is a mutated quantum gate, which may involve changes in gate type, adjustment of parameters, or position changes in the quantum circuit.
[0070] The crossover method is designed to ensure that the newly generated circuits can explore new solution spaces while maintaining the original excellent properties. The crossover operation generates new circuits by combining the advantages of two quantum circuits. i and p j They are two quantum circuits, and their intersection generates a new circuit p k It can be expressed as:
[0071] p k = {q i1 ,q j2 ,…,q iL}#(3
[0072] Among them, q i1 ,q j2 ,…,q iL It is from p i and p j The quantum gate sequence selected in is L, and L is the length of the new circuit.
[0073] The selection operation selects excellent quantum circuits based on the fitness function f(Q). According to the evaluation results of the fitness function, quantum circuits with excellent performance are selected as "elites", and these circuits will be retained to the next generation. At the same time, in order to maintain the diversity of the population, some circuits with average performance but different characteristics can also be selected. The fitness function can be expressed as:
[0074] f(Q)=w1·A+w2·C+w3·R#(4)
[0075] Among them, A represents the accuracy of the algorithm, C represents the computational efficiency, R represents the resource consumption, and w1, w2, and w3 are weight coefficients used to balance the importance of different performance indicators.
[0076] The evaluation results of the fitness function will guide the selection operation to determine which quantum circuits will be retained to the next generation of the population. The selection process can be implemented by ranking selection, roulette selection or tournament selection.
[0077] The entire evolution process is an iterative optimization process, which can be expressed as:
[0078]
[0079] in, represents the population of generation t, Represents the next generation population.
[0080] Through this adaptive generation process, highly optimized quantum circuits are generated, which can provide excellent performance for specific quantum image processing tasks. At the same time, the diversity and representativeness of quantum circuits can ensure that the algorithm can learn image features from different angles and conditions while improving the quality of quantum data sets.
[0081] In some examples, key metrics considered by the fitness function include algorithm accuracy, computational efficiency, and resource consumption. Each circuit can be executed on a quantum simulator or actual quantum hardware to collect data on its performance in the fitness function. The fitness function f(Q) is defined as the circuit expectation vector value E between two images. rg =E1-E0 and Euclidean distance ED rg The Spearman correlation evaluation index. Euclidean distance E d It can be expressed as:
[0082]
[0083] Among them, (R 2i ,G 2i ,G 2i ) and (R 1i ,G 1i ,G 1i ) represent the RGB values of the i-th pixel in the reference image and the image to be compared, respectively. In actual calculation, the color frequency histogram and other methods can also be used to simplify this process to compress pixel information for fast calculation. At this time, the Euclidean distance can be expressed as:
[0084]
[0085] Among them, H 1i and H 2i They represent the channel information of the i-th interval of the two histograms respectively, and n represents the total number of intervals in each histogram.
[0086] The Spearman correlation coefficient is a non-parametric statistic that measures the correlation between two variables and is independent of the distribution of the data. By definition, the Spearman correlation coefficient ranges from -1 to 1, with 0 indicating no correlation, 1 indicating a perfect positive correlation, and -1 indicating a perfect negative correlation. Models that exhibit higher positive correlation values show relatively better performance. The calculation of the correlation assessment score follows the following method:
[0087]
[0088] Among them, E sim(i) and Ed (i) Respectively represent E rg and ED rg The i-th element of , and σ(E rg ) and σ(ED rg Denote two sets E rg and ED rg The average value of the elements in .
[0089] The necessity of using Spearman correlation as a fitness function is that it can fully reflect the intuitive differences and statistical correlations between images. This evaluation method not only improves the accuracy of the evaluation, but also enhances the adaptability of the algorithm to different image data sets. In this way, quantum circuits with high fitness can be screened out to build a large-scale, high-quality, and high-standard quantum data set for image similarity detection tasks.
[0090] Furthermore, in the image similarity evaluation stage, the optimized quantum circuit is used to process the image data, demonstrating the advantages of the high-adaptability metric subcircuit in reflecting the similarity between images. Through continuous iterative optimization, the evolutionary algorithm can adapt to different image data sets and similarity evaluation tasks. This iterative process ensures the continuous improvement and optimization of the quantum circuit to meet the ever-changing evaluation needs. Finally, the best quantum circuit is converted into QASM format and saved as a file.
[0091] In some examples, the specific process of post-processing quantum datasets is given. In quantum image processing tasks, quantum datasets are constructed using high-fitness quantum circuits. First, the original dataset is Encode in a unified encoding method, the corresponding encoding circuit is encoder, then use the evolved quantum circuit ansatz for evolution, and finally save the encoder's encoding circuit and the quantum circuit merged by ansatz as QA SM files. The specific steps are as follows:
[0092] ① Encoded dataset: Encode the original dataset Through a unified quantum coding method, it is mapped to quantum state 0. For each image x i, through the encoding function E(x i ), mapping it to the corresponding quantum state
[0093] |ψ i >.
[0094] |ψ i > = E(x i )
[0095] ②Quantum circuit evolution: Use ansatz to perform quantum circuit evolution and generate the quantum state corresponding to each image. Assuming that the retained quantum circuit is U, the quantum state after evolution |φ i > is represented by the following formula:
[0096] |φ i >=U|ψ i >
[0097] This process loads and executes the corresponding quantum gate operations through the QASM file, so that the quantum state corresponding to each image undergoes a series of quantum gate operations to obtain the evolved quantum state.
[0098] ③ Quantum circuit processing: The encoder's coding circuit and the quantum circuit merged by ansatz are uniformly saved as QASM files respectively. The two saved QASM files are two separate files, which are distinguished by the saved file name.
[0099] ④ Data annotation: During the construction of the quantum dataset, each QASM file is annotated in detail, including the basic attributes of the image, correlation labels, and quantum circuit properties, such as the number of quantum bits, circuit depth, number of CNOT gates, etc., to facilitate further analysis and optimization.
[0100] ⑤Data storage: Store the QASM file corresponding to each image and the corresponding label in CSV format to generate a quantum dataset for image similarity tasks.
[0101] Through these steps, a high-quality quantum data set can be constructed, providing a solid data foundation for quantum image processing and similarity detection tasks. In general, the quantum data set construction method of the present invention fully utilizes the powerful potential of quantum computing and provides an efficient and accurate new tool in the field of image similarity assessment. The implementation of this method will undoubtedly open up a new path for the development of quantum image processing technology, which has important scientific significance and broad application prospects.
[0102] In another exemplary embodiment, based on the same inventive concept as the above method, a quantum data set construction system for image similarity tasks is provided, comprising:
[0103] A binary data set construction module is used to obtain an original image data set, and enhance the original image therein to obtain an enhanced image; the original image and the enhanced image are combined to form a binary data set;
[0104] A quantum coding module, used for converting each image in the binary data set into a quantum state through a specific quantum coding method;
[0105] A quantum circuit evolution module is used to perform quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the quantum circuit evolution according to the quantum state includes:
[0106] Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits;
[0107] The quantum data set construction module is used to save the best quantum circuit as a QASM file and annotate each QASM file; it is also used to store the QASM file and the annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
[0108] It should be noted that each module in the system implements functions corresponding to each step in the above method embodiment, which will not be described in detail here.
[0109] In another exemplary embodiment, based on the same inventive concept as the above method, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the quantum data set construction method for image similarity tasks provided by the embodiment of the present invention is implemented. Based on such an understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] In another exemplary embodiment, based on the same inventive concept as the above method, a terminal is provided, including a memory and a processor, wherein the memory stores computer instructions executable on the processor, and when the processor executes the computer instructions, the quantum data set construction method for image similarity tasks provided in an embodiment of the present invention is executed.
[0111] The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
[0112] Embodiments of the subject matter and functional operations described in this specification may be implemented in: tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode and transmit information to a suitable receiver device for execution by the data processing device.
[0113] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.
[0114] Processors suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0115] It should be understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A quantum dataset construction method for image similarity tasks, characterized in that: The following steps are involved: S1, obtaining an original image data set, and enhancing the original image therein to obtain an enhanced image; combining the original image and the enhanced image to form a binary data set; S2, converting each image in the binary data set into a quantum state by a specific quantum encoding method; S3. Performing quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the performing quantum circuit evolution based on the quantum state includes: Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits; S4, saving the best quantum circuit as a QASM file, and marking each QASM file; S5. Store the QASM file and annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
2. A quantum data set construction method for image similarity tasks according to claim 1, characterized in that: The step of enhancing the original image comprises: The original image is cropped and / or rotated and / or noise is added.
3. The method for constructing a quantum data set for image similarity tasks according to claim 1, characterized in that: The step of combining the original image and the enhanced image to form a binary data set includes: Pairing an original image with its corresponding enhanced image forms a set of images; pairing two different original images forms another set of images.
4. The method for constructing a quantum data set for image similarity tasks according to claim 1, characterized in that: The quantum coding method is amplitude coding.
5. The method for constructing a quantum data set for image similarity tasks according to claim 1, characterized in that: The method of using an evolutionary algorithm to optimize quantum circuits includes: The quantum circuits are subjected to mutation, crossover and selection operations in sequence.
6. The method for constructing a quantum data set for image similarity tasks according to claim 5, characterized in that: When selecting quantum circuits, high fitness quantum circuits are selected through fitness functions.
7. The method for constructing a quantum data set for image similarity tasks according to claim 1, characterized in that: The marking of each QASM file includes: Annotate the basic properties of the image, correlation labels, and quantum circuit properties.
8. A quantum dataset construction system for image similarity tasks, characterized in that: include: A binary data set construction module is used to obtain an original image data set and enhance the original image therein to obtain an enhanced image; The original image and the enhanced image are combined to form a binary dataset; A quantum coding module, used for converting each image in the binary data set into a quantum state through a specific quantum coding method; A quantum circuit evolution module is used to perform quantum circuit evolution based on the quantum state of each image to generate the evolved quantum state of each image; wherein the quantum circuit evolution according to the quantum state includes: Use evolutionary algorithms to optimize quantum circuits and select the best quantum circuits; The quantum data set construction module is used to save the best quantum circuit as a QASM file and annotate each QASM file; it is also used to store the QASM file and the annotation file corresponding to each image to obtain a quantum data set for the image similarity task.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for constructing a quantum data set for an image similarity task as described in any one of claims 1 to 7 is implemented.
10. A terminal comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, characterized in that: When the processor runs the computer instructions, it executes the quantum data set construction method for image similarity tasks described in any one of claims 1 to 7.
