Pattern recognition method and device

The pattern recognition method leverages quantum computing to prepare quantum states and perform inverse Fourier transforms, enhancing the efficiency of pattern recognition by utilizing quantum parallelism to quickly determine recognition results.

CN119227826AActive Publication Date: 2024-12-31ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310790853.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2024-12-31
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

The efficiency of pattern recognition is limited by the computing power of classical computing, especially with the increasing amount of data to be processed.

Method used

A pattern recognition method utilizing quantum computing, involving the preparation of a first quantum state based on reference and target sequences, followed by measurement and inverse quantum Fourier transform to obtain a target wave number, which is then used with a preset threshold to determine recognition results.

Benefits of technology

Quantum computing's intrinsic parallelism allows for rapid computation of the target wave number, reducing the time required for pattern recognition and improving efficiency compared to classical methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227826A_ABST
    Figure CN119227826A_ABST
Patent Text Reader

Abstract

The invention discloses a pattern recognition method and device, and the method comprises the steps: preparing a first quantum state based on the serial number of a reference sequence and the serial number of a target sequence; measuring the first quantum state on a specified quantum bit to obtain a first measurement result; performing inverse quantum Fourier transform on the first quantum state in response to the fact that the first measurement result is a target value to obtain a second quantum state; obtaining a target wavenumber based on the second measurement result; and obtaining an identification result of the to-be-identified object and the target object by using the target wave number and a preset threshold value. According to the embodiment of the invention, the mode recognition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of quantum computing technology, and in particular to a pattern recognition method and device. Background Art

[0002] Objects that can be observed in time and space, if the same or similar object categories can be distinguished, the distinguishable objects are called patterns. Patterns are not specific objects, but abstract categories, which are information obtained from objects. Therefore, patterns are often manifested as information with time and space distribution. Pattern recognition is to classify the patterns to be recognized into their respective pattern categories based on certain measurements or observations.

[0003] Pattern recognition can be applied in various fields, such as automatic cytology, chromosome characteristics research, and genetic research in the field of biology; astronomical telescope image analysis and automatic spectroscopy in the field of astronomy; stock trading prediction and corporate behavior analysis in the field of economics; electrocardiogram analysis, electroencephalogram analysis, and medical image analysis in the field of medicine; product defect detection, feature recognition, voice recognition, automatic navigation systems, and pollution analysis in engineering; aerial photography analysis, radar and sonar signal detection and classification, and automatic target recognition in the military field; fingerprint recognition, face recognition, surveillance and alarm systems in the security field, and so on.

[0004] Pattern recognition technology is the basic technology of artificial intelligence. The 21st century is a century of intelligence, informatization, computing, and networking. In this century characterized by digital computing, pattern recognition technology, as a basic discipline of artificial intelligence technology, will surely gain huge room for development. However, with the development of pattern recognition technology, the amount of data to be processed is increasing. Limited by the computing power limitations of classical computing, the efficiency of pattern recognition is relatively low. Summary of the invention

[0005] The purpose of the present invention is to provide a pattern recognition method and device, aiming at improving the efficiency of pattern recognition.

[0006] An embodiment of the present application provides a pattern recognition method, the method comprising:

[0007] Preparing a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified;

[0008] Measuring the first quantum state on a specified quantum bit to obtain a first measurement result;

[0009] In response to the first measurement result being a target value, performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state;

[0010] Obtaining a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the designated quantum bit;

[0011] The target wave number and the preset threshold are used to obtain the recognition results of the object to be recognized and the target object.

[0012] Optionally, the preparing the first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence includes:

[0013] preparing a superposition state of the sequence number of the reference sequence and the sequence number of the target sequence;

[0014] Obtain a quantum state including a comparison result of a first value and a second value; use an Oracle module to evolve the superposition state to obtain a quantum state including a target result as a first quantum state, wherein the target result is a result of whether the first value and the second value are equal, the first value is a value in a sequence corresponding to a sequence number in the reference sequence, and the second value is a value in a sequence corresponding to a sequence number in the target sequence.

[0015] Optionally, the first quantum state is:

[0016]

[0017] Among them, |ψ1> is the first quantum state, n is determined by the sequence number of the reference sequence, m is determined by the sequence number of the target sequence, i is the sequence number of the reference sequence, j is the sequence number of the target sequence, f(i) is the first value, f(j) is the second value, if f(i)=f(j), y is 1, otherwise it is 0.

[0018] Optionally, the second measurement result includes a first sub-measurement result and a second sub-measurement result;

