A lung CT image segmentation method based on Grover algorithm

By converting the lung CT image segmentation problem into a Max-Cut problem and using the Grover algorithm for quantum computing, the problems of segmentation object limitations and long calculation time in the existing technology are solved, and efficient, real-time Lung CT image segmentation.

CN116630337BActive Publication Date: 2025-01-21CENT SOUTH UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310727491.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2025-01-21
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

The existing lung CT image segmentation technology has the problems of segmentation objects and the problem of excessive calculation time.

Method used

A method based on Grover algorithm is used to convert the segmentation problem of lung CT images into a Max-Cut problem and solve it through a quantum system. The parallel computing advantages of Grover algorithm are used to improve computing efficiency.

Benefits of technology

It achieves efficient calculation of lung CT image segmentation, significantly improves the real-time performance of segmentation, and has the characteristics of versatility and wide applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630337B_ABST
    Figure CN116630337B_ABST
Patent Text Reader

Abstract

The invention discloses a lung CT image segmentation method based on Grover algorithm, comprising the steps of obtaining a lung CT grayscale image to be segmented, converting the grayscale image segmentation problem to be segmented into a maximum cut Max‑Cut problem by constructing an undirected weighted graph; constructing an objective function of the Max‑Cut problem, converting the maximum cut Max‑Cut problem into a polynomial maximum value solution problem by adopting a quantum method; solving the polynomial maximum value by adopting the Grover algorithm; using the maximum value obtained by the solution, obtaining an image segmentation scheme by setting a threshold value, and completing the segmentation processing of the lung CT grayscale image; the method of the invention makes full use of the parallel computing advantage of a quantum system, can process multiple computing results in one computing, and significantly improves the real-time performance of the segmentation; and the method of the invention has good versatility, wide applicability, and improved computing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of quantum computing, and in particular relates to a lung CT image segmentation method based on Grover algorithm. Background Art

[0002] With the development of computer technology, image segmentation has been developed and widely used in many fields. Computed tomography (CT) is one of the commonly used methods in chest imaging. Providing doctors with segmented lung CT images through image segmentation technology can not only improve the doctor's diagnostic efficiency, but also reduce the probability of misjudgment by the doctor.

[0003] Current lung CT image segmentation technologies mainly include threshold segmentation technology, region growing method, and deep learning. The basic idea of ​​threshold segmentation technology is to classify pixels by setting different thresholds. The segmentation effect of threshold segmentation technology depends on the selection of parameters and there is no unified standard for the selection of parameters. The region growing method starts from the seed point and gradually grows the region according to the similarity between pixels. The main defect of the region growing method is that it is sensitive to the selection of seed points and growth merging rules. The deep learning method can achieve end-to-end lung segmentation by using convolutional neural networks (CNN) and various network architectures, with high accuracy and robustness, but it also has shortcomings. The deep learning method requires a large amount of training data and computing resources and is time-consuming.

[0004] In summary, most of the current lung CT image segmentation methods have problems such as limitations in segmentation objects and long segmentation time. Summary of the invention

[0005] The object of the present invention is to provide a lung CT image segmentation method based on the Grover algorithm with good versatility, wide applicability and improved computational efficiency.

[0006] The lung CT image segmentation method based on the Grover algorithm provided by the present invention comprises the following steps:

[0007] S1. Obtain a grayscale CT image of the lung to be segmented, and convert the grayscale image segmentation problem into a maximum cut Max-Cut problem by constructing an undirected weighted graph;

[0008] S2. Using the maximum cut problem obtained in step S1, constructing the objective function of the Max-Cut problem, and using quantum methods to convert the maximum cut problem into a polynomial maximum value solution problem;

[0009] S3. Using the polynomial maximum value solution problem obtained in step S2, the maximum value is solved by Grover algorithm;

[0010] S4. Using the maximum value obtained in step S3, an image segmentation scheme is obtained by setting a threshold value, thereby completing the segmentation process of the grayscale image of the lung CT.

