CN116415670A - Method for generating countermeasure sample for quantum variation line - Google Patents

Method for generating countermeasure sample for quantum variation line Download PDF

Info

Publication number
CN116415670A
CN116415670A CN202310680123.3A CN202310680123A CN116415670A CN 116415670 A CN116415670 A CN 116415670A CN 202310680123 A CN202310680123 A CN 202310680123A CN 116415670 A CN116415670 A CN 116415670A
Authority
CN
China
Prior art keywords
quantum
sample
expression
variation line
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310680123.3A
Other languages
Chinese (zh)
Inventor
闫丽丽
颜金歌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu University of Information Technology
Original Assignee
Chengdu University of Information Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu University of Information Technology filed Critical Chengdu University of Information Technology
Priority to CN202310680123.3A priority Critical patent/CN116415670A/en
Publication of CN116415670A publication Critical patent/CN116415670A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/40Physical realisations or architectures of quantum processors or components for manipulating qubits, e.g. qubit coupling or qubit control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Liquid Crystal (AREA)

Abstract

The invention discloses a method for generating an countermeasure sample for a quantum variation line, which comprises the following steps: s1, constructing a quantum variation line model, and training the quantum variation line model completely to obtain a quantum variation line model with complete training; s2, selecting a samplexConstructing a specific quantum variation line through a quantum variation line model, and obtaining a loss function pairxGradient values of (2)vThe method comprises the steps of carrying out a first treatment on the surface of the S3, according to the loss function pairxGradient values of (2)vCalculating a disturbance, adding the disturbance toxIn the process, obtainxIs of the challenge sample of (a)x adv The method comprises the steps of carrying out a first treatment on the surface of the According to the invention, a specific quantum variation line is constructed, and the gradient value is obtained by measuring the specific quantum variation line, the quantum variation line is utilized to generate an countermeasure sample, and the quantum variation line is trained by using the countermeasure sample, so that the robustness of the model can be effectively improved.

Description