[0019] The target wave number includes a first wave number and a second wave number;

[0020] The step of obtaining a target wave number based on the second measurement result includes:

[0021] Obtain a first sub-measurement result and a second sub-measurement result respectively;

[0022] Determine a first sub-measurement result from all the first sub-measurement results and convert it into a decimal number, and use the decimal number as the first wave number;

[0023] From all the second sub-measurement results, determine a second sub-measurement result converted into a decimal number, and use the decimal number as the second wave number.

[0024] Optionally, obtaining the recognition results of the object to be recognized and the target object by using the target wave number includes:

[0025] Using the first and second wave numbers, the pattern width is calculated;

[0026] Based on the size relationship between the pattern width and a preset threshold, the recognition results of the object to be recognized and the target object are obtained.

[0027] Optionally, the calculating the mode width by using the first wave number and the second wave number includes:

[0028] Based on the first and second wave numbers, the pattern width is calculated using the following formula:

[0029]

[0030]

[0031] Where D is the mode width, k is the first wave number, and k ′ is the second wave number, is an integer, θ is the deviation angle, N=2 n ,=2 m ,=NM, κ is a value predetermined by using the multi-slit diffraction principle, χ is a preset mode ratio, n is determined by the serial number of the reference sequence, and m is determined by the serial number of the target sequence.

[0032] Optionally, obtaining the recognition results of the object to be recognized and the target object based on the size relationship between the pattern width and a preset threshold value includes:

[0033] In response to the pattern width being greater than a preset threshold, obtaining a pattern center position based on the deviation angle;

[0034] The pattern center position is used to determine a module that matches the object to be identified from the target object.

[0035] Optionally, the using the pattern center position to determine, from the target object, a module that matches the object to be identified, includes:

[0036] Using the pattern center position, determine an area in the target object that contains a module matching the object to be identified as a target area;

[0037] The target area is segmented, and each block after the target area is segmented is used as a new target object, and a new target sequence is generated respectively. The step of preparing the first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence is returned until a module matching the object to be identified is determined from the target object.

[0038] Determining the area containing the module matching the object to be identified and the module matching the object to be identified Optionally, the method further includes:

[0039] When the pattern width is not greater than a preset threshold, a new target sequence is selected, and the process returns to the step of preparing a first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence.

[0040] Another embodiment of the present application provides a pattern recognition device, the device comprising:

[0041] A preparation module, configured to prepare a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified;

[0042] A first obtaining module, used to measure the first quantum state on a specified quantum bit to obtain a first measurement result;

[0043] A second obtaining module is used for performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state in response to the first measurement result being a target value;

[0044] A third obtaining module is used to obtain a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the designated quantum bit;

[0045] The fourth obtaining module is used to obtain the recognition results of the object to be identified and the target object by using the target wave number and a preset threshold.

[0046] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement any of the above methods when running.

[0047] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement any of the above methods.

[0048] Compared with the prior art, the present invention first prepares a first quantum state based on the serial number of the reference sequence and the serial number of the target sequence; then measures the first quantum state on the specified quantum bit to obtain a first measurement result; then, in response to the first measurement result being the target value, performs an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state; then based on the second measurement result, obtains the target wave number; finally, uses the target wave number and a preset threshold to obtain the identification result of the object to be identified and the target object. Due to the superposition and entanglement of quantum bits, quantum computing has intrinsic parallelism. The target wave number can be quickly obtained through the computing power of quantum computing, and then the target wave number and the preset threshold are used to obtain the identification result. The computing power of quantum computing is used to reduce the time required for identification, thereby improving the efficiency of identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a network block diagram of a pattern recognition system provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of a flow chart of a pattern recognition method provided by an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of a quantum circuit for pattern recognition provided by an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a dot matrix provided by an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of the structure of a pattern recognition device provided by an embodiment of the present invention;

[0054] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.

[0056] Figure 1 1 is a network block diagram of a pattern recognition system provided by an embodiment of the present invention. The pattern recognition system may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.

[0057] The network 110 is a medium for providing communication links between various devices and computers connected together in the pattern recognition system, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method may be wired, wireless communication links or optical fiber cables.

[0058] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.

[0059] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to a pattern recognition method provided in an embodiment of the present invention.

[0060] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0061] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum calculations.

[0062] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.

[0063] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in silicon chips, the number of such computing units is also sufficient. Currently, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.

[0064] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit. The input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the length of use and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of the quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical function combinations to achieve the computing effect.

