Chinese Journal of Quantum Electronics, Volume. 42, Issue 1, 123(2025)

Quantum convolutional neural network based on particle swarm optimization algorithm

ZHANG Jiawen1、*, CAI Binbin1,2, and LIN Song1
Author Affiliations
  • 1College of Computer and Cyber Security, Fujian Normal University, Fuzhou 350007, China
  • 2Digital Fujian Internet-of-Things Laboratory of Environmental Monitoring, Fuzhou 350007, China
  • show less
    Figures & Tables(17)
    Architecture of QCNN[11]
    QCNN for classification[13]
    Pooling layer structure [13]
    Example of quantum circuit encoding
    Ansatz circuit structures obtained using PSO optimization algorithm for different numbers of basic gates (Fashion MNIST). (a) k=3; (b) k=6; (c) k=8; (d) k=10 (a) k=3; (b) k=6; (c) k=8; (d) k=10
    Ansatz circuit structures (MNIST) obtained using PSO optimization algorithm for different numbers of basic gates. (a) k=3; (b) k=6; (c) k=8; (d) k=10; (e) k=10 (a) k=3; (b) k=6; (c) k=8; (d) k=10; (e) k=10;
    Convergence curve (Fashion MNIST), where (a), (b), (c) and (d) correspond to the cases k = 3, 6, 8 and 10, respectively (k is the dimension of the particle)
    Convergence curve (MNIST), where (a), (b), (c), (d) and (e) correspond to the cases k = 3, 6, 8, 10,10 respectively
    Convergence of particles in the spatial search process of PSO-QCNN model with k=3
    QCNN structure of optimal classification results at k=3
    • Table 1. Correspondence between index and quantum gate

      View table
      View in Article

      Table 1. Correspondence between index and quantum gate

      12345678910111213
      XYZIRx(θ)Ry(θ)Rz(θ)CNOTCYCZCRx(θ)CRy(θ)CRz(θ)
    • Table 2. PSO⁃QCNN algorithm

      View table
      View in Article

      Table 2. PSO⁃QCNN algorithm

      Algorithm 1: PSO⁃QCNN

      The input: Size of the particle swarm N, Dimensions of the search space D, Initialization parameters w, c1,c2,r1, r2.

      The output: α* and θ* in Eq. (6), Optimal fitness of F.

      The algorithm process:

      1. Initialize the ansatz structure αi0 and the velocity vi0 of all particles in the particle swarm.

      2. Calculate the individual extremum value ρi0 for each particle and the group extremum γ0 for the whole particle swarm.

      3. for t in range (1, m+1):

      4. Update the ansatz structure αit and the velocity vit of all particles according to Eq. (1) and Eq. (2)

      5. if αit and vit are not within the specified range of values, then border processing.

      // Update the individual extremum value ρit and the group extremum γt

      6. Initialize the parameter θ0 corresponding to αit

      7. for s in range(1, n+1):

      8. Run Q(αit,θs-1) on quantum computer.

      9. Calculate the loss function L(αit,θs-1).

      10. Execute the gradient descent by θsθs-1-ηθLθ, η is the learning rate.

      11. Run Q(αit,θit*) on quantum computer and calculate the classification accuracy acct.

      12. Calculate the fitness Fit and Update ρit and γt.

      13. α*=argminγF, corresponding θ as θ*.

      14. end

    • Table 3. Accuracy comparison of different QCNN models with different numbers of base gates (Fashion MNIST)

      View table
      View in Article

      Table 3. Accuracy comparison of different QCNN models with different numbers of base gates (Fashion MNIST)

      Dimension k of particlesClassification accuracy
      HKP-QCNN/%GPZ-QCNN/%PSO-QCNN/%
      390.990.7794.45
      690.791.6294.6
      890.4-94.7
      1089.989.794.7
    • Table 4. Accuracy comparison of different QCNN models with results for different numbers of base gates (MNIST)

      View table
      View in Article

      Table 4. Accuracy comparison of different QCNN models with results for different numbers of base gates (MNIST)

      Dimension k of particlesClassification accuracy
      HKP-QCNN/%GPZ-QCNN/%PSO-QCNN/%
      396.895.2598.77
      697.892.7298.96
      897.2-99.05
      1098.395.9199.05
    • Table 5. Accuracy comparison of different QCNN models with different numbers of parameters (Fashion MNIST)

      View table
      View in Article

      Table 5. Accuracy comparison of different QCNN models with different numbers of parameters (Fashion MNIST)

      Number of parameters for QCNNClassification accuracy
      HKP-QCNN/%GPZ-QCNN/%PSO-QCNN/%
      9--94.7
      1290.990.7794.6
      1890.189.5794.7
      3689.989.7-
    • Table 6. Accuracy comparison of different QCNN models with different numbers of parameters (MNIST)

      View table
      View in Article

      Table 6. Accuracy comparison of different QCNN models with different numbers of parameters (MNIST)

      Number of parameters for QCNNClassification accuracy
      HKP-QCNN/%GPZ-QCNN/%PSO-QCNN/%
      1296.895.2598.77
      15--99.05
      1893.897.3199.05
      30--99.05
      3698.395.91-
    • Table 7. Comparison of classification accuracy between PSOQ⁃CNN model and CNN model

      View table
      View in Article

      Table 7. Comparison of classification accuracy between PSOQ⁃CNN model and CNN model

      ModelClassification Accuracy
      Fashion MNIST/%MNIST/%
      CNN87.6786.32
      PSO-QCNN94.6 (k=6)99.05 (k=8)
      PSO-QCNN94.7 (k=10)99.05 (k=10)
    Tools

    Get Citation

    Copy Citation Text

    Jiawen ZHANG, Binbin CAI, Song LIN. Quantum convolutional neural network based on particle swarm optimization algorithm[J]. Chinese Journal of Quantum Electronics, 2025, 42(1): 123

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category: Quantum Computing

    Received: Feb. 28, 2024

    Accepted: --

    Published Online: Mar. 13, 2025

    The Author Email: ZHANG Jiawen (gamung123@163.com)

    DOI:10.3969/j.issn.1007-5461.2025.01.012

    Topics