Method for generating countermeasure sample for quantum variation line
Technical Field
The invention relates to the field of quantum countermeasure machine learning, in particular to a countermeasure sample generation method aiming at a quantum variation line.
Background
Machine learning models have proven vulnerable, and in machine learning models that accomplish image recognition tasks, adding a disturbance to the data that is difficult for the naked eye to recognize, generated by an attack method, can cause the model to output errors. In practical applications such as image recognition, autopilot, industrial control, malware detection, biometric authentication, medical diagnostics, an attacker may use an attack method to make these applications incorrect, e.g. a logo recognition system of an autopilot car may incorrectly classify a parking logo with a bit of dirt as a park-forbidden logo, resulting in catastrophic accidents. Attack methods typically construct perturbations to the gradient values of a sample based on a loss function, adding the perturbations to a legitimate sample to implement an attack. At present, quantum machine learning is a research hotspot in academia, wherein a quantum variation line is a common quantum machine learning model, and can be widely applied to classification and identification tasks. Quantum machine learning models have also proven vulnerable. One effective way to improve the defensive, robust nature of quantum machine learning models is to train the model using challenge samples, which are obtained by generating perturbations from the present solution and adding to legitimate samples.
The generation of disturbance requires obtaining the gradient value of the loss function input to the model, but at present, the quantum machine learning model is only realized in a classical computer in a simulation mode, so the gradient can be calculated in the classical computer by using an automatic differential method, which brings two problems: 1. in a quantum variation line built by a real quantum computer, an automatic differential method cannot be used for acquiring a gradient to generate an countermeasure sample; 2. the automatic differentiation method is realized by a classical computer, so that the parallel advantage of a quantum computer cannot be represented, and the time complexity is high.
Disclosure of Invention
Aiming at the defects in the prior art, the method for generating the countermeasure sample for the quantum variation circuit solves the problems of insufficient robustness and higher time complexity in the prior art.
In order to achieve the aim of the invention, the invention adopts the following technical scheme: provided is an countermeasure sample generation method for a quantum variation line, including the steps of:
s1, constructing a quantum variation line model, and training the quantum variation line model completely to obtain a quantum variation line model with complete training;
s2, selecting a samplexObtaining a loss function pair of a quantum variation circuit modelxGradient values of (2)v
S3, according to the loss function pairxGradient values of (2)vCalculating optimal disturbance coefficient
Figure SMS_1
Will be +.>
Figure SMS_2
The generated disturbance is added toxIn the process, obtainxIs of the challenge sample of (a)x adv
Further: the step S1 comprises the following sub-steps:
s11 and structurenA quantum circuit, as a quantum variation circuit model, in which multiple layers are arrangedROTDoor and controlXA gate for selecting one or more lines and settingMBased measurement, obtaining expectations of quantum circuitsEAnd expect the quantum circuitEAs output of the quantum variation line model;
Ethe expression of (2) is:
Figure SMS_3
wherein M is a measuring operator,
Figure SMS_5
for the quantum state obtained after amplitude encoding of sample x, -/->
Figure SMS_7
Is->
Figure SMS_10
Left vector of (2) satisfy->
Figure SMS_6
,/>
Figure SMS_8
Is a generic term for a series of ROT gates and control-X gates, +.>
Figure SMS_9
As a set of parameters,
Figure SMS_11
is->
Figure SMS_4
Is the reverse of the above;
s12, selecting a data set for machine learning, obtaining corresponding quantum states after quantum amplitude encoding of data in the data set, taking quantum state data as an input sample, inputting the input sample into a quantum variation circuit model to obtain output, and optimizing a parameter set according to the output
Figure SMS_12
By means of the optimized parameter set +.>
Figure SMS_13
Training a quantum variation line model to obtain a quantum variation line model with complete training;
the data in the data set comprises N characteristics, which satisfyN=2 n
Wherein,,Nas a number of data features in the data set,nis the number of quantum wires.
Further: the output of the quantum variation line model in the step S12 is the loss function pair ROT gate and control-XThe gradient value of the gate parameter, the bias value of the gradient value is obtained by adopting a parameter displacement method, and the formula is as follows:
Figure SMS_14
wherein,,
Figure SMS_15
as a loss function of the quantum variational circuit model,yfor entering class labels to which the sample belongs, +.>
Figure SMS_16
Is a parameter set->
Figure SMS_17
One of the parameters->
Figure SMS_18
The quantum state is taken, and pi is the circumference ratio.
Further: the step S2 comprises the following sub-steps:
s21, using a quantum variation line model with complete training to samplexConstructing a specific quantum circuit, and obtaining a loss function of the specific quantum circuit, wherein the loss function has the expression:
Figure SMS_19
wherein the sample isx=(x1,x2,...,xN) WhereinxNIs the first sampleNA characteristic value;
s22, preparing a quantum system to obtainK i Is a value of (2);
wherein,,K i to obtain the loss function pairxGradient values of (2)vKey values of (2);
s23, according toK i Calculating the loss function pair of a specific quantum circuitxGradient values of (2)v
Further: the step S22 includes the following sub-steps:
s2201, preparationnIndividual qubits
Figure SMS_20
And 1 auxiliary qubit->
Figure SMS_21
Will benIndividual qubits->
Figure SMS_22
As a data register, an initial quantum system is obtainedG 0G 0 The expression of (2) is:
Figure SMS_23
wherein,,
Figure SMS_24
is thatnA quantum bit;
s2202, performing Hadamard gate operation on the auxiliary quantum bit to obtain a quantum system after one Hadamard gate operationG 1G 1 The expression of (2) is:
Figure SMS_25
s2203 toG 1 Auxiliary qubit in (a)
Figure SMS_26
For control bits, the data register is used as operation bitnIndividual qubits->
Figure SMS_27
Is transformed into->
Figure SMS_28
Quantum system for obtaining one-time quantum operationG 2G 2 The expression of (2) is:
Figure SMS_29
s2204 toG 2 Auxiliary qubit in (a)
Figure SMS_30
For control bits, the data register is used as operation bitnIndividual qubits->
Figure SMS_31
Is transformed into->
Figure SMS_32
Quantum system for obtaining secondary quantum operationG 3G 3 The expression of (2) is:
Figure SMS_33
wherein,,x i for the samplexIs the first of (2)iA plurality of features;
s2205 pair ofG 3 Data register of (a) to be processed
Figure SMS_34
Manipulation, get->
Figure SMS_35
Operated quantum systemG 4G 4 The expression of (2) is:
Figure SMS_36
wherein,,AandBall are intermediate variables;
s2206, selecting a measurement operatorMTo assist in qubits
Figure SMS_37
For control bits, data registers are used as operation bits, pairs ofG 4 Measuring and calculating to obtain a measured quantum systemG 5G 5 The expression of (2) is:
Figure SMS_38
s2207 pair ofG 5 Auxiliary qubit in (a)
Figure SMS_39
Performing Hadamard gate operation to obtain a quantum system after secondary Hadamard gate operationG 6G 6 The expression of (2) is:
Figure SMS_40
s2208, selectZBase measurementG 5 Occurs in (a)
Figure SMS_41
Probability of (2)P(/>
Figure SMS_42
) And (3) appearance->
Figure SMS_43
Probability of (2)P(/>
Figure SMS_44
),P(/>
Figure SMS_45
) AndP(/>
Figure SMS_46
) The expression of (2) is as follows:
Figure SMS_47
wherein P is%
Figure SMS_48
) For G5->
Figure SMS_49
Probability of P (+)>
Figure SMS_50
) For G5->
Figure SMS_51
Probability of (2);
s2209 according toP
Figure SMS_52
) AndP(/>
Figure SMS_53
) ObtainingK i Is used as a reference to the value of (a),K i the values of (2) are:
Figure SMS_54
further: the expression of the gradient of the model input of the loss function of the specific quantum circuit in the step S23 is:
Figure SMS_55
wherein,,
Figure SMS_56
the gradient input to the quantum variational circuit model for the loss function of a particular quantum circuit,
Figure SMS_57
(.) represents computing gradients input to the quantum variational circuit model.
Further: the step S3 comprises the following sub-steps:
s31, setting an initial value of a disturbance coefficient
Figure SMS_58
Sum step sizedWhereindThe value of (2) is less than +.>
Figure SMS_59
Is a value of (2);
s32, will
Figure SMS_60
Substituting disturbance, generating an countermeasure sample by using the disturbance, and testing whether a quantum variation line model is wrongly identified:
if yes, at each time
Figure SMS_61
In the way of (a) the perturbation coefficient is reduced until it is correctly identified by the quantum variational circuit model, the last wrongly identified +.>
Figure SMS_62
Is the optimal perturbation coefficient +.>
Figure SMS_63
Step S33 is performed;
if not, at each time
Figure SMS_64
In the way of (a) increasing the disturbance factor until the quantum variational circuit model incorrectly identifies it, the first incorrectly identified +.>
Figure SMS_65
Is the optimal perturbation coefficient +.>
Figure SMS_66
Step S33 is performed;
s33, sample directionxAdding the most ideal disturbance coefficient
Figure SMS_67
The generated disturbance is used for acquiring an countermeasure samplex advx adv The expression of (2) is:
Figure SMS_68
wherein,,
Figure SMS_69
is the most ideal disturbance coefficient. The beneficial effects of the invention are as follows:
1. the method provided by the invention generates a reactance sample in a mode of constructing a quantum variation line to acquire gradient, and the mode is suitable for the quantum variation line constructed by a real quantum computer;
2. the method provided by the invention is realized through a quantum variation circuit, the parallel advantage of a quantum computer is reflected, the time complexity is greatly reduced, and the robustness is improved.
Drawings
Fig. 1 is a flowchart of a method for generating an countermeasure sample for a quantum variation line according to the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
As shown in fig. 1, in one embodiment of the present invention, there is provided an countermeasure sample generating method for a quantum variation line, including the steps of:
s1, constructing a quantum variation line model, and training the quantum variation line model completely to obtain a quantum variation line model with complete training;
s2, selecting a samplexObtaining a loss function pair of a quantum variation circuit modelxGradient values of (2)v
S3, according to the loss function pairxGradient values of (2)vCalculating optimal disturbance coefficient
Figure SMS_70
Will be +.>
Figure SMS_71
The generated disturbance is added toxIn the process, obtainxIs of the challenge sample of (a)x adv
In this embodiment, the step S1 includes the following sub-steps:
s11 and structurenA quantum circuit, as a quantum variation circuit model, in which multiple layers are arrangedROTDoor and controlXA gate for selecting one or more lines and settingMBased measurement, obtaining expectations of quantum circuitsEAnd expect the quantum circuitEAs output of the quantum variation line model;
Ethe expression of (2) is:
Figure SMS_72
wherein M is a measuring operator,
Figure SMS_75
to sample x amplitudeQuantum states obtained after encoding,/->
Figure SMS_77
Is->
Figure SMS_79
Left vector of (2) satisfy->
Figure SMS_73
,/>
Figure SMS_76
Is a generic term for a series of ROT gates and control-X gates, +.>
Figure SMS_78
As a set of parameters,
Figure SMS_80
is->
Figure SMS_74
Is the reverse of the above;
s12, selecting a data set for machine learning, obtaining corresponding quantum states after quantum amplitude encoding of data in the data set, taking quantum state data as an input sample, inputting the input sample into a quantum variation circuit model to obtain output, and optimizing a parameter set according to the output
Figure SMS_81
By means of the optimized parameter set +.>
Figure SMS_82
Training a quantum variation line model to obtain a quantum variation line model with complete training;
the data in the data set comprises N characteristics, which satisfyN=2 n
Wherein,,Nas a number of data features in the data set,nthe number of the quantum circuits;
the output of the quantum variation line model in the step S12 is the loss function pair ROT gate and control-XThe gradient value of the gate parameter, the bias value of the gradient value is obtained by adopting a parameter displacement method, and the formula is as follows:
Figure SMS_83
wherein,,
Figure SMS_84
as a loss function of the quantum variational circuit model,yfor entering class labels to which the sample belongs, +.>
Figure SMS_85
Is a parameter set->
Figure SMS_86
One of the parameters->
Figure SMS_87
The quantum state is taken, and pi is the circumference ratio.
In this embodiment, the step S2 includes the following sub-steps:
s21, using a quantum variation line model with complete training to samplexConstructing a specific quantum circuit, and obtaining a loss function of the specific quantum circuit, wherein the loss function has the expression:
Figure SMS_88
wherein the sample isx=(x1,x2,...,xN) WhereinxNIs the first sampleNA characteristic value;
s22, preparing a quantum system to obtainK i Is a value of (2);
wherein,,K i to obtain the loss function pairxGradient values of (2)vKey values of (2);
the step S22 includes the following sub-steps:
s2201, preparationnIndividual qubits
Figure SMS_89
And 1 auxiliary qubit->
Figure SMS_90
Will benIndividual qubits->
Figure SMS_91
As a data register, an initial quantum system is obtainedG 0G 0 The expression of (2) is:
Figure SMS_92
wherein,,
Figure SMS_93
is thatnA quantum bit;
s2202, performing Hadamard gate operation on the auxiliary quantum bit to obtain a quantum system after one Hadamard gate operationG 1G 1 The expression of (2) is:
Figure SMS_94
s2203 toG 1 Auxiliary qubit in (a)
Figure SMS_95
For control bits, the data register is used as operation bitnIndividual qubits->
Figure SMS_96
Is transformed into->
Figure SMS_97
Quantum system for obtaining one-time quantum operationG 2G 2 The expression of (2) is:
Figure SMS_98
s2204 toG 2 Auxiliary qubit in (a)
Figure SMS_99
For control bits, data registersOperating position, willnIndividual qubits->
Figure SMS_100
Is transformed into->
Figure SMS_101
Quantum system for obtaining secondary quantum operationG 3G 3 The expression of (2) is:
Figure SMS_102
wherein,,x i for the samplexIs the first of (2)iA plurality of features;
s2205 pair ofG 3 Data register of (a) to be processed
Figure SMS_103
Manipulation, get->
Figure SMS_104
Operated quantum systemG 4G 4 The expression of (2) is:
Figure SMS_105
wherein,,AandBall are intermediate variables;
s2206, selecting a measurement operatorMTo assist in qubits
Figure SMS_106
For control bits, data registers are used as operation bits, pairs ofG 4 Measuring and calculating to obtain a measured quantum systemG 5G 5 The expression of (2) is:
Figure SMS_107
s2207 pair ofG 5 Auxiliary qubit in (a)
Figure SMS_108
Performing Hadamard gate operation to obtain a quantum system after secondary Hadamard gate operationG 6G 6 The expression of (2) is:
Figure SMS_109
s2208, selectZBase measurementG 5 Occurs in (a)
Figure SMS_110
Probability of (2)P(/>
Figure SMS_111
) And (3) appearance->
Figure SMS_112
Probability of (2)P(/>
Figure SMS_113
),P(/>
Figure SMS_114
) AndP(/>
Figure SMS_115
) The expression of (2) is as follows:
Figure SMS_116
wherein P is%
Figure SMS_117
) For G5->
Figure SMS_118
Probability of P (+)>
Figure SMS_119
) For G5->
Figure SMS_120
Probability of (2);
S2209. according toP
Figure SMS_121
) AndP(/>
Figure SMS_122
) ObtainingK i Is used as a reference to the value of (a),K i the values of (2) are:
Figure SMS_123
s23, according toK i Calculating the loss function pair of a specific quantum circuitxGradient values of (2)v
The expression of the gradient of the model input of the loss function of the specific quantum circuit in the step S23 is:
Figure SMS_124
wherein,,
Figure SMS_125
the gradient input to the quantum variational circuit model for the loss function of a particular quantum circuit,
Figure SMS_126
(.) represents computing gradients input to the quantum variational circuit model.
In this embodiment, the step S3 includes the following sub-steps:
s31, setting an initial value of a disturbance coefficient
Figure SMS_127
Sum step sizedWhereindThe value of (2) is less than +.>
Figure SMS_128
Is a value of (2);
s32, will
Figure SMS_129
Substituting disturbance, generating an countermeasure sample by using the disturbance, and testing a quantum variation circuit modelWhether a pattern is falsely identified as such:
if yes, at each time
Figure SMS_130
In the way of (a) the perturbation coefficient is reduced until it is correctly identified by the quantum variational circuit model, the last wrongly identified +.>
Figure SMS_131
Is the optimal perturbation coefficient +.>
Figure SMS_132
Step S33 is performed;
if not, at each time
Figure SMS_133
In the way of (a) increasing the disturbance factor until the quantum variational circuit model incorrectly identifies it, the first incorrectly identified +.>
Figure SMS_134
Is the optimal perturbation coefficient +.>
Figure SMS_135
Step S33 is performed;
s33, sample directionxAdding the most ideal disturbance coefficient
Figure SMS_136
The generated disturbance is used for acquiring an countermeasure samplex advx adv The expression of (2) is:
Figure SMS_137
wherein,,
Figure SMS_138
is the most ideal disturbance coefficient.
In the description of the present invention, it should be understood that the terms "center," "thickness," "upper," "lower," "horizontal," "top," "bottom," "inner," "outer," "radial," and the like indicate or are based on the orientation or positional relationship shown in the drawings, merely to facilitate description of the present invention and to simplify the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be configured and operated in a particular orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be interpreted as indicating or implying a relative importance or number of technical features indicated. Thus, a feature defined as "first," "second," "third," or the like, may explicitly or implicitly include one or more such feature.