[0065] Based on these differences, the design of the logical function acting on the quantum bit (including the design of whether the quantum bit is used or not and the design of the efficiency of each quantum bit) is the key to improving the computing performance of the quantum computer, and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to achieve efficient pattern recognition in quantum computing, the present invention proposes a pattern recognition method and device, aiming to improve the efficiency of pattern recognition.

[0066] See also Figure 2 , Figure 2 A schematic flow chart of a pattern recognition method provided by an embodiment of the present invention may include the following steps:

[0067] S201: Preparing a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified.

[0068] When performing pattern recognition, the objects to be recognized may be different in different fields. For example, in fingerprint recognition, the object to be recognized may be a fingerprint; in vehicle recognition, the object to be recognized may be a vehicle; in product defect detection, the object to be recognized may be a defect, etc. The object to be recognized may be presented in different forms in different application scenarios. Specifically, the object to be recognized may be presented in the form of an image, in the form of text, or in other forms that can represent the object to be recognized.

[0069] The object to be identified is processed and converted into string data, which is the reference sequence. Specifically, taking the object to be identified as an image as an example, the image is processed to a certain resolution through cropping, block division, etc., and then a character is assigned to each pixel using information such as color and brightness, so that the image is processed into a string format.

[0070] The target sequence can be obtained by processing the target object in the same way as the object to be identified. The target sequence can be pre-processed and stored in a database or other location that can be called by other pattern recognition systems. The serial number of the reference sequence and the serial number of the target sequence are numbered in the same way. Specifically, each bit of the sequence is numbered, and the numbering can be in binary form. Exemplarily, if the reference sequence is 1001, then the serial numbers of the reference sequence are 00, 01, 10, 11, and the target sequence is 11100100, then the serial numbers of the target sequence are 000, 001, 010, 011, 100, 101, 110, 111. The serial numbers of the reference sequence and the target sequence are quantum-state encoded, and the quantum state obtained by the quantum-state encoding is further processed to obtain the first quantum state. The first quantum state represents the object to be identified and the target object, and includes information about the serial number of the reference sequence and the serial number of the target sequence, as well as information about the value in the sequence corresponding to the serial number of the reference sequence and the serial number of the target sequence. The embodiment of the present invention uses a quantum device to prepare the first quantum state. The quantum device can be a quantum computer, a quantum virtual machine, or other devices that can implement or simulate quantum computing. After obtaining the reference sequence and the target sequence, the quantum device can determine the number of quantum bits required to prepare the first quantum state according to the length of the sequence, and then can use quantum bits and quantum logic gates to generate quantum circuits, and use quantum circuits to prepare the first quantum state. The function of a quantum logic gate can be equivalent to the function of other quantum logic gates or a combination of quantum logic gates. There are also many kinds of functional relationships between quantum logic gates and quantum bits. Therefore, in the embodiment of the present invention, as long as the above-mentioned first quantum state can be prepared, there is no restriction on the specific preparation method.

[0071] In the embodiment of the present invention, for two sequences of length N and M, only O(logX+logM) quantum space is needed to store them, which saves exponential storage space compared with classical computing.

[0072] S202: Measure the first quantum state on a specified quantum bit to obtain a first measurement result.

[0073] The designated quantum bits are one or more quantum bits required to prepare the first quantum state, and may be predetermined.

[0074] S203: In response to the first measurement result being a target value, performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state.

[0075] The target value is a preset value. For example, the target value can be 1. After obtaining the first measurement result, it is determined whether the first measurement result is the target value. If the first measurement result is the target value, then the first quantum state is the quantum state required for pattern recognition, and the next step of processing can be performed. Specifically, using QFT -1 (Inverse Quantum Fourier Transform), transforming the first quantum state into the second quantum state.

[0076] S204: Obtain a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the designated quantum bit.

[0077] There may be multiple second measurement results, and multiple second measurement results can be obtained by multiple measurements. The second measurement results may be processed to obtain the wave number. Specifically, one measurement result may be selected from the second measurement results, and the measurement result may be converted to a base to obtain the wave number. The selection method may be set according to different requirements, or the second measurement result may be calculated. One method may be to convert the second measurement result into a decimal number, perform weighted averaging on the converted decimal numbers, and use the weighted average as the target wave number.

[0078] S205: Obtain recognition results of the object to be recognized and the target object by using the target wave number and a preset threshold.