[0011] The step S1 of obtaining the grayscale image of the lung to be segmented, and converting the grayscale image segmentation problem into a maximum cut Max-Cut problem by constructing an undirected weighted graph, specifically includes:

[0012] Obtain a grayscale lung CT image to be segmented, and based on the theories and methods in the field of graph theory, map the grayscale lung CT image into an undirected weighted graph, correspond "pixels" to "nodes", correspond the difference in grayscale values ​​between two pixels to the "weight" of the edge between the two nodes, thereby constructing an undirected weighted graph corresponding to the grayscale image;

[0013] The mathematical model of the undirected weighted graph is represented by the following formula:

[0014] G=(V,E)

[0015] Among them, V represents the set of nodes, and E represents the set of edges;

[0016] n represents the number of nodes, S∈{0,1} n×n Represents the adjacency matrix, where 0 means that there is no "edge" connecting the two nodes in the undirected weighted graph, and 1 means that there is an "edge" connecting the two nodes in the undirected weighted graph; when n takes different values, the structure of the undirected weighted graph is different, including:

[0017] Based on the undirected weighted graph constructed above, each node in the graph follows the Max-Cut problem principle. The Max-Cut problem principle aims to divide the node set V into two non-intersecting subsets and ensure that the total weight of the edges of the non-intersecting subsets is the largest.

[0018] The node set V of the undirected weighted graph and the edge weights are used to construct the weight matrix. The formula is as follows:

[0019] W=(w ij ) n×n

[0020] Among them, w ij Represents the weight of the edge connecting the i-th and j-th nodes; if there is no connection between the two nodes, the weight value is 0;

[0021] Select to remove several "edges" in the undirected weighted graph, divide the node set V into two non-intersecting subsets, namely V1 and V2, and call the removed edge set a "cut set"; the sum of the weights of all edges in the cut set is called a "cut", which is expressed by the following formula:

[0022]

[0023] Among them, g ij represents the grayscale difference between the i-th and j-th nodes, V1 and V2 represent the subsets of two non-intersecting vertices after division;

[0024] Through the above processing, the grayscale image segmentation problem is converted into a maximum cut Max-Cut problem;

[0025] The step S2 uses the maximum cut problem obtained in step S1 to construct the objective function of the Max-Cut problem, and uses the quantum method to convert the maximum cut problem into a polynomial maximum value solution problem, which specifically includes:

[0026] Max-Cut problem To maximize the cut problem, the following formula is used to describe the objective function of the Max-Cut problem:

[0027]

[0028] The essence of the Max-Cut problem is to divide the nodes into two categories while ensuring that the weight of the edges connecting nodes in different categories is maximized;

[0029] In a quantum system, by measuring whether a bit is in state 0 or 1, each quantum bit can be divided into two categories: the node state of the wireless weighted graph obtained above is initialized, and the "basis vector state" in the quantum state is used to represent the state of the node, and state 0 is defined as the non-target state I1, and state 1 is defined as the target state I2; in the initial state, all nodes are in state 0; at the final cut, all nodes in the target state I2 are divided into a subset, defined as the "target subset", and all nodes in the non-target state I1 are divided into a subset, defined as the "non-target subset";

[0030] Select an n-bit qubit input register |x> n Represents the quantum state, and uses the following formula to describe |x> at any time n The manifestation:

[0031] |x> n =|x> n-1 |x> n-2 …|x>1|x>0=|x n-1 x n-2 …x1x0>

[0032] Among them, |x> n Represents the nth quantum bit, corresponding to the nth pixel;

[0033] Select an m-bit qubit output register |z> m The function value corresponding to the total weight of the edges of two disjoint subsets |f(x)-y> m , where f(x) represents the objective function, y represents the maximum value of the objective function at the last measurement, and y is initially set to 0;

[0034] The Max-Cut problem in quantum state is described as a quadratic unconstrained binary optimization problem (Quadratic Unconstrained Binary Optimization, QUBO), and the objective function in quantum system is described by the following formula:

[0035]