Claims (7)

1. A method of generating an countermeasure sample for a quantum variation line, comprising the steps of:
s1, constructing a quantum variation line model, and training the quantum variation line model completely to obtain a quantum variation line model with complete training;
s2, selecting a samplexObtaining a loss function pair of a quantum variation circuit modelxGradient values of (2)v
S3, according to the loss function pairxGradient values of (2)vCalculating optimal disturbance coefficient
Figure QLYQS_1
Will be +.>
Figure QLYQS_2
The generated disturbance is added toxIn the process, obtainxIs of the challenge sample of (a)x adv
2. The method of generating an countermeasure sample for a quantum variation line according to claim 1, wherein the step S1 includes the sub-steps of:
s11 and structurenA quantum circuit, as a quantum variation circuit model, in which multiple layers are arrangedROTDoor and controlXA gate for selecting one or more lines and settingMBasic measurement to obtain quantum wireRoad expectationEAnd expect the quantum circuitEAs output of the quantum variation line model;
Ethe expression of (2) is:
Figure QLYQS_3
wherein M is a measuring operator,
Figure QLYQS_5
for the quantum state obtained after amplitude encoding of sample x, -/->
Figure QLYQS_7
Is->
Figure QLYQS_9
Left vector of (2) satisfy->
Figure QLYQS_6
,/>
Figure QLYQS_8
Is a generic term for a series of ROT gates and control-X gates, +.>
Figure QLYQS_10
For parameter set, ++>
Figure QLYQS_11
Is->
Figure QLYQS_4
Is the reverse of the above;
s12, selecting a data set for machine learning, obtaining corresponding quantum states after quantum amplitude encoding of data in the data set, taking quantum state data as an input sample, inputting the input sample into a quantum variation circuit model to obtain output, and optimizing a parameter set according to the output
Figure QLYQS_12
By means of the optimized parameter set +.>
Figure QLYQS_13
Training a quantum variation line model to obtain a quantum variation line model with complete training;
the data in the data set comprises N characteristics, which satisfyN=2 n
Wherein,,Nas a number of data features in the data set,nis the number of quantum wires.
3. The method for generating an countermeasure sample for a quantum dot line according to claim 2, wherein the output of the quantum dot line model in the step S12 is a loss function pair ROT gate and controlXThe gradient value of the gate parameter, the bias value of the gradient value is obtained by adopting a parameter displacement method, and the formula is as follows:
Figure QLYQS_14
wherein,,
Figure QLYQS_15
as a loss function of the quantum variational circuit model,yfor entering class labels to which the sample belongs, +.>
Figure QLYQS_16
Is a parameter set->
Figure QLYQS_17
One of the parameters->
Figure QLYQS_18
The quantum state is taken, and pi is the circumference ratio.
4. A challenge sample generation method for quantum variational circuits according to claim 3, wherein said step S2 comprises the sub-steps of:
s21, using a quantum variation line model with complete training to samplexConstructing a specific quantum circuit, and obtaining a loss function of the specific quantum circuit, wherein the loss function has the expression:
Figure QLYQS_19
wherein the sample isx=(x1,x2,...,xN) WhereinxNIs the first sampleNA characteristic value;
s22, preparing a quantum system to obtainK i Is a value of (2);
wherein,,K i to obtain the loss function pairxGradient values of (2)vKey values of (2);
s23, according toK i Calculating the loss function pair of a specific quantum circuitxGradient values of (2)v
5. The method of generating an countermeasure sample for a quantum variation line according to claim 4, wherein the step S22 includes the sub-steps of:
s2201, preparationnIndividual qubits
Figure QLYQS_20
And 1 auxiliary qubit->
Figure QLYQS_21
Will benIndividual qubits->
Figure QLYQS_22
As a data register, an initial quantum system is obtainedG 0G 0 The expression of (2) is:
Figure QLYQS_23
wherein,,
Figure QLYQS_24
is thatnA quantum bit;
s2202, performing Hadamard gate operation on the auxiliary quantum bit to obtain a quantum system after one Hadamard gate operationG 1G 1 The expression of (2) is:
Figure QLYQS_25
s2203 toG 1 Auxiliary qubit in (a)
Figure QLYQS_26
For control bits, the data register is used as operation bitnIndividual qubits
Figure QLYQS_27
Is transformed into->
Figure QLYQS_28
Quantum system for obtaining one-time quantum operationG 2G 2 The expression of (2) is:
Figure QLYQS_29
s2204 toG 2 Auxiliary qubit in (a)
Figure QLYQS_30
For control bits, the data register is used as operation bitnIndividual qubits
Figure QLYQS_31
Is transformed into->
Figure QLYQS_32
Quantum system for obtaining secondary quantum operationG 3G 3 The expression of (2) is:
Figure QLYQS_33
wherein,,x i for the samplexIs the first of (2)iA plurality of features;
s2205 pair ofG 3 Data register of (a) to be processed
Figure QLYQS_34
Manipulation, get->
Figure QLYQS_35
Operated quantum systemG 4G 4 The expression of (2) is:
Figure QLYQS_36
wherein,,AandBall are intermediate variables;
s2206, selecting a measurement operatorMTo assist in qubits
Figure QLYQS_37
For control bits, data registers are used as operation bits, pairs ofG 4 Measuring and calculating to obtain a measured quantum systemG 5G 5 The expression of (2) is:
Figure QLYQS_38
s2207 pair ofG 5 Auxiliary qubit in (a)
Figure QLYQS_39
Performing Hadamard gate operation to obtain a quantum system after secondary Hadamard gate operationG 6G 6 The expression of (2) is:
Figure QLYQS_40
s2208, selectZBase measurementG 5 Occurs in (a)
Figure QLYQS_41
Probability of (2)P(/>
Figure QLYQS_42
) And (3) appearance->
Figure QLYQS_43
Probability of (2)P(/>
Figure QLYQS_44
),P(/>
Figure QLYQS_45
) AndP(/>
Figure QLYQS_46
) The expression of (2) is as follows:
Figure QLYQS_47
wherein P is%
Figure QLYQS_48
) For G5->
Figure QLYQS_49
Probability of P (+)>
Figure QLYQS_50
) For G5->
Figure QLYQS_51
Probability of (2);
s2209 according toP
Figure QLYQS_52
) AndP(/>
Figure QLYQS_53
) ObtainingK i Is used as a reference to the value of (a),K i the values of (2) are:
Figure QLYQS_54
6. the method of generating an countermeasure sample for a quantum variation line according to claim 5, wherein the expression of the gradient of the model input of the loss function of the specific quantum line in step S23 is:
Figure QLYQS_55
wherein,,
Figure QLYQS_56
gradient input to quantum variational circuit model for loss function of specific quantum circuit, +.>
Figure QLYQS_57
(.) represents computing gradients input to the quantum variational circuit model.
7. The method of generating an countermeasure sample for a quantum variation line according to claim 6, wherein the step S3 includes the sub-steps of:
s31, setting an initial value of a disturbance coefficient
Figure QLYQS_58
Sum step sizedWhereindThe value of (2) is less than +.>
Figure QLYQS_59
Is a value of (2);
s32, will
Figure QLYQS_60
Substituting disturbance, generating an countermeasure sample by using the disturbance, and testing whether a quantum variation line model is wrongly identified:
if yes, at each time
Figure QLYQS_61
In the way of (a) the perturbation coefficient is reduced until it is correctly identified by the quantum variational circuit model, the last wrongly identified +.>
Figure QLYQS_62
Is the optimal perturbation coefficient +.>
Figure QLYQS_63
Step S33 is performed;
if not, at each time
Figure QLYQS_64
In the way of (a) increasing the disturbance factor until the quantum variational circuit model incorrectly identifies it, the first incorrectly identified +.>
Figure QLYQS_65
Is the optimal perturbation coefficient +.>
Figure QLYQS_66
Step S33 is performed;
s33, sample directionxAdding the most ideal disturbance coefficient
Figure QLYQS_67
The generated disturbance is used for acquiring an countermeasure samplex advx adv The expression of (2) is:
Figure QLYQS_68
wherein,,
Figure QLYQS_69
is the most ideal disturbance coefficient.
CN202310680123.3A 2023-06-09 2023-06-09 Method for generating countermeasure sample for quantum variation line Pending CN116415670A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310680123.3A CN116415670A (en) 2023-06-09 2023-06-09 Method for generating countermeasure sample for quantum variation line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310680123.3A CN116415670A (en) 2023-06-09 2023-06-09 Method for generating countermeasure sample for quantum variation line