[0079] In the embodiment of the present invention, the target wave number can be further processed. Specifically, the magnitude relationship between the wave number and the preset threshold value can be used to determine the recognition result. The target wave number and the preset threshold value can also be used to determine whether there is a region similar to the object to be recognized in the target object based on the multi-slit diffraction principle, thereby determining the recognition result. Of course, the target wave number can also be used for further calculation, and the relationship between the calculation result and the preset threshold value can be used to obtain the recognition result. The recognition can be that the object to be recognized does not match the target object, that is, the object to be recognized is not the same or similar to the target object, the object to be recognized matches the target object, or the classification label of the object to be recognized is the same as the classification label of the target object, the content of the object to be recognized and the target object matches, or the similarity between the object to be recognized and the target object, etc.

[0080] In an embodiment of the present invention, pattern recognition is performed through quantum superposition state and quantum Fourier transform, and the time complexity is O(logN). When pattern recognition is performed using classical computing, the time complexity is O(N+NlogN) or O(M+M logM). Therefore, by using an embodiment of the present invention, the time complexity of pattern recognition can be reduced, thereby improving recognition efficiency.

[0081] It can be seen that the present invention first prepares a first quantum state based on the serial number of the reference sequence and the serial number of the target sequence; then measures the first quantum state on the specified quantum bit to obtain a first measurement result; then, in response to the first measurement result being the target value, performs an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state; then based on the second measurement result, obtains the target wave number; finally, uses the target wave number and the preset threshold to obtain the identification result of the object to be identified and the target object. Due to the superposition and entanglement of quantum bits, quantum computing has intrinsic parallelism. The target wave number can be quickly obtained through the computing power of quantum computing, and the identification result is obtained by using the target wave number and the preset threshold. The computing power of quantum computing is used to reduce the time required for identification, thereby improving the efficiency of identification.

[0082] In some possible implementations of the present invention, the method may further include:

[0083] When the first measurement result is not the target value, the first quantum state is re-prepared.

[0084] The first measurement result is not the target value, which indicates that the first quantum state is not the quantum state required to realize quantum pattern recognition. Therefore, the first quantum state needs to be re-prepared until the first measurement result is the target value.

[0085] In some possible implementations of the present invention, the preparing the first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence includes:

[0086] preparing a superposition state of the sequence number of the reference sequence and the sequence number of the target sequence;

[0087] The superposition state is evolved by using an Oracle module to obtain a quantum state containing a target result as a first quantum state, wherein the target result is a result of whether a first value and a second value are equal, the first value is a value in a sequence corresponding to a sequence number in the reference sequence, and the second value is a value in a sequence corresponding to a sequence number in the target sequence.

[0088] In an embodiment of the present invention, the quantum circuit for pattern recognition can be as follows: Figure 3 As shown, q v To specify the quantum bit, k = n + m, encode the serial number of the reference sequence into the first n quantum bits of the k quantum bits, encode the serial number of the target sequence into the last m quantum bits of the k quantum bits, or encode the serial number of the target sequence into the first m quantum bits of the k quantum bits, and encode the serial number of the reference sequence into the last n quantum bits of the k quantum bits, and obtain a superposition state. Specifically, the superposition state can be realized using the H gate, and the superposition state can be expressed as |ψ>|0>=H n+m |0> n+m+1. The Oracle module is mainly used to obtain the first value and the second value, and obtain the comparison result of the first value and the second value, and evolve the superposition state so that the first quantum state contains a quantum state that compares whether the first value and the second value are equal. Continuing with the above example, the target result can be shown in the following table, where the row represents the serial number of the reference sequence, the column represents the serial number of the target sequence (the row and column can be replaced), and the value in the brackets is the value corresponding to the serial number. If the first value is equal to the second value, the target result is 1, otherwise it is 0:

[0089] 000(1) 001(1) 010(1) 011(0) 100(0) 101(1) 110(0) 111(0) 00(1) 1 1 1 0 0 1 0 0 01(0) 0 0 0 1 1 0 1 1 10(0) 0 0 0 1 1 0 1 1 11(1) 1 1 1 0 0 1 0 0

[0090] In pattern recognition, we need to find similar modules between two sequences, which can be determined using the following principles:

[0091] 2 n The value is the horizontal axis, 2 m The value is the vertical axis, or 2 m The value is the horizontal axis, 2 n The value is the vertical axis, and the value of the specified bit is plotted. If the measurement result of the specified bit is 1, the corresponding point is black, and if it is 0, the corresponding point is white, thus forming a graph like Figure 4 The figure shown in the figure can be called a dot plot. If there are similar modules in the two sequences, the corresponding positions will show a diagonal shape. Such a diagonal shape has obvious periodicity, so its frequency can be obtained through Fourier transform. Then use QFT -1 , convert the frequency, continue to measure the converted result, and process the measured result to obtain the wave number, so as to finally obtain the recognition results of the two sequences based on the wave number.