[0036] Among them, x i is the state corresponding to the i-th quantum bit, or the state of the i-th node; x j is the state corresponding to the jth quantum bit, or the state of the jth node; g ij Represents the grayscale difference between the i-th and j-th nodes; Represents an XOR operation, and the result of the XOR operation represents the connection method between different nodes. In quantum systems, this is achieved through controlled CNOT gates; n represents the total number of nodes;

[0037] When x i 、x j When it is 0 or 1 at the same time, it means that the pixel i and the pixel j in the grayscale image will be divided into the same area. At this time, there is no need to calculate the grayscale difference between the two nodes, which is reflected in the objective function as x i 、x j The XOR result is 0, and x i 、x j The coefficient of the constructed polynomial is also 0 and is not reflected in the objective function;

[0038] The polynomial maximum value solution problem obtained in step S2 described in step S3 is solved by using the Grover algorithm, which specifically includes:

[0039] Constructing the state preparation operator A represents the polynomial shown in the objective function constructed in step S2;

[0040] The quantum black box Oracle operator O and Grover diffusion operator D are constructed, and together with the constructed state preparation operator A, they form the core elements of the Grover algorithm. The maximum value is solved through the Grover algorithm, which includes:

[0041] (3-1) State preparation operator A:

[0042] The input register |x> n A set of quantum bits Control unitary operator U G (θ) to the output register |z> m , the control process is expressed by the following formula:

[0043]

[0044] Where C represents the controlled operation; U represents the unitary operator; x j The construction of XOR implementation;

[0045] The general form of a polynomial in n variables is expressed as follows:

[0046]

[0047] Among them, a J are non-zero coefficients, each subset There are corresponding Monomial;

[0048] Operator A is constructed based on quantum coding, including:

[0049] Each subset Apply controlled geometry sequence changes After that, the inverse quantum Fourier transform (QFT) is applied;

[0050] For input register |x> n , output register |z> m Starting from the equal superposition state, using the unitary operator U G (θ) is controlled, the applied angle parameter corresponds to the non-zero coefficient a J ; A single application of the inverse quantum Fourier transform (QFT) to U at the end of the circuit G (θ) decode the encoded periodic signal;

[0051] The following formula is used to represent the system after the A operator is applied:

[0052]

[0053] Among them, y is the threshold, which represents the maximum value of the objective function at the last measurement, and the corresponding value is set to 0 in the initial state;

[0054] (3-2) Quantum black box Oralce operator O:

[0055] The Oralce operator is used to identify the state of interest and multiply its amplitude by -1 to mark the target value state of the quantum system;

[0056] By marking all states x that satisfy the following conditions, it is possible to use the Grover algorithm to search for a solution x whose function value is better than y:

[0057] f(x)>y

[0058] Output register |z> m The value of f(x)-y is represented in the output register. The sign bit in the output register is used to determine whether the state meets the above conditions.

[0059] The following formula is used to represent the system after being processed by the Oracle operator:

[0060]

[0061] Where X represents the set of states x that meet the condition f(x)>y;

[0062] (3-3) Grover diffusion operator D:

[0063] The Grover diffusion operator D reverses the mean of all amplitudes in the marked quantum state, so that the amplitudes of all target value states are amplified and the amplitudes of non-target value states are reduced. The following formula is used to express the expression of operator D:

[0064]

[0065] Among them, H represents the Hadamard gate, which is a single-qubit gate used to construct a quantum superposition state; I represents the Identity gate, which is an identity operation and does not perform any transformation or operation on the qubit;

[0066] Iterate the Grover diffusion operator D for the quantum system and measure the iterative output result;

[0067] The maximum value obtained in step S3 is adopted in step S4, and an image segmentation scheme is obtained by setting a threshold value to complete the segmentation process of the grayscale image of the lung CT. Specifically, the following steps are included:

[0068] The maximum value obtained by solving step S3 is set as the threshold y, and the value is set to 0 in the initial state; the Grover operation operator constructed by the Grover algorithm in step S3 is used to iteratively process the quantum system, and each output measurement value is compared with the threshold. If it is greater than the threshold, the output value replaces the threshold and is defined as a new threshold; when the output measurement value does not change with respect to the threshold after three consecutive iterative processes, the iteration is stopped, the output result is defined as the final result, and the grayscale image segmentation process is completed based on the final output result.

[0069] The lung CT image segmentation method based on the Grover algorithm provided by the method of the present invention adopts a quantum algorithm to solve the CT image segmentation problem, associates the CT image segmentation problem with the maximum cut (Max-Cut) problem of a graph, and adopts the Grover algorithm to perform simulation and solution, and finally obtains the optimal cutting scheme corresponding to the lung CT image segmentation; the method of the present invention fully utilizes the parallel computing advantages of the quantum system, can process multiple calculation results in one calculation, and significantly improves the real-time performance of the segmentation; and the method of the present invention has good versatility, wide applicability, and improved computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 The figure is a schematic diagram of the method flow of the present invention.

[0071] Figure 2 Schematic diagram of the weight matrix in the method of the present invention.

[0072] Figure 3 The figure is a schematic diagram of mapping a grayscale image into an undirected weighted graph in the method of the present invention.

[0073] Figure 4 This is a quantum circuit diagram exemplified in the method of the present invention.

[0074] Figure 5 Schematic diagram of quantum circuit encoding polynomial superposition operator A in the method of the present invention.

[0075] Figure 6 Schematic diagram of the framework circuit of the Grover algorithm in the method of the present invention.

[0076] Figure 7 Schematic diagram of the optimal image segmentation solution in the method of the present invention. DETAILED DESCRIPTION

[0077] like Figure 1 The figure shows a schematic flow chart of the method of the present invention: the lung CT image segmentation method based on the Grover algorithm provided by the present invention comprises the following steps:

[0078] S1. Obtain a grayscale CT image of the lung to be segmented, and convert the grayscale image segmentation problem into a maximum cut Max-Cut problem by constructing an undirected weighted graph; specifically, the following steps are included:

[0079] Obtain a grayscale lung CT image to be segmented, and based on the theories and methods in the field of graph theory, map the grayscale lung CT image into an undirected weighted graph, correspond "pixels" to "nodes", correspond the difference in grayscale values ​​between two pixels to the "weight" of the edge between the two nodes, thereby constructing an undirected weighted graph corresponding to the grayscale image;

[0080] The mathematical model of the undirected weighted graph is represented by the following formula:

[0081] G=(V,E)

[0082] Among them, V represents the set of nodes, and E represents the set of edges;

[0083] n represents the number of nodes, S∈{0,1} n×n Represents the adjacency matrix, where 0 means that there is no "edge" connecting the two nodes in the undirected weighted graph, and 1 means that there is an "edge" connecting the two nodes in the undirected weighted graph; when n takes different values, the structure of the undirected weighted graph is different, including:

[0084] Based on the undirected weighted graph constructed above, each node in the graph follows the Max-Cut problem principle. The Max-Cut problem principle aims to divide the node set V into two non-intersecting subsets and ensure that the total weight of the edges of the non-intersecting subsets is the largest.

[0085] The node set V of the undirected weighted graph and the edge weights are used to construct the weight matrix. The formula is as follows:

[0086] W=(w ij ) n×n

[0087] Among them, w ij Represents the weight of the edge connecting the i-th and j-th nodes; if there is no connection between the two nodes, the weight value is 0; Figure 2 Shown is a schematic diagram of a weight matrix in the method of the present invention;

[0088] Select to remove several "edges" in the undirected weighted graph, divide the node set V into two non-intersecting subsets, namely V1 and V2, and call the removed edge set a "cut set"; the sum of the weights of all edges in the cut set is called a "cut", which is expressed by the following formula:

[0089]

[0090] Among them, g ijrepresents the grayscale difference between the i-th and j-th nodes, V1 and V2 represent the subsets of two non-intersecting vertices after division;

[0091] Through the above processing, the grayscale image segmentation problem is converted into a maximum cut Max-Cut problem;