Publications (1)

Publication Number Publication Date
CN116415670A true CN116415670A (en) 2023-07-11

Family

ID=87054693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310680123.3A Pending CN116415670A (en) 2023-06-09 2023-06-09 Method for generating countermeasure sample for quantum variation line

Country Status (1)

Country Link
CN (1) CN116415670A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407922A (en) * 2023-12-11 2024-01-16 成都信息工程大学 Federal learning privacy protection system and method based on quantum noise
CN117556916A (en) * 2024-01-12 2024-02-13 深圳量旋科技有限公司 S N 2 reaction path simulation method and device, storage medium, and quantum computing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112381232A (en) * 2020-11-16 2021-02-19 成都信息工程大学 Method for learning anti-attack model by quantum fuzzy machine
CN114531274A (en) * 2022-01-13 2022-05-24 西安电子科技大学 Intelligent countermeasure method, system, medium and device for communication signal modulation recognition

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112381232A (en) * 2020-11-16 2021-02-19 成都信息工程大学 Method for learning anti-attack model by quantum fuzzy machine
CN114531274A (en) * 2022-01-13 2022-05-24 西安电子科技大学 Intelligent countermeasure method, system, medium and device for communication signal modulation recognition

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YAN, JINGE等: "A new method of constructing adversarial examples of quantum variational circuits", 《CHINESE PHYSICS B》, pages 1 - 5 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407922A (en) * 2023-12-11 2024-01-16 成都信息工程大学 Federal learning privacy protection system and method based on quantum noise
CN117407922B (en) * 2023-12-11 2024-03-22 成都信息工程大学 Federal learning privacy protection system and method based on quantum noise
CN117556916A (en) * 2024-01-12 2024-02-13 深圳量旋科技有限公司 S N 2 reaction path simulation method and device, storage medium, and quantum computing device
CN117556916B (en) * 2024-01-12 2024-03-22 深圳量旋科技有限公司 S N 2 reaction path simulation method and device, storage medium, and quantum computing device