[0092] In some possible implementations of the present invention, the first quantum state may be:

[0093]

[0094] Among them, |ψ1> is the first quantum state, n is determined by the sequence number of the reference sequence, m is determined by the sequence number of the target sequence, i is the sequence number of the reference sequence, j is the sequence number of the target sequence, f(i) is the first value, f(j) is the second value, if f(i)=f(j), y is 1, otherwise it is 0.

[0095] When the first measurement result is the target value, the first quantum state of all quantum bits except the specified quantum bit can be expressed as |ψ2>=∑ i,j,f(i,j)=1 |i>|>, continuing the above example, |ψ2>=|00,000>+|11,000>+|00,001>+….

[0096] In some possible implementations of the present invention, the second measurement result includes a first sub-measurement result and a second sub-measurement result;

[0097] The target wave number includes a first wave number and a second wave number;

[0098] The step of obtaining a target wave number based on the second measurement result includes:

[0099] Obtain a first sub-measurement result and a second sub-measurement result respectively;

[0100] Determine a first sub-measurement result from all the first sub-measurement results and convert it into a decimal number, and use the decimal number as the first wave number;

[0101] From all the second sub-measurement results, determine a second sub-measurement result converted into a decimal number, and use the decimal number as the second wave number.

[0102] The number of measurements can be predetermined, or the measurement can be stopped when the probability of a measurement result greater than a preset value is obtained, or the measurement can be stopped when the probability of several consecutive measurement results is within a preset range. Of course, other conditions can also be set to determine whether to stop the measurement, which are not listed here one by one. The above judgment criteria can be used to determine whether to stop the measurement of the first sub-measurement result and the second sub-measurement result. The first sub-measurement result and the second sub-measurement result can both be Figure 3 In the quantum circuit shown, q0- k-1 The measurement results are obtained, except that the first sub-measurement result has the first n qubits of the k qubits measured encoding the serial number of the reference sequence, and the last m qubits encoding the serial number of the target sequence; the second sub-measurement result has the first m qubits of the k qubits measured encoding the serial number of the target sequence, and the last n qubits encoding the serial number of the reference sequence.

[0103] After the first sub-measurement result stops measuring, a measurement result with the maximum probability or a sufficiently large probability is selected from the obtained first sub-measurement results, and the selected measurement result is converted into a decimal number, which is the first wave number. The probability of being sufficiently large is determined according to a preset rule, and it can be that if the probability is greater than a preset probability value, then the probability is considered to be sufficiently large. In the same way, the second sub-measurement result is processed to obtain the second wave number.

[0104] In some possible implementations of the present invention, the obtaining the recognition result of the object to be recognized and the target object by using the target wave number and a preset threshold value includes:

[0105] Using the first and second wave numbers, the pattern width is calculated;

[0106] Based on the size relationship between the pattern width and a preset threshold, the recognition results of the object to be recognized and the target object are obtained.

[0107] After obtaining the first wave number and the second wave number, the pattern width can be calculated using the relationship between the wave number and the pattern width. The size of the pattern width and the preset threshold is determined, and the recognition result is determined based on the determined size relationship.

[0108] In some possible implementations of the present invention, the calculating the mode width using the target wave number and a preset threshold may include:

[0109] Based on the first and second wave numbers, the pattern width is calculated using the following formula:

[0110]

[0111]

[0112] Where D is the mode width, k is the first wave number, k′ is the second wave number, is an integer, θ is the deviation angle, N=2 n ,M=2 m ,S=NM, κ is a value predetermined by using the multi-slit diffraction principle, χ is a preset mode ratio, n is determined by the serial number of the reference sequence, and m is determined by the serial number of the target sequence.

[0113] L is the Laue function, and the parameters included in this function are all borrowed from X-ray crystal diffraction experiments. Since X-ray crystal diffraction is essentially a Fourier transform, it can be directly calculated using the principle of X-ray diffraction. κ is a value predetermined using the principle of multi-slit diffraction. κ is similar to the "number of slits" of multi-slit diffraction, and θ is similar to the phase difference of multi-slit diffraction. In quantum computing, k can be a physical quantity related to scale, and θ can be a physical quantity related to phase difference. However, κ does not directly represent the number of quantum bits, and θ does not directly represent the quantum phase difference.