[0092] like Figure 3 The figure shows a schematic diagram of mapping a grayscale image into an undirected weighted graph in the method of the present invention, where four pixels in the grayscale image correspond to four nodes numbered 1 to 4 in the weighted graph, and the grayscale values ​​corresponding to the four nodes are 0, 255, 200, and 0, respectively;

[0093] S2. Using the maximum cut problem obtained in step S1, constructing the objective function of the Max-Cut problem, and using quantum methods to convert the maximum cut problem into a polynomial maximum value solution problem; specifically including:

[0094] Max-Cut problem To maximize the cut problem, the following formula is used to describe the objective function of the Max-Cut problem:

[0095]

[0096] The essence of the Max-Cut problem is to divide the nodes into two categories while ensuring that the weight of the edges connecting nodes in different categories is maximized;

[0097] In a quantum system, by measuring whether a bit is in state 0 or 1, each quantum bit can be divided into two categories: the node state of the wireless weighted graph obtained above is initialized, and the "basis vector state" in the quantum state is used to represent the state of the node, and state 0 is defined as the non-target state I1, and state 1 is defined as the target state I2; in the initial state, all nodes are in state 0; at the final cut, all nodes in the target state I2 are divided into a subset, defined as the "target subset", and all nodes in the non-target state I1 are divided into a subset, defined as the "non-target subset";

[0098] Select an n-bit qubit input register |x> n Representing the quantum state, the following formula is used to describe any

[0099] Deliberately download |x> n The manifestation:

[0100] |x> n =|x> n-1 |x> n-2 …|x>1|x>0=x n-1 x n-2 …x1x0>

[0101] Among them, |x> n Represents the nth quantum bit, corresponding to the nth pixel;

[0102] Select an m-bit qubit output register |z> m The function value corresponding to the total weight of the edges of two disjoint subsets |f(x)-y> m , where f(x) represents the objective function, y represents the maximum value of the objective function at the last measurement, and y is initially set to 0;

[0103] The Max-Cut problem in quantum state is described as a quadratic unconstrained binary optimization problem (Quadratic Unconstrained Binary Optimization, QUBO), and the objective function in quantum system is described by the following formula:

[0104]

[0105] Among them, x i is the state corresponding to the i-th quantum bit, or the state of the i-th node; x j is the state corresponding to the jth quantum bit, or the state of the jth node; g ij Represents the grayscale difference between the i-th and j-th nodes; Represents an XOR operation, and the result of the XOR operation represents the connection method between different nodes. In quantum systems, this is achieved through controlled CNOT gates; n represents the total number of nodes;

[0106] When x i 、x j When it is 0 or 1 at the same time, it means that the pixel i and the pixel j in the grayscale image will be divided into the same area. At this time, there is no need to calculate the grayscale difference between the two nodes, which is reflected in the objective function as x i 、x j The XOR result is 0, and x i 、x j The coefficient of the constructed polynomial is also 0 and is not reflected in the objective function;

[0107] by Figure 3 Take the undirected weighted graph shown in as an example, and solve Figure 3 When solving the Max-Cut problem of the weighted graph shown in the figure, 4 qubits are required to represent the state of each node. In the initial state, each node is in an uncut state and all belong to a subset. The following formula is used to represent the corresponding state:

[0108] |x>4=|x>3|x>2|x>1|x>0=|0000>

[0109] The Max-Cut problem of weighted graph is converted into the maximum value problem of the following polynomial, and the image problem is converted into the maximum value problem of an objective function:

[0110]

[0111] S3. Using the polynomial maximum value solution problem obtained in step S2, the maximum value is solved by Grover algorithm; specifically including:

[0112] Constructing the state preparation operator A represents the polynomial shown in the objective function constructed in step S2;

[0113] The quantum black box Oracle operator O and Grover diffusion operator D are constructed, and together with the constructed state preparation operator A, they form the core elements of the Grover algorithm. The maximum value is solved through the Grover algorithm, which includes:

[0114] (3-1) State preparation operator A:

[0115] Set the input register |x> n A set of quantum bits Control unitary operator U G (θ) to output register |z> m , the control process is expressed by the following formula:

[0116]

[0117] Where C represents the controlled operation; U represents the unitary operator; x j The construction of XOR implementation;

[0118] In the method of the present invention, C {1,2} (U) as an example, Figure 4 As shown, a quantum circuit with n input qubits and m output qubits is illustrated;

[0119] The general form of a polynomial in n variables is expressed as follows:

[0120]

[0121] Among them, a J are non-zero coefficients, each subset There are corresponding Monomial;

[0122] Operator A is constructed based on quantum coding, including:

[0123] Each subset Apply controlled geometry sequence changes After that, the inverse quantum Fourier transform (QFT) is applied;

[0124] like Figure 5 , which is a schematic diagram of a quantum circuit encoding a polynomial superposition operator A in the method of the present invention;

[0125] For input register |x> n , output register |z> m Starting from the equal superposition state, using the unitary operator U G (θ) is controlled, the applied angle parameter corresponds to the non-zero coefficient a J ; A single application of the inverse quantum Fourier transform (QFT) to U at the end of the circuit G (θ) decode the encoded periodic signal;

[0126] The following formula is used to represent the system after the A operator is applied:

[0127]

[0128] Among them, y is the threshold, which represents the maximum value of the objective function at the last measurement, and the corresponding value is set to 0 in the initial state;

[0129] (3-2) Quantum black box Oralce operator O:

[0130] The Oralce operator is used to identify the state of interest and multiply its amplitude by -1 to mark the target value state of the quantum system;

[0131] By marking all states x that satisfy the following conditions, it is possible to use the Grover algorithm to search for a solution x whose function value is better than y:

[0132] f(x)>y

[0133] Output register |z> m The value of f(x)-y is represented in the output register. The sign bit in the output register is used to determine whether the state meets the above conditions.

[0134] The following formula is used to represent the system after being processed by the Oracle operator:

[0135]

[0136] Where X represents the set of states x that meet the condition f(x)>y;

[0137] (3-3) Grover diffusion operator D:

[0138] The Grover diffusion operator D reverses the mean of all amplitudes in the marked quantum state, so that the amplitudes of all target value states are amplified and the amplitudes of non-target value states are reduced. The following formula is used to express the expression of operator D:

[0139]

[0140] Among them, H represents the Hadamard gate, which is a single-qubit gate used to construct a quantum superposition state; I represents the Identity gate, which is an identity operation and does not perform any transformation or operation on the qubit;

[0141] Iterate the Grover diffusion operator D for the quantum system and measure the iterative output result;

[0142] S4. Using the maximum value obtained in step S3, by setting a threshold, an image segmentation scheme is obtained to complete the segmentation process of the grayscale image of the lung CT; specifically, the following steps are included:

[0143] like Figure 6 The figure shows a schematic diagram of the framework circuit of the Grover algorithm in the method of the present invention;

[0144] The maximum value obtained by solving step S3 is set as the threshold value y, and the value is set to 0 in the initial state; the Grover operation operator constructed by the Grover algorithm in step S3 is used to iteratively process the quantum system, and each output measurement value is compared with the threshold value. If it is greater than the threshold value, the output value replaces the threshold value and is defined as a new threshold value; when the output measurement value does not change with respect to the threshold value after three consecutive iterative processes, the iteration is stopped, the output result is defined as the final result, and the grayscale image segmentation process is completed according to the final output result;

[0145] by Figure 3 Taking the undirected weighted graph shown in as an example, it is calculated that when the input register |x>4 is |0110>, |1001>, the objective function has a maximum value of 1110001110, that is, 910; when nodes 2 and 3 are divided into one subset, and nodes 1 and 4 are divided into another subset, the total weight value of the edges of the two subsets is the largest, or the difference between the two subgraphs obtained by image division is the largest, and the corresponding image cutting scheme is as follows Figure 7 The figure shows a schematic diagram of the optimal image segmentation scheme in the method of the present invention.