Similar Documents

Publication Publication Date Title
CN116415670A (en) Method for generating countermeasure sample for quantum variation line
US10311322B2 (en) Character information recognition method based on image processing
CN113378988B (en) Particle swarm algorithm-based robustness enhancement method and device for deep learning system
CN111754519B (en) Class activation mapping-based countermeasure method
CN112861945B (en) Multi-mode fusion lie detection method
CN107832789B (en) Feature weighting K nearest neighbor fault diagnosis method based on average influence value data transformation
CN110880024B (en) Nonlinear process fault identification method and system based on discrimination kernel slow characteristic analysis
CN111564179A (en) Species biology classification method and system based on triple neural network
CN117218707B (en) Deep face detection method based on positive disturbance
CN115186816B (en) Back door detection method based on decision shortcut search
CN110677437A (en) User disguised attack detection method and system based on potential space countermeasure clustering
Jiang et al. Multi-sensor data fusion-enabled semi-supervised optimal temperature-guided PCL framework for machinery fault diagnosis
Zhang et al. Amplitude‐frequency images‐based ConvNet: Applications of fault detection and diagnosis in chemical processes
Dirik Detection of counterfeit banknotes using genetic fuzzy system
Singh et al. Steganalysis using learned denoising kernels
CN113343123A (en) Training method and detection method for generating confrontation multiple relation graph network
CN109886151B (en) False identity attribute detection method
CN116310969A (en) Depth fake video detection method and device based on multi-scale feature decoupling
CN115690677A (en) Abnormal behavior identification method based on local intuition fuzzy support vector machine
JP2011113125A (en) Apparatus and program for processing information
CN113642029B (en) Method and system for measuring correlation between data sample and model decision boundary
Liu et al. A spatial-temporal transformer based on domain generalization for motor imagery classification
CN112766410A (en) Rotary kiln firing state identification method based on graph neural network feature fusion
JP6786364B2 (en) Learning device and learning method
CN110633774A (en) Generation method of double-order two-dimensional code and anti-copy verification method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230711