[0114] The unknown variables in the above two equations are D and θ. Because the equations are obtained using the principle of multi-slit diffraction, the waveforms obtained by multi-slit diffraction are similar. Therefore, using different The calculated D and θ are not much different. In the embodiment of the present invention, one of the The calculated D and θ are used as calculation results.

[0115] In some possible implementations of the present invention, obtaining the recognition results of the object to be recognized and the target object based on the size relationship between the pattern width and a preset threshold value includes:

[0116] In response to the pattern width being greater than a preset threshold, obtaining a pattern center position;

[0117] The pattern center position is used to determine a module that matches the object to be identified from the target object.

[0118] When a pattern width is greater than a preset threshold, it means that the position corresponding to the point is a periodic diagonal line on the dot matrix, which means that there is a module in the target object that is similar to the object to be identified. The pattern center position z is determined, where z0 is the set starting position, and based on the pattern center position, it is determined that there is a module in the target object that matches the object to be identified.

[0119] In some possible implementations of the present invention, the step of using the pattern center position to determine, from the target object, a module that matches the object to be identified includes:

[0120] Using the pattern center position, determine an area in the target object that contains a module matching the object to be identified as a target area;

[0121] The target area is segmented, and each block after the target area is segmented is used as a new target object, and a new target sequence is generated respectively. The step of preparing the first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence is returned until a module matching the object to be identified is determined from the target object.

[0122] By using the center position of the pattern, the area containing the module matching the object to be identified is determined from the current target object as the target area, the target area is segmented to obtain blocks, the blocks are used as new target objects, the target objects are processed to obtain the target sequence of the object, and then pattern recognition is performed until the module matching the object to be identified is found. Specifically, the formula for calculating the center position of the pattern is, because The value of is different, and a series of oblique lines are presented in the target object. The area occupied by the oblique lines contains the module that matches the object to be identified, which is the target area. Exemplarily, the area occupied by the oblique lines of the target object is the lower right corner of the target object, so the lower right corner of the target object is the target area. The target area is segmented, and the segmented content is processed in the same way as the object to be identified to obtain a new target sequence, and then pattern recognition is performed until the module that matches the object to be identified is determined. Exemplarily, the illegal vehicle needs to obtain license plate information for punishment due to obstruction of the license plate. At this time, the illegal vehicle is taken as the object to be identified, and the vehicle image captured by the road traffic system monitoring is taken as the target object. Now it is necessary to find a position in the target sequence that has highly similar features to the reference sequence (that is, a module that matches the object to be identified), so as to find the same vehicle as the identified vehicle in the database, and then obtain the license plate number of the illegal vehicle.

[0123] In some possible implementations of the present invention, the method may further include:

[0124] When the pattern width is not greater than a preset threshold, a new target sequence is selected, and the process returns to the step of preparing a first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence.

[0125] In the actual recognition process, there may be many target sequences. When the pattern width is not greater than the preset threshold, it means that there is no module in the target object that matches the object to be recognized. At this time, a target sequence that does not participate in the pattern recognition of the object to be recognized is selected from the database as the new target sequence, and then a new round of pattern recognition is performed.

[0126] See also Figure 5 , Figure 5 A schematic diagram of a pattern recognition device provided by an embodiment of the present invention, and Figure 2 Corresponding to the process shown, the device includes:

[0127] A preparation module 501 is used to prepare a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified;

[0128] A first obtaining module 502 is used to measure the first quantum state on a specified quantum bit to obtain a first measurement result;

[0129] A second obtaining module 503 is used for performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state in response to the first measurement result being a target value;

[0130] A third obtaining module 504 is used to obtain a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the specified quantum bit;

[0131] The fourth obtaining module 505 is used to obtain the recognition results of the object to be recognized and the target object by using the target wave number and a preset threshold.

[0132] In some possible implementations of the present invention, the preparation module 501 may also be used for:

[0133] When the first measurement result is not the target value, the first quantum state is re-prepared.

[0134] In some possible implementations of the present invention, the preparation module 501 may be specifically used for:

[0135] preparing a superposition state of the sequence number of the reference sequence and the sequence number of the target sequence;

[0136] The superposition state is evolved by using an Oracle module to obtain a quantum state containing a target result as a first quantum state, wherein the target result is a result of whether a first value and a second value are equal, the first value is a value in a sequence corresponding to a sequence number in the reference sequence, and the second value is a value in a sequence corresponding to a sequence number in the target sequence.

