Laser & Optoelectronics Progress, Volume. 61, Issue 24, 2411003(2024)

Autofocus Method Based on Deep Learning in the Visual Measurement System

Bowen Zheng1,2,3, Shaojin Liu1,2,3、*, Chengwu Shen1,2,3, Jianrong Li1,2,3, Yan Han1,2,3, and Haoyang Sun1,2,3
Author Affiliations
  • 1Changchun Institute of Optics Fine Mechanics and Physics, Chinese Academy of Sciences, Changchun 130033, Jilin , China
  • 2Relative Pose Measurement Laboratory, Changchun Institute of Optics Fine Mechanics and Physics, Chinese Academy of Sciences, Changchun 130033, Jilin , China
  • 3University of Chinese Academy of Sciences, Beijing 100049, China
  • show less
    Figures & Tables(16)
    Visual measurement system composition
    Model training and prediction process
    Partial dataset images and their real defocus distance
    Decline of training set loss and validation set loss
    Defocusing distance of model prediction in test set
    Single defocus image sequence sharpness evaluation curve
    Schematic diagram of focus sub-region division
    Two-step focusing algorithm flow chart
    Multi-depth-of-field target scene used in the experiment
    Focus error statistics diagram. (a) Group A; (b) group B; (c) group C
    • Table 1. Main imaging parameters of vision measurement system

      View table

      Table 1. Main imaging parameters of vision measurement system

      ParameterValue
      Focal distance/m0.15‒10.00
      Resolution2592(H)×2048(V)
      Pixel dimension/μm4.8
    • Table 2. Network structure used to predict defocus distance

      View table

      Table 2. Network structure used to predict defocus distance

      TypeConvolutional kernel size or strideOutput size
      Input224×224×3
      Conv2D3×3/2112×112×24
      Max pool3×3/256×56×24
      Stage 11×unit for spatial down sampling15/228×28×116
      3×basic unit15/1
      Stage 21×unit for spatial down sampling/214×14×232
      7×basic unit/1
      Stage 31×unit for spatial down sampling/27×7×464
      3×basic unit/1
      Conv2D1×1/17×7×1024
      Global pool7×7/11×1×1024
      FC 11×1×1024
      FC 21×1×256
      FC 31×1×1
    • Table 3. Deep learning training and prediction parameters

      View table

      Table 3. Deep learning training and prediction parameters

      ParameterValue
      Training set images43354
      Validation set images12386
      Test set images6193
      Computer dispositionNVDIA GeForce RTX 3070 Ti
      Training environmentPyTorch
      Batch size256
      Epochs200
      Training duration /min312
      Predicting duration /ms23
      Model memory /M6.04
    • Table 4. Single frame target image defocus distance prediction method

      View table

      Table 4. Single frame target image defocus distance prediction method

      Focus sub-regionRegion defocus distanceSingle frame target image defocus distance D
      w12.122.10
      w22.69
      w31.62
      w42.09
    • Table 5. Proposed method is compared with traditional autofocus method

      View table

      Table 5. Proposed method is compared with traditional autofocus method

      GroupFocus start position /VProposed methodTraditional autofocus methodBest focus positionVf /V
      Detect focus position VD /VFocus time /sLens adjustment timesDetect focus position VD /VFocus time /sLens adjustment times
      A3544.70.602244.82.3121545.2
      3845.10.583244.62.90518
      4045.00.591244.82.13315
      B3541.50.305240.81.6391642.3
      3841.40.289241.61.23412
      4041.60.337240.41.45914
      C3541.30.293241.21.2361241.5
      3841.10.294241.21.74416
      4041.10.352241.21.11511
    • Table 6. Focusing error and focusing stability of the proposed method and the traditional autofocus method

      View table

      Table 6. Focusing error and focusing stability of the proposed method and the traditional autofocus method

      GroupAverage focusing error /VFocusing stability
      Proposed methodTraditional autofocus methodProposed methodTraditional autofocus method
      A0.2810.3810.1920.218
      B0.7071.6460.1330.507
      C0.3810.2620.1170.192
    Tools

    Get Citation

    Copy Citation Text

    Bowen Zheng, Shaojin Liu, Chengwu Shen, Jianrong Li, Yan Han, Haoyang Sun. Autofocus Method Based on Deep Learning in the Visual Measurement System[J]. Laser & Optoelectronics Progress, 2024, 61(24): 2411003

    Download Citation

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

    Category: Imaging Systems

    Received: Mar. 21, 2024

    Accepted: Apr. 24, 2024

    Published Online: Dec. 4, 2024

    The Author Email: Shaojin Liu (evsv@sohu.com)

    DOI:10.3788/LOP240938

    CSTR:32186.14.LOP240938

    Topics