Claims

1. A lung CT image segmentation method based on Grover algorithm, comprising the following steps: S1. Obtain a grayscale CT image of the lung to be segmented, and convert the grayscale image segmentation problem into a maximum cut Max-Cut problem by constructing an undirected weighted graph; specifically, the following steps are included: Obtain the grayscale image of the lung CT to be segmented, and based on the theories and methods in the field of graph theory, map the grayscale image of the lung CT to an undirected weighted graph, correspond "pixels" to "nodes", and correspond the difference in the grayscale values ​​between two pixels to the "weight" of the edge between the two nodes, thereby constructing an undirected weighted graph corresponding to the grayscale image; The mathematical model of the undirected weighted graph is represented by the following formula: G=(V,E) Among them, V represents the set of nodes, and E represents the set of edges; n represents the number of nodes, S∈{0,1} n×n Represents the adjacency matrix, where 0 means that there is no "edge" connecting the two nodes in the undirected weighted graph, and 1 means that there is an "edge" connecting the two nodes in the undirected weighted graph; when n takes different values, the structure of the undirected weighted graph is different, including: Based on the undirected weighted graph constructed above, each node in the graph follows the Max-Cut problem principle. The Max-Cut problem principle aims to divide the node set V into two non-intersecting subsets and ensure that the total weight of the edges of the non-intersecting subsets is the largest. The node set V of the undirected weighted graph and the edge weights are used to construct the weight matrix. The formula is as follows: In=(in ij ) n×n Among them, w ij Represents the weight of the edge connecting the i-th and j-th nodes; if there is no connection between the two nodes, the weight value is 0; Select to remove several "edges" in the undirected weighted graph, divide the node set V into two non-intersecting subsets, namely V1 and V2, and call the removed edge set a "cut set"; the sum of the weights of all edges in the cut set is called a "cut", which is expressed by the following formula: Among them, g ij represents the grayscale difference between the i-th and j-th nodes, V1 and V2 represent the subsets of two non-intersecting vertices after division; Through the above processing, the grayscale image segmentation problem is converted into a maximum cut Max-Cut problem; S2. Using the maximum cut problem obtained in step S1, constructing the objective function of the Max-Cut problem, and using quantum methods to convert the maximum cut problem into a polynomial maximum value solution problem; specifically including: Max-Cut problem To maximize the cut problem, the following formula is used to describe the objective function of the Max-Cut problem: The essence of the Max-Cut problem is to divide the nodes into two categories while ensuring that the weight of the edges connecting nodes in different categories is maximized; In a quantum system, by measuring whether a bit is in state 0 or 1, each quantum bit can be divided into two categories: the node state of the wireless weighted graph obtained above is initialized, and the "basis vector state" in the quantum state is used to represent the state of the node, and state 0 is defined as the non-target state I1, and state 1 is the target state I2; in the initial state, all nodes are in state 0; at the final cut, all nodes in the target state I2 are divided into a subset, defined as the "target subset", and all nodes in the non-target state I1 are divided into a subset, defined as the "non-target subset"; Select an n-bit qubit input register |x> n Represents the quantum state, and uses the following formula to describe |x> at any time n The manifestation: |x> n =|x> n-1 |x> n-2 …|x>1|x>0=|x n-1 x n-2 …x1x0> Among them, |x> n Represents the nth quantum bit, corresponding to the nth pixel; Select an m-bit qubit output register |z> m The function value corresponding to the total weight of the edges of two disjoint subsets |f(x)-y> m , where f(x) represents the objective function, y represents the maximum value of the objective function at the last measurement, and y is initially set to 0; The Max-Cut problem in the quantum state is described as a quadratic unconstrained binary optimization problem, and the objective function in the quantum system is described by the following formula: Among them, x i is the state corresponding to the i-th quantum bit, or the state of the i-th node; x j is the state corresponding to the jth quantum bit, or the state of the jth node; g ij Represents the grayscale difference between the i-th and j-th nodes; Represents an XOR operation, and the result of the XOR operation represents the connection method between different nodes. In quantum systems, this is achieved through controlled CNOT gates; n represents the total number of nodes; S3. Using the polynomial maximum value solution problem obtained in step S2, the maximum value is solved by Grover algorithm; S4. Using the maximum value obtained in step S3, an image segmentation scheme is obtained by setting a threshold value, thereby completing the segmentation process of the grayscale image of the lung CT.