[0137] In some possible implementations of the present invention, the first quantum state may be:

[0138]

[0139] Among them, |ψ1> is the first quantum state, n is determined by the sequence number of the reference sequence, m is determined by the sequence number of the target sequence, i is the sequence number of the reference sequence, j is the sequence number of the target sequence, f(i) is the first value, f(j) is the second value, if f(i)=f(j), y is 1, otherwise it is 0.

[0140] In some possible implementations of the present invention, the second measurement result may include a first sub-measurement result and a second sub-measurement result;

[0141] The target wave number may include a first wave number and a second wave number;

[0142] The third obtaining module 504 may be specifically used for:

[0143] Obtain a first sub-measurement result and a second sub-measurement result respectively;

[0144] Determine a first sub-measurement result from all the first sub-measurement results and convert it into a decimal number, and use the decimal number as the first wave number;

[0145] From all the second sub-measurement results, determine a second sub-measurement result converted into a decimal number, and use the decimal number as the second wave number.

[0146] In some possible implementations of the present invention, the fourth obtaining module 505 may include:

[0147] A calculation unit, used for calculating the mode width using the first wave number and the second wave number;

[0148] The obtaining unit is used to obtain the recognition results of the object to be recognized and the target object based on the size relationship between the pattern width and a preset threshold.

[0149] In some possible implementations of the present invention, the computing unit may be specifically used for:

[0150] Based on the first and second wave numbers, the pattern width is calculated using the following formula:

[0151]

[0152]

[0153] Where D is the mode width, k is the first wave number, and k ′ is the second wave number, is an integer, θ is the deviation angle, N=2 n ,=2 m ,=NM, κ is a value predetermined by using the multi-slit diffraction principle, χ is a preset mode ratio, n is determined by the serial number of the reference sequence, and m is determined by the serial number of the target sequence.

[0154] In some possible implementations of the present invention, the obtaining unit may be specifically used to:

[0155] In response to the pattern width being greater than a preset threshold, obtaining a pattern center position based on the deviation angle;

[0156] The pattern center position is used to determine a module that matches the object to be identified from the target object.

[0157] In some possible implementations of the present invention, the obtaining unit may also be specifically used for:

[0158] Using the pattern center position, determine an area in the target object that contains a module matching the object to be identified as a target area;

[0159] The target area is segmented, and each block after the target area is segmented is used as a new target object, and a new target sequence is generated respectively, and the preparation module 501 is returned to be executed until a module matching the object to be identified is determined from the target object.

[0160] In some possible implementations of the present invention, the device may further include:

[0161] The selection module is used to select a new target sequence when the pattern width is not greater than a preset threshold, and return to the execution preparation module 501.

[0162] It can be seen that the present invention first prepares a first quantum state based on the serial number of the reference sequence and the serial number of the target sequence; then measures the first quantum state on the specified quantum bit to obtain a first measurement result; then, in response to the first measurement result being the target value, performs an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state; then based on the second measurement result, obtains the target wave number; finally, uses the target wave number and the preset threshold to obtain the identification result of the object to be identified and the target object. Due to the superposition and entanglement of quantum bits, quantum computing has intrinsic parallelism. The target wave number can be quickly obtained through the computing power of quantum computing, and then the target wave number and the preset threshold are used to obtain the identification result. The computing power of quantum computing is used to reduce the time required for identification, thereby improving the efficiency of identification.

[0163] See also Figure 6 The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the pattern recognition method described in any of the above embodiments. Figure 6 , the computer device may be a classical computer. The computer device may also be a quantum computer.

[0164] An embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to implement the pattern recognition method described in any of the above embodiments when running.

[0165] The embodiments of the present application also provide a computer program product comprising instructions, which, when executed by a computer, enables the computer to implement the pattern recognition method described in any of the above embodiments.

[0166] It can be understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited to this.

[0167] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those generally understood by those skilled in the art of the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present application. The term "and / or" used in the present application includes any and all combinations of one or more related listed items. The singular forms of "a kind of", "above" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0168] It can be understood that the processor of the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0169] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0170] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.

[0172] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

Claims

1. A pattern recognition method, characterized in that: The method comprises: Preparing a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified; Measuring the first quantum state on a specified quantum bit to obtain a first measurement result; In response to the first measurement result being a target value, performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state; Obtaining a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the designated quantum bit; The target wave number and the preset threshold are used to obtain the recognition results of the object to be recognized and the target object.

2. The method according to claim 1, characterized in that The step of preparing a first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence includes: preparing a superposition state of the sequence number of the reference sequence and the sequence number of the target sequence; The superposition state is evolved by using an Oracle module to obtain a quantum state containing a target result as a first quantum state, wherein the target result is a result of whether the first value and the second value are equal; the first value is a value in a sequence corresponding to a sequence number in the reference sequence, and the second value is a value in a sequence corresponding to a sequence number in the target sequence.

3. The method according to claim 2, characterized in that The first quantum state is: Among them, |ψ1> is the first quantum state, n is determined by the sequence number of the reference sequence, m is determined by the sequence number of the target sequence, i is the sequence number of the reference sequence, j is the sequence number of the target sequence, f(i) is the first value, f(j) is the second value, if f(i)=f(j), y is 1, otherwise it is 0.

4. The method according to any one of claims 1 to 3, characterized in that: The second measurement result includes a first sub-measurement result and a second sub-measurement result; The target wave number includes a first wave number and a second wave number; The step of obtaining a target wave number based on the second measurement result includes: Obtain a first sub-measurement result and a second sub-measurement result respectively; Determine a first sub-measurement result from all the first sub-measurement results and convert it into a decimal number, and use the decimal number as the first wave number; From all the second sub-measurement results, determine a second sub-measurement result converted into a decimal number, and use the decimal number as the second wave number.

5. The method according to claim 4, characterized in that The obtaining the recognition result of the object to be recognized and the target object by using the target wave number and the preset threshold value includes: Using the first and second wave numbers, the pattern width is calculated; Based on the size relationship between the pattern width and a preset threshold, the recognition results of the object to be recognized and the target object are obtained.

6. The method according to claim 5, characterized in that The method of calculating the mode width by using the first wave number and the second wave number includes: Based on the first and second wave numbers, the pattern width is calculated using the following formula: Where D is the mode width, k is the first wave number, k′ is the second wave number, is an integer, θ is the deviation angle, N=2 n ,M=2 m ,S=NM, κ is a value predetermined by using the multi-slit diffraction principle, χ is a preset mode ratio, n is determined by the serial number of the reference sequence, and m is determined by the serial number of the target sequence.

7. The method according to claim 6, characterized in that The obtaining the recognition results of the object to be recognized and the target object based on the size relationship between the pattern width and the preset threshold value includes: In response to the pattern width being greater than a preset threshold, obtaining a pattern center position based on the deviation angle; The pattern center position is used to determine a module that matches the object to be identified from the target object.

8. The method according to claim 7, characterized in that The method of using the pattern center position to determine, from the target object, a module that matches the object to be identified, comprises: Using the pattern center position, determine an area in the target object that contains a module matching the object to be identified as a target area; The target area is segmented, and each block after the target area is segmented is used as a new target object, and a new target sequence is generated respectively. The step of preparing the first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence is returned until a module matching the object to be identified is determined from the target object.

9. The method according to claim 5, characterized in that The method further comprises: When the pattern width is not greater than a preset threshold, a new target sequence is selected, and the process returns to the step of preparing a first quantum state based on the sequence number of the reference sequence and the sequence number of the target sequence.

10. A pattern recognition device, characterized in that: The device comprises: A preparation module, configured to prepare a first quantum state based on a sequence number of a reference sequence and a sequence number of a target sequence, wherein the reference sequence represents an object to be identified, the target sequence represents a target object, and the target object includes an object of the same type as the object to be identified; A first obtaining module, used to measure the first quantum state on a specified quantum bit to obtain a first measurement result; A second obtaining module is used for performing an inverse quantum Fourier transform on the first quantum state to obtain a second quantum state in response to the first measurement result being a target value; A third obtaining module is used to obtain a target wave number based on a second measurement result, wherein the second measurement result is a measurement result obtained by measuring the second quantum state on all quantum bits except the designated quantum bit; The fourth obtaining module is used to obtain the recognition results of the object to be identified and the target object by using the target wave number and a preset threshold.

11. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to implement the method according to any one of claims 1 to 9 when executed.

12. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the computer program to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Identification method, system and device based on quantum network and storage medium

    CN114169469A

  • Soft quantum neural network system and pattern recognition method

    CN114519430A

  • Method and apparatus for pattern recognition

    US20090087084A1

  • Quantum circuit optimization using machine learning

    US20200342344A1

  • Quantum, biological, computer vision, and neural network systems for industrial internet of things

    WO2022236064A2