2. The lung CT image segmentation method based on Grover algorithm according to claim 1 is characterized in that The polynomial maximum value solution problem obtained in step S2 described in step S3 is solved by using the Grover algorithm, which specifically includes: Constructing the state preparation operator A represents the polynomial shown in the objective function constructed in step S2; The quantum black box Oracle operator O and Grover diffusion operator D are constructed, and together with the constructed state preparation operator A, they form the core elements of the Grover algorithm. The maximum value is solved through the Grover algorithm, which includes: (3-1) State preparation operator A: The input register |x> n A set of quantum bits Control unitary operator U G (θ) to the output register |z> m , the control process is expressed by the following formula: Where C represents the controlled operation; U represents the unitary operator; x j The construction of XOR implementation; The general form of a polynomial in n variables is expressed as follows: Among them, a J are non-zero coefficients, each subset There are corresponding Monomial; Operator A is constructed based on quantum coding, including: Each subset Apply controlled geometry sequence changes After that, the inverse quantum Fourier transform is applied; For input register |x> n , output register |z> m Starting from the equal superposition state, using the unitary operator U G (θ) is controlled, the applied angle parameter corresponds to the non-zero coefficient a J ; A single application of the inverse quantum Fourier transform (QFT) to U at the end of the circuit G (θ) decode the encoded periodic signal; The following formula is used to represent the system after the A operator is applied: Among them, y is the threshold, which represents the maximum value of the objective function at the last measurement, and the corresponding value is set to 0 in the initial state; (3-2) Quantum black box Oralce operator O: The Oralce operator is used to identify the state of interest and multiply its amplitude by -1 to mark the target value state of the quantum system; By marking all states x that satisfy the following conditions, it is possible to use the Grover algorithm to search for a solution x whose function value is better than y: f(x)>y Output register |z> m The value of f(x)-y is represented in the output register. The sign bit in the output register is used to determine whether the state meets the above conditions. The following formula is used to represent the system after being processed by the Oracle operator: Where X represents the set of states x that meet the condition f(x)>y; (3-3) Grover diffusion operator D: The Grover diffusion operator D reverses the mean of all amplitudes in the marked quantum state, so that the amplitudes of all target value states are amplified and the amplitudes of non-target value states are reduced. The following formula is used to express the expression of operator D: Among them, H represents the Hadamard gate, which is a single-qubit gate used to construct a quantum superposition state; I represents the Identity gate, which is an identity operation and does not perform any transformation or operation on the qubit; An iterative process of the Grover diffusion operator D is performed on the quantum system, and a measurement process is performed on the result of the iterative output.

3. The lung CT image segmentation method based on Grover algorithm according to claim 2 is characterized in that The maximum value obtained in step S3 is adopted in step S4, and an image segmentation scheme is obtained by setting a threshold value to complete the segmentation process of the grayscale image of the lung CT. Specifically, the following steps are included: The maximum value obtained by solving step S3 is set as the threshold y, and the value is set to 0 in the initial state; the Grover operation operator constructed by the Grover algorithm in step S3 is used to iteratively process the quantum system, and each output measurement value is compared with the threshold. If it is greater than the threshold, the output value replaces the threshold and is defined as a new threshold; when the output measurement value does not change with respect to the threshold after three consecutive iterative processes, the iteration is stopped, the output result is defined as the final result, and the grayscale image segmentation process is completed based on the final output result.

Citation Information

Patent Citations

  • Image retrieval method and device based on quantum Grover algorithm and medium

    CN113434723A

  • Graph maximum segmentation problem solving method based on QAOA parameter optimization

    CN115018080A